rustdv_methodology/rustdv_methodology.rs
1//! # rustdv-methodology
2//!
3//! The verification methodology layer — rustdv's analog of the UVM's
4//! component methodology (design-doc §5, as revised by review-memo R1–R6).
5//!
6//! **Read this first: R3, R4 and R5 are being reversed.** They are what
7//! made rustdv a *closed-world* framework — one that cannot configure or
8//! override anything you did not write yourself — and the branch this
9//! crate is on exists to undo them. `output/.design-decisions.md` is
10//! authoritative; the list below marks each item's real status so nobody
11//! mistakes the current code for the intended design.
12//!
13//! - Transactions are plain structs with std derives (R1) — no base trait.
14//! **Stands.**
15//! - The component tree is the ownership tree (R2): children are struct
16//! fields; [`ComponentNode`] provides traversal, hand-implementable or
17//! generated by `#[derive(Component)]`. **Stands** — the tree is still
18//! ownership; what returns is the phase structure over it.
19//! - build/connect are constructor conventions (R3); the runtime lifecycle
20//! is the [`Component`] trait. **Reversed — `build`/`connect` are real
21//! phase methods again (D5/D6/D51), and the runner drives all nine phases
22//! over the tree (`run_component_test`).** The *first half* of ch24 (the
23//! phase-logging test) runs on this. Still pending: two-stage
24//! construction, where a parent creates children as `Option<T>`/`Vec<T>`
25//! in its own `build` — the second half of ch24.
26//! - Configuration is typed config structs passed to constructors (R4).
27//! **Reversed by D11–D16, not yet implemented.** A path-addressed
28//! `ConfigDb` returns, with three-tier resolution and loud failure.
29//! - Variation points are constructor injection (R5) — no factory.
30//! **Reversed, not yet implemented.** The factory returns in ch29
31//! (D26 keeps it out of ch23 only because the book does).
32//! - Communication is channels + [`AnalysisBus`] + the sequencer
33//! handshake, preserved event-for-event from pyuvm (R6, §5.6).
34//! **Stands, and is being extended:** TLM ports, exports and FIFOs
35//! arrive per D17–D24, with ports in components and exports on FIFOs.
36//!
37//! What *has* landed on this branch is step 4: [`RustdvCtx`], the one
38//! context (D47), and [`Component`]'s `async fn run` (D46, D48).
39
40pub mod analysis;
41pub mod channel;
42#[cfg(test)]
43use rustdv_vpi_stubs as _;
44
45pub mod component;
46pub mod config;
47pub mod factory;
48pub mod error;
49pub mod fifo;
50pub mod objection;
51pub mod port;
52pub mod sequence;
53pub mod shared;
54
55pub use analysis::{AnalysisBus, PublishExport, SubscribeExport};
56pub use shared::RustdvShared;
57pub use channel::{channel, Receiver, Sender, TlmEmpty, TlmError, TlmFull};
58pub use component::{
59 build_all, check_all, connect_all, end_of_elaboration_all, extract_all, final_all,
60 check_connections, print_hierarchy, report_all, run_all, run_component_test,
61 run_extract_check_report, unconnected_ports,
62 start_all, start_of_simulation_all, Active, CheckSink, Component, ComponentNode, DynPhases,
63 RustdvCtx,
64};
65pub use config::{ConfigDb, ConfigError};
66pub use error::TestError;
67pub use factory::{RustdvComp, ComponentReg, Factory, Maker};
68pub use fifo::{GetExport, PeekExport, PutExport, TapExport, TlmFifo};
69pub use port::{
70 bind, ConnectError, GetIf, GetPort, PeekIf, PeekPort, Port, PortField, PortInfo, PortName,
71 PortOwner, PublishIf, PublishPort, PutIf, PutPort, SinkHandle, SubscribePort, Subscriber,
72};
73pub use objection::{ObjectionGuard, ObjectionRegistry};
74pub use sequence::{
75 clear_seq_overrides, create_seq, set_seq_override, set_sequence_seed, DynSequence,
76 ResponseQueue, RustdvSeq, SeqCtx, SeqError, SeqItem, SeqItemExport, SeqItemIf, SeqItemPort,
77 Sequence, Sequencer, TxnId,
78};