Canonical form of an expression under a class map: references to classified nodes become their class id, everything else is kept.
The defining node of a statement, if it defines a single wire.
Equations
- Sparkle.IR.RegDedup.definedNode (Sparkle.IR.AST.Stmt.assign lhs rhs) = some lhs
- Sparkle.IR.RegDedup.definedNode (Sparkle.IR.AST.Stmt.register out clock reset input initValue) = some out
- Sparkle.IR.RegDedup.definedNode (Sparkle.IR.AST.Stmt.memory name addrWidth dataWidth clock writeAddr writeData writeEnable readAddr rd comboRead) = some rd
- Sparkle.IR.RegDedup.definedNode x✝ = none
Instances For
The declared type of a node, when it is a FIXED width (bit or
bitVector n). A symbolic width, an array or an undeclared name is
none: such a node is never merged and never looked through.
Equations
- Sparkle.IR.RegDedup.fixedTy tys n = match tys.get? n with | some t@h:Sparkle.IR.Type.HWType.bit => some t | some t@h:(Sparkle.IR.Type.HWType.bitVector width) => some t | x => none
Instances For
A node's refinement signature: its own current class (so classes
only ever split), its declared type (tyKey: two nodes of different
widths carry different values even when their defining statements
agree — a register or wire truncates its input to its own width),
plus its defining statement with references canonicalised.
Equations
Instances For
Merge bisimilar nodes. Internal (_tmp_*) non-representatives become
plain aliases n := rep (a duplicate register's output turns into an
alias of the surviving register); user-named nodes keep their own
statement is replaced by the alias as well (see below).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Sparkle.IR.RegDedup.mergeDuplicatesDesign d = { topModule := d.topModule, modules := List.map Sparkle.IR.RegDedup.mergeDuplicates d.modules }