Skip to content

Commit f81ea2c

Browse files
committed
Fix a bug about repeated writing
1 parent 4fc9ccd commit f81ea2c

File tree

1 file changed

+4
-1
lines changed
  • projects/cpu_axi_diff/vsrc

1 file changed

+4
-1
lines changed

projects/cpu_axi_diff/vsrc/cpu.v

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,15 @@ exe_stage Exe_stage(
9494
.rd_data (rd_data)
9595
);
9696

97+
98+
wire w_ena = rd_w_ena & fetched;
99+
97100
regfile Regfile(
98101
.clk (clock),
99102
.rst (reset),
100103
.w_addr (rd_w_addr),
101104
.w_data (rd_data),
102-
.w_ena (rd_w_ena),
105+
.w_ena (w_ena),
103106

104107
.r_addr1 (rs1_r_addr),
105108
.r_data1 (r_data1),

0 commit comments

Comments
 (0)