diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-25 01:12:19 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-25 02:57:32 +0200 |
commit | 1c903d3e4742c015dc8f0b3b5d8c8c1895459822 (patch) | |
tree | a8b6412e33b8c07a77bdcd617f5c05b748377e94 /passes/sat | |
parent | 69bf5c81c7cf65ccb8bd035eb45137e31a68ae86 (diff) | |
download | yosys-1c903d3e4742c015dc8f0b3b5d8c8c1895459822.tar.gz yosys-1c903d3e4742c015dc8f0b3b5d8c8c1895459822.tar.bz2 yosys-1c903d3e4742c015dc8f0b3b5d8c8c1895459822.zip |
sim: Add wide port support.
Diffstat (limited to 'passes/sat')
-rw-r--r-- | passes/sat/sim.cc | 6 |
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); |