addr_depth can be computed by addr_width.
Signed-off-by: Michael Walle <michael@walle.cc>
lm32_dp_ram
#(
// ----- Parameters -----
- .addr_depth(1<<5),
.addr_width(5),
.data_width(32)
)
lm32_dp_ram
#(
- .addr_depth(1<<5),
.addr_width(5),
.data_width(32)
)
rdata_o);
parameter addr_width = 32;
-parameter addr_depth = 1024;
parameter data_width = 8;
input clk_i;
input [addr_width-1:0] raddr_i;
output [data_width-1:0] rdata_o;
-reg [data_width-1:0] mem[addr_depth-1:0];
+reg [data_width-1:0] mem[(1<<addr_width)-1:0];
reg [addr_width-1:0] raddr_r;
assign rdata_o = mem[raddr_r];