pub enum LoopCell {
Arith {
op: AluOp,
a: Src,
b: Src,
},
Select {
cmp: CmpKind,
ca: Src,
cb: Src,
t: Src,
e: Src,
},
Func {
unit: FuncUnit,
a: Src,
b: Src,
},
MemRead {
addr: Src,
},
HeapRead {
addr: Src,
},
HeapWrite {
addr: Src,
val: Src,
},
HeapAlloc {
size: Src,
},
VectorArith {
op: VecOp,
ty: LaneTy,
a: Src,
b: Src,
},
}Expand description
One body cell of the CGRA fabric: an arithmetic tile, or a predicated SELECT (mux) tile whose
comparison is folded in. A branch in the loop body is if-CONVERTED to a Select: both arms
compute, the signed predicate selects — control becomes data, no divergence.
Variants§
Arith
v = a op b.
Select
v = (ca cmp cb) ? t : e — the CGRA mux tile, the predicate folded in.
Func
v = a unit b — a SEQUENTIAL functional-unit tile (signed division/remainder via the
shared_divider). Distinct from Arith so the emitter wires the multi-cycle divider, not a
combinational one. See FuncUnit.
MemRead
v = seq[addr] — a MEMORY-read tile reading the loop’s iterated sequence (see
LoopFabric::seq_input) at addr (the induction variable). On silicon this is a scratchpad
read (the induction counter drives the address bus); in the model it indexes the sequence array.
HeapRead
v = heap[addr] — a HEAP-read tile (the shared state plane). The heap mirrors the VM’s exact
layout: a collection at pointer p is heap[p] = length then its elements at heap[p+1..=p+len]
(1-based). length of xs is HeapRead(p); item i of xs is HeapRead(p + i). This is the
collection-read primitive the whole state plane composes from (with HeapWrite/HeapAlloc).
HeapWrite
heap[addr] = val (side effect); the tile’s value is val. SetIndex/ListPush compose from this.
HeapAlloc
Allocate size fresh words at the heap top (zeroed); the tile’s value is the NEW pointer. NewList
composes an alloc + writes; value semantics (COW) are handled upstream by DeepClone/EnsureOwned.
VectorArith
A packed-SIMD tile: a VecOp (lane-wise add / bitwise) over two operand words for lane type ty.
First-class placeable — routes to a CellKind::Simd tile exactly like Arith; combinational; proven
≡ N independent scalar ops by simd_tile_lock (SAT carry-isolation) + iverilog.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LoopCell
impl<'de> Deserialize<'de> for LoopCell
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for LoopCell
impl Eq for LoopCell
impl StructuralPartialEq for LoopCell
Auto Trait Implementations§
impl Freeze for LoopCell
impl RefUnwindSafe for LoopCell
impl Send for LoopCell
impl Sync for LoopCell
impl Unpin for LoopCell
impl UnsafeUnpin for LoopCell
impl UnwindSafe for LoopCell
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.