pub enum GateBinding {
Block(String),
}Expand description
How one ideal switch’s gate state is resolved, every step: always from a named block’s
current output, on while it’s >= 0.5. No non-block-driven variant exists — even a
permanently-off gate is an explicit Const(0.0) wired through a domain=voltage
BlockKind::Sig2Phys,
the same as every other gate — and no bare carrier-comparator variant exists either: that
comparison now lives entirely inside gate-driving BlockKinds themselves
(BlockKind::Pwm/BlockKind::PhaseShiftPwm, or a hand-built chain of ordinary blocks),
so GateBinding has exactly one job — reading a number and thresholding it — regardless of
what produced that number: a modulator’s own main/complement output, a
BlockKind::Hysteresis block (no carrier at all, event-driven bang-bang switching), or any
other block a caller composes.
Variants§
Block(String)
§Gate Binding
Purpose: how an ideal switch’s gate state is resolved from a named block, every step. Library: Electrical Interface
§Description
This is not a kind= block itself — it’s the gate=/ctrl= field pair on a
kind=ideal_switch device line. GateBinding has exactly one variant and exactly one
job: reading a named block’s current output and thresholding it at >= 0.5. No
non-block-driven variant exists — even a permanently-off gate is an explicit Const(0.0)
wired through a domain=voltage BlockKind::Sig2Phys, the same as every other gate.
The named block (ctrl=) must itself be a domain=voltage BlockKind::Sig2Phys — an
ideal switch’s gate is itself a voltage ($V_{GS}$ against $v_{th}$), not a distinct
discrete-actuation signal domain (and never domain=current, even though Sig2Phys
itself allows that domain for I-source targets).
§Parameters
gate=block— the only accepted value; every gate is block-driven.ctrl=<name>— the name of a declareddomain=voltageBlockKind::Sig2Physblock.
§Errors
gate=missing entirely on akind=ideal_switchline — rejected at parse time:missing field 'gate' (gate=block ctrl=<name> -- every gate is block-driven, see this file's own module doc comment).gate=present but notblock— rejected at parse time:unknown gate spec '<value>' (only gate=block ctrl=<name> exists -- every gate is block-driven).ctrl=naming a block that isn’t adomain=voltageBlockKind::Sig2Phys(including adomain=currentone) — rejected atdae-runtime’s validation stage (not netlist parse time):DaeError::GateTargetNotSig2Voltage.
§Netlist form
NAME kind=ideal_switch r_on=<f64> g_breakdown=<f64> v_breakdown=<f64> g_off=<f64> \
v_th=<f64> g_on=<f64> gate=block ctrl=<sig2phys_voltage_block_name>§Example
An ideal switch permanently held on via a Const(1) wired through Sig2Phys — the
plain D1 in out idealswitchmodel line gives the electrical connectivity (drain, source;
the model name is unused for a kind=ideal_switch-overridden device), the same-named
kind=ideal_switch line supplies the physics and gate. Verified end to end: V(out)
settles to 5 * 1000 / (1000 + 0.1) ≈ 4.9995 (a fully-on 0.1 Ω ideal switch in series
with a 1 kΩ load):
ONVAL kind=const value=1
ONGATE kind=sig2phys domain=voltage in=ONVAL
V1 in 0 5
D1 in out idealswitchmodel
D1 kind=ideal_switch r_on=0.1 g_breakdown=0 v_breakdown=-100 g_off=0 v_th=0.5 g_on=5 \
gate=block ctrl=ONGATE
R1 out 0 1kOn while the named block’s current output is >= 0.5.
Implementations§
Source§impl GateBinding
impl GateBinding
Sourcepub fn source_blocks(&self) -> [Option<&str>; 2]
pub fn source_blocks(&self) -> [Option<&str>; 2]
The block this binding reads from.
Sourcepub fn resolve(&self, outputs: &BTreeMap<String, SignalValue>) -> SwitchState
pub fn resolve(&self, outputs: &BTreeMap<String, SignalValue>) -> SwitchState
§Panics
If the named block’s own current value is a SignalValue::Vector — unreachable in
practice, since the only legal GateBinding target is a domain=voltage
BlockKind::Sig2Phys converter (enforced before any step runs), and Sig2Phys itself
rejects a Vector input at evaluation time — there is no way for a validly-targeted gate
to ever see one here. Also panics if name isn’t in outputs at all, exactly as before
this variant existed (equally unreachable, for the same “checked before any step runs”
reason).
Trait Implementations§
Source§impl Clone for GateBinding
impl Clone for GateBinding
Source§fn clone(&self) -> GateBinding
fn clone(&self) -> GateBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more