testbench for designs with generic

Status
Not open for further replies.

hithesh123

Full Member level 6
Joined
Nov 21, 2009
Messages
324
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
lax
Activity points
3,548
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.
 

true value can be written in the top level.
 

it depends what you want to test.

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.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…