Merge pull request #21 from wallclimber21/mem_wdata
Only clock mem_wdata when necesssary
This commit is contained in:
commit
2f3e3a6910
|
@ -498,9 +498,11 @@ module picorv32 #(
|
||||||
end else begin
|
end else begin
|
||||||
if (mem_la_read || mem_la_write) begin
|
if (mem_la_read || mem_la_write) begin
|
||||||
mem_addr <= mem_la_addr;
|
mem_addr <= mem_la_addr;
|
||||||
mem_wdata <= mem_la_wdata;
|
|
||||||
mem_wstrb <= mem_la_wstrb & {4{mem_la_write}};
|
mem_wstrb <= mem_la_wstrb & {4{mem_la_write}};
|
||||||
end
|
end
|
||||||
|
if (mem_la_write) begin
|
||||||
|
mem_wdata <= mem_la_wdata;
|
||||||
|
end
|
||||||
case (mem_state)
|
case (mem_state)
|
||||||
0: begin
|
0: begin
|
||||||
if (mem_do_prefetch || mem_do_rinst || mem_do_rdata) begin
|
if (mem_do_prefetch || mem_do_rinst || mem_do_rdata) begin
|
||||||
|
|
Loading…
Reference in New Issue