Skip to main content

Datapath

Trait Datapath 

Source
pub trait Datapath {
    type V: Clone;

    // Required methods
    fn input(&mut self, k: usize) -> Self::V;
    fn constant(&mut self, c: i64) -> Self::V;
    fn arith(&mut self, op: AluOp, a: Self::V, b: Self::V) -> Self::V;
    fn select(
        &mut self,
        cmp: CmpKind,
        ca: Self::V,
        cb: Self::V,
        t: Self::V,
        e: Self::V,
    ) -> Self::V;
}
Expand description

The datapath vocabulary a placed grid — or a straight-line cell body — is lowered through.

Required Associated Types§

Source

type V: Clone

The lowered value: a BoundedExpr for the tree form, a Word for the shared gate DAG.

Required Methods§

Source

fn input(&mut self, k: usize) -> Self::V

The global circuit input k.

Source

fn constant(&mut self, c: i64) -> Self::V

A constant, truncated to the datapath width.

Source

fn arith(&mut self, op: AluOp, a: Self::V, b: Self::V) -> Self::V

An ALU operation over two lowered operands.

Source

fn select( &mut self, cmp: CmpKind, ca: Self::V, cb: Self::V, t: Self::V, e: Self::V, ) -> Self::V

The mux tile: (ca cmp cb) ? t : e.

Implementors§