|
CIRCT 23.0.0git
|
Represents a single gate/node in the flat logic network. More...
#include <CutRewriter.h>

Public Types | |
| enum | Kind : uint8_t { Constant = 0 , PrimaryInput = 1 , And2 = 2 , Xor2 = 3 , Maj3 = 4 , Identity = 5 } |
| Kind of logic gate. More... | |
Public Member Functions | |
| LogicNetworkGate () | |
| LogicNetworkGate (Operation *op, Kind kind, llvm::ArrayRef< Signal > operands={}) | |
| Kind | getKind () const |
| Get the kind of this gate. | |
| Operation * | getOperation () const |
| Get the operation pointer (nullptr for constants). | |
| unsigned | getNumFanins () const |
| Get the number of fanin edges based on kind. | |
| bool | isLogicGate () const |
| Check if this is a logic gate that can be part of a cut. | |
| bool | isAlwaysCutInput () const |
| Check if this should always be a cut input (PI or constant). | |
Public Attributes | |
| llvm::PointerIntPair< Operation *, 3, Kind > | opAndKind |
| Operation pointer and kind packed together. | |
| Signal | edges [3] |
| Fanin edges (up to 3 inputs). | |
Represents a single gate/node in the flat logic network.
This structure is designed to be cache-friendly and supports up to 3 inputs (sufficient for AND, XOR, MAJ gates). For nodes with fewer inputs, unused edges have index 0 (constant 0 node).
Special indices:
It uses 8 bytes for operation pointer + enum, 12 bytes for edges = 20 bytes per gate.
Definition at line 112 of file CutRewriter.h.
| enum circt::synth::LogicNetworkGate::Kind : uint8_t |
Kind of logic gate.
Definition at line 114 of file CutRewriter.h.
|
inline |
Definition at line 132 of file CutRewriter.h.
|
inline |
Definition at line 133 of file CutRewriter.h.
|
inline |
Get the kind of this gate.
Definition at line 142 of file CutRewriter.h.
References opAndKind.
Referenced by getNumFanins(), isAlwaysCutInput(), and isLogicGate().
|
inline |
Get the number of fanin edges based on kind.
Definition at line 148 of file CutRewriter.h.
References And2, Constant, getKind(), Identity, Maj3, PrimaryInput, and Xor2.
|
inline |
Get the operation pointer (nullptr for constants).
Definition at line 145 of file CutRewriter.h.
References opAndKind.
Referenced by circt::synth::Cut::dump(), circt::synth::Cut::getOutputSize(), and circt::synth::CutEnumerator::visitLogicOp().
|
inline |
Check if this should always be a cut input (PI or constant).
Definition at line 171 of file CutRewriter.h.
References Constant, getKind(), and PrimaryInput.
Referenced by isAlwaysCutInput().
|
inline |
| Signal circt::synth::LogicNetworkGate::edges[3] |
Fanin edges (up to 3 inputs).
For AND gates, only edges[0] and edges[1] are used. For MAJ gates, all three are used. For PrimaryInput/Constant, none are used. The inversion bit is encoded in each edge.
Definition at line 130 of file CutRewriter.h.
Referenced by Python.support.BackedgeBuilder::__exit__(), and Python.support.BackedgeBuilder::_create().
| llvm::PointerIntPair<Operation *, 3, Kind> circt::synth::LogicNetworkGate::opAndKind |
Operation pointer and kind packed together.
The kind is stored in the low bits of the pointer.
Definition at line 125 of file CutRewriter.h.
Referenced by getKind(), and getOperation().