Disable CSR writes if the execute stage is stalled

This commit is contained in:
Graham Edgecombe 2018-01-01 19:30:31 +00:00
parent d7e417df0b
commit b4c58919b6
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -117,6 +117,7 @@ module rv32_execute (
rv32_csrs csrs (
.clk(clk),
.stall_in(stall_in),
/* control in */
.read_in(csr_read_in),