pub enum ScOp {
Show 16 variants
Input {
id: ValueId,
name: String,
ty: ScType,
},
Output {
id: ValueId,
name: String,
source: ValueId,
},
Constant {
id: ValueId,
value: ScConst,
ty: ScType,
},
Encode {
id: ValueId,
prob: ValueId,
length: usize,
seed: u16,
},
BitwiseAnd {
id: ValueId,
lhs: ValueId,
rhs: ValueId,
},
Popcount {
id: ValueId,
input: ValueId,
},
LifStep {
id: ValueId,
current: ValueId,
leak: ValueId,
gain: ValueId,
noise: ValueId,
params: LifParams,
},
DenseForward {
id: ValueId,
inputs: ValueId,
weights: ValueId,
leak: ValueId,
gain: ValueId,
params: DenseParams,
},
BitwiseXor {
id: ValueId,
lhs: ValueId,
rhs: ValueId,
},
Reduce {
id: ValueId,
input: ValueId,
mode: ReduceMode,
},
GraphForward {
id: ValueId,
features: ValueId,
adjacency: ValueId,
n_nodes: usize,
n_features: usize,
},
SoftmaxAttention {
id: ValueId,
q: ValueId,
k: ValueId,
v: ValueId,
dim_k: usize,
},
KuramotoStep {
id: ValueId,
phases: ValueId,
omega: ValueId,
coupling: ValueId,
dt: f64,
},
Scale {
id: ValueId,
input: ValueId,
factor: f64,
},
Offset {
id: ValueId,
input: ValueId,
offset: f64,
},
DivConst {
id: ValueId,
input: ValueId,
divisor: u64,
},
}Expand description
A single operation in the SC compute graph.
Each variant produces exactly one value identified by id.
Input operands reference values produced by earlier operations.
Variants§
Input
Module input port. No operands; value comes from external I/O.
Output
Module output port. Consumes one value; no new value produced.
id is a dummy (not referenced by other ops).
Constant
Compile-time constant.
Encode
Encode a probability (Rate or FixedPoint) into a Bitstream.
Maps to sc_bitstream_encoder in HDL.
Fields
BitwiseAnd
Bitwise AND of two bitstreams (stochastic multiply).
Maps to sc_bitstream_synapse in HDL.
Popcount
Population count: count 1-bits in a bitstream.
Part of sc_dotproduct_to_current in HDL.
LifStep
Single LIF neuron step.
Maps to sc_lif_neuron in HDL.
Fields
DenseForward
Dense SC layer: N_INPUTS → N_NEURONS with full SC pipeline.
Maps to sc_dense_layer_core in HDL.
Fields
params: DenseParamsLayer parameters.
BitwiseXor
Bitwise XOR of two bitstreams (HDC binding).
Reduce
Reduce a vector to a scalar (Sum or Max).
GraphForward
Graph forward: input features × adjacency → aggregated output.
SoftmaxAttention
Softmax attention: Q·K^T/sqrt(d) → softmax → ·V.
KuramotoStep
Single Kuramoto integration step: dθ/dt = ω + ΣK sin(θ_m - θ_n).
Scale
Scale a value by a constant: output = input * factor.
Offset
Offset a value by a constant: output = input + offset.
DivConst
Integer division by a constant (for rate computation).
Implementations§
Trait Implementations§
impl StructuralPartialEq for ScOp
Auto Trait Implementations§
impl Freeze for ScOp
impl RefUnwindSafe for ScOp
impl Send for ScOp
impl Sync for ScOp
impl Unpin for ScOp
impl UnsafeUnpin for ScOp
impl UnwindSafe for ScOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more