Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Automating multiple simulation runs of testbench with different parameters each time

Status
Not open for further replies.

BartlebyScrivener

Member level 5
Joined
Feb 8, 2012
Messages
90
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,081
I have written a test bench for a SystemVerilog design that has multiple parameters. I know if I wanted to load this in another module I would call it something like this ...

Code:
testBench #(parameterA, parameterB, parameterC)

But I don't want to call it in another module, I want to run 20 simulations for 20000ns, each simulation increasing the value of parameter C by one each time.

I am currently using ModelSim to simulate by manually changing the parameter values in the file, re-compiling and loading the simulation by typing 'vsim testBench', then typing 'run 20000ns', then repeating this procedure ad nauseum.

How can I automate this?
 

The modelsim .do files are tcl scripts, so you easily write a script that increments the parameter, recompile, and re-run simulation.

I have written a test bench for a SystemVerilog design that has multiple parameters. I know if I wanted to load this in another module I would call it something like this ...

Code:
testBench #(parameterA, parameterB, parameterC)

But I don't want to call it in another module, I want to run 20 simulations for 20000ns, each simulation increasing the value of parameter C by one each time.

I am currently using ModelSim to simulate by manually changing the parameter values in the file, re-compiling and loading the simulation by typing 'vsim testBench', then typing 'run 20000ns', then repeating this procedure ad nauseum.

How can I automate this?
 
If you want to automate this, you need to instantiate your testBench in another module top, giving it a default set of parameter values. Then use the vsim -G switch in a script that loops producing:

Code:
vsim -G/top/tb/parameterC=1 top -do "run 20000ns;quit -f"
vsim -G/top/tb/parameterC=2 top -do "run 20000ns;quit -f"
vsim -G/top/tb/parameterC=3 top -do "run 20000ns;quit -f"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top