URL
https://opencores.org/ocsvn/tv80/tv80/trunk
[/] [tv80/] [trunk/] [sc_env/] [env_memory.cpp] - Diff between revs 91 and 92
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 91 |
Rev 92 |
Line 1... |
Line 1... |
#include "env_memory.h"
|
#include "env_memory.h"
|
|
#include <stdio.h>
|
|
|
void env_memory::event()
|
void env_memory::event()
|
{
|
{
|
int lcl_cs;
|
int lcl_cs;
|
int ad;
|
int ad;
|
Line 18... |
Line 19... |
printf ("Read %x from address %x\n", memory[ad], ad);
|
printf ("Read %x from address %x\n", memory[ad], ad);
|
#endif
|
#endif
|
}
|
}
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|
|
void inline readline(FILE *fh, char *buf)
|
|
{
|
|
int c = 1;
|
|
|
|
while (c) {
|
|
c = read (buf, 1, 1, fh);
|
|
if (c && (*buf == '\n'))
|
|
c = 0;
|
|
else buf++;
|
|
}
|
|
}
|
|
|
|
/*
|
|
line = ifh.readline()
|
|
while (line != ''):
|
|
if (line[0] == ':'):
|
|
rlen = int(line[1:3], 16)
|
|
addr = int(line[3:7], 16)
|
|
rtyp = int(line[7:9], 16)
|
|
ptr = 9
|
|
for i in range (0, rlen):
|
|
laddr = addr + i
|
|
val = int(line[9+i*2:9+i*2+2], 16)
|
|
self.map[laddr] = val
|
|
self.bcount += 1
|
|
if (laddr > self.max): self.max = laddr
|
|
if (laddr < self.min): self.min = laddr
|
|
|
|
line = ifh.readline()
|
|
*/
|
|
void env_memory::load_ihex(char *filename)
|
|
{
|
|
FILE *fh;
|
|
char line[80];
|
|
|
|
fh = fopen (filename, "r");
|
|
|
|
readline (fh, line);
|
|
|
|
fclose (fh);
|
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.