From 80aa70ec2e18015a3d03989437b1a0adcbdc0f1e Mon Sep 17 00:00:00 2001 From: Tom Verbeure Date: Wed, 7 Sep 2016 20:32:32 -0700 Subject: [PATCH] Only clock mem_wdata when necessary --- picorv32.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/picorv32.v b/picorv32.v index 88443b2..8ea791c 100644 --- a/picorv32.v +++ b/picorv32.v @@ -498,9 +498,11 @@ module picorv32 #( end else begin if (mem_la_read || mem_la_write) begin mem_addr <= mem_la_addr; - mem_wdata <= mem_la_wdata; mem_wstrb <= mem_la_wstrb & {4{mem_la_write}}; end + if (mem_la_write) begin + mem_wdata <= mem_la_wdata; + end case (mem_state) 0: begin if (mem_do_prefetch || mem_do_rinst || mem_do_rdata) begin