CO Course Project
CO Course Project
Course Project
A RISC CPU is to be designed in the VHDL/Verilog HDL modeling language, verified via Mentor
Graphics "ModelSim" simulator and implemented on the Xilinx FPGA board.
The data-path must have three 16-bit external “ports” to connect the CPU to the memory: a Read data bus,
A Write data bus and an address bus. The datapath must also have the various control and status signals as
external “ports”. Apart from those the datapath also needs to have the input “inr” used as a multiplexor to
decide the register number and the output “outvalue” which is used to display the contents of that register.
Report:
Students can submit one report per group. However, the report should clearly spell out the contribution of
each member of the group. It is expected that all members should have a reasonable equality in terms of
sharing the workload. The report should touch upon the following points:
B. Data-path Architecture:
In this part, you are to design the datapath of a CPU that will realize the instruction set architecture (ISA)
designed in the previous assignment (including any “adjustments” made to the ISA). Include the
following in your submission.
1. A block diagram (register level) of the datapath, with all components and control signals clearly
labeled.
2. A description of the function of each component in the datapath.
3. For each instruction of your ISA, list the register transfers, or sequence of register transfers,
required to fetch and execute the instruction. Register names should correspond to components in
your datapath diagram.
4. A discussion of the tradeoffs and other design decisions made in developing your datapath. This
should include:
- Cost vs. speed tradeoffs that you considered.
- Why you chose a single-cycle or multi-cycle design.
- Decisions related to “shared” and/or “dedicated” components.
- Selection of edge-triggered vs. latching registers.
- Other decisions that were considered.
C. Data-path Verification:
Develop and verify a VHDL/Verilog model of the data-path of your CPU. The CPU must be
capable of working with a single memory outside the CPU (you might need another instance of
the memory if your datapath has a separate data and instruction memory).
1. The top-level design should contain only component instantiations, matching your block
diagram (changes may be made to the diagram as necessary).
2. Design and test VHDL/verilog models of each unique component used in your datapath.
3. Create a table listing all control signals and the values of each control signal required for the
different clock cycles like fetch, decode, execute, etc.
4. You will have to submit the control signal table, the VHDL/verilog code and Simulation List
of all the components in the datapath as well as the VHDL/verilog code the complete top
level Datapath.
ALU: The ALU must provide all arithmetic and logic functions required to support your instruction
set. It should not provide unnecessary functions.
Register file: Design as a multi-port “memory array”. DO NOT instantiate individual registers.
Sign/zero extension logic, as appropriate, for ALU inputs.
Program counter (PC).
Instruction register (IR) (if required).
Assorted multiplexers for data paths and register address inputs.
D. Controller Design:
1. Design and test a VHDL/Verilog “behavioral” model of the control unit to realize the behavior
described in your Control Signal Table from the previous part of the project. Submit the
VHDL/verilog code and simulation results of the Control Unit.
2. Simulate the datapath component, verifying all required register transfers, by applying control
signals through the control unit created above and show in the simulation where you verified
each required register transfer for the CPU. (If some register transfers are common to multiple
instructions, you do not need to show them separately for every instruction – but it might be a
good idea to do so anyway.) Choose a test program. Force the inputs of control unit(which are
otherwise fetched from the program memory)as per the program so as to mimic the normal
operation and test all the stages of operation.
3. Create a CPU component by instantiating and connecting your control unit and datapath
components. CPU I/O ports should be limited to a clock, reset, inr as the input ports and outvalue
as the output port.
4. For the final simulation of the test program, to minimize the size of the listing, display only
one line per clock transition (i.e., trigger only on clock signal transitions). Show a sufficient set
of control signals to demonstrate correct operation of each instruction (control unit state, address
bus, data bus, ALU output, register file outputs, register file input, memory control signals, etc.)
On the simulation listing, annotate by writing the corresponding assembly language instruction
next to each execute cycle and highlighting the “significant” result register or bus value.
F. Remarks:
The remarks section of the report must be a three-page reply to four questions:
(a) What did you learn from this project?
(b) How can you possibly improve the performance of the deigned processor?
(c) What would you do differently next time?
(d) What is your advice to someone who is going to work on a similar project?