addr_depth can be computed by addr_width.

Signed-off-by: Michael Walle <mich...@walle.cc>
---
 cores/lm32/rtl/lm32_cpu.v    |    2 --
 cores/lm32/rtl/lm32_dp_ram.v |    3 +--
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/cores/lm32/rtl/lm32_cpu.v b/cores/lm32/rtl/lm32_cpu.v
index 2ee5a4e..e0be50b 100644
--- a/cores/lm32/rtl/lm32_cpu.v
+++ b/cores/lm32/rtl/lm32_cpu.v
@@ -1324,7 +1324,6 @@ lm32_debug #(
    lm32_dp_ram
      #(
        // ----- Parameters -----
-       .addr_depth(1<<5),
        .addr_width(5),
        .data_width(32)
        )
@@ -1343,7 +1342,6 @@ lm32_debug #(
 
    lm32_dp_ram
      #(
-       .addr_depth(1<<5),
        .addr_width(5),
        .data_width(32)
        )
diff --git a/cores/lm32/rtl/lm32_dp_ram.v b/cores/lm32/rtl/lm32_dp_ram.v
index 6ef952a..bba523e 100644
--- a/cores/lm32/rtl/lm32_dp_ram.v
+++ b/cores/lm32/rtl/lm32_dp_ram.v
@@ -8,7 +8,6 @@ module lm32_dp_ram(
        rdata_o);
 
 parameter addr_width = 32;
-parameter addr_depth = 1024;
 parameter data_width = 8;
 
 input clk_i;
@@ -19,7 +18,7 @@ input [data_width-1:0] wdata_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];
-- 
1.7.2.5

_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode

Reply via email to