Creating a Simple DO File Creating DO files is as simple as typing the commands in a text file. Alternatively, you can save the Main window transcript as a DO file. In this exercise, you will use the transcript to create a DO file that adds signals to the Wave window, provides stimulus to those signals, and then advances the simulation. 1. Load the test_counter design unit. a. If necessary, start ModelSim. b. Change to the directory you created in Lesson 2. c. In the Library tab of the Workspace pane, double-click the test_counter design unit to load it. 2. Enter commands to add signals to the Wave window, force signals, and run the simulation. a. Select File > New > Source > Do to create a new DO file. b. Enter the following commands into the source window: add wave count add wave clk add wave reset force -freeze clk 0 0, 1 {50 ns} -r 100 force reset 1 run 100 force reset 0 run 300 force reset 1 run 400 force reset 0 run 200 3. Save the file. a. Select File > Save As. b. Type sim.do in the File name: field and save it to the current directory. 4. Load the simulation again and use the DO file. a. Type quit -sim at the VSIM> prompt. b. Type vsim test_counter at the ModelSim> prompt. c. Type do sim.do at the VSIM> prompt. ModelSim executes the saved commands and draws the waves in the Wave window. 5. When you are done with this exercise, select File > Quit to quit ModelSim.
文章评论(0条评论)
登录后参与讨论