EE219 2026 Fall — Lab4: Baseline and Tiled GEMM Integration in Gemmini
Overview
Lab4 extends the Lab3 4 x 4 unsigned output-stationary(OS) systolic array into
Gemmini. Implement hardware-managed tiling and evaluate its performance against
host-managed tiling. Both execution modes use the same 4×4 OS systolic array and PE datapath.

Before implementation or tests, follow the environment guide for your class: SISI or SIST.
Task Overview
| Part | Work | Detailed requirements | Score weight |
|---|---|---|---|
| A | Implement the OS tiling scheduler; validate commands independently of the mesh. | OS Tiling Scheduler | design 30% + report 15% |
| B | Port the completed Lab3 array to Chisel and integrate the Gemmini mesh. | Chisel Mesh Integration | design 25% + report 10% |
| C | Compare the host-tiled baseline and hardware-tiled integrated system. | Performance Evaluation | 20% |
| Bonus | Optional standalone Verilog tiling, capture optimization, and system-overhead analysis. | Bonus |
A and B can be developed in parallel. Complete A's scheduling checkpoint before combined A+B validation. C depends on completed A and B. Standalone Bonus development is independent; its system-overhead comparison reuses C's logs.
Deliverables
Package the following required files (paths identify the source files) into a
single <student-id>_lab4.tar.gz archive and submit it through Gradescope:
student/Lab4OSLoopMatmulExecute.scala
student/Lab4Mesh.scala
<student-id>_lab4_report.pdf
The report must include:
- the baseline and optimized block diagrams;
- both exact Gemmini source seams changed;
- tile order and address equations;
- one K-tile accumulation trace and the decoded Part A tail-case command trace;
- A/B test logs and element-wise correctness results for both system modes;
- the Part C performance table; and
- an explanation of bubbles, fill/drain cost, boundary waste, and any additional optimization.
For the optional Bonus, include student/tiled_systolic_array.v, any extended
testbench/measurement scripts, and bonus logs in the same archive. Include a
separate Bonus subsection in the report.
| Item | Requirement |
|---|---|
| Platform | Submit one .tar.gz archive through Gradescope. |
| Naming | Name the archive <student-id>_lab4.tar.gz and the report <student-id>_lab4_report.pdf; keep the provided Scala filenames. |
| Do not submit | build/, a copied Chipyard/Gemmini checkout, or any Lab3 material. |
| AI use | We encourage the use of AI and LLM for this lab. Please submit your prompts in debugging and optimizing your design. AI report is mandatory for this lab. |
| Deadline | The submission deadline, its timezone, and the late policy are announced with the lab release on the course platform. |
Quick Start
First complete the environment setup in the guide for your class linked above.
Run the following commands from Lab4/.
In each new terminal, run
source chipyard/env.sh
Then, run these commands from Lab4/.
make integration-check # pinned source seams and starter interfaces
make gemmini-install # install once; keep installed student edits
make # default: A scheduler-test (B may be incomplete)
make scheduler-test # A commands only
# After completing B (which can be developed in parallel with A):
make gemmini-mesh-test # B arithmetic, timing, and metadata tests
make gemmini-compile # compile the Gemmini integration
make gemmini-test # combined A + B suites
# After A and B pass, run Part C:
make benchmark # build and run baseline, then tiled
Starter TODOs are expected to fail behavioral checks. Both starters must compile
for the independent A test, but B need not be complete or elaborated.
Tests and benchmarks install the overlay on first use and preserve installed copies
on later runs. After editing student/, synchronize the installed copies
before rerunning.
To run an individual benchmark mode:
make benchmark-baseline
make benchmark-tiled
Your environment guide gives the log locations, parsing command, and scope of
make clean. Use only runs that pass all required cases; see the
measurement definitions and acceptance criteria.
The system benchmark is separate from the default make target.
Documentation
| Document | Read it for |
|---|---|
| TASKS.md | Shared interfaces, integration seams, A/B/C requirements, tests, and benchmark metrics |
| BONUS.md | Standalone Verilog tiling, capture comparison, and system-overhead analysis |
| ENVIRONMENT ENVIRONMENT_SIST |
Chipyard/Gemmini pins, setup, tools, and environment variables |
| Overlay guide | Installed files, backups, and conservative restore behavior |
| Upstream references | Gemmini, Chisel, and Chipyard documentation |