Incremental Processor Design
Circuits due Tue Apr 16 by 11:59pm in your Lab07 GitHub Repo
Requirements
- For this lab, follow incremental development approach as described in lecture and the guides. Commit three top-level circuits:
lab07-part1.dig
,lab07-part2.dig
andlab07-part3.dig
. - Submit all your
.dig
files,.s
and.hex
files, and a PDF of your instruction decoder spreadsheet.
Part 1 - A Partial Processor
For this part you should implement all the components and the top-level partial processor circuit described in the Processor Guide Part 1 with the following exceptions: the Extender and Data Memory.
In summary you need to implement:
- A Program Counter using a 64-bit Register with CLR. You may use your own register, or the Digital Register component
- A Register File that has 32 registers. Two registers can be read, and one can be written, in a single clock cycle.
- An ALU that supports
addi
,sub
,mul
,sll
, andsrl
. - Your top-level processor should have a variation of the dashboard view using splitters, tunnels, and probes as shown in the guide. You do not have the replicate this view identically, but it should show the same information. You are free to come up with new and better ways to display the same information.
- Your top-level circuit should be able to increment through a program in instruction memory showing each instruction word for the specified program, although this is not tested by the autograder in this lab.
- By manipulating the inputs to the Register File, ALU,
CLK
, andCLR
, your circuit should be able to execute four small programs:addi t0, t0, 1
resulting inT0
= 1li t1, 2
resulting inT1
= 2addi t0, t0, -1
resulting inT0
= -1 (0xFFFFFFFF)this multi-instruction program
li t0, 1
resulting inT0
= 1li t1, 1
resulting inT1
= 1sub t0, t0, t1
resulting inT0
= 0
- Your ALU should be able to subtract A - B and calculate the correct result
- For the autograder to test the four cases above:
- Your main circuit must be named
lab07-part1.dig
, have inputs namedCLK
,CLR
,RR0
,RR1
,WR
,WE
,ALUSrcB
,ALUOp
, andImm
, and outputs namedT0
andT1
- Your
ALU
must be namedalu.dig
, have inputs namedA
,B
, andALUOp
, and an output namedR
- Your main circuit must be named
Part 2 - Our First Processor
Part one required manual manipulation. In this part you build a processor that can automatically execute code.
The top-level circuit should contain its own decoder circuit to identify instructions and propagate the appropriate control signals.
For this part you will combine your work from part1 with a new implementation of the control lines as described in the Processor Guide Part 2
Build decoders (for instructions, registers, and immediates) and top-level processor circuit which can execute this program (also given in the Guide)
Use the spreadsheet approach to develop a decoder table that associated inputs (opcode, funct3, funct7, and funct6) with decoder outputs (
RFW
,ALUOp
, etc.).You must have inputs for
CLK
,EN
,CLR
, andPROG
, and outputs forA0
,A1
,A2
andDONE
first_s: li a0, 1 li a1, 2 add a2, a0, a1 unimp
Your circuit must be named
lab07-part2.dig
.
Part 3 - JAL and JALR
The top-level circuit should contain its own decoder circuit to identify instructions and propagate the appropriate control signals.
For this part you will combine your work from part2 with a new implementation of the control lines as described in the Processor Guide Part 2
- Build the control and top-level processor circuit which can execute this program (also given in the Guide)
main: li a0, 1 li a1, 2 jal first_s unimp first_s: add a0, a0, a1 ret
- Your circuit must be named
lab07-part3.dig
Given
- You may use any of the circuits shown in Processor Guide Part 1 or Processor Guide Part 2
- You may use any of Digital’s built-in components, or your own if you prefer.
Rubric
100 points from autograder tests