shaiko
Advanced Member level 5
- Joined
- Aug 20, 2011
- Messages
- 2,644
- Helped
- 303
- Reputation
- 608
- Reaction score
- 297
- Trophy points
- 1,363
- Activity points
- 18,302
Code:
type long_array is array ( 0 to 3 ) of unsigned ( 8 downto 0 ) ;
type short_array is array ( 0 to 3 ) of unsigned ( 7 downto 0 ) ;
signal x : long_array ;
signal y : short_array ;
I want the lower 8 bits of each cell of array x to be assigned to the matching cells of array y.
I.E copy array x into array y while discarding the MSBs of array x.
This is what I wrote:
Code:
y <= x ( ( x ' range ) ( x ( 0 ) ' high - 1 downto 0 ) ) ;
Modelsim compilation fails with the following message:
Slice range direction (downto) does not match slice prefix direction (to).
What's the reason?
From what I see, the slices range direction matches well...