IEEE 200X Fast Track Change Proposal ID: FT-14 Proposer: Jim Lewis email: Jim@SynthWorks.com Status: Proposed Proposed: 12/03 Analyzed: Date Resolved: Date Enhancement Summary: Arrays of unconstrained arrays Related issues: FT-14 Relevant LRM section: Enhancement Detail: ---------------------------- type std_logic_matrix is array (natural range<>) of std_logic_vector; type std_logic_matrix2 is array (natural range<>, natural range<>) of std_logic_vector ; subtype Matrix_5x5 is std_logic_matrix(4 downto 0)(4 downto 0) ; signal A : std_logic_matrix(7 downto 0)(5 downto 0) ; -- Accessing a Row A(5) <= "111000" ; -- Accessing an Element A(7)(5) <= '1' ; entity e is generic ( width : integer := 2 ; depth : integer := 2 ) ; port ( A : std_logic_matrix(7 downto 0)(5 downto 0) ; B : std_logic_matrix(Depth -1 downto 0)(Width-1 downto 0); . . . ) ; ----------------------- COMPONENT Reduce is generic ( Width : integer; Depth : integer ); port ( D_IN : IN array(Depth -1 downto 0) of std_logic_vector(Width-1 downto 0); Q : OUT array(Depth -2 downto 0) of std_logic_vector(Width-2 downto 0); ); end COMPONENT; Form 1: unconstrained array of unconstrained array type two_dim_arrayofarray is array(natural <>) of std_logic_vector ; signal A : two_dim_arrayofarray (Depth-1 downto 0)(Width-1 downto 0) ; signal A2 : two_dim_arrayofarray (Depth-2 downto 0)(Width-2 downto 0) ; Currently arrays of arrays are really useful as one can manipulate a row as follows: signal D : std_logic_vector(Width-1 downto 0) ; D <= A(1) ; A further interesting extension would be to be able to grab a column as follows: signal G, H : std_logic_vector(Depth-1 downto 0) ; G <= A(Depth-1 downto 0)(1) ; H <= A(all)(1) ; Since one is really accessing a column of elements of std_logic, a type conversion may be required: G <= std_logic_vector(A(Depth-1 downto 0)(1)) ; H <= std_logic_vector(A(all)(1)) ; Perhaps further capability, but not justified by this example: A2 <= A(Width-2 downto 0)(Depth-2 downto 0) ; ------------------------------------ Form 3: Two dimensional arrays type two_dim_array is array(natural <>, natural <>) of std_logic ; signal C : two_dim_array(Depth-1 downto 0, Width-1 downto 0) ; signal C2 : two_dim_array(Depth-2 downto 0, Width-2 downto 0) ; Currently this one is not too interesting because one cannot access an entire row at a time, but if I could do the following this would be interesting: signal D, E, F : std_logic_vector(Width-1 downto 0) ; D <= C(1, Width-1 downto 0) ; E <= C(1, all) ; -- all = key word to replace the entire index of that object E <= C(1, *) ; -- an alternate to all F <= C(1) ; -- by default if a multidim object is referenced and only one -- index is specified it is the left most index -- this may be a bad thing for a strong typed language like VHDL OOPS, the above probably require type conversion/casting? D <= std_logic_vector(C(1, Width-1 downto 0)) ; E <= std_logic_vector(C(1, all)) ; . . . Even more interesting, a capability we don't have now: signal G : std_logic_vector(Depth-1 downto 0) ; G <= std_logic_vector(C(all, 2)) ; -- all elements from column 2 Perhaps further capability, but not justified by this example: C2 <= C(Width-2 downto 0, Depth-2 downto 0) ; Analysis: ---------------------------- [To be performed by the 200X Fast Track Working Group] Resolution: ---------------------------- [To be performed by the 200X Fast Track Working Group]