Line 10... |
Line 10... |
#include "di_mux.h"
|
#include "di_mux.h"
|
|
|
extern char *optarg;
|
extern char *optarg;
|
extern int optind, opterr, optopt;
|
extern int optind, opterr, optopt;
|
|
|
|
#define FILENAME_SZ 80
|
|
|
int sc_main(int argc, char *argv[])
|
int sc_main(int argc, char *argv[])
|
{
|
{
|
bool dumping = false;
|
bool dumping = false;
|
bool memfile = false;
|
bool memfile = false;
|
int index;
|
int index;
|
char *dumpfile_name;
|
char dumpfile_name[FILENAME_SZ];
|
char *mem_src_name;
|
char mem_src_name[FILENAME_SZ];
|
SpTraceFile *tfp;
|
SpTraceFile *tfp;
|
z80_decoder dec0 ("dec0");
|
z80_decoder dec0 ("dec0");
|
|
|
sc_clock clk("clk125", 8, SC_NS, 0.5);
|
sc_clock clk("clk125", 8, SC_NS, 0.5);
|
|
|
Line 48... |
Line 50... |
sc_signal<bool> baudout, uart_int;
|
sc_signal<bool> baudout, uart_int;
|
|
|
while ( (index = getopt(argc, argv, "d:i:k")) != -1) {
|
while ( (index = getopt(argc, argv, "d:i:k")) != -1) {
|
printf ("DEBUG: getopt optind=%d index=%d char=%c\n", optind, index, (char) index);
|
printf ("DEBUG: getopt optind=%d index=%d char=%c\n", optind, index, (char) index);
|
if (index == 'd') {
|
if (index == 'd') {
|
dumpfile_name = new char(strlen(optarg)+1);
|
strncpy (dumpfile_name, optarg, FILENAME_SZ);
|
strcpy (dumpfile_name, optarg);
|
|
dumping = true;
|
dumping = true;
|
printf ("VCD dump enabled to %s\n", dumpfile_name);
|
printf ("VCD dump enabled to %s\n", dumpfile_name);
|
} else if (index == 'i') {
|
} else if (index == 'i') {
|
mem_src_name = new char(strlen(optarg)+1);
|
strncpy (mem_src_name, optarg, FILENAME_SZ);
|
strcpy (mem_src_name, optarg);
|
|
memfile = true;
|
memfile = true;
|
} else if (index == 'k') {
|
} else if (index == 'k') {
|
printf ("Z80 Instruction decode enabled\n");
|
printf ("Z80 Instruction decode enabled\n");
|
dec0.en_decode = true;
|
dec0.en_decode = true;
|
}
|
}
|