~ruther/verilog-riscv-semestral-project

ref: bc02aba5f50d84e93657a0601f713d990ecb8f11 verilog-riscv-semestral-project/src/ram.sv -rwxr-xr-x 221 bytes
bc02aba5 — Rutherther fix: make sure alu is zeroed on memory load, write, jump 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
module ram (
  input         clk, we,
  input [31:0]  a, wd,
  output [31:0] rd);

  reg [31:0]    RAM[0:127];

  assign rd = RAM[a[8:2]]; // word aligned

  always @(posedge clk)
    if(we) RAM[a[8:2]] <= wd;

endmodule
Do not follow this link