Can I include include a constant in a constant array?

F

Fredxx

Example

type word_type is array (0 to 1) of std_logic_vector(7 downto 0);
constant height : word_type := (x"04", x"05");

and I would like to place this constant in

type Con_Array_type is array (0 to size - 1) of std_logic_vector(7 downto
0);
constant Con_Array : Con_Array_type := (
x"00", x"01",
x"02", x"03",
height[1], height[0],
x"06", x"07"
);

Is this possible? If so where am I going wrong?
 
F

Fredxx

Jonathan Bromley said:
type word_type is array (0 to 1) of std_logic_vector(7 downto 0);
constant height : word_type := (x"04", x"05");

and I would like to place this constant in

type Con_Array_type is array (0 to size - 1) of std_logic_vector(7 downto
0);
constant Con_Array : Con_Array_type := (
x"00", x"01",
x"02", x"03",
height[1], height[0],
x"06", x"07"
);

Is this possible?

I think so.
If so where am I going wrong?

Square brackets for VHDL array subscripts?

What kind of error message do you get?
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.

<feeling_embarrassed>
Thank you very kindly for your prompt reply. It was indeed the square
brackets as I was porting some code from "C"!!!
Now all working.
</feeling_embarrassed>
 
M

Mark McDougall

Fredxx said:
<feeling_embarrassed>
Thank you very kindly for your prompt reply. It was indeed the square
brackets as I was porting some code from "C"!!!
Now all working.
</feeling_embarrassed>

LOL!

Wait 'til you're debugging a mixed-language design, with VHDL and Verilog,
which includes a soft-core processor running C-code! You get some
interesting syntax errors there! ;)

Regards,
 
M

Martin Thompson

Mark McDougall said:
LOL!

Wait 'til you're debugging a mixed-language design, with VHDL and Verilog,
which includes a soft-core processor running C-code! You get some
interesting syntax errors there! ;)

Then try and compare your results with the Matlab simulation indexing
from 1 rather than 0 as well for yet more debugging fun :)

Cheers,
Martin
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top