Line 201... |
Line 201... |
mem->ops.writefunc8 = set_mem_8_inv;
|
mem->ops.writefunc8 = set_mem_8_inv;
|
mem->direct_ops.writefunc8 = set_mem_8_inv_direct;
|
mem->direct_ops.writefunc8 = set_mem_8_inv_direct;
|
mem->direct_ops.write_dat8 = mem;
|
mem->direct_ops.write_dat8 = mem;
|
}
|
}
|
|
|
if(!ops->writeprog) {
|
if(!ops->writeprog8) {
|
mem->ops.writeprog = mem->ops.writefunc32;
|
mem->ops.writeprog8 = mem->ops.writefunc8;
|
mem->ops.writeprog_dat = mem->ops.write_dat32;
|
mem->ops.writeprog8_dat = mem->ops.write_dat8;
|
|
}
|
|
|
|
if(!ops->writeprog32) {
|
|
mem->ops.writeprog32 = mem->ops.writefunc32;
|
|
mem->ops.writeprog32_dat = mem->ops.write_dat32;
|
}
|
}
|
|
|
if(ops->log) {
|
if(ops->log) {
|
if(!(mem->log = fopen(ops->log, "w")))
|
if(!(mem->log = fopen(ops->log, "w")))
|
PRINTF("ERR: Unable to open %s to log memory acesses to\n", ops->log);
|
PRINTF("ERR: Unable to open %s to log memory acesses to\n", ops->log);
|
Line 927... |
Line 932... |
void set_program32(oraddr_t memaddr, uint32_t value)
|
void set_program32(oraddr_t memaddr, uint32_t value)
|
{
|
{
|
struct dev_memarea *mem;
|
struct dev_memarea *mem;
|
|
|
if (memaddr & 3) {
|
if (memaddr & 3) {
|
PRINTF("%s:%d %s(): ERR unaligned access\n", __FILE__, __LINE__, __FUNCTION__);
|
PRINTF("%s(): ERR unaligned 32-bit program write\n", __FUNCTION__);
|
return;
|
return;
|
}
|
}
|
|
|
if((mem = verify_memoryarea(memaddr))) {
|
if((mem = verify_memoryarea(memaddr))) {
|
mem->ops.writeprog(memaddr & mem->size_mask, value, mem->ops.writeprog_dat);
|
mem->ops.writeprog32(memaddr & mem->size_mask, value,
|
|
mem->ops.writeprog32_dat);
|
} else
|
} else
|
PRINTF("ERR: 32-bit program load out of memory area: %"PRIxADDR"\n",
|
PRINTF("ERR: 32-bit program load out of memory area: %"PRIxADDR"\n",
|
memaddr);
|
memaddr);
|
}
|
}
|
|
|
|
/* set_program8 - same as set_direct8, but it also writes to memory that is
|
|
* non-writeable to the rest of the sim. Used to do program
|
|
* loading.
|
|
*/
|
|
void set_program8(oraddr_t memaddr, uint8_t value)
|
|
{
|
|
struct dev_memarea *mem;
|
|
|
|
if((mem = verify_memoryarea(memaddr))) {
|
|
mem->ops.writeprog8(memaddr & mem->size_mask, value,
|
|
mem->ops.writeprog8_dat);
|
|
} else
|
|
PRINTF("ERR: 8-bit program load out of memory area: %"PRIxADDR"\n",
|
|
memaddr);
|
|
}
|
|
|
void dumpmemory(oraddr_t from, oraddr_t to, int disasm, int nl)
|
void dumpmemory(oraddr_t from, oraddr_t to, int disasm, int nl)
|
{
|
{
|
oraddr_t i, j;
|
oraddr_t i, j;
|
struct label_entry *tmp;
|
struct label_entry *tmp;
|
int ilen = disasm ? 4 : 16;
|
int ilen = disasm ? 4 : 16;
|