EDAboard.com | EDAboard.de | EDAboard.co.uk | WTWH Media

array of strings

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - VHDL Language - array of strings

Maurice SAAB
Guest

Fri Mar 25, 2016 8:34 pm   



hello:

I'm writing a process to write stimulis to a file in a test-bench, I
like that pin names are printed vertically, so I need to access
individual characters, can this be done with strings? how to make an
array of strings, I got error on line: variable PINS: PIN_NAMES
:=("CP","PL","CE","BD",....
declaring using a two dimensions array of character is OK.

Thanks in advance


WRITE_STIMULIS: process
--type PIN_NAMES is ARRAY(1 to 14, 1 to 2) of character;
type PIN_NAMES is ARRAY(1 to 14) of string;
file stimulis : text;
variable ligne : line;
--variable PINS: PIN_NAMES
:=(('C','P'),('P','L'),('C','E'),('B','D'),('U','D'),('T','C'),
-- ('P','3'),('P','2'),('P','1'),('P','0'),
-- ('Q','3'),('Q','2'),('Q','1'),('Q','0'));
variable PINS: PIN_NAMES
:=("CP","PL","CE","BD","UD","TC","P3","P2","P1","P0","Q3","Q2","Q1","Q0");

begin
file_open(stimulis,"stimulis.txt",WRITE_MODE);
write(ligne," "); writeline (stimulis,ligne);
write(ligne," "); writeline (stimulis,ligne);
for j in 1 to 2 loop
write(ligne," ");
for i in 1 to 14 loop
write(ligne,PINS(i)(j));
end loop;
writeline (stimulis,ligne);
end loop;
write(ligne," "); writeline (stimulis,ligne);
for i in 1 to 9 loop
wait for 100 ns;
write(ligne,time'image(now));
write(ligne," ");
for j in 1 to 6 loop
write(ligne,chr(sig(j)));
end loop;
write(ligne, str(P));
write(ligne, str(Q));
writeline(stimulis,ligne);
end loop;
end process;


Guest

Fri Mar 25, 2016 8:34 pm   



On Friday, March 25, 2016 at 4:34:49 PM UTC+2, Maurice SAAB wrote:
Quote:
hello:

I'm writing a process to write stimulis to a file in a test-bench, I
like that pin names are printed vertically, so I need to access
individual characters, can this be done with strings? how to make an
array of strings, I got error on line: variable PINS: PIN_NAMES
:=("CP","PL","CE","BD",....
declaring using a two dimensions array of character is OK.

Thanks in advance


WRITE_STIMULIS: process
--type PIN_NAMES is ARRAY(1 to 14, 1 to 2) of character;
type PIN_NAMES is ARRAY(1 to 14) of string;
file stimulis : text;
variable ligne : line;
--variable PINS: PIN_NAMES
:=(('C','P'),('P','L'),('C','E'),('B','D'),('U','D'),('T','C'),
-- ('P','3'),('P','2'),('P','1'),('P','0'),
-- ('Q','3'),('Q','2'),('Q','1'),('Q','0'));
variable PINS: PIN_NAMES
:=("CP","PL","CE","BD","UD","TC","P3","P2","P1","P0","Q3","Q2","Q1","Q0");

begin
file_open(stimulis,"stimulis.txt",WRITE_MODE);
write(ligne," "); writeline (stimulis,ligne);
write(ligne," "); writeline (stimulis,ligne);
for j in 1 to 2 loop
write(ligne," ");
for i in 1 to 14 loop
write(ligne,PINS(i)(j));
end loop;
writeline (stimulis,ligne);
end loop;
write(ligne," "); writeline (stimulis,ligne);
for i in 1 to 9 loop
wait for 100 ns;
write(ligne,time'image(now));
write(ligne," ");
for j in 1 to 6 loop
write(ligne,chr(sig(j)));
end loop;
write(ligne, str(P));
write(ligne, str(Q));
writeline(stimulis,ligne);
end loop;
end process;


Resolved

Nicolas Matringe
Guest

Sat Mar 26, 2016 3:32 am   



On 25.03.2016 18:32, morisaab_at_gmail.com wrote:
Quote:
On Friday, March 25, 2016 at 4:34:49 PM UTC+2, Maurice SAAB wrote:
hello:

I'm writing a process to write stimulis to a file in a test-bench, I
like that pin names are printed vertically, so I need to access
individual characters, can this be done with strings? how to make an
array of strings, I got error on line: variable PINS: PIN_NAMES
:=("CP","PL","CE","BD",....
declaring using a two dimensions array of character is OK.
[...]
Resolved


Hello
It could have been nice to post the solution in case anyone wants to do
it again.

Nicolas

elektroda.net NewsGroups Forum Index - VHDL Language - array of strings

Ask a question - edaboard.com

Arabic version Bulgarian version Catalan version Czech version Danish version German version Greek version English version Spanish version Finnish version French version Hindi version Croatian version Indonesian version Italian version Hebrew version Japanese version Korean version Lithuanian version Latvian version Dutch version Norwegian version Polish version Portuguese version Romanian version Russian version Slovak version Slovenian version Serbian version Swedish version Tagalog version Ukrainian version Vietnamese version Chinese version Turkish version
EDAboard.com map