pub struct DramDataflow { /* private fields */ }Expand description
A straight-line in-DRAM dataflow graph: a growable row heap (operands then scratch) and the prim
sequence computed over it. not/and/or/copy append a node writing a FRESH scratch row and
return its index; higher-level gates compose those. This is the compiler-side spatial graph the
DRAM plane executes.
Implementations§
Source§impl DramDataflow
impl DramDataflow
Sourcepub fn new(inputs: usize) -> Self
pub fn new(inputs: usize) -> Self
A dataflow over inputs operand rows (indices 0..inputs); scratch rows are appended above.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
The number of in-DRAM primitive steps (dataflow nodes) — the cost of the kernel.
Sourcepub fn program(&self) -> &[Prim]
pub fn program(&self) -> &[Prim]
The emitted prim sequence (the spatial dataflow, in execution order).
pub fn copy(&mut self, a: usize) -> usize
pub fn not(&mut self, a: usize) -> usize
pub fn and(&mut self, a: usize, b: usize) -> usize
pub fn or(&mut self, a: usize, b: usize) -> usize
pub fn nand(&mut self, a: usize, b: usize) -> usize
pub fn nor(&mut self, a: usize, b: usize) -> usize
pub fn xnor(&mut self, a: usize, b: usize) -> usize
Sourcepub fn difference(&mut self, a: usize, b: usize) -> usize
pub fn difference(&mut self, a: usize, b: usize) -> usize
Set difference a \ b = a AND NOT b.
Sourcepub fn majority(&mut self, a: usize, b: usize, c: usize) -> usize
pub fn majority(&mut self, a: usize, b: usize, c: usize) -> usize
Bitwise majority MAJ(a,b,c) = (a AND b) OR (a AND c) OR (b AND c) — the full-adder carry.
Sourcepub fn boolean_fn(&mut self, a: usize, b: usize, truth: u8) -> usize
pub fn boolean_fn(&mut self, a: usize, b: usize, truth: u8) -> usize
Realize an ARBITRARY 2-input boolean function from its 4-bit truth table (bit 2·a+b =
f(a,b)) as an OR of minterms over {AND, OR, NOT} — a constructive functional-completeness
witness. An empty table yields constant 0 (a AND NOT a).
Trait Implementations§
Source§impl Clone for DramDataflow
impl Clone for DramDataflow
Source§fn clone(&self) -> DramDataflow
fn clone(&self) -> DramDataflow
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DramDataflow
impl Debug for DramDataflow
Source§impl Default for DramDataflow
impl Default for DramDataflow
Source§fn default() -> DramDataflow
fn default() -> DramDataflow
Auto Trait Implementations§
impl Freeze for DramDataflow
impl RefUnwindSafe for DramDataflow
impl Send for DramDataflow
impl Sync for DramDataflow
impl Unpin for DramDataflow
impl UnsafeUnpin for DramDataflow
impl UnwindSafe for DramDataflow
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.