Skip to content

Commit

Permalink
Issue openhwgroup#959 correction.
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Gouedo <pascal.gouedo@dolphin.fr>
  • Loading branch information
Pascal Gouedo committed Mar 14, 2024
1 parent bcfe9c5 commit 6ac2316
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions rtl/cv32e40p_load_store_unit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ module cv32e40p_load_store_unit #(
2'b00: begin // Writing a word
if (misaligned_st == 1'b0) begin // non-misaligned case
case (data_addr_int[1:0])
2'b00: data_be = 4'b1111;
2'b01: data_be = 4'b1110;
2'b10: data_be = 4'b1100;
2'b11: data_be = 4'b1000;
2'b00: data_be = 4'b1111;
2'b01: data_be = 4'b1110;
2'b10: data_be = 4'b1100;
default: data_be = 4'b1000;
endcase
; // case (data_addr_int[1:0])
end else begin // misaligned case
case (data_addr_int[1:0])
2'b00: data_be = 4'b0000; // this is not used, but included for completeness
2'b01: data_be = 4'b0001;
2'b10: data_be = 4'b0011;
2'b11: data_be = 4'b0111;
2'b01: data_be = 4'b0001;
2'b10: data_be = 4'b0011;
2'b11: data_be = 4'b0111;
default: data_be = 4'b0000; // this is not used, but included for completeness
endcase
; // case (data_addr_int[1:0])
end
Expand All @@ -141,10 +141,10 @@ module cv32e40p_load_store_unit #(
2'b01: begin // Writing a half word
if (misaligned_st == 1'b0) begin // non-misaligned case
case (data_addr_int[1:0])
2'b00: data_be = 4'b0011;
2'b01: data_be = 4'b0110;
2'b10: data_be = 4'b1100;
2'b11: data_be = 4'b1000;
2'b00: data_be = 4'b0011;
2'b01: data_be = 4'b0110;
2'b10: data_be = 4'b1100;
default: data_be = 4'b1000;
endcase
; // case (data_addr_int[1:0])
end else begin // misaligned case
Expand All @@ -154,10 +154,10 @@ module cv32e40p_load_store_unit #(

2'b10, 2'b11: begin // Writing a byte
case (data_addr_int[1:0])
2'b00: data_be = 4'b0001;
2'b01: data_be = 4'b0010;
2'b10: data_be = 4'b0100;
2'b11: data_be = 4'b1000;
2'b00: data_be = 4'b0001;
2'b01: data_be = 4'b0010;
2'b10: data_be = 4'b0100;
default: data_be = 4'b1000;
endcase
; // case (data_addr_int[1:0])
end
Expand Down

0 comments on commit 6ac2316

Please sign in to comment.