From 9a4e678f29d195b5289286589a2ad4ac030ce21d Mon Sep 17 00:00:00 2001 From: Fabrizio Ferrandi Date: Sat, 13 Apr 2024 09:22:48 +0200 Subject: [PATCH] Fixed a problem with databus sizing. --- etc/lib/technology/NC_MEM_IPs.xml | 32 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/etc/lib/technology/NC_MEM_IPs.xml b/etc/lib/technology/NC_MEM_IPs.xml index 38e72cbaf..f731699d9 100644 --- a/etc/lib/technology/NC_MEM_IPs.xml +++ b/etc/lib/technology/NC_MEM_IPs.xml @@ -3058,12 +3058,16 @@ function [n_byte_on_databus*2-1:0] CONV; input [n_byte_on_databus*2-1:0] po2; begin case (po2) - 1:CONV=(1<<1)-1; - 2:CONV=(1<<2)-1; - 4:CONV=(1<<4)-1; - 8:CONV=(1<<8)-1; - 16:CONV=(1<<16)-1; - 32:CONV=(1<<32)-1; + 1:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<1)-1; + 2:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<2)-1; + 4:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<4)-1; + 8:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<8)-1; + 16:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<16)-1; + 32:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<32)-1; + 64:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<64)-1; + 128:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<128)-1; + 256:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<256)-1; + 512:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<512)-1; default:CONV=-1; endcase end @@ -3719,12 +3723,16 @@ function [n_byte_on_databus*max_n_writes-1:0] CONV; input [n_byte_on_databus*max_n_writes-1:0] po2; begin case (po2) - 1:CONV=(1<<1)-1; - 2:CONV=(1<<2)-1; - 4:CONV=(1<<4)-1; - 8:CONV=(1<<8)-1; - 16:CONV=(1<<16)-1; - 32:CONV=(1<<32)-1; + 1:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<1)-1; + 2:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<2)-1; + 4:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<4)-1; + 8:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<8)-1; + 16:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<16)-1; + 32:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<32)-1; + 64:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<64)-1; + 128:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<128)-1; + 256:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<256)-1; + 512:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<512)-1; default:CONV=-1; endcase end