B
Brandon
Hopefully I'm not being stupid here but...
I'm trying to create a shift register with parallel outputs, but
because I want it to have a generic word width and shift length, it
seems slightly tricky to me. I can't use an array of std_logic_vector,
as that would mean an unconstrained array of an unconstrained array.
Instead, I can unwrap the array and create:
x: std_logic_vector(width*length-1 downto 0).
This doesn't naturally lend itself to indexing and/or simulation and
display, so I figured I'd come up with a function to convert 'x'
to a type:
array (length-1 downto 0) of std_logic_vector(width-1 downto 0)
However, I realized I can't do this, because this would involve
returning an unconstrained array of unconstrained array type. So, is
this the best solution to access individual words?
x(i) <= std_logic_vector( (i+1)*width-1 downto i*width);
-- where i = 7 downto 0
If anyone has any cleaner methods I'd love to hear them...
Thanks.
I'm trying to create a shift register with parallel outputs, but
because I want it to have a generic word width and shift length, it
seems slightly tricky to me. I can't use an array of std_logic_vector,
as that would mean an unconstrained array of an unconstrained array.
Instead, I can unwrap the array and create:
x: std_logic_vector(width*length-1 downto 0).
This doesn't naturally lend itself to indexing and/or simulation and
display, so I figured I'd come up with a function to convert 'x'
to a type:
array (length-1 downto 0) of std_logic_vector(width-1 downto 0)
However, I realized I can't do this, because this would involve
returning an unconstrained array of unconstrained array type. So, is
this the best solution to access individual words?
x(i) <= std_logic_vector( (i+1)*width-1 downto i*width);
-- where i = 7 downto 0
If anyone has any cleaner methods I'd love to hear them...
Thanks.