CS 315-02 Lecture/Lab — Meeting Summary (Fall 2025)¶
- Date: September 9, 2025
- Time: 2:57 PM Pacific
- Meeting ID: 868 6589 0521
Quick Recap¶
The session included: - Technical demonstrations: setting up a local RISC-V VM with QEMU, configuring SSH access, and installing/testing a new auto-grader for Lab 3. - Instruction on assembly language concepts: loop structures, array implementations, and how arrays relate to pointers in C. - Debugging techniques with GDB. - Plans for future function implementations and upcoming project requirements.
Next Steps¶
For Students¶
- Complete Lab 3, implementing both C and assembly versions.
- Ensure assembly logic mirrors the corresponding C logic.
- Install QEMU for running the local RISC-V VM.
- Create user accounts in the VM using CS Labs usernames.
- Configure SSH keys for easier VM access.
- Verify GitHub connectivity from within the VM (SSH).
- Update the auto-grader following the posted documentation.
For Greg¶
- Investigate error messages occurring with the new auto-grader setup.
- Update auto-grader installation instructions to include the UV package manager.
- Fix PATH configuration in the profile file for the auto-grader.
- Complete config.toml configuration to point to the correct CS315 path.
- Respond to the CampusWire post about the auto-grader update.
Session Details¶
RISC-V VM Setup with QEMU¶
- Demonstrated local RISC-V VM setup using QEMU and SSH.
- Covered creating a custom username, adding the user to sudoers, and configuring SSH access.
- Explained setting up SSH keys and connecting to GitHub via SSH.
- Outcome: Students can work locally in the VM and interact with GitHub repositories.
Auto-Grader Installation and Setup¶
- Demonstrated installation and configuration of the new Lab 3 auto-grader.
- Required updates included modifying PATH and configuring the Micro editor.
- Initial issues were encountered but resolved; the auto-grader was tested successfully with a Python script.
- Documentation and updated instructions are available on the course website.
- Noted: Beagle machines were initially down at 8 AM; a shell script was started to bring them online.
- Planned to review prior week’s material and answer related questions.
Assembly Code Implementation Strategies¶
- Discussed implementing the add_3 function in both C and assembly.
- Emphasized mirroring C logic in assembly.
- Reviewed labels, instructions, control flow (jumps and branches), and calling conventions.
- Stressed consistency in comment styles and writing assembly in a form expected by C callers.
Assembly Language Loop Components¶
- Explained loop structure in assembly: loop label, condition check, and body.
- Reviewed conventions, including register a0 for return values.
- Covered register/memory management, and using the stack for temporary storage.
- Noted architectural differences between RISC and x86 regarding memory access instructions.
Arrays and Pointers in C¶
- Clarified the relationship between arrays and pointers: array indexing is syntactic sugar over pointer arithmetic.
- Demonstrated accessing elements via pointer arithmetic with automatic byte offset calculation by type.
- Led a design discussion for a C function to retrieve an array element using pointer notation, to be implemented later in assembly.
Assembly Code: Array Access¶
- Discussed dereferencing arrays in assembly: calculating base address + offset for element access.
- Demonstrated using registers for arithmetic and memory loads (base-plus-offset pattern).
- Compared the class’s approach to a provided “Z code” example; highlighted the use of an index to access specific elements.
- Announced a 10-minute break; planned to continue with live implementation and GDB-based analysis afterward.
Project Grading and Auto-Grader Installation¶
- Reviewed a project grading case: work not merged into main by the deadline resulted in a 75% score.
- Advised installation and use of the auto-grader (installation via curl command provided in class).
- Noted a pending late grading issue to be addressed.
- Recommended GDB for debugging; acknowledged a helpful observation credited to Leo.
Assembly Code Debugging Techniques¶
- Emphasized minimizing inputs to isolate issues.
- Demonstrated GDB usage for inspecting memory and register values.
- Implemented and tested array read/write functions in both C and assembly, stepping through with GDB to verify correctness.
Understanding Functions and Debugging¶
- Reinforced building a mental model of execution with GDB and monitoring register updates.
- Encouraged seeking guidance (including using ChatGPT) when stuck.
- Defined simple functions (up to eight arguments, no calls) and introduced leaf functions.
- Outlined upcoming topics: writing functions that call other functions, recursion, full register usage, and stack operations.
- Noted: Project 2 is due next week.