reading and writing to the blockram should be in separate always blocks

This commit is contained in:
Raphael Jacquot 2019-02-09 01:06:44 +01:00
parent dfc315937a
commit da4299fd19

View file

@ -131,12 +131,16 @@ always @(posedge strobe) begin
if (configured & cmd_read) if (configured & cmd_read)
nibble_out <= sys_ram[(cmd_bus_dp?dp_ptr:pc_ptr) - base_addr]; nibble_out <= sys_ram[(cmd_bus_dp?dp_ptr:pc_ptr) - base_addr];
end
always @(posedge strobe) begin
// write to ram // write to ram
if (configured & cmd_write) if (configured & cmd_write)
sys_ram[(cmd_bus_dp?dp_ptr:pc_ptr) - base_addr] <= nibble_in; sys_ram[(cmd_bus_dp?dp_ptr:pc_ptr) - base_addr] <= nibble_in;
end
always @(posedge strobe) begin
case (command) case (command)
`BUSCMD_PC_READ, `BUSCMD_PC_WRITE: begin `BUSCMD_PC_READ, `BUSCMD_PC_WRITE: begin