problem with synthesizing for loop

Discussion in 'VHDL' started by amr elhosiny, Mar 5, 2009.

  1. amr elhosiny

    amr elhosiny

    Joined:
    Mar 5, 2009
    Messages:
    1
    this is my first post in this forum :)
    i'm doing my graduation project
    simulation and implementaion for LTE physical layer

    but i faced many problems with synthesizing for loops :(

    i was to write a code for a block called interleaver used in a turbo coder

    the function of the inteleaver is to read a certain data vector (124 bits) and fill a matrix (47*4) ROW by ROW
    then read them column by column

    i filled the matrix without problems
    but when i tried to read the matrix column by column and store them in a 124 output data vector i made a nested loop of 2 for loops with bounds
    i checked the syntax every thing is ok but when synthesizing it (RTL schematic) i got error synthesizing :(

    now if this loop is not synthesizable i will have to write expression for each element (188 :( )



    and when is the foor loop synthesizble and when not


    thanks in advance
     
    amr elhosiny, Mar 5, 2009
    #1
    1. Advertising

  2. amr elhosiny

    joris

    Joined:
    Jan 29, 2009
    Messages:
    152
    A loop is synthesizable only if it's range won't change during run time;

    This should be synthesizable:

    Code:
    constant N : integer := 1; -- any value
    
    v := (v'range => '0');
    for i in 0 to N loop
      for j in i to min(i + 5,x'high - 1) loop
        -- loop body depending on i or j
      end loop;
    end loop;
    This may mean a lot of logic is generated, depending on the loop body - To synthesise, the loop/loops will probably be unrolled completely.
     
    joris, Mar 6, 2009
    #2
    1. Advertising

  3. amr elhosiny

    joris

    Joined:
    Jan 29, 2009
    Messages:
    152
    Just wanted to add, if the number is not static but there is a sane upper-bound, you might do such for loop with upper-bound and run time checking (that'll be functionally equivalent to doing all that manually anyway)

    A loop with run-time bounds could also be described by using a state-machine construct but it'll take more clocks (but it can be useful to avoid too much logic being generated) - it is a bit more work but not that hard probably.
     
    joris, Mar 6, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelvin @ Singapore

    Synthesizing a design with RAM.

    Kelvin @ Singapore, Sep 9, 2003, in forum: VHDL
    Replies:
    0
    Views:
    525
    Kelvin @ Singapore
    Sep 9, 2003
  2. Takuon Soho
    Replies:
    5
    Views:
    727
    Charles Bailey
    Mar 9, 2005
  3. sps
    Replies:
    1
    Views:
    649
    Ralf Hildebrandt
    Aug 6, 2005
  4. universeee
    Replies:
    0
    Views:
    488
    universeee
    Nov 9, 2008
  5. Isaac Won
    Replies:
    9
    Views:
    397
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page