pub enum LutLang {
}Expand description
Definitions of e-node types. Programs are the only node type that is not a net/signal.
Variants§
Const(bool)
Program(u64)
DC
Var(Symbol)
Nor([Id; 2])
Mux([Id; 3])
And([Id; 2])
Xor([Id; 2])
Not([Id; 1])
Lut(Box<[Id]>)
Bus(Box<[Id]>)
Reg([Id; 4])
Arg([Id; 1])
Cycle([Id; 1])
Implementations§
Source§impl LutLang
impl LutLang
Sourcepub const MAX_LUT_SIZE: usize = 6
pub const MAX_LUT_SIZE: usize = 6
Maximum size allowed for a LUT.
This cannot be made larger due to us using u64 to represent LUTs. FPGAs generally do not
support greater than 6-LUTs so this limit should hopefully be sufficient forever.
Sourcepub fn verify_rec(&self, expr: &RecExpr<Self>) -> Result<(), String>
pub fn verify_rec(&self, expr: &RecExpr<Self>) -> Result<(), String>
Recursively verify the grammar of a LutLang expression expr rooted at self
Sourcepub fn get_program(&self, expr: &RecExpr<Self>) -> Result<u64, String>
pub fn get_program(&self, expr: &RecExpr<Self>) -> Result<u64, String>
Extract the program from a LutLang::Lut contained in expression expr
Sourcepub fn get_program_in_egraph(
&self,
egraph: &EGraph<LutLang, LutAnalysis>,
) -> Result<u64, String>
pub fn get_program_in_egraph( &self, egraph: &EGraph<LutLang, LutAnalysis>, ) -> Result<u64, String>
Extract the program from a LutLang::Lut contained in egraph
Sourcepub fn get_operand_classes(
&self,
_egraph: &EGraph<LutLang, LutAnalysis>,
) -> Result<Vec<Id>, String>
pub fn get_operand_classes( &self, _egraph: &EGraph<LutLang, LutAnalysis>, ) -> Result<Vec<Id>, String>
Extract the operand class ids from a LutLang::Lut contained in egraph
This filters out unwanted leaf nodes, like Programs.
Sourcepub fn get_lut_size(&self) -> Result<usize, String>
pub fn get_lut_size(&self) -> Result<usize, String>
Returns the fan-in of a LutLang::Lut
Sourcepub fn eval(
expr: &RecExpr<Self>,
inputs: &HashMap<String, bool>,
) -> Result<BitVec, String>
pub fn eval( expr: &RecExpr<Self>, inputs: &HashMap<String, bool>, ) -> Result<BitVec, String>
This funcion evaluates the expr as combinational logic under given inputs
Sourcepub fn deep_equals(&self, other: &Self, expr: &RecExpr<Self>) -> bool
pub fn deep_equals(&self, other: &Self, expr: &RecExpr<Self>) -> bool
Since variables/leaves can be duplicated in expressions, we sometimes need to do deep checks for equality.
This function returns true if the two nodes with children contained in expr are equal.
Sourcepub fn func_equiv(expr: &RecExpr<Self>, other: &RecExpr<Self>) -> Check
pub fn func_equiv(expr: &RecExpr<Self>, other: &RecExpr<Self>) -> Check
Given two expressions and a set of input values, this funcion returns true if they represent the same combinational logic
Sourcepub fn get_prim_name(&self) -> Option<String>
pub fn get_prim_name(&self) -> Option<String>
Returns the Verilog primitive name for a node type
Trait Implementations§
Source§impl Analysis<LutLang> for LutAnalysis
impl Analysis<LutLang> for LutAnalysis
Source§type Data = LutAnalysisData
type Data = LutAnalysisData
EClass data for this analysis.Source§fn remake(egraph: &mut EGraph<L, Self>, enode: &L, id: Id) -> Self::Data
fn remake(egraph: &mut EGraph<L, Self>, enode: &L, id: Id) -> Self::Data
Analysis::make, but called during rebuilding. Read moreSource§fn pre_union(
egraph: &EGraph<L, Self>,
id1: Id,
id2: Id,
justification: &Option<Justification>,
)
fn pre_union( egraph: &EGraph<L, Self>, id1: Id, id2: Id, justification: &Option<Justification>, )
Source§fn allow_ematching_cycles(&self) -> bool
fn allow_ematching_cycles(&self) -> bool
Source§impl Applier<LutLang, LutAnalysis> for CombineAlikeInputs
impl Applier<LutLang, LutAnalysis> for CombineAlikeInputs
Source§fn apply_one(
&self,
egraph: &mut EGraph<LutLang, LutAnalysis>,
eclass: Id,
subst: &Subst,
searcher_ast: Option<&PatternAst<LutLang>>,
rule_name: Symbol,
) -> Vec<Id>
fn apply_one( &self, egraph: &mut EGraph<LutLang, LutAnalysis>, eclass: Id, subst: &Subst, searcher_ast: Option<&PatternAst<LutLang>>, rule_name: Symbol, ) -> Vec<Id>
Source§fn apply_matches(
&self,
egraph: &mut EGraph<L, N>,
matches: &[SearchMatches<'_, L>],
rule_name: GlobalSymbol,
) -> Vec<Id>
fn apply_matches( &self, egraph: &mut EGraph<L, N>, matches: &[SearchMatches<'_, L>], rule_name: GlobalSymbol, ) -> Vec<Id>
Source§fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
Source§impl Applier<LutLang, LutAnalysis> for FuseCut
impl Applier<LutLang, LutAnalysis> for FuseCut
Source§fn apply_one(
&self,
egraph: &mut EGraph<LutLang, LutAnalysis>,
eclass: Id,
subst: &Subst,
searcher_ast: Option<&PatternAst<LutLang>>,
rule_name: Symbol,
) -> Vec<Id>
fn apply_one( &self, egraph: &mut EGraph<LutLang, LutAnalysis>, eclass: Id, subst: &Subst, searcher_ast: Option<&PatternAst<LutLang>>, rule_name: Symbol, ) -> Vec<Id>
Source§fn apply_matches(
&self,
egraph: &mut EGraph<L, N>,
matches: &[SearchMatches<'_, L>],
rule_name: GlobalSymbol,
) -> Vec<Id>
fn apply_matches( &self, egraph: &mut EGraph<L, N>, matches: &[SearchMatches<'_, L>], rule_name: GlobalSymbol, ) -> Vec<Id>
Source§fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
Source§impl Applier<LutLang, LutAnalysis> for PermuteInput
impl Applier<LutLang, LutAnalysis> for PermuteInput
Source§fn apply_one(
&self,
egraph: &mut EGraph<LutLang, LutAnalysis>,
eclass: Id,
subst: &Subst,
searcher_ast: Option<&PatternAst<LutLang>>,
rule_name: Symbol,
) -> Vec<Id>
fn apply_one( &self, egraph: &mut EGraph<LutLang, LutAnalysis>, eclass: Id, subst: &Subst, searcher_ast: Option<&PatternAst<LutLang>>, rule_name: Symbol, ) -> Vec<Id>
Source§fn apply_matches(
&self,
egraph: &mut EGraph<L, N>,
matches: &[SearchMatches<'_, L>],
rule_name: GlobalSymbol,
) -> Vec<Id>
fn apply_matches( &self, egraph: &mut EGraph<L, N>, matches: &[SearchMatches<'_, L>], rule_name: GlobalSymbol, ) -> Vec<Id>
Source§fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
Source§impl Applier<LutLang, LutAnalysis> for ShannonCondense
impl Applier<LutLang, LutAnalysis> for ShannonCondense
Source§fn apply_one(
&self,
egraph: &mut EGraph<LutLang, LutAnalysis>,
eclass: Id,
subst: &Subst,
searcher_ast: Option<&PatternAst<LutLang>>,
rule_name: Symbol,
) -> Vec<Id>
fn apply_one( &self, egraph: &mut EGraph<LutLang, LutAnalysis>, eclass: Id, subst: &Subst, searcher_ast: Option<&PatternAst<LutLang>>, rule_name: Symbol, ) -> Vec<Id>
Source§fn apply_matches(
&self,
egraph: &mut EGraph<L, N>,
matches: &[SearchMatches<'_, L>],
rule_name: GlobalSymbol,
) -> Vec<Id>
fn apply_matches( &self, egraph: &mut EGraph<L, N>, matches: &[SearchMatches<'_, L>], rule_name: GlobalSymbol, ) -> Vec<Id>
Source§fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
Source§impl Applier<LutLang, LutAnalysis> for ShannonExpand
Available on crate feature dyn_decomp only.
impl Applier<LutLang, LutAnalysis> for ShannonExpand
dyn_decomp only.Source§fn apply_one(
&self,
egraph: &mut EGraph<LutLang, LutAnalysis>,
eclass: Id,
subst: &Subst,
searcher_ast: Option<&PatternAst<LutLang>>,
rule_name: Symbol,
) -> Vec<Id>
fn apply_one( &self, egraph: &mut EGraph<LutLang, LutAnalysis>, eclass: Id, subst: &Subst, searcher_ast: Option<&PatternAst<LutLang>>, rule_name: Symbol, ) -> Vec<Id>
Source§fn apply_matches(
&self,
egraph: &mut EGraph<L, N>,
matches: &[SearchMatches<'_, L>],
rule_name: GlobalSymbol,
) -> Vec<Id>
fn apply_matches( &self, egraph: &mut EGraph<L, N>, matches: &[SearchMatches<'_, L>], rule_name: GlobalSymbol, ) -> Vec<Id>
Source§fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
fn get_pattern_ast(&self) -> Option<&RecExpr<ENodeOrVar<L>>>
Source§impl Canonical for LutLang
impl Canonical for LutLang
Source§fn expr_is_canonical(expr: &RecExpr<Self>) -> bool
fn expr_is_canonical(expr: &RecExpr<Self>) -> bool
Source§fn canonicalize_expr(expr: RecExpr<Self>) -> RecExpr<Self>
fn canonicalize_expr(expr: RecExpr<Self>) -> RecExpr<Self>
Source§impl CircuitLang for LutLang
impl CircuitLang for LutLang
Source§impl<A, B> CostFunction<LutLang> for ConjunctiveCostFn<A, B>
impl<A, B> CostFunction<LutLang> for ConjunctiveCostFn<A, B>
Source§impl CostFunction<LutLang> for DepthCostFn
impl CostFunction<LutLang> for DepthCostFn
Source§impl CostFunction<LutLang> for GateCostFn
impl CostFunction<LutLang> for GateCostFn
Source§impl CostFunction<LutLang> for KLUTCostFn
impl CostFunction<LutLang> for KLUTCostFn
Source§impl EquivCheck for LutLang
impl EquivCheck for LutLang
Source§impl Explanable for LutLang
impl Explanable for LutLang
Source§impl Extractable for LutLang
impl Extractable for LutLang
Source§fn depth_cost_fn() -> impl CostFunction<Self, Cost = i64>
fn depth_cost_fn() -> impl CostFunction<Self, Cost = i64>
Source§fn cell_cost_with_reg_weight_fn(
cut_size: usize,
w: u64,
) -> impl CostFunction<Self>
fn cell_cost_with_reg_weight_fn( cut_size: usize, w: u64, ) -> impl CostFunction<Self>
cut_size inputs.
Additionally, registers have a parameterized weight w.Source§fn exact_area_cost_fn() -> impl CostFunction<Self>
fn exact_area_cost_fn() -> impl CostFunction<Self>
Source§fn filter_cost_fn(set: HashSet<String>) -> impl CostFunction<Self>
fn filter_cost_fn(set: HashSet<String>) -> impl CostFunction<Self>
Source§fn cell_cost_fn(cut_size: usize) -> impl CostFunction<Self>
fn cell_cost_fn(cut_size: usize) -> impl CostFunction<Self>
cut_size inputs.
In this case, registers have weight 1.Source§impl Language for LutLang
impl Language for LutLang
Source§type Discriminant = Discriminant<LutLang>
type Discriminant = Discriminant<LutLang>
Source§fn discriminant(&self) -> Self::Discriminant
fn discriminant(&self) -> Self::Discriminant
Discriminant of this node.Source§fn matches(&self, other: &Self) -> bool
fn matches(&self, other: &Self) -> bool
Ids.Source§fn children_mut(&mut self) -> &mut [Id]
fn children_mut(&mut self) -> &mut [Id]
Source§fn for_each_mut<F>(&mut self, f: F)
fn for_each_mut<F>(&mut self, f: F)
Id, allowing mutation of that Id.Source§fn try_for_each<E, F>(&self, f: F) -> Result<(), E>
fn try_for_each<E, F>(&self, f: F) -> Result<(), E>
Source§fn update_children<F>(&mut self, f: F)
fn update_children<F>(&mut self, f: F)
Source§fn map_children<F>(self, f: F) -> Self
fn map_children<F>(self, f: F) -> Self
Source§fn fold<F, T>(&self, init: T, f: F) -> T
fn fold<F, T>(&self, init: T, f: F) -> T
Source§fn all<F>(&self, f: F) -> bool
fn all<F>(&self, f: F) -> bool
Source§fn any<F>(&self, f: F) -> bool
fn any<F>(&self, f: F) -> bool
Source§fn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self>
fn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self>
Source§fn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self>
fn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self>
Source§fn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err>
fn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err>
Language::build_recexpr, but fallible.Source§impl LogicCell<PrimitiveCell> for LutLang
impl LogicCell<PrimitiveCell> for LutLang
Source§fn get_cell(&self, params: &[(Identifier, Parameter)]) -> Option<PrimitiveCell>
fn get_cell(&self, params: &[(Identifier, Parameter)]) -> Option<PrimitiveCell>
Source§impl LogicFunc<LutLang> for PrimitiveCell
impl LogicFunc<LutLang> for PrimitiveCell
Source§impl Ord for LutLang
impl Ord for LutLang
Source§impl PartialOrd for LutLang
impl PartialOrd for LutLang
Source§impl Report<LutLang> for SynthReport
impl Report<LutLang> for SynthReport
Source§impl VerilogEmission for LutLang
impl VerilogEmission for LutLang
Source§fn get_gate_type(&self) -> Option<PrimitiveType>
fn get_gate_type(&self) -> Option<PrimitiveType>
Source§fn get_output_ids(expr: &RecExpr<Self>) -> Vec<Id>
fn get_output_ids(expr: &RecExpr<Self>) -> Vec<Id>
Source§fn get_verilog_primitive(
&self,
lookup: impl Fn(&Id) -> Option<String>,
fresh_prim_name: impl Fn() -> String,
fresh_signal_name: impl Fn() -> String,
) -> Result<Option<SVPrimitive>, String>
fn get_verilog_primitive( &self, lookup: impl Fn(&Id) -> Option<String>, fresh_prim_name: impl Fn() -> String, fresh_signal_name: impl Fn() -> String, ) -> Result<Option<SVPrimitive>, String>
lookupSource§impl VerilogParsing for LutLang
impl VerilogParsing for LutLang
impl Eq for LutLang
impl StructuralPartialEq for LutLang
Auto Trait Implementations§
impl Freeze for LutLang
impl RefUnwindSafe for LutLang
impl Send for LutLang
impl Sync for LutLang
impl Unpin for LutLang
impl UnsafeUnpin for LutLang
impl UnwindSafe for LutLang
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.