CS 452/652 - Real-time Programming
|
I hear the train a comin'
It's rollin' 'round the bend
And I ain't seen the sunshine
Since I don't know when...
Johnny Cash
|
Photo courtesy of y3285wan (W23) |
|
Winter 2025
Important Note for Students Not Enrolled Yet
Official Course Outline: CS 452, CS 652
Registrar's Schedule of Classes
Communication
Piazza is used as the primary communication channel for announcements, clarifications, questions, discussions, etc. It is expected that all students are familiar with all material posted and discussed on Piazza. There are different Q&A for:
- announcements,
- questions, and
- reporting hardware problems.
Private posting is disabled.
For any personal matters, please email the instructor.
Accommodations
If a student requests a short-term absence, individual adjustments will be made to assignment deadlines and/or weighting depending on the particular circumstances.
Lecture Notes
Lecture notes will be posted here after class. They are telegraphic, so they are not a substitute for the lectures. But if you attend the lectures they will most likely be a good memory prosthetic.
- Jan 7, 2025 - Introduction and Overview
- Jan 9, 2025 - Devices and Trains
- Jan 14, 2025 - Polling Loops, Kernel, Tasks
- Jan 16, 2025 - ARM Processor, Context Switch
- Jan 21, 2025 - ABI, Coding, Kernel
- Jan 23, 2025 - Scheduling, Optimization, Message Passing
- Jan 28, 2025 - Name Resolution, Measurements, Realtime Loop
- Jan 30, 2025 - Caching, Interrupts
- Feb 4, 2025 - Events, Clock, Idle
- Feb 6, 2025 - Software Design, Debugging
- Feb 11, 2025 - UART Interrupt Handling
- Feb 13, 2025 - Train Velocity, Design Approach (Snow day, class cancelled)
- Feb 17-21, 2025 - Model Train Week (aka Reading Week)
- Feb 25, 2025 - Train Modelling
- Feb 27, 2025 - Student Presentations: Kernel Design
- Mar 4, 2025 - Student Presentations: Kernel Design
- Mar 6, 2025 - Demo Preparation
- Mar 11, 2025 - TC1 Demos - no class
- Mar 13, 2025 - Train Control
- Mar 18, 2025 - Latency and Priorities
- Mar 20, 2025 - Train Control and Software Design Recap
- Mar 25, 2025 - TC2 Demos - no class
- Mar 27, 2025 - TC2 Debrief, Recap
- Apr 1, 2025 - Real-time Scheduling
- Apr 3, 2025 - Class cancelled in lieu of demo preparations, Q&A (in office)
Assignments
Assignment A0 is to be completed independently by each student. Afterwards, groups of 2 students (or 3 in exceptional circumstances) work on the remaining assignments.
IMPORTANT: Late assignment submissions will not be accepted. Plagiarism detection software will be used. Students might be asked to meet with TAs and explain their code. See the course outline for further information about academic integrity and appeals. Also see Notes on Assignments.
Due dates below are tentative until the assignment is published.
Assignment | Link to Assignment | Due Date | Notes
|
---|
A0 | Polling Loop | Tue, Jan 14, 9:00am | Communication with Trains and Terminal
|
K1 | Kernel (Part 1) | Tue, Jan 28, 9:00am | Context-Switch, Task Scheduling
|
K2 | Kernel (Part 2) | Tue, Feb 4, 9:00am | Message Passing, Name Server
|
K3 | Kernel (Part 3) | Thu, Feb 13, 9:00am Fri, Feb 14, 9:00pm | Event Notification, Clock Server
|
K4 | Kernel (Part 4) | Thu, Feb 27, 9:00am | I/O Server(s)
|
KD | Kernel Design | Tue, Feb 25, 9:00am Thu, Feb 27, 9:00am | In-Class Presentations on Feb 27, Mar 4
|
TC1 | Train Control (Part 1) | Tue, Mar 11, 9:00am | Demo: control one train
|
Project | Project Proposal | Tue, Mar 18, 9:00am | submitted for feedback, not graded
|
TC2 | Train Control (Part 2) | Tue, Mar 25, 9:00am | Demo: control multiple trains
|
Project | Final Project | Fri, Apr 4, 23:55pm | Final Project Demo
|
Final Exam
The final exam covers material from the entire course and is given as take-home exam.
It is
scheduled by the Registrar
for Saturday, Apr 12, 4pm - 6:30pm. The exam will be made available on Learn on Friday, Apr 11, 4pm.
Previous exams will be made available on Learn.
UW Final Exam Regulations
Math Faculty INC Grade Process
Resources
Lab
The lab room is MC 3018 and is for the exclusive use of CS 452/652 students. The access code is announced in class. Do not give the code to other students!
The usual rules apply, such as no food. Please see CSCF Teaching Lab Policies for details.
Most workstations in the main room run Ubuntu Linux with access to the regular linux.student.cs environment. The workstations connected to the Raspberry Pi computers run a slightly different Linux setup with a default login. Two of those are connected to train tracks. You can use the gtkterm terminal emulator to communicate with the Raspberry Pi via serial interface.
Raspberry Pi
The Raspberry Pi computers are custom-designed by Devon Merner of CSCF
and include a custom serial hat.
Train Set
The track and trains are controlled by sending commands via the serial interface.
Building and Running Code
Cross Compiler
In the linux.student.cs environment, the cross compiler is
installed at /u/cs452/public/xdev/bin/aarch64-none-elf-gcc. The
rest of the toolchain (g++, ld, objdump, readelf, etc.) is in the same
directory, following the same naming convention.
The cross compiler can also be downloaded from here.
Make sure to pick the right host platform and select 'AArch64 bare-metal' as
target platform.
Example Code
Sample code is available in the linux.student.cs environment at
/u/cs452/public/iotest. Please see the included README file for
further information. The example is also available here and as a pre-compiled image for testing.
Uploading
The Raspberry Pis in the lab use TFTP to download an image specific to their
MAC address, which is displayed on top of the Pi. An image can be uploaded
for a specific Pi using the web interface at
https://cs452.student.cs.uwaterloo.ca. Authentication is via standard UW
credentials (including possible 2FA).
When hovering over the user name in top-right corner of the web interface
and clicking on 'Profile', one can create and/or download an API token. With
this token stored in a local plaintext file named
$HOME/.cs452_token, the script at
/u/cs452/public/tools/upload.sh can alternatively be used to upload
an image for a specific Pi by specifying its MAC address. This method only
works from on-campus computers or when using UW's VPN.
Make sure to not interfere with another person currently using a particular
Pi!
Other
Curiosities