aboutsummaryrefslogtreecommitdiffstats
path: root/picorv32.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-04-10 13:25:05 +0200
committerClifford Wolf <clifford@clifford.at>2016-04-10 13:25:28 +0200
commitfce9656604316712df0b0ab87f6cd0ba708aa68c (patch)
treeded182a0b9e7d2ecfa2bbf79c5669aec6b4da470 /picorv32.v
parent9a5d35c19559a65826ea42d575d8085a682b94f6 (diff)
downloadpicorv32-fce9656604316712df0b0ab87f6cd0ba708aa68c.tar.gz
picorv32-fce9656604316712df0b0ab87f6cd0ba708aa68c.zip
Bugfix in memory interface (related to compressed ISA)
Diffstat (limited to 'picorv32.v')
-rw-r--r--picorv32.v6
1 files changed, 3 insertions, 3 deletions
diff --git a/picorv32.v b/picorv32.v
index 05c67ba..93a9a01 100644
--- a/picorv32.v
+++ b/picorv32.v
@@ -188,11 +188,11 @@ module picorv32 #(
reg [15:0] mem_16bit_buffer;
wire mem_busy = |{mem_do_prefetch, mem_do_rinst, mem_do_rdata, mem_do_wdata};
- wire mem_done = resetn && ((mem_ready && |mem_state && (mem_do_rinst || mem_do_rdata || mem_do_wdata)) || (&mem_state && mem_do_rinst)) && !mem_la_firstword;
+ wire mem_done = resetn && ((mem_valid && mem_ready && |mem_state && (mem_do_rinst || mem_do_rdata || mem_do_wdata)) || (&mem_state && mem_do_rinst)) && !mem_la_firstword;
assign mem_la_write = resetn && !mem_state && mem_do_wdata;
- assign mem_la_read = resetn && ((!mem_state && (mem_do_rinst || mem_do_prefetch || mem_do_rdata)) || (mem_ready && mem_la_firstword && !mem_la_secondword));
- assign mem_la_addr = (mem_do_prefetch || mem_do_rinst) ? {next_pc[31:2] + (mem_ready && mem_la_firstword), 2'b00} : {reg_op1[31:2], 2'b00};
+ assign mem_la_read = resetn && ((!mem_state && (mem_do_rinst || mem_do_prefetch || mem_do_rdata)) || (mem_valid && mem_ready && mem_la_firstword && !mem_la_secondword));
+ assign mem_la_addr = (mem_do_prefetch || mem_do_rinst) ? {next_pc[31:2] + (mem_valid && mem_ready && mem_la_firstword), 2'b00} : {reg_op1[31:2], 2'b00};
wire [31:0] mem_rdata_latched_noshuffle;
assign mem_rdata_latched_noshuffle = ((mem_valid && mem_ready) || LATCHED_MEM_RDATA) ? mem_rdata : mem_rdata_q;