Sign in

username:

password:



Not a member?

Search Comp.Arch.FPGA



Search tips

fpga by Keywords

Altera | ASIC | CPLD | Cyclone | DCM | DDR | DSP | Ethernet | ISE | JTAG | Linux | LVDS | Microblaze | ML310 | Modelsim | NIOS | OPB | PCI | Quartus | RocketIO | SDRAM | Spartan | Spartan3 | SRAM | Stratix | Verilog | VHDL | Virtex | Virtex-4 | Virtex-II | Xilinx | XST

Ads

See Also

DSPEmbedded SystemsElectronics

Comp.Arch.FPGA | XST issues with loop code

There are 2 messages in this thread.

You are currently looking at messages 0 to 2.

XST issues with loop code - Jeff Brower - 2006-04-19 10:53:00

All-

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;

          else

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

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.

-Jeff




Re: XST issues with loop code - John_H - 2006-04-19 11:22:00

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.

"Jeff Brower" <j...@signalogic.com> wrote in message 
news:1...@i40g2000cwc.googlegroups.com...
> All-
>
> 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;
>
>          else
>
>            b2[i][j] = 1'b1;
>        end
>        else begin
>          b1[i][j] = 1'b0;
>          b2[i][j] = 1'b0;
>        end
>      end
>    end
>  end
>
> 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.
>
> -Jeff
> 


______________________________
Join the blogging team on FPGARelated.com and earn rewards! Details Here.