XST issues with loop code

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View

I had posted before about XST not generating correct netlist for
comparisons inside nested loop code within an always block.  The code
is of this form:

  always @( a[0], a[1], a[2], ... ) begin

    for (i=0; i<32; i++) begin

      for (j=0; j<32; j++) begin

        if (a[j][4:0] == i) begin

          if (a[j][28:27] == 2'd2)  <-- comparison

            b1[i][j] = 1'b1;


            b2[i][j] = 1'b1;
        else begin
          b1[i][j] = 1'b0;
          b2[i][j] = 1'b0;

What I found for the following ways to do the innermost comparison:

  if (a[j][28:27] == 2)  <--- crashes XST

  if (a[j][28:27] == 2'd2)  <--- doesn't crash XST, but generates
incorrect netlist

  if (((a[j][28:27] & 32'h03000000) >> 28) = 2)  <--- generates correct
netlist, works

Results were the same whether I used while loops (see XST answer
records 22625 and 22066) or used a genvar for the outer loop (outside
the always block).

This is with XST 7.1i.  From the answer records about XST issues with
loop code, I might guess this problem could persist a while, possibly
through 9.1i or longer.  I thought I would put this up for future
reference, in case anyone else runs into the same thing.


Re: XST issues with loop code
The problem might go away sooner if this was submitted as a web case!
I know of *no* authors of EDA tools that want incorrect logic in their code.
Usability is one thing, bad results are another.

Quoted text here. Click to load it

Site Timeline