Skip to content

Commit e85187d

Browse files
committed
Fix write logic in SP model
The simulation model for SP memories wasn't describing a functional memory as on a write it was only setting bits, never clearing them. Fix the write statement. The bitwise OR operation may have been a remnant of a write mask. Before commit 0fb7f8c ("Re-factored fakeram to support sp/dp ram/regfile") there was a commented-out line: # V_file.write(' mem[addr_in] <= (wd_in & w_mask_in) | (mem[addr_in] & ~w_mask_in);\n') Signed-off-by: Martin Povišer <povik@cutebit.org>
1 parent 63706f6 commit e85187d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

utils/single_port_ram_verilog_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def export_module(self, out_fh):
6060
out_fh.write(f" else if ({we_pin})\n")
6161
out_fh.write(" begin\n")
6262
out_fh.write(
63-
f" mem[{addr_bus}] <= ({din_bus}) | (mem[{addr_bus}]);\n"
63+
f" mem[{addr_bus}] <= {din_bus};\n"
6464
)
6565
out_fh.write(" end\n")
6666
out_fh.write(" // read\n")

0 commit comments

Comments
 (0)