PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM
Transcript of PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM
![Page 1: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/1.jpg)
ModelSim Simulation Tips
Common - last updated 9/19/19
![Page 2: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/2.jpg)
2 © tjCommon
ModelSim Tips
• Simulation “tips”• Your simulation says it’s running but it never stops P3
• You stopped your simulation and the results just
look like a solid line P3
• Your simulation fails for some reason P4
• Extending the time of a simulation P5
• Adding internal signals to the simulation P6
• Save your waveform format to reuse P10
• Changing your VHDL file or testbench without
restarting Modelsim P11
• Can I change the way waveforms look (colors) P12
![Page 3: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/3.jpg)
3 © tjCommon
ModelSim Tips
• Simulation Run• Your simulation says it’s running but it never stops
• OR• You stopped your simulation and the results just look like
a solid line
• Issue: You failed to set the simulation time when creating the test bench in assignments→ settings→ simulation
![Page 4: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/4.jpg)
4 © tjCommon
ModelSim Tips
• Simulation Run• Your simulation fails for some reason
• Go to your project directory/simulation/modelsim and open the file msim_transcript in notepad• It should tell you why the simulation has failed
![Page 5: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/5.jpg)
5 © tjCommon
ModelSim Tips
• Extending the time of a simulation• You setup your testbench and ran the simulation (it took a
long time to run)
• You need to run the simulation for a little longer (or a lot)
• You could stop the simulation, modify the testbenchsimulation time parameter and restart
OR
• In ModelSim
Simulate -> Runtime Options… -> Default Run
set the default run to the desired simulation extension, e.g. 1000 ns
Simulate -> Run -> Run 100hitting Run 100 will run the simulation again, and again, and … each time extending the desired amount of time
![Page 6: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/6.jpg)
6 © tjCommon
ModelSim Tips
• Adding internal signals to the simulation• You setup your testbench and ran the simulation
• Something is not working and you need to see an internal signal to figure out what is happening
• You could stop the simulation, add I/Os to the design to see the internal signals, elaborate and re-run the simulation
OR
Cont’d
![Page 7: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/7.jpg)
7 © tjCommon
ModelSim Tips
• Adding internal signals to the simulation
expand the DUT and select one of the lines
internal signals addedto list
original simulation
Cont’d
![Page 8: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/8.jpg)
8 © tjCommon
ModelSim Tips
• Adding internal signals to the simulation
right click on the signal you want to add and select Add Wave
internal signals addedto wave list
Cont’d
![Page 9: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/9.jpg)
9 © tjCommon
ModelSim Tips
• Adding internal signals to the simulation
simulate -> restart
click OK
Simulate -> Runtime Options… -> Default Run
set the default run to the desired simulation time, e.g. 3000 ns
Simulate -> Run -> Run 100hitting Run 100 will run the simulation again with the new signal added
new signal added to new simulation
![Page 10: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/10.jpg)
10 © tjCommon
ModelSim Tips
• Save your waveform format to reuse • Add any signals• Choose Radix, …
File -> Save FormatWill default to something like
…/project/simulation/modelsim/wave.doyou can make as many .do files as you wish
• To reload
File -> Load -> Macro FilePoint to your desired .do files
Note: you will get duplicates of your original signals
![Page 11: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/11.jpg)
11 © tjCommon
ModelSim Tips
• Changing your VHDL file or testbench without restarting Modelsim• Make any changes to your testbench• No need to run Analyze and Elaborate
• Make any changes to your VHDL• Be sure to rerun Analyze and Elaborate
• In Modelsim (already open)Files -> Load -> Macro File
select Project-name_run_msim_rtl_vhdl.do
• Your original simulation will rerun using the new files
Note: You will have to reload any wave changes you made
![Page 12: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/12.jpg)
12 © tjCommon
ModelSim Tips
• Can I change the way waveforms look (colors)• Tools -> Edit Preferences -> Wave Windows
![Page 13: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/13.jpg)
13 © tjCommon
ModelSim Tips
• Can I change the way waveforms look (colors)• Default Colors
![Page 14: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM](https://reader035.fdocuments.net/reader035/viewer/2022071508/6128ee2cf8e69c5e296a1744/html5/thumbnails/14.jpg)
14 © tjCommon
ModelSim Tips
• Can I change the way waveforms look (colors)• waveformBackground→ white
(scroll down in Wave windows color screen)
• Logic0, Logic1, Text, Time → black
• Vector → red