Hierarchical References out of generate block

Discussion in 'VHDL' started by hssig, Nov 6, 2012.

  1. hssig

    hssig Guest

    Hi newsgroup,

    I am trying to use VHDL-2008 Hierarchical References in the following way:



    process(all)
    begin
    for k in 0 to 15 loop
    tap_vec(k) <= << signal .tb.uut.g_GenArr(k).i_rx.tap_sig : std_logic >>;
    end loop;
    end process;


    "g_GenArr" contains 16 components instantiated in a generate loop.

    When compiling with Modelsim 10.1c I get the following error message:
    (vcom-1303) An index in an external name must be a globally static expression.


    How can I solve that problem?

    Cheers, hssig
    hssig, Nov 6, 2012
    #1
    1. Advertising

  2. hssig

    HT-Lab Guest

    On 06/11/2012 10:54, hssig wrote:
    > Hi newsgroup,
    >
    > I am trying to use VHDL-2008 Hierarchical References in the following way:
    >
    >
    >
    > process(all)
    > begin
    > for k in 0 to 15 loop
    > tap_vec(k) <= << signal .tb.uut.g_GenArr(k).i_rx.tap_sig : std_logic >>;
    > end loop;
    > end process;
    >
    >
    > "g_GenArr" contains 16 components instantiated in a generate loop.
    >
    > When compiling with Modelsim 10.1c I get the following error message:
    > (vcom-1303) An index in an external name must be a globally static expression.
    >
    >
    > How can I solve that problem?
    >
    > Cheers, hssig
    >


    Hi Hssig,

    Don't forget the Modelsim verror command which can provide some extra info:

    D:\hdl_designs>verror 1303

    vcom Message # 1303:
    Only a globally static expression is allowed as the index expression
    in an indexed name in the pathname of an external name.
    [DOC: IEEE Std 1076-2008 VHDL LRM - 8.7 External names]

    Hans
    www.ht-lab.com
    HT-Lab, Nov 6, 2012
    #2
    1. Advertising

  3. hssig

    hssig Guest

    Hi Alan,

    replacing the process with a generate works! Fascinating ... :)

    What is the difference between a for loop in a process and a generate loop regarding k being static?


    Cheers,
    hssig
    hssig, Nov 7, 2012
    #3
  4. hssig

    Andy Guest

    On Wednesday, November 7, 2012 4:32:42 AM UTC-6, hssig wrote:
    > Hi Alan, replacing the process with a generate works! Fascinating ... :)What is the difference between a for loop in a process and a generate loopregarding k being static? Cheers, hssig


    For loops are sequential statements, and the index is a variable (non-static).

    For-generates are concurrent statements, and the index is globally static, similar to a generic. The value is set after compile (analysis), during elaboration (usually the very beginning of most simulators, but some tools have separate elaboration commands.)

    The statements in a for-loop execute in sequential order in each iteration.

    The concurrent statements in a for-generate execute concurrently. The for-generate is just instantiating the concurrent statements N times.
    Andy, Nov 7, 2012
    #4
  5. hssig

    rickman Guest

    On 11/7/2012 7:34 PM, Alan Fitch wrote:
    > On 07/11/12 18:59, Andy wrote:
    >> On Wednesday, November 7, 2012 4:32:42 AM UTC-6, hssig wrote:
    >>> Hi Alan, replacing the process with a generate works! Fascinating ... :) What is the difference between a for loop in a process and a generate loop regarding k being static? Cheers, hssig

    >>
    >> For loops are sequential statements, and the index is a variable (non-static).
    >>
    >> For-generates are concurrent statements, and the index is globally static, similar to a generic. The value is set after compile (analysis), during elaboration (usually the very beginning of most simulators, but some tools have separate elaboration commands.)
    >>
    >> The statements in a for-loop execute in sequential order in each iteration.
    >>
    >> The concurrent statements in a for-generate execute concurrently. The for-generate is just instantiating the concurrent statements N times.
    >>

    >
    > I agree with Andy :)
    >
    > In the standard, certain constructs are described as "dynamically
    > elaborated", i.e. they are evaluated out at runtime, not at
    > compile-time. These include (sequential) for loops, and procedure and
    > function calls.
    >
    > Regarding globally and locally static - locally static means that a
    > constant object's value can be determined by compiling (and elaborating)
    > that one design unit. Globally static means that the whole model needs
    > to be elaborated to determine the constant value,


    I was just looking for some info on hierarchical references and found
    this thread. Great info on the differences in "static", clearing up
    some of my "static".

    Thanks,

    Rick
    rickman, Jan 29, 2013
    #5
    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. Roger Leigh
    Replies:
    8
    Views:
    415
    Karl Heinz Buchegger
    Nov 17, 2003
  2. Replies:
    3
    Views:
    434
    Victor Bazarov
    Nov 10, 2004
  3. DanielEKFA
    Replies:
    8
    Views:
    587
    DanielEKFA
    May 16, 2005
  4. morrell
    Replies:
    1
    Views:
    933
    roy axenov
    Oct 10, 2006
  5. ituhaf
    Replies:
    0
    Views:
    162
    ituhaf
    Jun 5, 2014
Loading...

Share This Page