Expand description
§Contributing
§First build
From the workspace root:
cargo test -p rhdl_ed25519_model --release -j 1
cargo test -p rhdl_ed25519_core --release -j 1
RHDL_SKIP_IVERILOG_CHECK=1 cargo test --workspace --release -j 1
./tools/docs/build.shThe single Cargo job is intentional on memory-constrained development hosts. Run narrow crate tests while iterating; reserve the workspace command for an integration gate.
§Choosing a first issue
Good first hardware changes are narrow and independently testable:
- add a boundary vector to the field/scalar oracle tests;
- improve error/framing coverage in the top-level simulation;
- add a constant-pattern address assertion;
- document a state or intermediate bound next to its owning type;
- add a checksum/provenance check to a generated artifact.
Changes to point formulas, scalar reduction, canonical decoding, secret table selection, or top-level concurrency are high risk even when the diff is small.
§Development loop
- Identify the owning crate in
crate::code_map. - Write or locate an independent oracle.
- Add the failing narrow test.
- Change one ownership boundary at a time.
- Run the narrow Rust/RHDL test.
- Run emitted RTL simulation if lowering or black boxes are involved.
- Inspect counter/address traces for secret-independent behavior.
- Run integration simulation.
- Regenerate synthesis evidence before changing an area/timing claim.
§Generated assets
Do not hand-edit basepoint .mem files or emitted Verilog. Use the generator,
verify the pinned source checksum, and review the generated manifest. A table
change should explain its logical dimensions, physical banking, constant-scan
behavior, and synthesis impact.
§RHDL style
- Keep
Q(current registers) andD(next registers) conceptually separate. - Make handshake conditions explicit.
- Use fixed-size arrays and bit widths in synthesizable paths.
- Keep child-engine protocols ready/busy/done or ready/valid consistently.
- Split very large kernels by responsibility; avoid opaque mega-tuples unless they materially reduce RHDL lowering cost.
- Comments should record bounds, timing assumptions, or protocol invariants, not restate assignments.
§Security review questions
Before requesting review, answer:
- Which inputs are secret or attacker-controlled?
- Are loop counts, addresses, enables, and stalls independent of secrets?
- Are untrusted encodings checked before reduction/use?
- Which transient and cached values are cleared, and when?
- Does any waveform, report, or host log contain a seed?
§Performance review questions
- Is the number a cycle model, OOC synthesis, post-route result, or board run?
- What exact operation and message length does it cover?
- Is it latency or steady-state initiation interval?
- Does the resource count include the shell and data movers?
- Are source and artifact checksums recorded?
- Is comparison traffic and semantic work equivalent?
§Updating these docs
The documentation crate uses ordinary Rustdoc Markdown through include_str!.
Broken intra-doc links are denied. After an architecture or interface change,
update the owning crate docs and this contributor guide in the same change.
Build locally with ./tools/docs/build.sh. The script creates a root redirect
to this guide inside target/doc while preserving every workspace crate’s
generated Rustdoc pages.