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
I want to write a function that receives an array of multiple std_logic_vector elements and concatenates them to a single long std_logic_vector.
This is what I wrote:
Compilation fails with this note:
Please help me rewrite the function.
This is what I wrote:
Code:
function array_to_sentence
( array_data : array ,
width_array : positive ,
depth_array : positive ) return std_logic_vector ;
variable sentence : std_logic_vector ( width_array * depth_array - 1 downto 0 ) ;
begin
for index in 0 to depth_array - 1
loop
sentence ( ( ( width_array * ( depth_array - index ) ) - 1 ) downto ( width_array * ( depth_array - index ) - width_array ) ) <= array_data ( index ) ;
end loop ;
return sentence ;
end function array_to_sentence ;
Compilation fails with this note:
near "array": expecting STRING or IDENTIFIER or << or '('
Please help me rewrite the function.