pub struct RustdvCtx { /* private fields */ }Expand description
Handed to each test. Since step 4 this is the one universal context
(D47): the old TestCtx and RunCtx merged into RustdvCtx, which
lives in rustdv-methodology beside the Component trait that receives it.
Everything a running testbench is handed: the DUT, randomization, the
objection registry, and the component’s path.
One type, not one per phase. D8 wanted BuildCtx/ConnectCtx/
RunCtx so that build_child during run would fail to compile. D47
gives that up: Part II teaches a testbench with no components and
therefore no phases, and naming the type after a phase names a concept
the reader has not met. Phase-illegal operations are caught at run time,
as UVM catches them.
Clone is deliberate — the objection registry is Rc-shared, so a
clone objects to the same test. D9’s per-node context, when the build
phase arrives, is that clone with the path extended.
Implementations§
Source§impl RustdvCtx
impl RustdvCtx
Sourcepub fn new(path: &str, dut: HierarchyHandle, seed: u64) -> RustdvCtx
pub fn new(path: &str, dut: HierarchyHandle, seed: u64) -> RustdvCtx
Built by the runner, once per test, with path the test’s
registered name (D49 — UVM’s fixed uvm_test_top is not ported).
Sourcepub fn child(&self, name: &str) -> RustdvCtx
pub fn child(&self, name: &str) -> RustdvCtx
A child context: same services, path extended by name (D9). The
phase traversals hand each child its own context so a component’s
ctx.info() logs the path the walk derived, never a stored string.
pub fn dut(&self) -> HierarchyHandle
pub fn seed(&self) -> u64
Sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
This component’s path — derived by the walk, never stored on the component itself (D7).
Sourcepub fn rustdv_path(&self) -> &RustdvPath
pub fn rustdv_path(&self) -> &RustdvPath
This component’s path as segments. The connection registry (D83) addresses components by this, so a port key cannot be hand-typed.
pub fn debug(&self, msg: &str)
pub fn info(&self, msg: &str)
pub fn warning(&self, msg: &str)
pub fn error(&self, msg: &str)
pub fn critical(&self, msg: &str)
Sourcepub fn set_logging_level_hier(&self, level: Level)
pub fn set_logging_level_hier(&self, level: Level)
Port of set_logging_level_hier(level).
Sourcepub fn disable_logging_hier(&self)
pub fn disable_logging_hier(&self)
Port of disable_logging_hier().
Sourcepub fn add_file_handler_hier(
&self,
file: &str,
append: bool,
) -> Result<(), Error>
pub fn add_file_handler_hier( &self, file: &str, append: bool, ) -> Result<(), Error>
Port of add_logging_handler_hier(logging.FileHandler(path)) —
this subtree’s messages are also written to file.
Sourcepub fn remove_console_hier(&self)
pub fn remove_console_hier(&self)
Port of remove_streaming_handler_hier() — stop printing this
subtree to the console (file handlers keep receiving it).
Sourcepub fn raise_objection(&self, description: &str) -> ObjectionGuard
pub fn raise_objection(&self, description: &str) -> ObjectionGuard
Port of raise_objection, returning a guard whose Drop is drop_objection (pyuvm: uvm_component.objection()).
pub fn objections(&self) -> &ObjectionRegistry
Sourcepub async fn all_objections_dropped(&self)
pub async fn all_objections_dropped(&self)
Wait until every raised objection has been dropped. Logs the pyuvm “you never objected” warning if nothing was ever raised.