aboutsummaryrefslogtreecommitdiffstats
path: root/picorv32.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-04-13 12:27:00 +0200
committerClifford Wolf <clifford@clifford.at>2016-04-13 12:27:00 +0200
commit49aef716410a6207ba700db36c930a2ca3a89f18 (patch)
treef50fd23a4cbf289ab47540d6478920719a93dad2 /picorv32.v
parent435232eb859185f4e504935c885fcd9a1180d3b1 (diff)
downloadpicorv32-49aef716410a6207ba700db36c930a2ca3a89f18.tar.gz
picorv32-49aef716410a6207ba700db36c930a2ca3a89f18.zip
Some area improvements
Diffstat (limited to 'picorv32.v')
-rw-r--r--picorv32.v11
1 files changed, 6 insertions, 5 deletions
diff --git a/picorv32.v b/picorv32.v
index 664f8b4..10e3f6d 100644
--- a/picorv32.v
+++ b/picorv32.v
@@ -420,6 +420,11 @@ module picorv32 #(
end
always @(posedge clk) 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 (!resetn) begin
mem_state <= 0;
mem_valid <= 0;
@@ -427,9 +432,6 @@ module picorv32 #(
prefetched_high_word <= 0;
end else case (mem_state)
0: begin
- mem_addr <= mem_la_addr;
- mem_wdata <= mem_la_wdata;
- mem_wstrb <= mem_la_wstrb & {4{mem_la_write}};
if (mem_do_prefetch || mem_do_rinst) begin
current_insn_addr <= next_pc;
end
@@ -449,14 +451,13 @@ module picorv32 #(
if (mem_xfer) begin
if (COMPRESSED_ISA && mem_la_read) begin
mem_valid <= 1;
- mem_addr <= mem_la_addr;
mem_la_secondword <= 1;
if (!mem_la_use_prefetched_high_word)
mem_16bit_buffer <= mem_rdata[31:16];
end else begin
mem_valid <= 0;
mem_la_secondword <= 0;
- if (!mem_do_rdata) begin
+ if (COMPRESSED_ISA && !mem_do_rdata) begin
if (~&mem_rdata[1:0] || mem_la_secondword) begin
mem_16bit_buffer <= mem_rdata[31:16];
prefetched_high_word <= 1;