Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- re ifdefs - just trying to get my general "tools" in order. So far, I used the generate to include/exclude parts of a testbench (printing different things for different runs). --- Quote End --- For testbenches, using if-statements and generics is a nice quick-and-dirty solution. For example, I use a makefile to run all testbenches. Some of the more complex tests take a long time, so I use a generic to either full-test or run a smaller set. If I had a lot of different tests to perform on a system, then I would use a configuration; one configuration for each test, eg., lets say I have a Qsys system with lots of peripherals. Each peripheral could have its own set of test cases. The top-level testbench would contain a testcase generator component that does not really exist. You then use a configuration to connect that testcase generator to a specific testcase, eg., for the DDR you'd map non-existent testcase component to actual component testcase_ddr, etc. Read up on configurations, look at the code at the thread I posted above, and the above description will make a little more sense. Cheers, Dave