My vhdl entity has generic (n : natural := 8); declared in it.
The component in the test bench also has generic (n : natural := 8); declared in it.
My test bench entity also has generic (n : natural := 8); declared in it.
What is the correct way to write a test bench for vhdl entity with generic?
Does it need to be declared in all 3 places.
if you are happy with 1 value for the generic, you can just delcare a constant.
if you need to test several values for the generic, you can either:
make a constant array of test values and instantiate them in the testbench in parrallel
or put the same generic as a generic on the testbench and use TCL to force the generic value when you run the testbench, and run the testbench multiple times in a TCL loop.