2D Unconstrained Nx1 Array

后端 未结 2 1480
小蘑菇
小蘑菇 2020-12-21 18:41

I\'m trying to create a flexible array of constants. I want to use a 2D array which may sometimes be for example a 2x1, 2x2, 3x2 array etc. For example:

type         


        
2条回答
  •  天命终不由人
    2020-12-21 19:10

    The LRM (section 9.3.3 Aggregates) states:

    Aggregates containing a single element association shall always be specified using named association in order to distinguish them from parenthesized expressions.

    So, this is OK:

    constant n : int_1d_array(0 downto 0) := ( 0 => 1 );
    

    and this is not:

    constant n : int_1d_array(0 downto 0) := ( 1 );
    

    http://www.edaplayground.com/x/6a4

提交回复
热议问题