URL
https://opencores.org/ocsvn/tv80/tv80/trunk
Subversion Repositories tv80
Compare Revisions
- This comparison shows the changes necessary to convert path
/tv80/trunk
- from Rev 97 to Rev 98
- ↔ Reverse comparison
Rev 97 → Rev 98
/sc_env/sc_env_top.cpp
12,13 → 12,15
extern char *optarg; |
extern int optind, opterr, optopt; |
|
#define FILENAME_SZ 80 |
|
int sc_main(int argc, char *argv[]) |
{ |
bool dumping = false; |
bool memfile = false; |
int index; |
char *dumpfile_name; |
char *mem_src_name; |
char dumpfile_name[FILENAME_SZ]; |
char mem_src_name[FILENAME_SZ]; |
SpTraceFile *tfp; |
z80_decoder dec0 ("dec0"); |
|
50,13 → 52,11
while ( (index = getopt(argc, argv, "d:i:k")) != -1) { |
printf ("DEBUG: getopt optind=%d index=%d char=%c\n", optind, index, (char) index); |
if (index == 'd') { |
dumpfile_name = new char(strlen(optarg)+1); |
strcpy (dumpfile_name, optarg); |
strncpy (dumpfile_name, optarg, FILENAME_SZ); |
dumping = true; |
printf ("VCD dump enabled to %s\n", dumpfile_name); |
} else if (index == 'i') { |
mem_src_name = new char(strlen(optarg)+1); |
strcpy (mem_src_name, optarg); |
strncpy (mem_src_name, optarg, FILENAME_SZ); |
memfile = true; |
} else if (index == 'k') { |
printf ("Z80 Instruction decode enabled\n"); |
/sc_env/env_memory.cpp
10,7 → 10,8
if (!reset_n) |
return; |
if (!mreq_n && !wr_n && (addr < AM_DEPTH)) { |
ad = (int) addr; |
ad = (int) addr; |
assert (memory != NULL); |
memory[ad] = (unsigned char) wr_data.read(); |
#ifdef DEBUG |
//printf ("MEM WR %04x=%02x\n", ad, (int) wr_data.read()); |
19,8 → 20,9
|
// async read output |
if (addr < AM_DEPTH) { |
ad = (int) addr; |
rd_data.write ( (unsigned int) memory[ad] ); |
ad = (int) addr; |
assert (memory != NULL); |
rd_data.write ( (unsigned int) memory[ad] ); |
} |
} |
|
/sc_env/env_memory.h
23,7 → 23,7
void load_ihex (char *filename); |
|
SC_CTOR(env_memory) { |
memory = new unsigned char[AM_DEPTH]; |
memory = new unsigned char[AM_DEPTH]; |
SC_METHOD(event); |
sensitive << clk.pos() << addr; |
} |
/sc_env/z80_decoder.h
1,6 → 1,7
#ifndef Z80_DECODER_H_ |
#define Z80_DECODER_H_ |
|
#include <stdint.h> |
#include "systemc.h" |
|
typedef enum { UNPRE, PRE_CB, PRE_DD, PRE_ED, PRE_FD, DISP, IMM1, IMM2, IMM2B } dec_state; |