aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2021-05-25 01:12:19 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2021-05-25 02:57:32 +0200
commit1c903d3e4742c015dc8f0b3b5d8c8c1895459822 (patch)
treea8b6412e33b8c07a77bdcd617f5c05b748377e94
parent69bf5c81c7cf65ccb8bd035eb45137e31a68ae86 (diff)
downloadyosys-1c903d3e4742c015dc8f0b3b5d8c8c1895459822.tar.gz
yosys-1c903d3e4742c015dc8f0b3b5d8c8c1895459822.tar.bz2
yosys-1c903d3e4742c015dc8f0b3b5d8c8c1895459822.zip
sim: Add wide port support.
-rw-r--r--passes/sat/sim.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc
index 2e7a92cec..684e00382 100644
--- a/passes/sat/sim.cc
+++ b/passes/sat/sim.cc
@@ -334,7 +334,7 @@ struct SimInstance
{
auto &port = mem.rd_ports[port_idx];
Const addr = get_state(port.addr);
- Const data = Const(State::Sx, mem.width);
+ Const data = Const(State::Sx, mem.width << port.wide_log2);
if (port.clk_enable)
log_error("Memory %s.%s has clocked read ports. Run 'memory' with -nordff.\n", log_id(module), log_id(mem.memid));
@@ -342,7 +342,7 @@ struct SimInstance
if (addr.is_fully_def()) {
int index = addr.as_int() - mem.start_offset;
if (index >= 0 && index < mem.size)
- data = mdb.data.extract(index*mem.width, mem.width);
+ data = mdb.data.extract(index*mem.width, mem.width << port.wide_log2);
}
set_state(port.data, data);
@@ -457,7 +457,7 @@ struct SimInstance
{
int index = addr.as_int() - mem.start_offset;
if (index >= 0 && index < mem.size)
- for (int i = 0; i < mem.width; i++)
+ for (int i = 0; i < (mem.width << port.wide_log2); i++)
if (enable[i] == State::S1 && mdb.data.bits.at(index*mem.width+i) != data[i]) {
mdb.data.bits.at(index*mem.width+i) = data[i];
dirty_memories.insert(mem.memid);