pub struct Factory;Expand description
The factory. Ambient, like the ConfigDb it is built on; every method is an associated function.
Implementations§
Source§impl Factory
impl Factory
Sourcepub fn create_by_name(name: &str) -> RustdvComp
pub fn create_by_name(name: &str) -> RustdvComp
Build a component from its registered string name (D71). Overridable,
like anything from the factory. A name that is not registered is a
testbench bug and panics; the file-driven form (ch39) will return a
Result instead.
Sourcepub fn set_type_override<From, To>()where
From: Component + ComponentNode + Default + 'static,
To: Component + ComponentNode + Default + 'static,
pub fn set_type_override<From, To>()where
From: Component + ComponentNode + Default + 'static,
To: Component + ComponentNode + Default + 'static,
Override every From::create_comp() with a To, testbench-wide
(UVM set_type_override_by_type). Compile-checked: To must be a
component.
Sourcepub fn set_type_override_by_name(from: &str, to: &str)
pub fn set_type_override_by_name(from: &str, to: &str)
The same, by string name (UVM set_type_override_by_name). Not
compile-checked; an unregistered to panics at this call.
Sourcepub fn set_inst_override<From, To>(ctx: &RustdvCtx, path: &str)where
From: Component + ComponentNode + Default + 'static,
To: Component + ComponentNode + Default + 'static,
pub fn set_inst_override<From, To>(ctx: &RustdvCtx, path: &str)where
From: Component + ComponentNode + Default + 'static,
To: Component + ComponentNode + Default + 'static,
Override a single instance, addressed by its path relative to ctx
(UVM set_inst_override_by_type). The path is a string because it
names a component elsewhere in the tree — not a duplicate of a field
name (D75).