# Errors: 0, Warnings: VHDL finish procedure is defined in the standard ENV package. # Time: 1 ms Iteration: 0 Instance: /using_finish_tb After the testbench completes, the simulator quits, and at the last line, we are back in the Linux vsim -c -do 'vsim ing_finish_tb run -all' The example below shows a testbench using the finish procedure started in ModelSim batch mode in Linux. If you are using scripts to start the simulation, you want to return control to the calling script after the simulation finishes. By doing so, the finish procedure will behave in the same way as the stop procedure that we will discuss in the next section of this article.Īn advantage of using finish is that you can use the default behavior when simulating in batch mode. Fortunately, we can prevent this behavior by adding the “-onfinish stop” option to the vsim command, as shown below. If you click Yes, ModelSim is going to quit. If you are running ModelSim in the GUI version, a popup will appear saying “Are you sure you want to finish?”. Note that finish quits the simulation by default. Replace this line with your testbench logic The code below ends the simulation when we reach the last line of the testbench sequencer process. You have to import “finish” from the STD.ENV package, and you have to compile the testbench in VHDL-2008 or newer to use it. The VHDL finish procedure is my favorite way of stopping a VHDL testbench that completes without errors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |