AI Computing Systems (EE219)

School of Science and Technology (SIST), ShanghaiTech University

Shanghai Institute of Semiconductor Innovation (SISI)

Lab 4

Introduction

Lab4 extends the Lab3 4 x 4 unsigned output-stationary systolic array into Gemmini [1]. Implement hardware-managed tiling and evaluate its performance against host-managed tiling. Both paths use the same physical mesh.

Lab Overview

Lab Tasks

Download the Lab 4 materials.

  • Part A: OS Tiling Scheduler. Implement the OS tiling scheduler; validate commands independently of the mesh.
  • Part B: Chisel Mesh Integration. Port the completed Lab3 array to Chisel and integrate the Gemmini mesh.
  • Part C: Performance Evaluation. Compare the host-tiled baseline and hardware-tiled integrated system.

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.

Optional Bonus: standalone Verilog tiling, capture optimization, and system-overhead analysis.

Note: Please refer to README for the detailed requirements and instructions.

Lab Files

Complete the files in student/.

Scala tutorial: Official Scala 2 Book.

Before implementation or tests, follow the environment guide for your class. A prebuilt Docker image is also available.

SISI-student: visit sisi-internal-share-link, enter the code PS4M8, and download ee219-lab4-chipyard.tar.gz.

SIST-student: use the chipyard.tar.gz. We strongly recommend extracting the package inside Lab4/, so that the resulting directory is Lab4/chipyard, beside the Lab4 Makefile.

SISI: ENVIRONMENT.

SIST: ENVIRONMENT_SIST.

Requirements

Run commands from Lab4/. In each new terminal, run source chipyard/env.sh.

make integration-check
make gemmini-install
make scheduler-test
make gemmini-mesh-test
make gemmini-compile
make gemmini-test
make benchmark
  1. Part A is checked by make scheduler-test; Part B by make gemmini-mesh-test.
  2. After A and B pass, run Part C with make benchmark. Individual modes are available with make benchmark-baseline and make benchmark-tiled.
  3. After editing student/, synchronize the installed copies before rerunning, as described in the README.
  4. Use only runs that pass all required cases; see the measurement definitions and acceptance criteria in the README.

Submission

Before submitting:

  • Package student/Lab4OSLoopMatmulExecute.scala, student/Lab4Mesh.scala, and <student-id>_lab4_report.pdf into a single <student-id>_lab4.tar.gz archive and submit it through Gradescope. Keep the provided Scala filenames.
  • The report must include baseline/optimized block diagrams, both changed Gemmini seams, tile order and address equations, a K-tile accumulation trace, the decoded Part A tail-case trace, A/B logs, element-wise correctness results, the Part C performance table, and an explanation of bubbles, fill/drain cost, boundary waste, and optimizations.
  • 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.
  • Do not submit build/, a copied Chipyard/Gemmini checkout, or any Lab3 material.
  • 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.

References

  1. Hasan Genc et al. Gemmini: Enabling Systematic Deep-Learning Architecture Evaluation via Full-Stack Integration. Proceedings of the 58th Annual Design Automation Conference (DAC), 2021. GitHub: ucb-bar/gemmini.