Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Commit

Permalink
[Fix] Remove latch in store_data logic by specifying default behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenHeartcore committed Sep 27, 2023
1 parent 5a845c2 commit 144504d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mp2/hdl/datapath.sv
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ register mem_data_out(.*, .load(load_data_out), .in(store_data), .out(mem_wdata)
assign byte_in_word = mem_address[1:0];

always_comb begin : CALC_STORE_DATA
if (opcode == op_store) begin
unique case (store_funct3_t'(funct3))
sw:
store_data = rs2_out;
Expand All @@ -95,9 +94,8 @@ always_comb begin : CALC_STORE_DATA
2'b10: store_data = rs2_out << 16;
2'b11: store_data = rs2_out << 24;
endcase
default: ;
default: store_data = rs2_out;
endcase
end
end

/*****************************************************************************/
Expand Down

0 comments on commit 144504d

Please sign in to comment.