![]() |
|
|
|
#1 |
|
Hi all
Im trying to create a selection of files for a testbench, but the compiler is failing on the brackets. I tried the equivalent setup with a loop statement previously and that failed as well. Is there an easy way, or will I just need to define unique file names and create a explicit case statement in my code instead of an indexing signal?? The other option would be to have one bigger 'ReadF.txt' file, but then I lose flexibility for other tests... Thanks Andrew OUTPUT_WORD : process (gsr, sys_clk) variable VEC_WR_LINE : line; variable VEC_RD_LINE : line; file VEC_WR_FILE : text open write_mode is "WriteF.txt"; file VEC_RD_FILE(0) : text open read_mode is "ReadF.txt"; file VEC_RD_FILE(1) : text open read_mode is "ReadF.txt"; file VEC_RD_FILE(2) : text open read_mode is "ReadF.txt"; file VEC_RD_FILE(3) : text open read_mode is "ReadF.txt"; file VEC_RD_FILE(4) : text open read_mode is "ReadF.txt"; variable file_rd_bit_vec : bit_vector (15 downto 0); begin dwerdna |
|
|
|
|
#2 |
|
Posts: n/a
|
dwerdna wrote:
> I'm trying to create a selection of files for a testbench, but the > compiler is failing on the brackets. Declare an array of files type and an instance, something like: type selection_t is array(1 to 4) of file; variable vec_rd_file : selection_t; file vec_rd_file(1) : text open READ_MODE is "ReadF1.txt"; file vec_rd_file(2) : text open READ_MODE is "ReadF2.txt"; -- Mike Treseler Mike Treseler |
|
|
|
#3 |
|
Posts: n/a
|
dwerdna a écrit : > Hi all > > Im trying to create a selection of files for a testbench, but the > compiler is failing on the brackets. I tried the equivalent setup with > a loop statement previously and that failed as well. Is there an easy > way, or will I just need to define unique file names and create a > explicit case statement in my code instead of an indexing signal?? > > The other option would be to have one bigger 'ReadF.txt' file, but then > I lose flexibility for other tests... > > Thanks > > Andrew > > OUTPUT_WORD : process (gsr, sys_clk) > variable VEC_WR_LINE : line; > variable VEC_RD_LINE : line; > file VEC_WR_FILE : text open write_mode is "WriteF.txt"; > file VEC_RD_FILE(0) : text open read_mode is "ReadF.txt"; > file VEC_RD_FILE(1) : text open read_mode is "ReadF.txt"; > file VEC_RD_FILE(2) : text open read_mode is "ReadF.txt"; > file VEC_RD_FILE(3) : text open read_mode is "ReadF.txt"; > file VEC_RD_FILE(4) : text open read_mode is "ReadF.txt"; > variable file_rd_bit_vec : bit_vector (15 downto 0); > begin VHDL does not allow you to declare or use array of files. I don't really understand what you want to do. Why do you want to open a file 5 times. If you want to select a file, do it: constant my_filename : string := filename_chooser; file vec_rd_file : text open read_mode is my_filename; or because you are using VHDL-93, try: file vec_rd_file : text; .... file_open (vec_rd_file, "xxx.txt"); John. john Doef |
|
|
|
#4 |
|
Posts: n/a
|
Mike Treseler wrote:
> Declare an array of files type and an instance, something like: > type selection_t is array(1 to 4) of file; > variable vec_rd_file : selection_t; > file vec_rd_file(1) : text open READ_MODE is "ReadF1.txt"; ^ syntax error Sorry, I got it wrong. Arrays of files are illegal. -- Mike Treseler Mike Treseler |
|
|
|
#5 |
|
Posts: n/a
|
Hi all
Thanks for your comments I have a simple file which I use to simulate memory. I want to expand how many reads I do to that memory without increasing the file size. There is no particular reason in not increasing the file size, except I use the smaller file in other places. I therefore wanted to open an array of these files and have a pointer on which file to read from (exhaust one, and move onto the next). Thanks Andrew dwerdna |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert Video files to PSP | ivan | DVD Video | 4 | 06-17-2008 11:16 AM |
| How to copy *.vob files on DVD to the hard disk and merge them together | zengpeiwen1719 | Software | 0 | 05-24-2008 10:33 AM |
| Convert Video files to MP4 for iPod | ivan | DVD Video | 0 | 04-26-2006 08:38 AM |
| Very slow recognising DVD disc | Terry Pinnell | DVD Video | 1 | 03-28-2006 06:53 PM |
| Now I introduce some popular software of multimedia | eightsome@gmail.com | DVD Video | 0 | 03-28-2006 02:29 PM |