|
CSE Home | CSE 378 Fall 2006 | About Us | Search | Contact Info |
|
Lab 2: Taking Control - HWDue: 10/27/2006 DescriptionThe goal of the hardware portion of Lab 2 is to synthesize and implement your design, then place it on the board so that it can run a recursive program that solves the "Towers of Hanoi" for the case of 3 discs.Do NOT start this portion of the lab until you have verified that your design works in all the tests for the software portion. Phase 0: Administration
Phase 1: Towers of HanoiThe Towers of Hanoi is a simple puzzle that follows simple rules. (Towers of Hanoi). For this lab, the goal is to move 3 discs from peg 1 to peg 2 using peg 3 as a temporary. The files we've provided call the hanoi function, and print output using the print function. Part A: Implementation BackgroundIn the files hanoi.spim and hanoi.s the main program simply sets up the stack pointer and arguments and makes the initial call to hanoi. Hanoi takes four arguments:
EncodingsFor this lab we will be using only the LEDs as output. Therefore, we have to make the following changes:
The encoding of the pegs has no impact on the code. Your program will rearrange them for the recursive calls, but should not modify the initial values. The encoding of the discs calls for one change: see #1 in Part B for more info. OutputThe difference between hanoi.s and hanoi.spim is the implementation of the print function. For the board the print function does the following:
The discs are numbered 1,3,7, (ie. 0001, 0011, 0111) The pegs are numbered 1, 2, 4 (i.e. 0001, 0010, 01000) For an example, the LED pattern to move disc 2 from peg 3 to peg 1 would be:
Feel free to change the start and end patterns, but please don't change the peg and disc patterns. Part B: Implementing hanoi for SPIMThe initial call to hanoi is to move 3 discs from peg 1 to peg 2 using peg 4 as a temporary. Using the encoding described above, the call in C would be hanoi(7,1,2,4). Your tasks:
Part C: Making hanoi.ucfDownload asm_to_hex.pl and save in the Hardware folder of your designTo start this step, type the following command in the console: This will produce a new file called "hanoi.ucf" in $DSN\src\Hardware\UCFs. Phase 2: Synthesis and ImplementationIn order to properly synthesize your design, the Flow Settings for your design must be correctly set. Click on the Flow Settings button in the Design Flow Manager and verify that the following settings are correct:
Part A: Setting Synthesis Options:There are several options that you must set before synthesis can take place. A step by step tutorial that points out each of these settings is available here. Once you have completed setting the options for synthesis, you can run Synplify to begin the process. This is also covered in the tutorial.
Part B: SynthesisBe sure that you check the warnings produced by Synplify as some warnings may indicate significant problems with the design that could cause it to fail to implement correctly. A list of warnings grouped by severity can be found here. If you have run into a warning that is not listed on that page and are unsure about whether or not it is going to be a problem, contact one of the course staff.
Part C: Implementation OptionsAs with synthesis, you will need to set several options before beginning implementation. A detailed tutorial on setting up and running the implementation process is available here.
Part D: Implementation
This process can be time consuming, so be prepared to wait anywhere from 10 to 30 minutes for it to complete. For this reason, please do NOT perform implementation on workstations that have XUP boards attached, as this will tie them up when others could be using them.
Phase 3: TestingPart A: Configuring the boardThe final step in getting your design onto the board is using Impact to program the board using the initialized .bit file. A detailed tutorial on using Impact is available here.
When the little hourglass disappears the pattern should start. At the end of the moves, the program turns on all the lights and enters an infinite loop. To make it start from scratch, toggle the little white switch closest to the LEDs. Once you have successfully programmed the board, you should see the lights on the board blink according to the pattern described in part B of Phase 1. If so, you are ready to have your lab checked off. Part B: Changing the programIf your board does not function as expected and you believe that the problem is with the program that you wrote rather than with your design, you can save time in changing the program through the following steps:
DemonstrationTo demonstrate that you have successfully implemented your design on the board, let one of the course staff know and they will verify that this is the case. If you are unable to find someone to check off your work, come in during office hours or email cse378-tas@cs to schedule a time when one of us can check off your work. |
|||||||||||||||||||||||||||||||||||||||||||
Computer Science & Engineering University of Washington Box 352350 Seattle, WA 98195-2350 (206) 543-1695 voice, (206) 543-2969 FAX [comments to Course Staff] |