CIRCT

Circuit IR Compilers and Tools

'aig' Dialect

Representation of AIGs

Operations

aig.and_inv (::circt::aig::AndInverterOp)

AIG dialect AND operation

The aig.and_inv operation represents an And-Inverter in the AIG dialect. Unlike comb.and, operands can be inverted respectively.

Example:

  %r1 = aig.and_inv %a, %b: i3
  %r2 = aig.and_inv not %a, %b, not %c : i3
  %r3 = aig.and_inv not %a : i3

Traditionally, an And-Node in AIG has two operands. However, aig.and_inv extends this concept by allowing variadic operands and non-i1 integer types. Although the final stage of the synthesis pipeline requires lowering everything to i1-binary operands, it’s more efficient to progressively lower the variadic multibit operations.

Variadic operands have demonstrated their utility in low-level optimizations within the comb dialect. Furthermore, in synthesis, it’s common practice to re-balance the logic path. Variadic operands enable the compiler to select more efficient solutions without the need to traverse binary trees multiple times.

The ability to represent multibit operations during synthesis is crucial for scalability. This approach enables a form of vectorization, allowing for batch processing of logic synthesis when multibit operations are constructed in a similar manner.

Traits: AlwaysSpeculatableImplTrait, SameOperandsAndResultType

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
inverted::mlir::DenseBoolArrayAttri1 dense array attribute

Operands:

OperandDescription
inputsvariadic of any type

Results:

ResultDescription
resultany type

'aig' Dialect Docs