Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > How to load multiple test vector files, where the filename come fromgeneric parameters?

Reply
Thread Tools

How to load multiple test vector files, where the filename come fromgeneric parameters?

 
 
py
Guest
Posts: n/a
 
      12-19-2013
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 vhdl200 to specify a set of index-able filenames?


Thanks
 
Reply With Quote
 
 
 
 
Nicolas Matringe
Guest
Posts: n/a
 
      12-19-2013
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 vhdl200 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
 
Reply With Quote
 
 
 
 
py
Guest
Posts: n/a
 
      12-19-2013
Thanks! I was stump earlier due to uneven filename length. This file of files approach sounds good.
 
Reply With Quote
 
Nicolas Matringe
Guest
Posts: n/a
 
      12-20-2013
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to break a bash command into an array consisting of the argumentsin the command? Peng Yu Perl Misc 3 05-13-2013 10:27 AM
How to capture the “same” RGB images for the same scene using EDSDK? azuring@gmail.com Digital Photography 0 04-28-2013 12:08 PM
Considering File Content: Will the NetBeans IDE (deployed version)produce files identical to the javac compiler files clusardi2k@aol.com Java 4 04-26-2013 08:37 PM
How to get JSON values and how to trace sessions?? webmaster@terradon.nl Python 2 04-25-2013 02:12 PM
test test test test test test test Computer Support 2 07-02-2003 06:02 PM



Advertisments