Lab 4: TinyRV1 Processor
Part F: Assembly Programming
Lab 4 will give you experience designing, implementing, testing, and prototyping a single-cycle processor microarchitecture and a specialized accelerator. The processor will implement the TinyRV1 instruction set. The instruction set manual is located here:
The lab will continue to leverage concepts from Topic 2: Combinational Logic, Topic 3: Boolean Algebra, Topic 4: Combinational Building Blocks, Topic 6: Sequential Logic, Topic 7: Finite-State Machines, and Topic 8: Sequential Building Blocks. The lab will also leverage concepts from Topic 9: Instruction Set Architecture and Topic 10: Single-Cycle Processors The lab will continue to provide opportunities to leverage the three key abstraction principles: modularity, hierarchy, and regularity.
The lab includes seven parts:
-
Part A: Processor Components
- Due 11/6 @ 11:59pm via GitHub
- Students should work on Part A before, during, and after your assigned lab section during the week of 11/3
- Pre-lab survey on Canvas is (roughly) due by end of lab section during the week of 11/3
-
Part B: TinyRV1 Processor
- Due 11/13 @ 11:59pm via GitHub
- Students should work on Part B before, during, and after your assigned lab section during the week of 11/10
-
Part C: Accumulate Accelerator
- Due 11/25 @ 11:59pm via GitHub
- Students should plan to submit Part C before they leave for Thanksgiving Break
-
Part D: FPGA Prototype v1
- Due week of 11/17 during assigned lab section
- This part will focus on prototyping the code developed in Part A+B
- Even though completed with a partner, every student must turn in their own paper check-off sheet in their lab section!
-
Part E: FPGA Prototype v2
- Due week of 12/1 during assigned lab section
- This part will focus on prototyping the code developed in Part A+B+C
- Even though completed with a partner, every student must turn in their own paper check-off sheet in their lab section!
-
Part F: TinyRV1 Assembly
- Due 12/4 @ 11:59pm via GitHub
- This part will include all of the assembly developed during Part D+E
-
Part G: Report
- Due on 12/8 at 11:59pm for all groups!
- Post-lab survey on Canvas is due at the same time as the report
This handout assumes that you have read and understand the course tutorials and that you have attended the discussion sections. This handout assumes you have successfully completed Parts A, B, C, D, and E.
All parts of Lab 4 must be done with a partner. You can confirm your partner on Canvas (Click on People, then Groups, then search for your name to find your lab group).
You should have already cloned your group remote repository, so use git pull to ensure you have any recent updates before working on your lab assignment.
where XX should be replaced with your group number. Start by making
sure you are passing all of your hardware tests.
1. TinyRV1 Assembly Programs
The goal for this part is simply for you to collect together the various
assembly programs you developed in previous parts. These assembly
programs should all be located in the lab4/asm subdirectory and include
the three calculator assembly programs from Part D, the accumulate
assembly program from Part C and E, and the door monitor assembly
programs from Part E. More specifically, here is a list of the eight
assembly programs we expect you to submit:
calculator-step1.asmcalculator-step2.asmcalculator-step3.asmaccumulate.asmdoor-monitor-step1.asmdoor-monitor-step2.asmdoor-monitor-step3.asmdoor-monitor-step4.asm
It is ok if the assembly program for the final step of the calculator and door monitor includes code for the optional extensions as long as the submitted code is fully functional. You should spend a few minutes cleaning up your assembly code. Add a few comments and make sure the code is indented consistently and is easy to read and understand.
Use the ISA and single-cycle simulators in TUI mode to make sure all eight assembly programs are fully functional. For example, here is how to assemble step 1 of the calculator program and test it on both the ISA and single-cycle simulators using TUI mode.
% cd ${HOME}/ece2300/groupXX/build
% make calculator-step1.bin
% make proc-isa-sim
% ./proc-isa-sim +bin=calculator-step1.bin +tui
...
(tui) /in0=2
(tui) /in1=3
(tui) /20
(tui) /in0=4
(tui) /in1=5
(tui) /20
(tui) /quit
% make proc-scycle-sim
% ./proc-scycle-sim +bin=calculator-step1.bin +tui
...
(tui) /in0=2
(tui) /in1=3
(tui) /20
(tui) /in0=4
(tui) /in1=5
(tui) /20
(tui) /quit
Use a similar approach for testing all eight assembly programs. Keep in
mind you can also use +tui-tall for the larger programs to see more of
the assembly code. You will not really be able to fully test step 4 of
the door monitoring program in simulation since we have a 1000 cycle
timeout and your delay loop might run for hundreds of thousands of
cycles. Just verify it functions correctly for the first 1000 cycles.
2. Lab Code Submission
To submit your code you simply push your code to GitHub. You can push your code as many times as you like before the deadline. Students are responsible for going to the GitHub website for your repository, browsing the source code, and confirming the code on GitHub is the code they want to submit is on GitHub. Your assembly code will be assessed primarily in terms of code functionality.