Skip to content

Commit 17870cc

Browse files
committed
add soft option to dpram
1 parent d4fdbe2 commit 17870cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lambdalib/utils/templates/la_dprammemory.v

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ module {{ type }}
4949
input [TESTW-1:0] test // pass through ASIC test interface
5050
);
5151

52+
// Total number of bits
53+
localparam TOTAL_BITS = (2 ** AW) * DW;
54+
5255
// Determine which memory to select
53-
localparam MEM_PROP = (PROP != "DEFAULT") ? PROP :{% for aw, dw_select in selection_table.items() %}
56+
localparam MEM_PROP = (PROP != "DEFAULT") ? PROP :{% if minsize > 0 %} ({{ minsize }} >= TOTAL_BITS) ? "SOFT" :{% endif %}{% for aw, dw_select in selection_table.items() %}
5457
{% if loop.nextitem is defined %}(AW >= {{ aw }}) ? {% endif %}{% for dw, memory in dw_select.items() %}{% if loop.nextitem is defined %}(DW >= {{dw}}) ? {% endif %}"{{ memory}}"{% if loop.nextitem is defined %} : {% endif%}{% endfor %}{% if loop.nextitem is defined %} :{% else %};{% endif %}{% endfor %}
5558

5659
localparam MEM_WIDTH = {% for memory, width in width_table %}

0 commit comments

Comments
 (0)