Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17241 Discussions

Need multi-dimension syntax help.

Altera_Forum
Honored Contributor II
1,501 Views

I have 2 2-dimension signals: 

 

type signed_2d is array (0 to 7) of signed(13 downto 0); 

type signed_2dx2 is array (0 to 7) of signed(27 downto 0); 

 

signal short_x: signed_2d; 

signal long_x: signed_2dx2; 

 

Could someone show me how to point to the sub-elements of those signal please? 

For more obvious: I would like to signed-extend short_x and store it as long_x: 

long_y(0 to 7)(13 downto 0) <= short_x(0 to 7); <<=== the error is here :( 

long_y(0 to 7)(27 downto 14) <= (others => short_x(0 to 7)'high); 

and the error: 

Error (10381): VHDL Type Mismatch error at Normalized_LMS.vhd(47): indexed name returns a value whose type does not match "signed_2dx2", the type of the target expression
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
396 Views

 

--- Quote Start ---  

I have 2 2-dimension signals: 

 

type signed_2d is array (0 to 7) of signed(13 downto 0); 

type signed_2dx2 is array (0 to 7) of signed(27 downto 0); 

 

signal short_x: signed_2d; 

signal long_x: signed_2dx2; 

 

Could someone show me how to point to the sub-elements of those signal please? 

For more obvious: I would like to signed-extend short_x and store it as long_x: 

long_y(0 to 7)(13 downto 0) <= short_x(0 to 7); <<=== the error is here :( 

long_y(0 to 7)(27 downto 14) <= (others => short_x(0 to 7)'high); 

and the error: 

Error (10381): VHDL Type Mismatch error at Normalized_LMS.vhd(47): indexed name returns a value whose type does not match "signed_2dx2", the type of the target expression 

--- Quote End ---  

 

 

signal long_y : signed_2dx2 process(short_x) begin for i in 0 to 7 loop long_y(i) <= resize(short_x(i),28); end loop; end process;
0 Kudos
Reply