Skip to content

Commit

Permalink
fix sw
Browse files Browse the repository at this point in the history
  • Loading branch information
yttnn committed Apr 5, 2024
1 parent 46a3693 commit f36f35e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/core.sv
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ module core (
if (is_csr || is_ecall) begin
csr_regs[csr_addr] <= csr_wdata;
end
`ifdef DEBUG
if (is_store) begin
$display("store mem[%h]=%h", load_store_addr, mem_wdata);
end
`endif
state <= WB;
end
WB : begin
Expand Down
2 changes: 1 addition & 1 deletion core/memory.sv
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ module memory (
mem_rdata <= MEM[mem_addr[31:2]];
end
else if (mem_w_enable) begin
MEM[mem_addr] <= mem_wdata;
MEM[mem_addr[31:2]] <= mem_wdata;
end
end

Expand Down

0 comments on commit f36f35e

Please sign in to comment.