|
Path | |
You will be using |
Basics | |
Please read this document completely before starting.
|
Part 3: The Complete Processor | ||||||||||||||||
In this final part of the project you will to complete the
implementation of your pipelined processor. Implement the control logic and the
remainder of your datapath. The processor must be able to execute the boot
code, jump to the assembly code you've written, and execute instructions
without any intervention (other than stepping through cycles).
Template file. The template file for this project is You may modify You may not alter the prototype of cpu.cast or remove or rename any lines or nodes that were included in the file. Note that the code that instantiates the CPU is at the end of We have supplied some additional definitions and tools that you can use in your implementation of this part of the project. We have also made available a correct (but slow) alu in If your alu has problems, feel free to use ours instead (it's slow though). Processor-Memory Interface: The instruction and data memory are supplied by external modules. In order to interface to them in your CAST files, you will need to follow the steps below:
HINT: Instruction memory always reads words. IMC0 and IMC1 should therefore always be set to ???. |
Testing and Debugging | |
The basic testing strategy is as follows:
In general, you need to run step 1 anytime you make corrections to your cast files. However, you should be able to run different image files without running mipsgen each time, assuming that no changes have been made to the .cast files. You can copy any image file to mem.image to run it with your processor. For instance, you may want to run msort from proj 1. Feel free to edit the Makefile so that it makes more than just test.s. Repeat the above steps until your processor works. You should first try to get your processor working without bypassing. Once the basic implementation works, make a backup copy, and then try adding bypassing. You're better off submitting a cpu without bypassing that works, rather than a broken one with bypassing. Make a backup of your processor before adding any extra credit components as well. |
Grading Criteria | |
Most of your Project 4c grade will be computed automatically, based on correctness. We released a basic test script that tests the startup and a few basic instructions on your chip. This guarantees that we are able to test your chip automatically. If your chip does not pass the basic test you could get no (0) correctness points!The files basic_test.s and basic_test.cmd are provided to
you. Please check for irsim errors indicating that basic_test.cmd
cannot attach to the buses or nodes. These files are also a good starting
point when writing your own test cases.
(Hint: We do not thoroughly test the instructions contained in the boot test (but we will in our real tests)! We are just testing that your boot code works and that we will be able to grade your project. ) Extra CreditHere are a couple of extra-credit extensions you can make to your processor. You need to provide the appropriate documentation (make sure the file name is exactly as asked) if it is requested below.Note: If you want to do one of the extra credit options, it might be wise to get the basic processor working first and submit it to CMS. If you then implement an extra credit option, you can always submit again. In the absence of desperate emails, we use your latest submission for grading purposes. LWL and LWR Instructions (4 points)These two instructions are used together to load an unaligned word from memory. The description in the text (p. A-66) is altogether inadequate, but the online MIPS documentation is fine. Note that LWL and LWR use register rt as both a source and destination. Think about your forwarding/bypass paths! If you implement these instructions, you don't need to do anything special to let us know. Our auto testing script assumes that if the LWL and LWR instructions work you must have implemented them for extra credit. Carry-Lookahead Adder (5 points)We cannot tell by testing whether your ALU implements carry-lookahead or not.
This is the one case in which we grade manually. You must include a
documentation file named Performance (5 points)In order to get the full 5 points, your processor should run at 5ns. Anything better than 12ns will get some extra credit. Your bypassing logic must work in order to qualify for this extra credit (if it doesn't then your cpu is artificially faster since the bypassing is part of the longest delay). No documentation needed. Exceptions (5 points)Here is a simple design for precise exceptions, in
which there is no distinction between Kernel mode and User mode, and no TLB.
You need to detect only two kinds of exceptions: arithmetic overflow for You need to implement only two registers from CP0:
When one of the exception conditions is detected, your processor should cancel instructions as necessary to give precise interrupt behavior. It should store the appropriate values in the EPC and Cause registers, and then continue fetching instructions from the exception handler location 0x80000180. The “appropriate values” for EPC and Cause are:
You will receive partial extra credit even if you do not get around to handling exceptions in branch delay slots correctly. You need to implement (a subset of the functionality of) the
which reads CP0 register rd into general register rt .
You only need to handle EPC and Cause, so for example it is fine to read EPC if
rd is even and to read Cause if rd
is odd.
Because there is no Kernel/User Mode distinction, and no way to mask or disable
interrupts, you do not need to implement the If you implement exceptions (either with or without branch-delay-slot detection)
please include a file Note: Because you have not implemented the Interrupt Enable bit(s) in the CP0 Status Register, this design is not quite able to do interrupt-driven I/O. But it's very close! Note 2: This is a nontrivial extension, and requires substantial additions to the datapath. We suggest you get the rest of your project working (and submitted) before tackling this. |
Submitting Your Project | |
Submission will be done using CMS . In your where username1 and username2
are the netids of you and your partner. The remainder of your README
file should contain documentation explaining any special features of your
design.
If your documentation is not suitable for a plain text file, create a separate
file You will submit a single file: a
This will create your solution file proj4c_valid_sub.tar.gz
, which you should submit to CMS. This time the script takes all .cast
.cmd .s and .pdf files. |
List of Instructions | |
The complete list of required MIPS instructions is: |