Full Array Row

A

a_Conan

Hi everyone,

Suppose I have this code

type AR is array(6 downto 0, 6 downto 0) of unsigned(7 downto 0);
type FR is array(6 downto 0) of unsigned(7 downto 0);


signal AR_1 : AR;
signal FR_1 : FR;

I try to assign a full row from AR_1 to FR_1 like as aslice:

FR_1 <= AR_1(0, 6 downto 0);

but it doesn't work :(

Can anyone help me please?
 
B

Benjamin Todd

--type AR is array(6 downto 0, 6 downto 0) of unsigned(7 downto 0);
This is someting i've never seen before!
I think you should switch to a better approach...

something like
subtype OneDimensionArray is std_logic_vector (7 downto 0); -- here's the
starting point
type TwoDimensionArray is is array (6 downto 0) of
OneDimensionArray; --then build your FR
type ThreeDimensionArray is array (1 downto 0) of TwoDimensionArray; -- and
finally your AR

then declare FR as TwoDimensionArray and AR as ThreeDimensionArray, You can
then make a direct assignment to FR by slicing the AR like you've been
trying to do.
Ben
 
B

Benjamin Todd

Ah merde, I was wrong to suggest that change would completely solve your
problems, thing is I hardly ever Use 2d arrays like you have, maybe I should
change my ways.
What I should be commenting on is the
FR_1 <= AR_1(0, 6 downto 0);
Should this not be FR_1 <= AR_1(0) or something similar?
Just my 2p.
Ben
 
C

crazyrdx

Maybe you would be better off using a FOR loop to assign each element
in row instead of

FR_1 <= AR_1(0, 6 downto 0);

you might try

FR_1 <= AR_1(0, i ); with i in a FOR loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top