Skip to content

CS 315-01 Lecture/Lab Meeting Summary — Fall 2025

  • Date: Sep 09, 2025
  • Time: 08:08 AM Pacific
  • Meeting ID: 886 4953 2573

Quick Recap

The session focused on: - Technical setup for RISC-V development, including software installation and VM management with QEMU and UTM. - SSH configuration for VMs and GitHub access. - Assembly language concepts: function calling conventions, arrays, pointers, control flow, and memory access. - GDB debugging techniques. - Auto-grader setup and workflow for assignments. - Upcoming lab sessions on functions.

Action Items (Next Steps)

  • Gillian:
  • Finalize UTM setup instructions for the RISC-V VM and resolve the driver issue.
  • Greg:
  • Follow up on Beagle lab machine home directories not mounting.
  • Follow up on the submitted legal issue report.
  • Update assembly code examples with proper type annotations.
  • Students:
  • Set up local RISC-V VM environments following the demonstrated steps.
  • Complete Lab 3.
  • Download UTM (App Store or the free download from the UTM website).
  • Follow the setup instructions for the Ubuntu VM using the provided image.
  • Create a user account on the VM using the CS Labs username.
  • Set up SSH keys for passwordless login and GitHub access.
  • Visit Greg during office hours if experiencing VM installation problems.

Detailed Summary

RISC-V Software Setup

  • Overview of installing and configuring required tools across operating systems.
  • Noted issues with Beagle lab machines (home directories not mounting); students encouraged to use local environments.
  • Guidance provided on QEMU and UTM; a UTM link was shared on campus Wire.
  • The provided Ubuntu image for UTM includes necessary tooling to simplify setup.

SSH Setup on Virtual Machines

  • Demonstrated:
  • Creating a new user on the VM.
  • Configuring SSH keys for passwordless login and Git operations.
  • Copying a public key to the VM’s authorized_keys.
  • Recommended using a terminal and a window manager (e.g., UTM) for better workflow.

VM Configuration and Editor Settings

  • Walkthrough of local VM setup, addressing driver configuration and editor color scheme issues.
  • Encouraged consistent environment setup to avoid common tooling issues.

Assembly Language: Functions and Calling Conventions

  • Reviewed the add3 function and how arguments map to registers.
  • Emphasized:
  • Using labels for control flow.
  • Returning values in a0 (which may overwrite inputs—callers must preserve values if needed).
  • Leaf functions (functions that do not call other functions) and constraints: use A and T registers, ≤ 8 arguments.

Control Structures in Assembly

  • Implementing if-else and loops using branch instructions and labels.
  • Accessing arrays via load word instructions (lw) from memory addresses passed as arguments.
  • Encouraged practice with GDB to understand instruction flow.

Arrays and Pointers in C (for Assembly Preparation)

  • Explained equivalence between array indexing and pointer arithmetic.
  • Converted array access to pointer-based implementations to bridge C and assembly.
  • Assigned a challenge: implement C array access with pointers, then translate to assembly.

Array Access in Assembly

  • Demonstrated:
  • Calculating offsets (index * element size).
  • Adding base addresses and offsets.
  • Loading values with lw and updating values with sw.
  • Stressed:
  • Use of temporary registers.
  • Clear, correct code over optimization.
  • Direction of data flow: lw loads from memory; sw stores to memory.

GDB Debugging Techniques

  • Showed how to:
  • Set breakpoints and step through code.
  • Inspect registers and memory.
  • Use the x command to examine memory with specific formats and lengths.
  • Highlighted the utility of memory inspection for values that may not be visible in general output.

Auto-Grader Setup and Usage

  • Demonstrated:
  • Exporting the auto-grader profile.
  • Setting paths and configuring the test repository.
  • Emphasized:
  • Frequent commits and pushes to GitHub.
  • Beagle lab machines are expected to be restored; office hours are available for help.
  • Next lab will focus on functions.