Skip to content

Commit

Permalink
lsu: Simply the logic for lsu_ack
Browse files Browse the repository at this point in the history
  • Loading branch information
stffrdhrn committed Jul 1, 2021
1 parent c2bb16d commit 1382b6b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rtl/verilog/mor1kx_lsu_cappuccino.v
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ module mor1kx_lsu_cappuccino
reg dbus_atomic;

reg last_write;
// write_done indicates the store buffer has been flushed
reg write_done;

// Atomic operations
Expand Down Expand Up @@ -363,11 +364,12 @@ module mor1kx_lsu_cappuccino
assign store_buffer_ack = (FEATURE_STORE_BUFFER!="NONE") ?
store_buffer_write :
write_done;


// If we are writing we wait for the store buffer ack and
// in case of dcache being busy we wait for data cache ack too
assign lsu_ack = (ctrl_op_lsu_store_i | state == WRITE) ?
(store_buffer_ack & !ctrl_op_lsu_atomic_i |
write_done & ctrl_op_lsu_atomic_i) :
(dbus_access ? dbus_ack : dc_ack);
(ctrl_op_lsu_atomic_i ? write_done : store_buffer_ack) :
(dbus_access ? dbus_ack : dc_ack);

assign lsu_ldat = dbus_access ? dbus_dat : dc_ldat;
assign dbus_adr_o = dbus_adr;
Expand Down

0 comments on commit 1382b6b

Please sign in to comment.