UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor yash047
Visitor
610 Views
Registered: ‎02-14-2019

How to initialize an array of record in VHDL?

Jump to solution

I'm initializing an array of record which also contains a string. I'm getting an error HDLCompiler:806 Line 109: Syntax error near "text_passages" (Last line in the code below). What's the correct way of initialization?

type text_info is
    record
        text : string(1 to 15);        x: integer;        y: integer;
    end record;
constant init_text_info: text_info := (text => "               ", x => 0, y => 0);
type text_info_array is array(natural range <>) of text_info;

My declaration and initialization is as follows

signal text_passages : text_info_array(0 to 1) := (others => init_text_info);text_passages(0) <= (text => "This is a Test.", x => 50, y => 50))
text_passages(0) <= (text => "This is a Test.", x => 50, y => 50);

 

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
585 Views
Registered: ‎12-05-2016

Re: How to initialize an array of record in VHDL?

Jump to solution

hi @yash047 ,

signal assignments should be made after the keyword begin.

please check the image. 

i added one more text (hello world) and simulated. 

regards,

reshma 

sim1.JPG
array1.JPG
2 Replies
Explorer
Explorer
586 Views
Registered: ‎12-05-2016

Re: How to initialize an array of record in VHDL?

Jump to solution

hi @yash047 ,

signal assignments should be made after the keyword begin.

please check the image. 

i added one more text (hello world) and simulated. 

regards,

reshma 

sim1.JPG
array1.JPG
Visitor yash047
Visitor
564 Views
Registered: ‎02-14-2019

Re: How to initialize an array of record in VHDL?

Jump to solution
That was correct, I did signal assignment outside of bgein.
0 Kudos