Full Array Row

A

a_Conan

Guest
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?
 
--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

"a_Conan" <hailconan@gmail.com> wrote in message
news:1125294340.178555.317110@o13g2000cwo.googlegroups.com...
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?
 
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

"Benjamin Todd" <benjamin.toddREMOVEALLCAPITALS@cernREMOVEALLCAPITALS.ch>
wrote in message news:deuoek$1tn$1@sunnews.cern.ch...
--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

"a_Conan" <hailconan@gmail.com> wrote in message
news:1125294340.178555.317110@o13g2000cwo.googlegroups.com...
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?
 
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
 
actually i think you would also need another variable for the FR_1 part.
 

Welcome to EDABoard.com

Sponsor

Back
Top