This tutorial will demonstrate how to implement your design in Xilinx and download it to the FPGA for hardware testing. It will also cover using the debugging features of the FPGA. This testing should only be done after the processor has been extensively tested in the simulator, as ModelSim gives more useful information when errors are encountered.
Note: Implementing your design takes approximately 20 minutes if running from the local harddrive, and upwards of an hour if running over the network.
The latest and greatest version (1.1.3) of the PennSim simulator.
The zip file containing the top level module and all other necessary files.
In addition to your own test programs (such as your own implementation of snake) and other test programs, we've included a compressed hex dump of the breakout program demonstrated in class.
Immediately after download, the processor begins executing its instructions.
The clock can be set to either automatic or manual control. This is done with switch 1 (the leftmost) of the on-board (not extension board) switches. When the switch is down, the processor is in manual control. In this setting, use the down button on the board to advance the clock one cycle (this button is actually controlling the global write enable signal sent into all of your modules). When switch 1 is up, the clock will advance automatically.
The right button on the board resets the processors registers and memory, and sets the program counter back to its initial state. This button does not reset video memory, to do this you must reprogram the device.
On-board switches 2, 3, and 4 are used in conjunction with the seven segment display on the external board to display debugging information about the processor. In the following table, a 0 means down and a 1 means up, as we've inverted the switches.
sw2 | sw3 | sw4 | information displayed |
0 | 0 | 0 | 7-segment data (memory of address 0xFE04) |
0 | 0 | 1 | Current PC value |
0 | 1 | 0 | Current Instruction |
0 | 1 | 1 | Regfile write data |
1 | 0 | 0 | {reset,0,regfile we,dmem we} |
1 | 0 | 1 | dmem address |
1 | 1 | 0 | dmem data out |
1 | 1 | 1 | dmem data in |
A few hints on what to do if Xilinx is being flaky:
For the most part, once the bit file has been generated correctly, most designs have worked well on the boards. It seems the only glitches have been in the steps to actually generate the bits files.
[March 23] - added instructions on how to suppress warning messages from the provided code.
[March 29] - Added trouble shooting hints