Peter,
Of course if I was totally coherent, the first line would
have read:
I think we need to slice multidimensional arrays also
(it was in the original proposal). ...
Jim
> Peter,
> I think we need to slice arrays of arrays also (it was in
> the original proposal). I also think we need arrays of
> arrays to make it easy to either ignore the last dimension
> or use some other property of the type (unsigned, signed, ...)
>
>
> entity GenericShift is
> generic (
> Width : integer := 4 ;
> Depth : integer := 4 ;
> ) ;
> port (
> Clk : in std_logic ;
> ShiftIn : in std_logic_vector(WIDTH-1 downto 0) ;
> ShiftOut : out std_logic_vector(WIDTH-1 downto 0)
> ) ;
> end entity GenericShift ;
> architecture RTL of GenericShift is
>
> -- hopefully added to 1164 some day
> type std_logic_matrix is array (natural range<>) of std_logic_vector ;
>
> signal ShiftReg : std_logic_matrix(DEPTH-1 downto 0)(WIDTH-1 downto 0) ;
>
> begin
>
> ShiftReg <= ShiftReg(Depth-2 downto 0) & ShiftIn when rising_edge(Clk) ;
>
> end RTL ;
>
>
>
> Also if the array is to store math values such as signed or
> unsigned. Note I used the "." notation temporarily so no one
> will object to the interpretation of the slice.
>
> type unsigned_matrix is array (natrual range <>, natural range <>) of
> signed ;
> signal A : unsigned(0 to 3, 0 to 3).(7 downto 0) ;
>
> signal SignBit1_1 : std_logic ;
> signal Row, Col : std_logic_vector(0 to 3) ;
>
> Now lets suppose I need to collect the sign bits in one of
> the dimensions of the matrix:
>
> -- first sign bit:
> SignBit1_1 <= A(1,1).(7) ;
>
> -- row 1 sign bit
> Row <= std_logic_vector(A(1, 0 to 3).(7)) ;
>
> -- Column 1 sign bit
> Col <= std_logic_vector(A(0 to 3, 1).(7)) ;
>
>
> The original proposal for arrays of arrays included
> slicing for both multidimensional arrays and
> arrays of arrays. Ryan decided not to include it since
> he realized that the following did not do what I wanted
> it to do.
>
> A2 <= A(Width-2 downto 0)(Depth-2 downto 0) ;
>
> I think we need a notation to accomplish this. I am happy
> with ".", however I would be happier without it. I agree
> with Steve that we should not break backward compatibility,
> however, here I think we should look at what is being
> considered and determine whether this is something that was
> a side-effect of the bnf notation or something that was
> really intended. Likewise was it something that was
> really used or not.
>
> Cheers,
> Jim
>
> P.S.
> In some ways I like "." better as it acknowledges that
> the inner array dimensions are a field of the outer
> dimension. Hence it would have a nice consistency
> with record elements.
>
>
>> Jim,
>>
>> Why are you using arrays of arrays, as opposed to multidimensional
>> arrays?
>> If you used the latter, Steve's notions of extending slices to denote
>> rectangular chunks of multidimensional arrays would be rather elegant.
>> Using a single index for one of the dimensions instead of a range would
>> "collapse" that dimension of the chunk. So, for example, matrix(3
>> downto 1,
>> 3) would not be a 3x1 matrix, but a 3-element vector.
>>
>> Cheers,
>>
>> PA
>>
>> --
>> Dr. Peter J. Ashenden peter@ashenden.com.au
>> Ashenden Designs Pty. Ltd. www.ashenden.com.au
>> PO Box 640 Ph: +61 8 8339 7532
>> Stirling, SA 5152 Fax: +61 8 8339 2616
>> Australia Mobile: +61 414 70 9106
>>
>>
>>
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jim Lewis Director of Training mailto:Jim@SynthWorks.com SynthWorks Design Inc. http://www.SynthWorks.com 1-503-590-4787 Expert VHDL Training for Hardware Design and Verification ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Received on Mon May 31 10:48:09 2004
This archive was generated by hypermail 2.1.8 : Mon May 31 2004 - 10:48:11 PDT