T
Tricky
Guest
Im trying to bring in a load of file paths into a testbench via
generics (I use generics an an area for stuff other users are allowed
to modify). I really need an array of strings for the file paths
because I need to match the length to another generic that is an
array, otherwise the TB should fail.
Now I know I could easily do this with VHDL 2008 like:
type str_array_t is array(natural range <>
of string;
but lets assume for the moment that we cannot use VHDL 2008. am I
stuck, going to have to use a separate generic for each file path,
which makes the TB far more verbose because I wont be able to do a
loop to read in all of the files.
I thought about using an array of lines, but the problem with pointers
is that they have to be variables, and I would have to set the paths
up in a process. Ideally Id like to read the files before time starts.
Im guessing Im stuck, and this is exactly why they brought
unconstrained array elements into the language.
generics (I use generics an an area for stuff other users are allowed
to modify). I really need an array of strings for the file paths
because I need to match the length to another generic that is an
array, otherwise the TB should fail.
Now I know I could easily do this with VHDL 2008 like:
type str_array_t is array(natural range <>
but lets assume for the moment that we cannot use VHDL 2008. am I
stuck, going to have to use a separate generic for each file path,
which makes the TB far more verbose because I wont be able to do a
loop to read in all of the files.
I thought about using an array of lines, but the problem with pointers
is that they have to be variables, and I would have to set the paths
up in a process. Ideally Id like to read the files before time starts.
Im guessing Im stuck, and this is exactly why they brought
unconstrained array elements into the language.