Initializing array of BlockRAM instances in verilog

Guest
Hi,

I'm trying to create an array of Virtex-II BlockRam instances in
verilog using

RAMB16_S36_S36 BRAM[ram_modules-1:0] (.ADDRA(ADDRA), .ADDRB(ADDRB),
...., .DOPA(), .DOPB());

This works perfectly fine, even when I add parameters like:

RAMB16_S36_S36 #(.WRITE_MODE_A("READ_FIRST")) BRAM[ram_modules-1:0]
(.ADDRA(ADDRA), ...

However, when I add the initialization parameters, it doesn't work:

RAMB16_S36_S36 #(.WRITE_MODE_A("READ_FIRST"), .INIT_A(36'h012345678))
BRAM[ram_modules-1:0] (.ADDRA(ADDRA), ...

Compiling is ok, but trying to simulate gives one of these for each
module in the array:

# ELAB2: Warning: ELAB2_0048 increment.v (22): Actual value is
incompatible with formal "INIT_A" (mixed simulation) - actual value
will be skipped.

in Aldec Active-HDL.

I've tried a bunch of different ways to get this to work.
Initialization using the defparam statements with just one BRAM
instance works fine (but not on an array, at least that I can figure
out). I guess I could just unroll the whole thing by hand, but by now,
I'm interested in just figuring out what's going on and how to make it
work.

Anyone else run into this or have any ideas?

Much thanks
-Allan
 
The following code is from Xilinx's application note
xapp709(backend_rom_36.v).
It uses differnet ways to work for different EDA tools.
//synthesis translate_off
defparam
wr_rd_addr_lookup.INIT_00 =
256'h0003C1540003C1980003C0880003C0EC000231540002319800023088000230EC,
wr_rd_addr_lookup.INIT_01 =
256'h0083C1540083C1980083C0880083C0EC008231540082319800823088008230EC,
wr_rd_addr_lookup.INIT_02 =
256'h0043C1540043C1980043C0880043C0EC004231540042319800423088004230EC,
wr_rd_addr_lookup.INIT_03 =
256'h00C3C15400C3C19800C3C08800C3C0EC00C2315400C2319800C2308800C230EC,

wr_rd_addr_lookup.INIT_20 =
256'h0003C1540003C1980003C0880003C0EC000231540002319800023088000230EC,
wr_rd_addr_lookup.INIT_21 =
256'h0083C1540083C1980083C0880083C0EC008231540082319800823088008230EC,
wr_rd_addr_lookup.INIT_22 =
256'h0043C1540043C1980043C0880043C0EC004231540042319800423088004230EC,
wr_rd_addr_lookup.INIT_23 =
256'h00C3C15400C3C19800C3C08800C3C0EC00C2315400C2319800C2308800C230EC;
//synthesis translate_on

//synthesis attribute INIT_00 of wr_rd_addr_lookup is
"256'h0003C1540003C1980003C0880003C0EC000231540002319800023088000230EC"
//synthesis attribute INIT_01 of wr_rd_addr_lookup is
"256'h0083C1540083C1980083C0880083C0EC008231540082319800823088008230EC"
//synthesis attribute INIT_02 of wr_rd_addr_lookup is
"256'h0043C1540043C1980043C0880043C0EC004231540042319800423088004230EC"
//synthesis attribute INIT_03 of wr_rd_addr_lookup is
"256'h00C3C15400C3C19800C3C08800C3C0EC00C2315400C2319800C2308800C230EC"
//synthesis attribute INIT_20 of wr_rd_addr_lookup is
"256'h0003C1540003C1980003C0880003C0EC000231540002319800023088000230EC"
//synthesis attribute INIT_21 of wr_rd_addr_lookup is
"256'h0083C1540083C1980083C0880083C0EC008231540082319800823088008230EC"
//synthesis attribute INIT_22 of wr_rd_addr_lookup is
"256'h0043C1540043C1980043C0880043C0EC004231540042319800423088004230EC"
//synthesis attribute INIT_23 of wr_rd_addr_lookup is
"256'h00C3C15400C3C19800C3C08800C3C0EC00C2315400C2319800C2308800C230EC"

RAMB16_S36 wr_rd_addr_lookup (
.DO(addr_out[31:0]),
.DOP(),
.ADDR(wr_rd_addr[8:0]),
.CLK(clk266),
.DI(unused_data_in[31:0]),
.DIP(unused_data_in_p[3:0]),
.EN(wr_rd_addr_en_reg),
.SSR(gnd),
.WE(gnd)
)/* synthesis
xc_props="INIT_00 =
256'h0003C1540003C1980003C0880003C0EC000231540002319800023088000230EC,
INIT_01 =
256'h0083C1540083C1980083C0880083C0EC008231540082319800823088008230EC,
INIT_02 =
256'h0103C1540103C1980103C0880103C0EC010231540102319801023088010230EC,
INIT_03 =
256'h0183C1540183C1980183C0880183C0EC018231540182319801823088018230EC,
INIT_20 =
256'h0003C1540003C1980003C0880003C0EC000231540002319800023088000230EC,
INIT_21 =
256'h0083C1540083C1980083C0880083C0EC008231540082319800823088008230EC,
INIT_22 =
256'h0103C1540103C1980103C0880103C0EC010231540102319801023088010230EC,
INIT_23 =
256'h0183C1540183C1980183C0880183C0EC018231540182319801823088018230EC"
*/;


T
 

Welcome to EDABoard.com

Sponsor

Back
Top