How to load multiple test vector files, where the filename c

P

py

Guest
Hi,

For my test bench design, I coded an input procedure that loops continuously. In each iteration, it opens a vector file and load the content as test stimulus.

What I'm trying to do is pipe in the filenames as generic parameters. At the moment, I can only do something ugly like this:


for ii in 0 to G_NUM_TEST_CYCLE-1 loop
if ii=0 then
readline_nospace(f_data_ref, rline);
elsif ii = 1 then
readline_nospace(f_data_ref_1, rline);
elsif ii = 2 then
readline_nospace(f_data_ref_2, rline);
....


Is there a way to create an array string (if so what's the syntax? I am using vhdl2008) to specify a set of index-able filenames?


Thanks
 
Thanks! I was stump earlier due to uneven filename length. This file of files approach sounds good.
 
Le 19/12/2013 19:52, py a écrit :
Hi,

For my test bench design, I coded an input procedure that loops continuously. In each iteration, it opens a vector file and load the content as test stimulus.
What I'm trying to do is pipe in the filenames as generic parameters.
[...]
Is there a way to create an array string (if so what's the syntax? I am using vhdl2008) to specify a set of index-able filenames?

Hello
You can define an array of strings but they will have to have the same
length (all elements of an array mut be of the exact same type)
A more flexible way would be to read the file names from a single file:

variable filename : line;
file filenames_file, tb_file : text;

while not endfile(filenames_file) loop
readline(filenames_file, filename); -- Read the file name
file_open(tb_file, filename.all, read_mode); -- Open the file
while not endfile(tb_file) loop
<read the file and do whatever needs to be done>
end loop;
file_close(tb_file);
end loop;

Nicolas
 
Le 20/12/2013 00:59, py a écrit :
Thanks! I was stump earlier due to uneven filename length. This file of files approach sounds good.
It's ben a while since I've used this, my code may need some rework but
the basic ideas is there.

Nicolas
 

Welcome to EDABoard.com

Sponsor

Back
Top