pub struct Netlist<'d> {
pub templates: Vec<Template>,
pub instances: InstanceTree,
pub top: Vec<InstanceId>,
pub time_scale: TimeScale,
pub tick_ns_per_unit: u64,
/* private fields */
}Expand description
The hand-off value elaborate() produces: the full undeduped
InstanceTree plus (this task) a trivial 1:1 Template per instance.
Fields§
§templates: Vec<Template>§instances: InstanceTree§top: Vec<InstanceId>§time_scale: TimeScaleTask 6 (NL-026): the design’s global time scale — see
resolve_time_scale’s doc comment for exactly where this comes from
(a documented deviation from the plan’s literal spec).
tick_ns_per_unit: u64Task 6 (NL-025): the tick-per-nanosecond normalization factor SCHED
reads as its sole source of truth — see tick_ns_per_unit_of.
Implementations§
Source§impl<'d> Netlist<'d>
impl<'d> Netlist<'d>
Sourcepub fn member_symbol(&self, instance: InstanceId, key: SymbolKey) -> Symbol<'d>
pub fn member_symbol(&self, instance: InstanceId, key: SymbolKey) -> Symbol<'d>
Task 3 (Deviation #18): the real sv_lang::Symbol<'d> handle for one
instance’s own copy of a deduped Template member, keyed by that
member’s SymbolKey. sv_lang::Symbol is an internal handle type no
external NetlistView consumer needs (the trait’s public surface
stays exactly InstanceId/TemplateId/SymbolKey-based), so the
plan’s own doc comment calls this “crate-private”. Deviation from the
plan’s literal pub(crate): verified this function must actually be
pub, not pub(crate) — the plan’s own test
member_symbols_are_distinct_real_symbols_per_instance_not_the_canonical_aliased
calls netlist.member_symbol(..) from tests/netlist_dedup_invariants.rs,
an external integration-test crate (tests/*.rs files are compiled as
separate crates and only see this crate’s pub surface — exactly the
reasoning the plan’s own confirm_and_assign_symbol_keys doc comment
gives for why that function is pub, immediately above this one).
pub(crate) would make that test fail to compile. Still not part of
NetlistView and not re-exported from netlist::mod beyond
Netlist itself, so it remains effectively internal to callers that
hold a concrete Netlist<'d> (same crate, or an integration test).
Panics only if called with an (instance, key) pair elaborate()
itself never produced — every real caller (Task 8, same crate) only
ever passes pairs read off this same Netlist’s own
Template/InstanceTree data, so this can never fire for a correct
caller; a wrong caller is a programmer error this wave chooses to
catch loudly, not a Result (this is not an sv_lang/sv_lang_kinds
kind match, so it is not bound by this plan’s “match must fall
through to a typed error” rule — it is an internal indexing
precondition).
Sourcepub fn instance_symbol(&self, id: InstanceId) -> Symbol<'d>
pub fn instance_symbol(&self, id: InstanceId) -> Symbol<'d>
Task F3 (CG-125/NL-035): the real, undeduped Instance-kind
sv_lang::Symbol<'d> for id — the instantiation site itself (see
instance_syms’s own doc comment for why this, not member_symbol,
is what the run pipeline needs to reach instance_body()/
instance_port_connections()). Panics only for an InstanceId
elaborate() itself never produced, the same indexing-precondition
posture member_symbol’s own doc comment documents immediately
above.
Trait Implementations§
Source§impl<'d> NetlistView for Netlist<'d>
impl<'d> NetlistView for Netlist<'d>
fn registration_order(&self) -> Vec<InstanceId>
fn hierarchical_path(&self, id: InstanceId) -> &str
fn resolve_hier_path(&self, path: &str) -> Option<InstantiatedSignalId>
fn dedup_key(&self, tmpl: TemplateId) -> &TemplateKey
Source§fn tick_ns_per_unit(&self) -> u64
fn tick_ns_per_unit(&self) -> u64
Source§fn instance(&self, id: InstanceId) -> &InstanceNode
fn instance(&self, id: InstanceId) -> &InstanceNode
impl<'d> Netlist<'d> specifies. Purely
additive to this trait (Deviation #1) — every existing method keeps
its exact signature.