Professional Documents
Culture Documents
-Introduction
Modelsim SE is a standard for simulating large scale projects. The ability to simulate the
entire EDK system is a major benefit for debugging components of the project as well as
the entire system.
The software provided by UNM is for academic use only. It is not intended for
commercial work and should not be used for such.
-Objective
-Process
Open project
ModelsimSE.ini file modification
Update environment variables
Clean simulation files
Generate simulation files
-Implementation
1
Figure 2. Modifying Hello World C code
Open the previously created project from Tutorial 1. Modify the hello world file as
shown above. This will print a single “U” to the UART. The significance of this is that
the character “U” is 55 in hex. This will allow visualization of a nice waveform.
2
Change the rate of the UART. This will allow the simulation not to have to run as long.
3
Use the Modelsim SE simulator that has been loaded.
Figure 9. Recompile
5
Figure 10. Clean Simulation
Regenerate the Simulation HDL files for running the new simulation.
6
Figure 12. Launch Simulator
7
Figure 14. Load the design
Set up the waveform window. When this is done, the various signals associated with the
project should be visiable.
8
Figure 16. Run Simulation
Run the simulation. For this tutorial, 2ms was chosen as it was a sufficient amount of
time to obtain output data from the UART. This is a user choice.
9
Figure 18. Waveforms
There are many signals that are displayed in the simulation. The user should spend time
going through some of them to include the general purpose registers.
By expanding the UART transmit it is possible to see the 01010101 that represents the
“U” coming out of the UART.
10
Figure 20. Launch EDK Shell
Another useful tool is the capability to visualize the Assembly code. To do this it will be
necessary to disassemble the .elf file. Launch the EDK Shell.
11
Disassemble the .elf file into a text tile. In this tutorial, the dump.dis file name was
chosen.
If the user searches for the “U” then they will see the applicable assembly code.
12
Attachment 1
This is an excerpt from a Xilinx Application Note for modifying the modelsim.ini file
Although ModelSim SE and ModelSim PE (5.7 or later) support the SWIFT Interface,
you must make certain modifications to the default ModelSim setup to enable this
feature.
You must make the following changes to the "modelsim.ini" file located in the
"%MODEL_TECH%" directory:
edit the statement that follows, from "Resolution = ns" to "Resolution = ps."
comment the following statement by adding a semicolon (;) at the beginning of the line:
PathSeparator = /
NOTE: It is important that you change the order in which the commands appear in the
"modelsim.ini" file. The simulation might not work if you do not follow the order
recommended above.
13
Attachment 2
Compiling the Modelsim Libraries and
______________________________________________
To compile libraries it should look like the following setup which I think is default. If it
isn’t the default, then it is a good idea to place the compiled libraries into a common
location such as “sim.”
Then you would use the same C:\simlib\EDK9.2_mti_se_nt path for the EDK_Lib.
Then make sure the smartmodel paths are setup correctly for the environmental variables
and the modelsim.ini. Which the installed path for the Smartmodels is at
C:\simlib\EDK9.2_mti_se_nt\smartmodel\nt\installed_nt.
LMC_HOME C:\simlib\EDK9.2_mti_se_nt\smartmodel\nt\installed_nt
Add to the PATH %LMC_HOME%\bin;%LMC_HOME%\lib\pcnt.lib;
14