URL
https://opencores.org/ocsvn/zipcpu/zipcpu/trunk
[/] [zipcpu/] [trunk/] [bench/] [cpp/] [memsim.cpp] - Diff between revs 2 and 36
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 2 |
Rev 36 |
Line 77... |
Line 77... |
|
|
for(; nr<m_len; nr++)
|
for(; nr<m_len; nr++)
|
m_mem[nr] = 0l;
|
m_mem[nr] = 0l;
|
}
|
}
|
|
|
void MEMSIM::apply(const unsigned char wb_cyc,
|
void MEMSIM::apply(const unsigned int clk, const unsigned char wb_cyc,
|
const unsigned char wb_stb, const unsigned char wb_we,
|
const unsigned char wb_stb, const unsigned char wb_we,
|
const BUSW wb_addr, const BUSW wb_data,
|
const BUSW wb_addr, const BUSW wb_data,
|
unsigned char &o_ack, unsigned char &o_stall, BUSW &o_data) {
|
unsigned char &o_ack, unsigned char &o_stall, BUSW &o_data) {
|
if ((wb_cyc)&&(wb_stb)) {
|
if ((wb_cyc)&&(wb_stb)&&(clk)) {
|
if (wb_we)
|
if (wb_we)
|
m_mem[wb_addr & m_mask] = wb_data;
|
m_mem[wb_addr & m_mask] = wb_data;
|
o_ack = 1;
|
o_ack = 1;
|
o_stall= 0;
|
o_stall= 0;
|
o_data = m_mem[wb_addr & m_mask];
|
o_data = m_mem[wb_addr & m_mask];
|
Line 93... |
Line 93... |
/*
|
/*
|
printf("MEMBUS -- ACK %s 0x%08x - 0x%08x\n",
|
printf("MEMBUS -- ACK %s 0x%08x - 0x%08x\n",
|
(wb_we)?"WRITE":"READ",
|
(wb_we)?"WRITE":"READ",
|
wb_addr, o_data);
|
wb_addr, o_data);
|
*/
|
*/
|
} else {
|
} else if (clk) {
|
o_ack = 0;
|
o_ack = 0;
|
o_stall = 0;
|
o_stall = 0;
|
}
|
}
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.