Array of strings?

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.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!