EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

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 versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map