Code made in Xilinx Project Manager is simulated using ModelSim, a program made by Mentor Graphics. The following is a tutorial for those who are getting started with ModelSim, specifically the windows version since the Unix version is covered in the labs.
To start, one must make a project. Select File>New>Project, then select the names and location of the project in the pop up window. A pop window should appear which will give you the adding existing files or making a new file for your project. A file can also be added to the project by selecting File>Add to Project>File. After the file has been added to the project an icon with the file's name will appear in the "Project" window.
To compile this file you can right click in the window and select "Compile". If there are errors in the design you can see what the errors are present by right clicking and selecting compile>compile report. If the compile is successful it will say so in green letter in the command window, and a green checkmark will appear beside the name of the file in the project window. After the files are compiled they will be put into the work library. Click on the library tab beside the project tab, and then on the "+" next to the work library, and the library will expand to show the names of the compiled files.
To simulate the design double click on the file name in the work library in the library window. You can also do this by right clicking and selecting simulate. A new window called sim will appear. You are now ready to start simulating. To open all the simulation windows select view>all windows from the menu. Seven windows should appear: wave, list, dataflow, variables, signals, process, and source.To start simulating you will need to select the signals that you want to see. To do so, go the "signals" window and select the signal you want and drag it to the "wave" window.
The following line could be written in the command window to force the clock to 1 after 50ns and 0 after 100ns and repeats this every 100ns.
force clk 1 50, 0 100 -repeat 100
The force function can also be used to set other signals. For instance the following line would force the value of the signal "reset" to 1:
force reset 1
The length of the simulation can be chosen using the box in the menu bar. The radix of the signals displayed in the "wave" window can be chosen by right clicking on the signal in the "wave" window and selecting "radix".
Back to Main Xilinx Guide Page