X-Git-Url: http://git.joshuawise.com/firearm.git/blobdiff_plain/03bbc40b28ecb9fab7f459f627d3843ba3f10b16..55c6199c2c85349b6ff16144ec9cbd770b0ee5f6:/BlockRAM.v diff --git a/BlockRAM.v b/BlockRAM.v index e0eceeb..091c749 100644 --- a/BlockRAM.v +++ b/BlockRAM.v @@ -31,11 +31,11 @@ module BlockRAM( always @(posedge clk) begin if (bus_wr && decode) - data[ramaddr[13:2]] = bus_wdata; + data[ramaddr[13:2]] <= bus_wdata; /* This is not allowed to be conditional -- stupid Xilinx * blockram. */ - temprdata <= data[ramaddr[13:2]]; + temprdata <= (bus_wr && decode) ? bus_wdata : data[ramaddr[13:2]]; lastread <= ramaddr; end endmodule