This shows you the differences between two versions of the page.
|
rasb:lab:02 [2026/06/22 03:00] ciprian.popescu0411 [Instructor Reference] |
rasb:lab:02 [2026/06/24 18:34] (current) cezar.zlatea [Exercise 1: Identify The Renode Scenario] |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Duration ===== | ===== Duration ===== | ||
| - | 3 hours: | + | 2 hours: |
| - | * 1h30 guided introduction to Renode and the digital-twin workflow; | + | * 0h30 guided introduction to Renode and the digital-twin workflow; |
| * 1h30 practical firmware exercise using a virtual sensor stream. | * 1h30 practical firmware exercise using a virtual sensor stream. | ||
| Line 278: | Line 278: | ||
| - Which output file contains firmware UART logs? | - Which output file contains firmware UART logs? | ||
| - | Expected answers: | + | hints: |
| * wiring file: ''renode/sensor_i2c.repl''; | * wiring file: ''renode/sensor_i2c.repl''; | ||
| Line 410: | Line 410: | ||
| - Which method is easier to tune if the data distribution changes? | - Which method is easier to tune if the data distribution changes? | ||
| - | Expected discussion: | + | hint: |
| * the threshold filter catches large absolute outliers and large immediate jumps; | * the threshold filter catches large absolute outliers and large immediate jumps; | ||
| Line 425: | Line 425: | ||
| * update ''docker/scripts/generate_report.py'' to make disagreements easier to inspect in the HTML report. | * update ''docker/scripts/generate_report.py'' to make disagreements easier to inspect in the HTML report. | ||
| - | ===== Instructor Timing ===== | ||
| - | Suggested 3-hour schedule: | ||
| - | |||
| - | ^ Time ^ Topic ^ | ||
| - | | 0:00 - 0:15 | Digital twin motivation and project layout | | ||
| - | | 0:15 - 0:35 | ''.resc'' walkthrough with ''renode/run_test.resc'' | | ||
| - | | 0:35 - 0:55 | ''.repl'' and virtual wiring with ''renode/sensor_i2c.repl'' | | ||
| - | | 0:55 - 1:15 | Custom I2C peripheral walkthrough with ''VirtualSensorStream.cs'' | | ||
| - | | 1:15 - 1:30 | IDE run loop, UART output, HTML report | | ||
| - | | 1:30 - 1:45 | Exercise 1 | | ||
| - | | 1:45 - 2:05 | Exercise 2 | | ||
| - | | 2:05 - 2:25 | Exercise 3 | | ||
| - | | 2:25 - 2:45 | Exercises 4 and 5 | | ||
| - | | 2:45 - 3:00 | Exercise 6 discussion or optional extension | | ||
| - | |||
| - | ===== Instructor Reference ===== | ||
| - | |||
| - | The completed solution is stored separately from the student starter: | ||
| - | |||
| - | <code> | ||
| - | reference/firmware/main.c | ||
| - | </code> | ||
| - | |||
| - | The student TODO file remains: | ||
| - | |||
| - | <code> | ||
| - | firmware/main.c | ||
| - | </code> | ||
| - | |||
| - | To validate the reference without modifying the starter permanently: | ||
| - | |||
| - | <code bash> | ||
| - | sg docker -c 'DOCKER_HOST=unix:///var/run/docker.sock docker run --rm --entrypoint /bin/bash \ | ||
| - | -v "$PWD":/host:ro renode_dt-digital-twin:latest \ | ||
| - | -lc "cp /host/reference/firmware/main.c /workspace/firmware/main.c && /workspace/scripts/entrypoint.sh"' | ||
| - | </code> | ||
| - | |||
| - | If the current shell already has Docker group membership, the outer ''sg docker -c'' wrapper is not needed. Keep ''%%DOCKER_HOST=unix:///var/run/docker.sock%%'' if Docker points at a stale rootless socket. | ||
| ===== Common Problems ===== | ===== Common Problems ===== | ||
| Line 501: | Line 463: | ||
| This is expected. The starter code reads the sensor but does not yet implement the threshold and model decisions correctly. | This is expected. The starter code reads the sensor but does not yet implement the threshold and model decisions correctly. | ||
| - | |||
| - | ===== What To Submit ===== | ||
| - | |||
| - | For the practical part, submit: | ||
| - | |||
| - | * answers to Exercises 1 and 2; | ||
| - | * the implementation of the threshold filter; | ||
| - | * the implementation of the model score and model keep/drop decision; | ||
| - | * the final summary line; | ||
| - | * a short explanation of why the two methods disagree at ''seq=2'' and ''seq=7''. | ||