pub struct Grid {
pub rows: usize,
pub cols: usize,
pub n_in: usize,
pub tiles: Vec<Vec<Tile>>,
pub out: (usize, usize, Chan),
pub extra_outs: Vec<(usize, usize, Chan)>,
}Expand description
A placed-and-routed CGRA: a rows × cols array of tiles plus the tile/channel that carries the
result. Feed-forward (dataflow goes south/east), so it is a combinational DAG.
Fields§
§rows: usize§cols: usize§n_in: usize§tiles: Vec<Vec<Tile>>§out: (usize, usize, Chan)The primary output (a single-output fabric’s result = out0).
extra_outs: Vec<(usize, usize, Chan)>Additional outputs (a loop body has one next-state per accumulator). Total outputs =
[out] ++ extra_outs, named result when there is one, else out0..outK.
Implementations§
Source§impl Grid
impl Grid
pub fn new(rows: usize, cols: usize, n_in: usize) -> Grid
Sourcepub fn all_outs(&self) -> Vec<(usize, usize, Chan)>
pub fn all_outs(&self) -> Vec<(usize, usize, Chan)>
All output taps in order: the primary followed by the extras.
pub fn set(&mut self, r: usize, c: usize, t: Tile)
Sourcepub fn used_channels(&self) -> usize
pub fn used_channels(&self) -> usize
Manhattan wire length = sum over tiles of the channel spans actually used (a rough area/ routing-cost proxy; every used channel is one nearest-neighbor hop).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Grid
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnsafeUnpin for Grid
impl UnwindSafe for Grid
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.