M
Maurice SAAB
Guest
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;
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;