Add phase-by-phase tutorial notes
Add a Tutorial tree that mirrors the roadmap from Phase 0 through Linux bring-up. Each phase and subphase gets a short learning note with consistent sections for context, goals, new concepts, mental model, learning tasks, pitfalls, tooling, testing, and references. The tutorial material is intentionally explanatory rather than implementation code. It gives a systems-oriented learner enough FPGA, SystemVerilog, RISC-V, firmware, and Linux bring-up context to approach each roadmap phase without turning the notes into copy-paste RTL.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# Phase 12 - A Extension
|
||||
|
||||
## Context
|
||||
|
||||
The RISC-V A extension adds atomic memory operations. Mainline Linux expects atomics for
|
||||
locking, reference counts, futexes, and synchronization.
|
||||
|
||||
## Goals
|
||||
|
||||
- Implement LR/SC.
|
||||
- Implement AMO read-modify-write instructions.
|
||||
- Run RV32A tests before Linux work.
|
||||
|
||||
## New Concepts
|
||||
|
||||
- Atomic operation: memory operation that appears indivisible to other agents.
|
||||
- LR/SC: load-reserved/store-conditional pair.
|
||||
- Reservation: remembered address that allows a later store-conditional to succeed.
|
||||
- AMO: atomic memory operation combining load, operation, and store.
|
||||
|
||||
## How To Think About It
|
||||
|
||||
In a single-hart, single-master system atomics are conceptually simple. The value is in
|
||||
building the right architectural behavior now so the Linux path is realistic later.
|
||||
|
||||
## Learning Tasks
|
||||
|
||||
- Study success and failure cases for `sc.w`.
|
||||
- Decide when the reservation is cleared.
|
||||
- List AMO operations and their signed/unsigned comparison behavior.
|
||||
|
||||
## Pitfalls
|
||||
|
||||
- Returning the wrong success code from `sc.w`.
|
||||
- Forgetting AMOs return the original memory value.
|
||||
- Assuming single-hart shortcuts will remain valid if DMA or another master is added.
|
||||
|
||||
## Tooling And Testing
|
||||
|
||||
- Run `rv32ua` tests from riscv-tests or architectural tests.
|
||||
- Use memory traces to verify read-modify-write ordering.
|
||||
- Test reservation clearing on stores to the reserved address.
|
||||
|
||||
## References
|
||||
|
||||
- RISC-V unprivileged ISA, A extension: https://riscv.org/technical/specifications/
|
||||
- riscv-tests: https://github.com/riscv-software-src/riscv-tests
|
||||
- Linux atomic operations documentation: https://docs.kernel.org/core-api/wrappers/atomic_t.html
|
||||
|
||||
Reference in New Issue
Block a user