Re: [myhdl-list] Testbench Template
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2012-08-03 12:58:30
|
On 7/31/12 10:50 PM, Christopher Felton wrote: > I have been using a simple testbench template > for small single module tests. I use this testbench > template so that I can quickly add basic test stimulus > to a module. From the testbench I can do operations > that require similar setup. > > >> python test_.py trace > >> python test_.py convert > >> python test_.py cosim > > Note, I usually have a more complicated test environment > (only as complicated as needed and no more) for full > designs. In addition to the *full* verification > environment I typically have individual module tests > that use the template. > > I attached the template and an example using a simple > adder. Might be useful (might not). Feel free to > comment, always room for improvement. This is a > template that needs to be manually modified and uses > some features only available in 0.8dev branch. > > Regards, > Chris > > I modified the /testbench/ template to be a class which is more reusable. Also, used the Python argparser for the command line options. Using the same example as the previous post the CLI is: python test_myadder.py -h usage: test_myadder.py [-h] [--trace] [--cosim] [--convert] [-Tclk CLOCK_PERIOD] Testbench optional arguments: -h, --help show this help message and exit --trace enable testbench tracing (create VCD file) --cosim run cosimulation --convert convert the module -Tclk CLOCK_PERIOD, --clock_period CLOCK_PERIOD set the clock period Again, this is intended to streamline the creation of tests for small single module designs. Regards, Chris |