CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::Cube Struct Reference

Represents a product term (cube) in a sum-of-products expression. More...

#include <TruthTable.h>

Collaboration diagram for circt::Cube:

Public Member Functions

 Cube ()=default
unsigned size () const
 Get number of literals in this cube.
bool hasLiteral (unsigned varIndex) const
 Has literal for variable at index varIndex.
void setLiteral (unsigned varIndex, bool isInverted)
void removeLiteral (unsigned varIndex)
bool isLiteralInverted (unsigned varIndex) const

Public Attributes

uint64_t mask = 0
 Bitmask indicating which variables appear in this cube.
uint64_t inverted = 0
 Bitmask indicating which variables are negated.

Detailed Description

Represents a product term (cube) in a sum-of-products expression.

Each cube is a conjunction of literals (variables or their negations). Assumes number of variables is less than 64.

Definition at line 251 of file TruthTable.h.

Constructor & Destructor Documentation

◆ Cube()

circt::Cube::Cube ( )
default

Member Function Documentation

◆ hasLiteral()

bool circt::Cube::hasLiteral ( unsigned varIndex) const
inline

Has literal for variable at index varIndex.

Definition at line 263 of file TruthTable.h.

References mask.

◆ isLiteralInverted()

bool circt::Cube::isLiteralInverted ( unsigned varIndex) const
inline

Definition at line 279 of file TruthTable.h.

References inverted.

◆ removeLiteral()

void circt::Cube::removeLiteral ( unsigned varIndex)
inline

Definition at line 273 of file TruthTable.h.

References inverted, and mask.

◆ setLiteral()

void circt::Cube::setLiteral ( unsigned varIndex,
bool isInverted )
inline

Definition at line 267 of file TruthTable.h.

References inverted, and mask.

◆ size()

unsigned circt::Cube::size ( ) const
inline

Get number of literals in this cube.

Definition at line 260 of file TruthTable.h.

References mask.

Member Data Documentation

◆ inverted

uint64_t circt::Cube::inverted = 0

Bitmask indicating which variables are negated.

Definition at line 255 of file TruthTable.h.

Referenced by isLiteralInverted(), removeLiteral(), and setLiteral().

◆ mask

uint64_t circt::Cube::mask = 0

Bitmask indicating which variables appear in this cube.

Definition at line 253 of file TruthTable.h.

Referenced by hasLiteral(), removeLiteral(), setLiteral(), and size().


The documentation for this struct was generated from the following file: