Disable CSR writes if the execute stage is stalled
This commit is contained in:
parent
d7e417df0b
commit
b4c58919b6
2 changed files with 3 additions and 1 deletions
|
|
@ -137,6 +137,7 @@
|
|||
|
||||
module rv32_csrs (
|
||||
input clk,
|
||||
input stall_in,
|
||||
|
||||
/* control in */
|
||||
input read_in,
|
||||
|
|
@ -301,7 +302,7 @@ module rv32_csrs (
|
|||
end
|
||||
|
||||
always_ff @(posedge clk) begin
|
||||
if (write_in) begin
|
||||
if (!stall_in && write_in) begin
|
||||
case (csr_in)
|
||||
`RV32_CSR_MSCRATCH: mscratch <= new_value;
|
||||
endcase
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ module rv32_execute (
|
|||
|
||||
rv32_csrs csrs (
|
||||
.clk(clk),
|
||||
.stall_in(stall_in),
|
||||
|
||||
/* control in */
|
||||
.read_in(csr_read_in),
|
||||
|
|
|
|||
Loading…
Reference in a new issue