Forum Discussion
Altera_Forum
Honored Contributor
12 years agoLet me ad this....I should also say that the contents of the Wave View can be managed by scripting as well.
Here are some of the typical TCL commands for building a stimulus file (I've removed my design hierarchy information, so all you see if the signal name): 1. active Low reset: force -freeze sim:/RES 1 {} force -freeze sim:/RES 0 10 force -freeze sim:/RES 1 45 2. setting up a clock: force -freeze sim:/CLK 1 0, 0 {25 ps} -r 50 3. add signal to wave viewer: add wave -position end sim:/ROW_DATA 4. assign values to inputs at start time and at time offsets: force ROW_DATA 0 0 set elapsedTime03 3000 force ROW_DATA 1 $elapsedTime03 5. run simulation for some number of cycles: run 9000000 I'm not going to describe the TCL syntax or statement semantics; this is something you can look up online (and everything in Quartus uses TCL scripting in the background, so it's a good thing to learn). You would also likely have some set of statements before all the ones I've listed that would do signal initialization, any looping to increment counters, etc., and send signals at periodic times, and also perform offset calculations. When you submit your script statements to ModelSim, it executes them internally; depending on the complexity of your stimulus algorithm, it can take many seconds to run before the vsim> prompt comes back...remember to be patient. Plus, as an interactive scripting tool, you get immediate feedback from ModelSim if you have an error (error messages). Once you run all the statements to operate on your signals and indicate which signals you want to view, you tell ModelSim to "run" some number of time steps. Once it completes this process, the wave viewer is updated with the waveform response. Make sure to open the Wave Viewer (or specify it in TCL command). Scripting your test stimulus can be fairly easy yet powerful option, and you can get this going quickly. To give you contrast, it took me a few hours to write scripting to drive my simulations, whereas when I finally had to write the TestBench, it took me 3-4 days (since it has to be fully simulated by itself to insure that it is correct before applying it to the the model). One other suggestion: start small, work out the behavior of a single test signal, get it working, then add other signals to the stimulus set. Hope this helps. Have fun. regds, jim