Xilinx RAM16_S9.V model syntax problem

Mar 22, 2006 2 Replies

I'm upgrading to ISE8.1 from ISE6.2 and my (old) Modelsim V5.5 is unhappy about some Verilog code in the Xilinx RAM16_S9.V model (as well as some other of the RAM16 models).



The Xilinx model has two models built into it - a "legacy_model" and a new model. A `ifdef selects between them. In the newer model, there's some code that looks like:



reg [7:0] mem[2047:0];



for (count = 0; count < 32; count = count + 1) begin mem[count] = INIT_00[(count * 8) +: 8]; mem[32 * 1 + count] = INIT_01[(count * 8) +: 8]; // more lines like the above.



This is code straight from the Xilinx unisims directory.



Note the +: near the end of each line.



Is this legal Verilog? It looks illegal to me (and to Modelsim 5.5). It looks like an operator is missing. I don't believe Verilog allows this.



It also looks like the code couldn't possibly do the intended initialization.



Has anyone else run into this?



Thanks for any help!



John Providenza



The '+:' is an indexed part select operator, which was introduced in Verilog-2001. You can find it on page 53 of the Standard. If you dont have access to it, you can find it in section 3.4 of the following paper.

formatting link

Kunal

Kunal -

Thanks for the pointer, I found it in the spec.

John P

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required