powerpoint presentation...title powerpoint presentation author tim created date 9/19/2019 8:27:00 am

14
ModelSim Simulation Tips Common - last updated 9/19/19

Upload: others

Post on 24-Apr-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PowerPoint Presentation...Title PowerPoint Presentation Author Tim Created Date 9/19/2019 8:27:00 AM

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

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

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

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

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

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

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

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

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

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

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

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

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

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