CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt Namespace Reference

The InstanceGraph op interface, see InstanceGraphInterface.td for more details. More...

Namespaces

namespace  detail
namespace  analysis
namespace  firrtl
namespace  calyxToFSM
namespace  calyx
namespace  handshake
namespace  hw
namespace  aiger
namespace  handshaketodc
namespace  liberty
namespace  scfToCalyx
namespace  sv
namespace  arc
namespace  axi4
namespace  comb
namespace  datapath
namespace  dc
namespace  emit
namespace  esi
namespace  chirrtl
namespace  fsm
namespace  hwarith
namespace  kanagawa
namespace  llhd
namespace  ltl
namespace  moore
namespace  msft
namespace  om
namespace  pipeline
namespace  rtg
namespace  seq
namespace  sim
namespace  ssp
namespace  igraph
namespace  synth
namespace  systemc
namespace  verif
namespace  firtool
namespace  reduce
namespace  scheduling
namespace  parsing_util
namespace  pretty
namespace  debug
namespace  ExportSystemC
namespace  bmc
namespace  lec
namespace  lsp
namespace  test
namespace  python
namespace  impl
namespace  ExportVerilog
namespace  ImportVerilog
namespace  pipelinetocalyx
namespace  scftocalyx

Classes

struct  DebugAnalysis
 Identify operations and values that are only used for debug info. More...
struct  DIModule
struct  DIInstance
struct  DIVariable
struct  DebugInfo
 Debug information attached to an operation and the operations nested within. More...
class  HWArithToHWTypeConverter
 A helper type converter class that automatically populates the relevant materializations and type conversions for converting HWArith to HW. More...
struct  HWToLLVMEndianessConverter
struct  HWToLLVMArraySpillCache
 Helper class mapping array values (HW or LLVM Dialect) to pointers to buffers containing the array value. More...
struct  ImportVerilogOptions
 Options that control how Verilog input files are parsed and processed. More...
struct  LlhdToCorePipelineOptions
 Convert LLHD dialect IR into core dialect IR. More...
struct  SMTGlobalsHandler
 A symbol cache for LLVM globals and functions relevant to SMT lowering patterns. More...
struct  TypeConversionPattern
 Generic pattern which replaces an operation by one of the same operation name, but with converted attributes, operands, and result types to eliminate illegal types. More...
struct  TypeOpConversionPattern
struct  Reduction
 An abstract reduction pattern. More...
struct  OpReduction
 A reduction pattern for a specific operation. More...
struct  PassReduction
 A reduction pattern that applies an mlir::Pass. More...
class  ReducePatternSet
struct  ReducePatternDialectInterface
 A dialect interface to provide reduction patterns to a reducer tool. More...
struct  ReducePatternInterfaceCollection
class  Tester
 A testing environment for reduction attempts. More...
class  TestCase
 A single test case to be run by a tester. More...
class  BackedgeBuilder
 Instantiate one of these and use it to build typed backedges. More...
class  Backedge
 Backedge is a wrapper class around a Value. More...
class  StringAttrOrRef
 A helper union that can represent a StringAttr, StringRef, or Twine. More...
class  ConversionPatternSet
 Extension of RewritePatternSet that allows adding matchAndRewrite functions with op adaptors and ConversionPatternRewriter as patterns. More...
class  ScopedDebugPassLogger
 RAII helper for creating a pass header and footer automatically. More...
struct  FieldInfo
 A named and typed field of an aggregate type. More...
class  FieldRef
 This class represents a reference to a specific field or element of an aggregate value. More...
class  FVInt
 Four-valued arbitrary precision integers. More...
struct  LoweringOptions
 Options which control the emission from CIRCT to Verilog. More...
struct  LoweringOptionsParser
 Commandline parser for LoweringOptions. More...
struct  LoweringOptionsOption
class  Namespace
 A namespace that is used to store existing names and generate new names in some scope within the IR. More...
class  VerbosePassInstrumentation
class  ProceduralRegion
 Signals that an operation's regions are procedural. More...
class  NonProceduralRegion
 Signals that an operation's regions are non-procedural. More...
class  ProceduralOp
 Signals that an operation must not be in a non-procedural region. More...
class  NonProceduralOp
 Signals that an operation must not be in a procedural region. More...
class  IncrementalSATSolver
 Abstract interface for incremental SAT solvers with an IPASIR-style API. More...
struct  CadicalSATSolverOptions
class  CyclicOpSCC
 A cyclic SCC: a pointer-sized, directly-iterable reference to a group of mutually-reachable operations (or a single op with a self-loop). More...
class  SparseOpSCC
 Iterative Tarjan SCC analysis on a sparse subgraph of MLIR operations. More...
class  SymbolCacheBase
 Base symbol cache class to allow for cache lookup through a pointer to some abstract cache. More...
class  SymbolCache
 Default symbol cache implementation; stores associations between names (StringAttr's) to mlir::Operation's. More...
struct  BinaryTruthTable
 Represents a boolean function as a truth table. More...
struct  NPNClass
 Represents the canonical form of a boolean function under NPN equivalence. More...
class  NPNTable
 Precomputed NPN canonicalization table for 4-input single-output functions. More...
struct  Cube
 Represents a product term (cube) in a sum-of-products expression. More...
struct  SOPForm
 Represents a sum-of-products expression. More...
struct  UnusedOpPruner
 Utility that tracks operations that have potentially become unused and allows them to be cleaned up at a later point. More...
class  ValueMapper
 The ValueMapper class facilitates the definition and connection of SSA def-use chains between two location - a 'from' location (defining use-def chains) and a 'to' location (where new operations are created based on the 'from' location). More...
struct  ArcPreprocessingOptions
struct  ArcConversionOptions
struct  ArcOptimizationOptions
struct  ArcStateLoweringOptions
struct  ArcStateAllocationOptions
struct  ArcToLLVMOptions
class  SSAMaximizationStrategy
 Strategy class to control the behavior of SSA maximization. More...
struct  FirMemConfig
 The configuration of a FIR memory. More...
class  FirMemLowering
 FIR memory lowering helper. More...
class  ReachableMuxes
struct  OpUserInfo
class  FirRegLowering
 Lower FirRegOp to sv.reg and sv.always. More...
struct  SeqToSVPass
class  MapVector
class  SmallDenseMap
struct  SmallMapVector
class  SmallSet
class  SmallSetVector
class  OpConversionPattern
class  OperationPass
struct  OpRewritePattern
class  OwningOpRef
class  TypeConverter
class  TypeStorage

Typedefs

using OpSCCFilter = std::function<bool(mlir::Operation *, mlir::OpOperand &)>
 Filter predicate passed to the SparseOpSCC constructor.
using OpSCC = llvm::PointerUnion<void *, mlir::Operation *, CyclicOpSCC>
 One entry in the SCC output: a null sentinel, a trivial (non-cyclic) operation, or a cyclic group.
using DefaultTypeStorage
using OpAsmSetValueNameFn

Enumerations

enum class  OpSCCDirection { Forward , Backward }
 Traversal direction for SparseOpSCC. More...
enum class  OpCountEmissionFormat { Readable , ReadableSorted , JSON }

Functions

std::unique_ptr< mlir::Pass > createAffineToLoopSchedule ()
std::unique_ptr< OperationPass< ModuleOp > > createLowerArcToLLVMPass ()
std::unique_ptr< mlir::Pass > createCalyxNativePass ()
std::unique_ptr< mlir::Pass > createCalyxToFSMPass ()
std::unique_ptr< mlir::Pass > createMaterializeCalyxToFSMPass ()
std::unique_ptr< mlir::Pass > createRemoveGroupsFromFSMPass ()
std::unique_ptr< mlir::Pass > createCalyxToHWPass ()
std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > createHandshakeAnalysisPass ()
std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > createCFToHandshakePass (bool sourceConstants=false, bool disableTaskPipelining=false)
std::unique_ptr< mlir::OperationPass< handshake::FuncOp > > createHandshakeCanonicalizePass ()
std::unique_ptr< mlir::OperationPass< handshake::FuncOp > > createHandshakeRemoveBlockPass ()
mlir::LogicalResult insertMergeBlocks (mlir::Region &r, mlir::ConversionPatternRewriter &rewriter)
 Insert additional blocks that serve as counterparts to the blocks that diverged the control flow.
std::unique_ptr< mlir::Pass > createInsertMergeBlocksPass ()
void populateCombToArithConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns)
std::unique_ptr< Pass > createConvertCombToArithPass ()
void populateCombToLLVMConversionPatterns (mlir::LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Get the Comb to LLVM conversion patterns.
void populateCombToSMTConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns)
 Get the HW to SMT conversion patterns.
std::unique_ptr< mlir::Pass > createConvertCoreToFSMPass ()
void populateDatapathToSMTConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns)
 Get the Datapath to SMT conversion patterns.
std::unique_ptr< mlir::Pass > createDCToHWPass ()
std::unique_ptr< mlir::Pass > createExportVerilogPass (std::unique_ptr< llvm::raw_ostream > os)
std::unique_ptr< mlir::Pass > createExportVerilogPass (llvm::raw_ostream &os)
std::unique_ptr< mlir::Pass > createExportVerilogPass ()
std::unique_ptr< mlir::Pass > createExportSplitVerilogPass (llvm::StringRef directory="./")
mlir::LogicalResult exportVerilog (mlir::ModuleOp module, llvm::raw_ostream &os)
 Export a module containing HW, and SV dialect code.
mlir::LogicalResult exportSplitVerilog (mlir::ModuleOp module, llvm::StringRef dirname)
 Export a module containing HW, and SV dialect code, as one file per SV module.
std::unique_ptr< mlir::Pass > createLowerFIRRTLToHWPass (bool enableAnnotationWarning=false, firrtl::VerificationFlavor assertionFlavor=firrtl::VerificationFlavor::None, bool lowerToCore=false)
 This is the pass constructor.
std::unique_ptr< mlir::Pass > createConvertFSMToCorePass ()
std::unique_ptr< mlir::Pass > createConvertFSMToSMTPass ()
std::unique_ptr< mlir::Pass > createConvertFSMToSVPass ()
std::unique_ptr< mlir::Pass > createHandshakeToHWPass ()
void populateHWArithToHWConversionPatterns (HWArithToHWTypeConverter &typeConverter, RewritePatternSet &patterns)
 Get the HWArith to HW conversion patterns.
std::unique_ptr< mlir::Pass > createHWArithToHWPass ()
std::unique_ptr< mlir::Pass > createConvertHWToBTOR2Pass (llvm::raw_ostream &os)
std::unique_ptr< mlir::Pass > createConvertHWToBTOR2Pass ()
void populateHWToLLVMTypeConversions (mlir::LLVMTypeConverter &converter, mlir::DataLayout &layout)
 Get the HW to LLVM type conversions.
void populateHWToLLVMConversionPatterns (mlir::LLVMTypeConverter &converter, RewritePatternSet &patterns, Namespace &globals, DenseMap< std::pair< Type, ArrayAttr >, mlir::LLVM::GlobalOp > &constAggregateGlobalsMap, std::optional< HWToLLVMArraySpillCache > &spillCacheOpt)
 Get the HW to LLVM conversion patterns.
void populateHWToSMTConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns, bool forSMTLIBExport)
 Get the HW to SMT conversion patterns.
void populateHWToSMTTypeConverter (TypeConverter &converter)
 Get the HW to SMT type conversions.
std::unique_ptr< mlir::OperationPass< hw::HWModuleOp > > createLowerHWToSVPass ()
std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > createConvertHWToSystemCPass ()
 Create a HW to SystemC dialects conversion pass.
mlir::LogicalResult importVerilog (llvm::SourceMgr &sourceMgr, mlir::MLIRContext *context, mlir::TimingScope &ts, mlir::ModuleOp module, const ImportVerilogOptions *options=nullptr)
 Parse files in a source manager as Verilog source code and populate the given MLIR module with corresponding ops.
void populateVerilogToMoorePipeline (mlir::OpPassManager &pm)
 Optimize and simplify the Moore dialect IR.
void populateMooreToCorePipeline (mlir::OpPassManager &pm)
 Convert Moore dialect IR into core dialect IR.
void populateLlhdToCorePipeline (mlir::OpPassManager &pm, const LlhdToCorePipelineOptions &options)
mlir::LogicalResult preprocessVerilog (llvm::SourceMgr &sourceMgr, mlir::MLIRContext *context, mlir::TimingScope &ts, llvm::raw_ostream &os, const ImportVerilogOptions *options=nullptr)
 Run the files in a source manager through Slang's Verilog preprocessor and emit the result to the given output stream.
void registerFromVerilogTranslation ()
 Register the import-verilog MLIR translation.
std::string getSlangVersion ()
 Return a human-readable string describing the slang frontend version linked into CIRCT.
std::unique_ptr< OperationPass< ModuleOp > > createLoopScheduleToCalyxPass ()
 Create a LoopSchedule to Calyx conversion pass.
std::unique_ptr< mlir::Pass > createLowerLTLToCorePass ()
std::unique_ptr< OperationPass< ModuleOp > > createConvertMooreToCorePass ()
 Create an Moore to Comb/HW/LLHD conversion pass.
std::unique_ptr< mlir::Pass > createPipelineToHWPass (const PipelineToHWOptions &options={})
 Create an SCF to Calyx conversion pass.
std::unique_ptr< OperationPass< ModuleOp > > createSCFToCalyxPass (std::string topLevelFunction="")
 Create an SCF to Calyx conversion pass.
std::unique_ptr< mlir::Pass > createLowerSeqToSVPass (const LowerSeqToSVOptions &options={})
std::unique_ptr< mlir::Pass > createLowerFirMemPass ()
std::unique_ptr< mlir::Pass > createLowerSeqFIRRTLInitToSV ()
std::unique_ptr< mlir::Pass > createLowerSimToSVPass ()
void populateSMTToZ3LLVMTypeConverter (TypeConverter &converter)
 Populate the given type converter with the SMT to LLVM type conversions.
void populateSMTToZ3LLVMConversionPatterns (RewritePatternSet &patterns, TypeConverter &converter, SMTGlobalsHandler &globals, const LowerSMTToZ3LLVMOptions &options)
 Add the SMT to LLVM IR conversion patterns to 'patterns'.
void populateVerifToSMTConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns, Namespace &names, bool risingClocksOnly, SmallVectorImpl< Operation * > &propertylessBMCOps)
 Get the Verif to SMT conversion patterns.
std::unique_ptr< OperationPass< hw::HWModuleOp > > createLowerVerifToSVPass ()
 Create the Verif to SV conversion pass.
LogicalResult doTypeConversion (Operation *op, ValueRange operands, ConversionPatternRewriter &rewriter, const TypeConverter *typeConverter)
ParseResult parseInputPortList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &inputs, SmallVectorImpl< Type > &inputTypes, ArrayAttr &inputNames)
 Parse a list of instance input ports.
void printInputPortList (OpAsmPrinter &p, Operation *op, OperandRange inputs, TypeRange inputTypes, ArrayAttr inputNames)
 Print a list of instance input ports.
ParseResult parseOutputPortList (OpAsmParser &parser, SmallVectorImpl< Type > &resultTypes, ArrayAttr &resultNames)
 Parse a list of instance output ports.
void printOutputPortList (OpAsmPrinter &p, Operation *op, TypeRange resultTypes, ArrayAttr resultNames)
 Print a list of instance output ports.
ParseResult parseOptionalParameterList (OpAsmParser &parser, ArrayAttr &parameters)
 Parse an parameter list if present.
void printOptionalParameterList (OpAsmPrinter &p, Operation *op, ArrayAttr parameters)
 Print a parameter list for a module or instance.
void registerAllDialects (mlir::DialectRegistry &registry)
void registerAllPasses ()
void registerAllTranslations ()
void populateGenericReducePatterns (MLIRContext *context, ReducePatternSet &patterns, std::optional< int64_t > maxNumRewrites=std::nullopt)
 Populate reduction patterns that are not specific to certain operations or dialects.
APInt sextZeroWidth (APInt value, unsigned width)
 A safe version of APInt::sext that will NOT assert on zero-width signed APSInts.
APSInt extOrTruncZeroWidth (APSInt value, unsigned width)
 A safe version of APSInt::extOrTrunc that will NOT assert on zero-width signed APSInts.
ParseResult parseImplicitSSAName (OpAsmParser &parser, StringAttr &attr)
 Parse an implicit SSA name string attribute.
ParseResult parseImplicitSSANames (OpAsmParser &parser, ArrayAttr &attr)
 Parse an array of implicit SSA name string attributes.
ParseResult parseImplicitSSAName (OpAsmParser &parser, NamedAttrList &attrs)
 Parse an attribute dictionary and ensure that it contains a name field by inferring its value from the SSA name of the operation's first result if necessary.
bool inferImplicitSSAName (OpAsmParser &parser, NamedAttrList &attrs)
 Ensure that attrs contains a name attribute by inferring its value from the SSA name of the operation's first result if necessary.
void printImplicitSSAName (OpAsmPrinter &p, Operation *op, StringAttr attr)
 Print an implicit SSA name string attribute.
void printImplicitSSANames (OpAsmPrinter &p, Operation *op, ArrayAttr attr)
 Print an array of implicit SSA name string attributes.
void printImplicitSSAName (OpAsmPrinter &p, Operation *op, DictionaryAttr attrs, ArrayRef< StringRef > extraElides={})
 Print an attribute dictionary and elide the name field if its value matches the SSA name of the operation's first result.
void elideImplicitSSAName (OpAsmPrinter &printer, Operation *op, DictionaryAttr attrs, SmallVectorImpl< StringRef > &elides)
 Check if the name attribute in attrs matches the SSA name of the operation's first result.
void printOptionalBinaryOpTypes (OpAsmPrinter &p, Operation *op, Type lhs, Type rhs)
 Print/parse binary operands type only when types are different.
ParseResult parseOptionalBinaryOpTypes (OpAsmParser &parser, Type &lhs, Type &rhs)
ParseResult parseKeywordBool (OpAsmParser &parser, BoolAttr &attr, StringRef trueKeyword, StringRef falseKeyword)
 Parse a boolean as one of two keywords.
void printKeywordBool (OpAsmPrinter &printer, Operation *op, BoolAttr attr, StringRef trueKeyword, StringRef falseKeyword)
 Print a boolean as one of two keywords.
ParseResult parseVariadicInvertibleOperands (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operands, Type &resultType, mlir::DenseBoolArrayAttr &inverted, NamedAttrList &attrDict)
 Parse a variadic list of operands that may be prefixed with an optional not keyword.
void printVariadicInvertibleOperands (OpAsmPrinter &printer, Operation *op, OperandRange operands, Type resultType, mlir::DenseBoolArrayAttr inverted, DictionaryAttr attrDict)
 Print a variadic list of operands that may be prefixed with an optional not keyword.
llvm::raw_ostream & debugHeader (const llvm::Twine &str, unsigned width=80)
 Write a "header"-like string to the debug stream with a certain width.
llvm::raw_ostream & debugPassHeader (const mlir::Pass *pass, unsigned width=80)
 Write a boilerplate header for a pass to the debug stream.
llvm::raw_ostream & debugFooter (unsigned width=80)
 Write a boilerplate footer to the debug stream to indicate that a pass has ended.
bool operator== (const FieldInfo &a, const FieldInfo &b)
llvm::hash_code hash_value (const FieldInfo &fi)
ParseResult parseFieldList (AsmParser &p, SmallVectorImpl< FieldInfo > &fields, SmallVectorImpl< std::pair< llvm::SMLoc, StringAttr > > &duplicates)
 Parse a list of named fields within <>, e.g.
void printFieldList (AsmPrinter &p, ArrayRef< FieldInfo > fields)
 Print a list of fields within <>, e.g. <foo: i7, bar: i8>.
inline ::llvm::hash_code hash_value (const FieldRef &fieldRef)
 Get a hash code for a FieldRef.
static std::optional< APInt > getConstantInt (Attribute operand)
 Determine the integer value of a constant operand.
static bool isConstantZero (Attribute operand)
 Determine whether a constant operand is a zero value.
static bool isConstantOne (Attribute operand)
 Determine whether a constant operand is a one value.
unsigned getDecimalDigitWidth (unsigned bits, bool isSigned)
 Number of decimal digits required to print the largest value of an integer type of the given bit width.
unsigned getNaturalIntegerWidth (unsigned bits, unsigned radix, bool isSigned)
 Natural field width of an integer type printed in the given radix: the number of digits required to print the type's largest value.
void formatInteger (llvm::raw_ostream &os, const llvm::APInt &value, unsigned radix, bool isUpperCase, bool isLeftAligned, char paddingChar, std::optional< int32_t > specifierWidth, bool isSigned)
 Format value in the given radix and emit it to os, padded to a field width.
FVInt operator& (uint64_t a, const FVInt &b)
FVInt operator| (uint64_t a, const FVInt &b)
FVInt operator^ (uint64_t a, const FVInt &b)
FVInt operator+ (uint64_t a, const FVInt &b)
FVInt operator* (uint64_t a, const FVInt &b)
FVInt operator& (const APInt &a, const FVInt &b)
FVInt operator| (const APInt &a, const FVInt &b)
FVInt operator^ (const APInt &a, const FVInt &b)
FVInt operator+ (const APInt &a, const FVInt &b)
FVInt operator* (const APInt &a, const FVInt &b)
FVInt operator- (uint64_t a, const FVInt &b)
FVInt operator- (const APInt &a, const FVInt &b)
bool operator== (uint64_t a, const FVInt &b)
bool operator!= (uint64_t a, const FVInt &b)
raw_ostream & operator<< (raw_ostream &os, const FVInt &value)
llvm::hash_code hash_value (const FVInt &a)
void printFVInt (AsmPrinter &p, const FVInt &value)
 Print a four-valued integer usign an AsmPrinter.
ParseResult parseFVInt (AsmParser &p, FVInt &result)
 Parse a four-valued integer using an AsmParser.
LogicalResult convertAttributeToJSON (llvm::json::OStream &json, Attribute attr)
 Convert a simple attribute to JSON.
Attribute convertJSONToAttribute (MLIRContext *context, llvm::json::Value &value, llvm::json::Path p)
 Convert arbitrary JSON to an MLIR Attribute.
bool isUselessName (StringRef name)
 Return true if this is a possibly useless temporary name.
StringRef chooseName (StringRef a, StringRef b)
 Choose a good name for an item from two options.
StringAttr chooseName (StringAttr a, StringAttr b)
 Choose a good name for an item from two options.
StringAttr chooseName (Operation *a, Operation *b)
 Choose the better name between two ops.
void replaceOpAndCopyNamehint (PatternRewriter &rewriter, Operation *op, Value newValue)
 A wrapper of PatternRewriter::replaceOp to propagate "sv.namehint" attribute.
template<typename OpTy, typename... Args>
static OpTy replaceOpWithNewOpAndCopyNamehint (PatternRewriter &rewriter, Operation *op, Args &&...args)
 A wrapper of PatternRewriter::replaceOpWithNewOp to propagate "sv.namehint" attribute.
std::unique_ptr< Pass > createSimpleCanonicalizerPass ()
 Create a simple canonicalizer pass.
void appendPossiblyAbsolutePath (llvm::SmallVectorImpl< char > &base, const llvm::Twine &suffix)
 Append a path to an existing path, replacing it if the other path is absolute.
void makeCommonDirectoryPrefix (llvm::SmallVectorImpl< char > &a, StringRef b)
 Truncate a in place to the longest common directory prefix of a and b, ensuring that the result ends on a directory separator (or is empty).
std::unique_ptr< llvm::ToolOutputFile > createOutputFile (StringRef filename, StringRef dirname, function_ref< InFlightDiagnostic()> emitError)
 Creates an output file with the given filename in the specified directory.
LogicalResult verifyNotInProceduralRegion (Operation *op)
 Returns success if the operation has no closer surrounding parent marked as procedural region than its closest parent marked as non-procedural region.
LogicalResult verifyNotInNonProceduralRegion (Operation *op)
 Returns success if the operation has no closer surrounding parent marked as non-procedural region than its closest parent marked as procedural region.
bool isInProceduralRegion (Operation *op)
 Returns true if op has a parent marked as a procedural region that is closer than any parent marked as a non-procedural region.
void addAndClauses (int outVar, llvm::ArrayRef< int > inputLits, llvm::function_ref< void(llvm::ArrayRef< int >)> addClause)
 Emit clauses encoding outVar <=> and(inputLits).
void addOrClauses (int outVar, llvm::ArrayRef< int > inputLits, llvm::function_ref< void(llvm::ArrayRef< int >)> addClause)
 Emit clauses encoding outVar <=> or(inputLits).
void addXorClauses (int outVar, int lhsLit, int rhsLit, llvm::function_ref< void(llvm::ArrayRef< int >)> addClause)
 Emit clauses encoding outVar <=> (lhsLit xor rhsLit).
void addParityClauses (int outVar, llvm::ArrayRef< int > inputLits, llvm::function_ref< void(llvm::ArrayRef< int >)> addClause, llvm::function_ref< int()> newVar)
 Emit clauses encoding outVar <=> parity(inputLits).
void addAtMostOneClauses (llvm::ArrayRef< int > inputLits, llvm::function_ref< void(llvm::ArrayRef< int >)> addClause, llvm::function_ref< int()> newVar)
 Emit clauses encoding that at most one literal in inputLits can be true.
void addExactlyOneClauses (llvm::ArrayRef< int > inputLits, llvm::function_ref< void(llvm::ArrayRef< int >)> addClause, llvm::function_ref< int()> newVar)
 Emit clauses encoding that exactly one literal in inputLits is true.
std::unique_ptr< IncrementalSATSolver > createZ3SATSolver ()
 Construct a Z3-backed incremental IPASIR-style SAT solver.
std::unique_ptr< IncrementalSATSolver > createCadicalSATSolver (const CadicalSATSolverOptions &options={})
 Construct a CaDiCaL-backed incremental IPASIR-style SAT solver.
bool hasIncrementalSATSolverBackend ()
 Return true when at least one incremental SAT backend is available.
std::unique_ptr< IncrementalSATSolver > createSATSolver (llvm::StringRef backend="auto")
 Construct an incremental SAT solver using the requested backend.
void collectCanonicalNPN4Representatives (llvm::SmallVectorImpl< uint16_t > &representatives)
 Collect all canonical 4-input single-output NPN representatives in ascending truth-table order.
llvm::APInt createVarMask (unsigned numVars, unsigned varIndex, bool positive)
 Create a mask for a variable in the truth table.
std::pair< llvm::APInt, llvm::APInt > computeCofactors (const llvm::APInt &f, unsigned numVars, unsigned varIndex)
 Compute cofactor of a Boolean function for a given variable.
SOPForm extractISOP (const llvm::APInt &truthTable, unsigned numVars)
 Extract ISOP (Irredundant Sum-of-Products) from a truth table.
bool isAncestorOfValueOwner (Operation *op, Value value)
 Return true if a Value is created "underneath" an operation.
template<typename T>
static SmallVector< T > removeElementsAtIndices (ArrayRef< T > input, const llvm::BitVector &indicesToDrop)
 Remove elements from the input array corresponding to set bits in indicesToDrop, returning the elements not mentioned.
template<class IterTy, class ResultTy, class ReduceFuncTy, class TransformFuncTy>
static ResultTy transformReduce (MLIRContext *context, IterTy begin, IterTy end, ResultTy init, ReduceFuncTy reduce, TransformFuncTy transform)
 Wrapper for llvm::parallelTransformReduce that performs the transform_reduce serially when MLIR multi-threading is disabled.
template<class RangeTy, class ResultTy, class ReduceFuncTy, class TransformFuncTy>
static ResultTy transformReduce (MLIRContext *context, RangeTy &&r, ResultTy init, ReduceFuncTy reduce, TransformFuncTy transform)
 Range wrapper.
const char * getCirctVersion ()
const char * getCirctVersionComment ()
void populateArcPreprocessingPipeline (mlir::OpPassManager &pm, const ArcPreprocessingOptions &options={})
void populateArcConversionPipeline (mlir::OpPassManager &pm, const ArcConversionOptions &options={})
void populateArcOptimizationPipeline (mlir::OpPassManager &pm, const ArcOptimizationOptions &options={})
void populateArcStateLoweringPipeline (mlir::OpPassManager &pm, const ArcStateLoweringOptions &options={})
void populateArcStateAllocationPipeline (mlir::OpPassManager &pm, const ArcStateAllocationOptions &options={})
void populateArcToLLVMPipeline (mlir::OpPassManager &pm, const ArcToLLVMOptions &options={})
void populateArithToCombPatterns (mlir::RewritePatternSet &patterns, TypeConverter &typeConverter)
std::unique_ptr< mlir::Pass > createMapArithToCombPass (bool enableBestEffortLowering=false)
std::unique_ptr< mlir::Pass > createConvertIndexToUIntPass ()
std::unique_ptr< mlir::Pass > createFlattenMemRefPass ()
std::unique_ptr< mlir::Pass > createFlattenMemRefCallsPass ()
std::unique_ptr< mlir::Pass > createStripDebugInfoWithPredPass (const std::function< bool(mlir::Location)> &pred)
 Creates a pass to strip debug information from a function.
std::unique_ptr< mlir::Pass > createMaximizeSSAPass ()
std::unique_ptr< mlir::Pass > createPrintOpCountPass ()
std::unique_ptr< mlir::Pass > createMemoryBankingPass (ArrayRef< unsigned > bankingFactors={}, ArrayRef< unsigned > bankingDimensions={})
std::unique_ptr< mlir::Pass > createIndexSwitchToIfPass ()
std::unique_ptr< mlir::Pass > createHierarchicalRunner (const std::string &topName, llvm::function_ref< void(mlir::OpPassManager &)> pipeline, bool includeBoundInstances=false)
bool isUniDimensional (mlir::MemRefType memref)
bool isRegionSSAMaximized (Region &region)
LogicalResult maximizeSSA (Value value, PatternRewriter &rewriter)
 Converts a single value within a function into maximal SSA form.
LogicalResult maximizeSSA (Operation *op, SSAMaximizationStrategy &strategy, PatternRewriter &rewriter)
 Considers all of an operation's results for SSA maximization, following a provided strategy.
LogicalResult maximizeSSA (Block *block, SSAMaximizationStrategy &strategy, PatternRewriter &rewriter)
 Considers all values defined by a block (i.e., block arguments and operation results within the block) for SSA maximization, following a provided strategy.
LogicalResult maximizeSSA (Region &region, SSAMaximizationStrategy &strategy, PatternRewriter &rewriter)
 Considers all blocks within a region for SSA maximization, following a provided strategy.
std::unique_ptr< mlir::Pass > createPrintOpCountPass (llvm::raw_ostream &os)

Variables

constexpr const char * circtBugReportMsg
 A generic bug report message for CIRCT-related projects.

Detailed Description

The InstanceGraph op interface, see InstanceGraphInterface.td for more details.

VerifyInnerRefNamespace pass until have container operation.

Transforms combinational groups, which have a constant done condition, into proper groups by registering the values read from the ports of cells used within the combinational group.

It also transforms (invoke,if,while)-with into semantically equivalent control programs that first enable a group that calculates and registers the ports defined by the combinational group execute the respective cond group and then execute the control operator.

Example

group comb_cond<"static"=0> {
lt.right = 32'd10;
lt.left = 32'd1;
eq.right = r.out;
eq.left = x.out;
comb_cond[done] = 1'd1;
}
control {
invoke comp(left = lt.out, ..)(..) with comb_cond;
if lt.out with comb_cond {
...
}
while eq.out with comb_cond {
...
}
}

into:

group comb_cond<"static"=1> {
lt.right = 32'd10;
lt.left = 32'd1;
eq.right = r.out;
eq.left = x.out;
lt_reg.in = lt.out
lt_reg.write_en = 1'd1;
eq_reg.in = eq.out;
eq_reg.write_en = 1'd1;
comb_cond[done] = lt_reg.done & eq_reg.done ? 1'd1;
}
control {
seq {
comb_cond;
invoke comp(left = lt_reg.out, ..)(..);
}
seq {
comb_cond;
if lt_reg.out {
...
}
}
seq {
comb_cond;
while eq_reg.out {
...
comb_cond;
}
}
}
Definition seq.py:1

Typedef Documentation

◆ DefaultTypeStorage

Definition at line 192 of file LLVM.h.

◆ OpAsmSetValueNameFn

Definition at line 193 of file LLVM.h.

◆ OpSCC

using circt::OpSCC = llvm::PointerUnion<void *, mlir::Operation *, CyclicOpSCC>

One entry in the SCC output: a null sentinel, a trivial (non-cyclic) operation, or a cyclic group.

Use llvm::isa / llvm::cast / llvm::dyn_cast to distinguish. Note: void * must be placed first in the union so that the all-zero (default-constructed) state identifies unambiguously as invalid, not as a null Operation*.

Definition at line 211 of file SparseOpSCC.h.

◆ OpSCCFilter

using circt::OpSCCFilter = std::function<bool(mlir::Operation *, mlir::OpOperand &)>

Filter predicate passed to the SparseOpSCC constructor.

Return true to include an edge in the traversal, false to skip it. The first argument is the operation the traversal would enter. The second argument is the OpOperand being followed: for forward traversal its owner equals the first argument; for backward traversal its defining op equals the first argument.

Definition at line 144 of file SparseOpSCC.h.

Enumeration Type Documentation

◆ OpCountEmissionFormat

enum class circt::OpCountEmissionFormat
strong
Enumerator
Readable 
ReadableSorted 
JSON 

Definition at line 30 of file Passes.h.

◆ OpSCCDirection

enum class circt::OpSCCDirection
strong

Traversal direction for SparseOpSCC.

  • Forward: follow def-use edges forward (defining op -> users).
  • Backward: follow def-use edges backward (user -> defining op).
Enumerator
Forward 
Backward 

Definition at line 216 of file SparseOpSCC.h.

Function Documentation

◆ addAndClauses()

void circt::addAndClauses ( int outVar,
llvm::ArrayRef< int > inputLits,
llvm::function_ref< void(llvm::ArrayRef< int >)> addClause )

Emit clauses encoding outVar <=> and(inputLits).

Definition at line 266 of file SATSolver.cpp.

References addAndClauses().

Referenced by addAndClauses().

◆ addAtMostOneClauses()

void circt::addAtMostOneClauses ( llvm::ArrayRef< int > inputLits,
llvm::function_ref< void(llvm::ArrayRef< int >)> addClause,
llvm::function_ref< int()> newVar )

Emit clauses encoding that at most one literal in inputLits can be true.

Unlike the Tseitin-style gate helpers above, this helper does not take an outVar; it only emits the cardinality constraint itself.

Definition at line 318 of file SATSolver.cpp.

References addAtMostOneClauses().

Referenced by addAtMostOneClauses(), and addExactlyOneClauses().

◆ addExactlyOneClauses()

void circt::addExactlyOneClauses ( llvm::ArrayRef< int > inputLits,
llvm::function_ref< void(llvm::ArrayRef< int >)> addClause,
llvm::function_ref< int()> newVar )

Emit clauses encoding that exactly one literal in inputLits is true.

Definition at line 357 of file SATSolver.cpp.

References addAtMostOneClauses(), and addExactlyOneClauses().

Referenced by addExactlyOneClauses().

◆ addOrClauses()

void circt::addOrClauses ( int outVar,
llvm::ArrayRef< int > inputLits,
llvm::function_ref< void(llvm::ArrayRef< int >)> addClause )

Emit clauses encoding outVar <=> or(inputLits).

Definition at line 279 of file SATSolver.cpp.

References addOrClauses().

Referenced by addOrClauses().

◆ addParityClauses()

void circt::addParityClauses ( int outVar,
llvm::ArrayRef< int > inputLits,
llvm::function_ref< void(llvm::ArrayRef< int >)> addClause,
llvm::function_ref< int()> newVar )

Emit clauses encoding outVar <=> parity(inputLits).

Definition at line 299 of file SATSolver.cpp.

References addParityClauses(), addXorClauses(), and assert().

Referenced by addParityClauses().

◆ addXorClauses()

void circt::addXorClauses ( int outVar,
int lhsLit,
int rhsLit,
llvm::function_ref< void(llvm::ArrayRef< int >)> addClause )

Emit clauses encoding outVar <=> (lhsLit xor rhsLit).

Definition at line 291 of file SATSolver.cpp.

References addXorClauses().

Referenced by addParityClauses(), and addXorClauses().

◆ appendPossiblyAbsolutePath()

void circt::appendPossiblyAbsolutePath ( llvm::SmallVectorImpl< char > & base,
const llvm::Twine & suffix )

Append a path to an existing path, replacing it if the other path is absolute.

This mimicks the behaviour of foo/bar and /foo/bar being used in a working directory /home, resulting in /home/foo/bar and /foo/bar, respectively.

Definition at line 26 of file Path.cpp.

Referenced by createOutputFile(), createOutputFile(), and circt::ExportVerilog::SharedEmitterState::gatherFiles().

◆ chooseName() [1/3]

StringAttr circt::chooseName ( Operation * a,
Operation * b )

Choose the better name between two ops.

Picks the "name" attribute as first preference, using "sv.namehint" as an alternative.

Definition at line 66 of file Naming.cpp.

References chooseName(), and getNameOrHint().

◆ chooseName() [2/3]

StringAttr circt::chooseName ( StringAttr a,
StringAttr b )

Choose a good name for an item from two options.

Definition at line 51 of file Naming.cpp.

References isNameBetter().

◆ chooseName() [3/3]

StringRef circt::chooseName ( StringRef a,
StringRef b )

Choose a good name for an item from two options.

Definition at line 47 of file Naming.cpp.

References isNameBetter().

Referenced by chooseName(), and updateName().

◆ collectCanonicalNPN4Representatives()

void circt::collectCanonicalNPN4Representatives ( llvm::SmallVectorImpl< uint16_t > & representatives)

Collect all canonical 4-input single-output NPN representatives in ascending truth-table order.

Definition at line 418 of file TruthTable.cpp.

Referenced by circt::NPNTable::NPNTable().

◆ computeCofactors()

std::pair< llvm::APInt, llvm::APInt > circt::computeCofactors ( const llvm::APInt & f,
unsigned numVars,
unsigned varIndex )

Compute cofactor of a Boolean function for a given variable.

A cofactor of a function f with respect to variable x is the function obtained by fixing x to a constant value:

  • Negative cofactor f|x=0 : f with variable x set to 0
  • Positive cofactor f|x=1 : f with variable x set to 1

Cofactors are fundamental in Boolean function decomposition and the Shannon expansion: f = x'*f|x=0 + x*f|x=1

In truth table representation, cofactors are computed by selecting the subset of minterms where the variable has the specified value, then replicating that pattern across the full truth table width.

This function returns a pair of cofactors (negative, positive) for the specified variable index.

◆ convertAttributeToJSON()

LogicalResult circt::convertAttributeToJSON ( llvm::json::OStream & json,
Attribute attr )

Convert a simple attribute to JSON.

Definition at line 25 of file JSON.cpp.

References convertAttributeToJSON(), failure(), and success().

Referenced by convertAttributeToJSON().

◆ convertJSONToAttribute()

Attribute circt::convertJSONToAttribute ( MLIRContext * context,
llvm::json::Value & value,
llvm::json::Path p )

Convert arbitrary JSON to an MLIR Attribute.

References context.

◆ createAffineToLoopSchedule()

std::unique_ptr< mlir::Pass > circt::createAffineToLoopSchedule ( )

Definition at line 667 of file AffineToLoopSchedule.cpp.

◆ createCadicalSATSolver()

std::unique_ptr< IncrementalSATSolver > circt::createCadicalSATSolver ( const CadicalSATSolverOptions & options = {})

Construct a CaDiCaL-backed incremental IPASIR-style SAT solver.

Definition at line 374 of file SATSolver.cpp.

References createCadicalSATSolver().

Referenced by createCadicalSATSolver(), and createSATSolver().

◆ createCalyxNativePass()

std::unique_ptr< mlir::Pass > circt::createCalyxNativePass ( )

Definition at line 168 of file CalyxNative.cpp.

◆ createCalyxToFSMPass()

std::unique_ptr< mlir::Pass > circt::createCalyxToFSMPass ( )

Definition at line 405 of file CalyxToFSM.cpp.

◆ createCalyxToHWPass()

std::unique_ptr< mlir::Pass > circt::createCalyxToHWPass ( )

Definition at line 488 of file CalyxToHW.cpp.

◆ createCFToHandshakePass()

std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > circt::createCFToHandshakePass ( bool sourceConstants = false,
bool disableTaskPipelining = false )

Definition at line 1771 of file CFToHandshake.cpp.

◆ createConvertCombToArithPass()

std::unique_ptr< Pass > circt::createConvertCombToArithPass ( )

Definition at line 421 of file CombToArith.cpp.

◆ createConvertCoreToFSMPass()

std::unique_ptr< mlir::Pass > circt::createConvertCoreToFSMPass ( )

◆ createConvertFSMToCorePass()

std::unique_ptr< mlir::Pass > circt::createConvertFSMToCorePass ( )

Definition at line 547 of file FSMToCore.cpp.

◆ createConvertFSMToSMTPass()

std::unique_ptr< mlir::Pass > circt::createConvertFSMToSMTPass ( )

Definition at line 756 of file FSMToSMT.cpp.

◆ createConvertFSMToSVPass()

std::unique_ptr< mlir::Pass > circt::createConvertFSMToSVPass ( )

Definition at line 757 of file FSMToSV.cpp.

◆ createConvertHWToBTOR2Pass() [1/2]

std::unique_ptr< mlir::Pass > circt::createConvertHWToBTOR2Pass ( )

Definition at line 1400 of file HWToBTOR2.cpp.

◆ createConvertHWToBTOR2Pass() [2/2]

std::unique_ptr< mlir::Pass > circt::createConvertHWToBTOR2Pass ( llvm::raw_ostream & os)

Definition at line 1395 of file HWToBTOR2.cpp.

Referenced by circt::firtool::populateHWToBTOR2().

◆ createConvertHWToSystemCPass()

std::unique_ptr< OperationPass< ModuleOp > > circt::createConvertHWToSystemCPass ( )

Create a HW to SystemC dialects conversion pass.

Definition at line 356 of file HWToSystemC.cpp.

◆ createConvertIndexToUIntPass()

std::unique_ptr< mlir::Pass > circt::createConvertIndexToUIntPass ( )

Definition at line 151 of file ConvertIndexToUInt.cpp.

◆ createConvertMooreToCorePass()

std::unique_ptr< OperationPass< ModuleOp > > circt::createConvertMooreToCorePass ( )

Create an Moore to Comb/HW/LLHD conversion pass.

Create a Moore to core dialects conversion pass.

Definition at line 4451 of file MooreToCore.cpp.

◆ createDCToHWPass()

std::unique_ptr< mlir::Pass > circt::createDCToHWPass ( )

Definition at line 914 of file DCToHW.cpp.

◆ createExportSplitVerilogPass()

std::unique_ptr< mlir::Pass > circt::createExportSplitVerilogPass ( llvm::StringRef directory = "./")

◆ createExportVerilogPass() [1/3]

std::unique_ptr< mlir::Pass > circt::createExportVerilogPass ( )

◆ createExportVerilogPass() [2/3]

std::unique_ptr< mlir::Pass > circt::createExportVerilogPass ( llvm::raw_ostream & os)

Definition at line 7648 of file ExportVerilog.cpp.

◆ createExportVerilogPass() [3/3]

std::unique_ptr< mlir::Pass > circt::createExportVerilogPass ( std::unique_ptr< llvm::raw_ostream > os)

Definition at line 7643 of file ExportVerilog.cpp.

◆ createFlattenMemRefCallsPass()

std::unique_ptr< mlir::Pass > circt::createFlattenMemRefCallsPass ( )

Definition at line 513 of file FlattenMemRefs.cpp.

◆ createFlattenMemRefPass()

std::unique_ptr< mlir::Pass > circt::createFlattenMemRefPass ( )

Definition at line 509 of file FlattenMemRefs.cpp.

◆ createHandshakeAnalysisPass()

std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > circt::createHandshakeAnalysisPass ( )

◆ createHandshakeCanonicalizePass()

std::unique_ptr< mlir::OperationPass< handshake::FuncOp > > circt::createHandshakeCanonicalizePass ( )

◆ createHandshakeRemoveBlockPass()

std::unique_ptr< mlir::OperationPass< handshake::FuncOp > > circt::createHandshakeRemoveBlockPass ( )

Definition at line 1778 of file CFToHandshake.cpp.

◆ createHandshakeToHWPass()

std::unique_ptr< mlir::Pass > circt::createHandshakeToHWPass ( )

Definition at line 2056 of file HandshakeToHW.cpp.

◆ createHierarchicalRunner()

std::unique_ptr< mlir::Pass > circt::createHierarchicalRunner ( const std::string & topName,
llvm::function_ref< void(mlir::OpPassManager &)> pipeline,
bool includeBoundInstances = false )

Definition at line 140 of file HierarchicalRunner.cpp.

◆ createHWArithToHWPass()

std::unique_ptr< Pass > circt::createHWArithToHWPass ( )

Definition at line 477 of file HWArithToHW.cpp.

◆ createIndexSwitchToIfPass()

std::unique_ptr< mlir::Pass > circt::createIndexSwitchToIfPass ( )

Definition at line 123 of file IndexSwitchToIf.cpp.

◆ createInsertMergeBlocksPass()

std::unique_ptr< mlir::Pass > circt::createInsertMergeBlocksPass ( )

Definition at line 375 of file InsertMergeBlocks.cpp.

◆ createLoopScheduleToCalyxPass()

std::unique_ptr< OperationPass< ModuleOp > > circt::createLoopScheduleToCalyxPass ( )

Create a LoopSchedule to Calyx conversion pass.

Definition at line 1716 of file LoopScheduleToCalyx.cpp.

◆ createLowerArcToLLVMPass()

std::unique_ptr< OperationPass< ModuleOp > > circt::createLowerArcToLLVMPass ( )

Definition at line 1975 of file LowerArcToLLVM.cpp.

◆ createLowerFirMemPass()

std::unique_ptr< Pass > circt::createLowerFirMemPass ( )

Definition at line 83 of file LowerFirMem.cpp.

◆ createLowerFIRRTLToHWPass()

std::unique_ptr< mlir::Pass > circt::createLowerFIRRTLToHWPass ( bool enableAnnotationWarning = false,
firrtl::VerificationFlavor assertionFlavor = firrtl::VerificationFlavor::None,
bool lowerToCore = false )

This is the pass constructor.

Definition at line 657 of file LowerToHW.cpp.

Referenced by circt::firtool::populateLowFIRRTLToHW().

◆ createLowerHWToSVPass()

std::unique_ptr< OperationPass< hw::HWModuleOp > > circt::createLowerHWToSVPass ( )

Definition at line 86 of file HWToSV.cpp.

◆ createLowerLTLToCorePass()

std::unique_ptr< mlir::Pass > circt::createLowerLTLToCorePass ( )

Definition at line 376 of file LTLToCore.cpp.

Referenced by circt::firtool::populateHWToBTOR2().

◆ createLowerSeqFIRRTLInitToSV()

std::unique_ptr< mlir::Pass > circt::createLowerSeqFIRRTLInitToSV ( )

◆ createLowerSeqToSVPass()

std::unique_ptr< Pass > circt::createLowerSeqToSVPass ( const LowerSeqToSVOptions & options = {})

Definition at line 858 of file SeqToSV.cpp.

Referenced by circt::firtool::populateHWToSV().

◆ createLowerSimToSVPass()

std::unique_ptr< Pass > circt::createLowerSimToSVPass ( )

Definition at line 1050 of file SimToSV.cpp.

Referenced by circt::firtool::populateHWToSV().

◆ createLowerVerifToSVPass()

std::unique_ptr< OperationPass< hw::HWModuleOp > > circt::createLowerVerifToSVPass ( )

Create the Verif to SV conversion pass.

Definition at line 243 of file VerifToSV.cpp.

Referenced by circt::firtool::populateHWToSV().

◆ createMapArithToCombPass()

std::unique_ptr< mlir::Pass > circt::createMapArithToCombPass ( bool enableBestEffortLowering = false)

Definition at line 283 of file MapArithToComb.cpp.

◆ createMaterializeCalyxToFSMPass()

std::unique_ptr< mlir::Pass > circt::createMaterializeCalyxToFSMPass ( )

Definition at line 247 of file MaterializeFSM.cpp.

◆ createMaximizeSSAPass()

std::unique_ptr< mlir::Pass > circt::createMaximizeSSAPass ( )

Definition at line 246 of file MaximizeSSA.cpp.

Referenced by circt::kanagawa::loadKanagawaHighLevelPassPipeline().

◆ createMemoryBankingPass()

std::unique_ptr< mlir::Pass > circt::createMemoryBankingPass ( ArrayRef< unsigned > bankingFactors = {},
ArrayRef< unsigned > bankingDimensions = {} )

Definition at line 955 of file MemoryBanking.cpp.

◆ createOutputFile()

std::unique_ptr< llvm::ToolOutputFile > circt::createOutputFile ( StringRef filename,
StringRef dirname,
function_ref< InFlightDiagnostic()> emitError )

Creates an output file with the given filename in the specified directory.

The function will create any parent directories as needed. If an error occurs during file or directory creation, it will use the provided emitError callback to report the error and return an empty unique_ptr.

Definition at line 55 of file Path.cpp.

References appendPossiblyAbsolutePath().

Referenced by createSplitOutputFile(), and exportSplitVerilogImpl().

◆ createPipelineToHWPass()

std::unique_ptr< mlir::Pass > circt::createPipelineToHWPass ( const PipelineToHWOptions & options = {})

Create an SCF to Calyx conversion pass.

Definition at line 512 of file PipelineToHW.cpp.

◆ createPrintOpCountPass() [1/2]

std::unique_ptr< mlir::Pass > circt::createPrintOpCountPass ( )

Definition at line 99 of file PrintOpCount.cpp.

◆ createPrintOpCountPass() [2/2]

std::unique_ptr< mlir::Pass > circt::createPrintOpCountPass ( llvm::raw_ostream & os)

Definition at line 94 of file PrintOpCount.cpp.

◆ createRemoveGroupsFromFSMPass()

std::unique_ptr< mlir::Pass > circt::createRemoveGroupsFromFSMPass ( )

Definition at line 315 of file RemoveGroupsFromFSM.cpp.

◆ createSATSolver()

std::unique_ptr< IncrementalSATSolver > circt::createSATSolver ( llvm::StringRef backend = "auto")

Construct an incremental SAT solver using the requested backend.

The auto backend prefers CaDiCaL and falls back to Z3.

Definition at line 382 of file SATSolver.cpp.

References createCadicalSATSolver(), createSATSolver(), and createZ3SATSolver().

Referenced by createSATSolver(), and hasIncrementalSATSolverBackend().

◆ createSCFToCalyxPass()

std::unique_ptr< OperationPass< ModuleOp > > circt::createSCFToCalyxPass ( std::string topLevelFunction = "")

Create an SCF to Calyx conversion pass.

Definition at line 3122 of file SCFToCalyx.cpp.

◆ createSimpleCanonicalizerPass()

◆ createStripDebugInfoWithPredPass()

std::unique_ptr< Pass > circt::createStripDebugInfoWithPredPass ( const std::function< bool(mlir::Location)> & pred)

Creates a pass to strip debug information from a function.

Definition at line 129 of file StripDebugInfoWithPred.cpp.

References createStripDebugInfoWithPredPass().

Referenced by createStripDebugInfoWithPredPass(), and detail::populatePrepareForExportVerilog().

◆ createVarMask()

APInt circt::createVarMask ( unsigned numVars,
unsigned varIndex,
bool positive )

Create a mask for a variable in the truth table.

This function generates a bitmask that identifies which minterms have a particular value for a given variable in a truth table representation.

For positive=true: mask has 1s where var=1 in the truth table encoding For positive=false: mask has 1s where var=0 in the truth table encoding

For example, with 3 variables (a,b,c) where c is LSB:

  • createVarMask(3, 0, true) creates mask for c=1: 0b10101010
  • createVarMask(3, 1, true) creates mask for b=1: 0b11001100
  • createVarMask(3, 2, true) creates mask for a=1: 0b11110000

Parameters: numVars: Number of variables in the truth table var: Variable index (0 = LSB) positive: true for var=1 mask, false for var=0 mask

Returns: APInt mask with numBits = 2^numVars

Definition at line 624 of file TruthTable.cpp.

References createVarMaskImpl().

Referenced by circt::SOPForm::computeTruthTable(), and circt::synth::getTruthTable().

◆ createZ3SATSolver()

std::unique_ptr< IncrementalSATSolver > circt::createZ3SATSolver ( )

Construct a Z3-backed incremental IPASIR-style SAT solver.

Definition at line 365 of file SATSolver.cpp.

References createZ3SATSolver().

Referenced by createSATSolver(), and createZ3SATSolver().

◆ debugFooter()

llvm::raw_ostream & circt::debugFooter ( unsigned width = 80)

Write a boilerplate footer to the debug stream to indicate that a pass has ended.

This produces text like the following:

===--------------------------------—===

Definition at line 36 of file Debug.cpp.

Referenced by circt::ScopedDebugPassLogger::~ScopedDebugPassLogger().

◆ debugHeader()

llvm::raw_ostream & circt::debugHeader ( const llvm::Twine & str,
unsigned width = 80 )

Write a "header"-like string to the debug stream with a certain width.

This produces output like the following:

===- Hello World --------------------===

This is commonly used for generating a header in debug information. The format is modeled after LLVM/MLIR/CIRCT source file headers.

Definition at line 17 of file Debug.cpp.

Referenced by debugPassHeader(), and circt::firrtl::InstanceInfo::InstanceInfo().

◆ debugPassHeader()

llvm::raw_ostream & circt::debugPassHeader ( const mlir::Pass * pass,
unsigned width = 80 )

Write a boilerplate header for a pass to the debug stream.

This generates output like the following if the pass's name is "FooPass":

===- Running FooPass --------------—===

This is commonly used to generate a header in debug when a pass starts running.

Definition at line 31 of file Debug.cpp.

References debugHeader().

Referenced by circt::ScopedDebugPassLogger::ScopedDebugPassLogger().

◆ doTypeConversion()

LogicalResult circt::doTypeConversion ( Operation * op,
ValueRange operands,
ConversionPatternRewriter & rewriter,
const TypeConverter * typeConverter )

◆ elideImplicitSSAName()

void circt::elideImplicitSSAName ( OpAsmPrinter & printer,
Operation * op,
DictionaryAttr attrs,
SmallVectorImpl< StringRef > & elides )

Check if the name attribute in attrs matches the SSA name of the operation's first result.

If it does, add name to elides. This is helpful during printing of attribute dictionaries in order to determine if the inclusion of the name field would be redundant.

Definition at line 99 of file CustomDirectiveImpl.cpp.

References attrs, and isdigit.

Referenced by printFIRRTLImplicitSSAName(), and printImplicitSSAName().

◆ exportSplitVerilog()

mlir::LogicalResult circt::exportSplitVerilog ( mlir::ModuleOp module,
llvm::StringRef dirname )

Export a module containing HW, and SV dialect code, as one file per SV module.

Requires that the SV dialect is loaded in to the context.

Files are created in the directory indicated by dirname.

Referenced by mlirExportSplitVerilog().

◆ exportVerilog()

mlir::LogicalResult circt::exportVerilog ( mlir::ModuleOp module,
llvm::raw_ostream & os )

Export a module containing HW, and SV dialect code.

Requires that the SV dialect is loaded in to the context.

Referenced by mlirExportVerilog().

◆ extOrTruncZeroWidth()

APSInt circt::extOrTruncZeroWidth ( APSInt value,
unsigned width )

A safe version of APSInt::extOrTrunc that will NOT assert on zero-width signed APSInts.

Instead of asserting, this will zero extend.

Definition at line 22 of file APInt.cpp.

Referenced by getExtendedConstant().

◆ extractISOP()

SOPForm circt::extractISOP ( const llvm::APInt & truthTable,
unsigned numVars )

Extract ISOP (Irredundant Sum-of-Products) from a truth table.

Computes an ISOP cover for a Boolean function using the Minato-Morreale algorithm. An ISOP is a sum-of-products where:

  1. No cube can be removed without changing the function
  2. The cubes are pairwise disjoint (no minterm is covered by multiple cubes)

Parameters: truthTable: Single-output truth table represented as APInt numVars: Number of variables (truthTable must have 2^numVars bits)

Returns: SOPForm representing the ISOP cover

◆ formatInteger()

void circt::formatInteger ( llvm::raw_ostream & os,
const llvm::APInt & value,
unsigned radix,
bool isUpperCase,
bool isLeftAligned,
char paddingChar,
std::optional< int32_t > specifierWidth,
bool isSigned )
inline

Format value in the given radix and emit it to os, padded to a field width.

The field width defaults to the natural width of the value's type and is overridden by specifierWidth when present; a specifierWidth of 0 therefore disables padding. Right-aligned output (the default) is padded on the leading side with paddingChar, matching the SystemVerilog d/h family. Left-aligned output is padded on the trailing side with spaces, matching C printf, whose zero-pad flag is ignored under left justification; SystemVerilog's $display has no left-aligned form. radix must be one of {2, 8, 10, 16}.

Definition at line 75 of file FormatInteger.h.

References getNaturalIntegerWidth().

Referenced by formatIntegersByRadix(), and formatToStream().

◆ getCirctVersion()

const char * circt::getCirctVersion ( )

◆ getCirctVersionComment()

const char * circt::getCirctVersionComment ( )

◆ getConstantInt()

std::optional< APInt > circt::getConstantInt ( Attribute operand)
inlinestatic

Determine the integer value of a constant operand.

Definition at line 19 of file FoldUtils.h.

Referenced by isConstantOne(), and isConstantZero().

◆ getDecimalDigitWidth()

unsigned circt::getDecimalDigitWidth ( unsigned bits,
bool isSigned )
inline

Number of decimal digits required to print the largest value of an integer type of the given bit width.

Definition at line 36 of file FormatInteger.h.

Referenced by getNaturalIntegerWidth().

◆ getNaturalIntegerWidth()

unsigned circt::getNaturalIntegerWidth ( unsigned bits,
unsigned radix,
bool isSigned )
inline

Natural field width of an integer type printed in the given radix: the number of digits required to print the type's largest value.

radix must be one of {2, 8, 10, 16}.

Definition at line 52 of file FormatInteger.h.

References getDecimalDigitWidth().

Referenced by formatInteger().

◆ getSlangVersion()

std::string circt::getSlangVersion ( )

Return a human-readable string describing the slang frontend version linked into CIRCT.

Definition at line 44 of file ImportVerilog.cpp.

◆ hash_value() [1/3]

llvm::hash_code circt::hash_value ( const FieldInfo & fi)
inline

Definition at line 35 of file FieldInfo.h.

References circt::FieldInfo::name, and circt::FieldInfo::type.

◆ hash_value() [2/3]

inline ::llvm::hash_code circt::hash_value ( const FieldRef & fieldRef)

Get a hash code for a FieldRef.

Definition at line 94 of file FieldRef.h.

References circt::FieldRef::getFieldID(), and circt::FieldRef::getValue().

◆ hash_value() [3/3]

llvm::hash_code circt::hash_value ( const FVInt & a)

Definition at line 143 of file FVInt.cpp.

References circt::FVInt::getRawUnknown(), and circt::FVInt::getRawValue().

◆ hasIncrementalSATSolverBackend()

bool circt::hasIncrementalSATSolverBackend ( )

Return true when at least one incremental SAT backend is available.

Definition at line 395 of file SATSolver.cpp.

References createSATSolver(), and hasIncrementalSATSolverBackend().

Referenced by hasIncrementalSATSolverBackend().

◆ importVerilog()

mlir::LogicalResult circt::importVerilog ( llvm::SourceMgr & sourceMgr,
mlir::MLIRContext * context,
mlir::TimingScope & ts,
mlir::ModuleOp module,
const ImportVerilogOptions * options = nullptr )

Parse files in a source manager as Verilog source code and populate the given MLIR module with corresponding ops.

References context.

Referenced by registerFromVerilogTranslation().

◆ inferImplicitSSAName()

bool circt::inferImplicitSSAName ( OpAsmParser & parser,
NamedAttrList & attrs )

Ensure that attrs contains a name attribute by inferring its value from the SSA name of the operation's first result if necessary.

Returns true if a name was inferred, false if attrs already contained a name.

Definition at line 53 of file CustomDirectiveImpl.cpp.

References attrs, context, and isdigit.

Referenced by parseFIRRTLImplicitSSAName(), and parseImplicitSSAName().

◆ insertMergeBlocks()

LogicalResult circt::insertMergeBlocks ( mlir::Region & r,
mlir::ConversionPatternRewriter & rewriter )

Insert additional blocks that serve as counterparts to the blocks that diverged the control flow.

Manually run merge block insertion on a region.

The resulting merge block tree is guaranteed to be a binary tree.

This transformation does treat loops like a single block and thus does not affect them.

This transformation does treat loops like a single block and thus does not affect them.

◆ isAncestorOfValueOwner()

bool circt::isAncestorOfValueOwner ( Operation * op,
Value value )
inline

Return true if a Value is created "underneath" an operation.

This is frequently useful when negated as that indicates that a Value is defined "outside" the region of an Operation and that the Operation is thereby "capturing" the value.

Definition at line 27 of file Utils.h.

Referenced by LowerLayersPass::runOnModuleBody().

◆ isConstantOne()

bool circt::isConstantOne ( Attribute operand)
inlinestatic

Determine whether a constant operand is a one value.

Definition at line 35 of file FoldUtils.h.

References getConstantInt().

◆ isConstantZero()

bool circt::isConstantZero ( Attribute operand)
inlinestatic

Determine whether a constant operand is a zero value.

Definition at line 28 of file FoldUtils.h.

References getConstantInt().

Referenced by eraseIfPredFalse().

◆ isInProceduralRegion()

bool circt::isInProceduralRegion ( Operation * op)

Returns true if op has a parent marked as a procedural region that is closer than any parent marked as a non-procedural region.

Returns false otherwise, including when no parent is marked as either.

Definition at line 37 of file ProceduralRegionTrait.cpp.

Referenced by maskOpByIfdef(), and moveOpsIntoIfdefGuardsAndProcesses().

◆ isRegionSSAMaximized()

bool circt::isRegionSSAMaximized ( Region & region)

Definition at line 61 of file MaximizeSSA.cpp.

References getDefiningBlock().

◆ isUniDimensional()

bool circt::isUniDimensional ( mlir::MemRefType memref)

Referenced by hasMultiDimMemRef().

◆ isUselessName()

bool circt::isUselessName ( StringRef name)

Return true if this is a possibly useless temporary name.

This method is FIRRTL-centric, dropping useless temporaries.

Definition at line 16 of file Naming.cpp.

Referenced by isNameBetter().

◆ makeCommonDirectoryPrefix()

void circt::makeCommonDirectoryPrefix ( llvm::SmallVectorImpl< char > & a,
StringRef b )

Truncate a in place to the longest common directory prefix of a and b, ensuring that the result ends on a directory separator (or is empty).

This computes the lowest common ancestor directory of two paths and is used, for example, to pick a shared output directory for deduplicated operations.

Definition at line 36 of file Path.cpp.

Referenced by computeCommonOutputFile(), and makeCommonPrefix().

◆ maximizeSSA() [1/4]

LogicalResult circt::maximizeSSA ( Block * block,
SSAMaximizationStrategy & strategy,
PatternRewriter & rewriter )

Considers all values defined by a block (i.e., block arguments and operation results within the block) for SSA maximization, following a provided strategy.

This removes any implicit dataflow of the selected values within the enclosing function. The function adds new block arguments wherever necessary to carry the values explicitly between blocks. Succeeds when it was possible to convert the selected values defined by the block into maximal SSA form.

Definition at line 170 of file MaximizeSSA.cpp.

References failure(), circt::SSAMaximizationStrategy::maximizeArgument(), circt::SSAMaximizationStrategy::maximizeOp(), maximizeSSA(), and success().

◆ maximizeSSA() [2/4]

LogicalResult circt::maximizeSSA ( Operation * op,
SSAMaximizationStrategy & strategy,
PatternRewriter & rewriter )

Considers all of an operation's results for SSA maximization, following a provided strategy.

This removes any implicit dataflow of the selected operation's results within the enclosing function. The function adds new block arguments wherever necessary to carry the results explicitly between blocks. Succeeds when it was possible to convert the selected operation's results into maximal SSA form.

Definition at line 158 of file MaximizeSSA.cpp.

References failure(), circt::SSAMaximizationStrategy::maximizeResult(), maximizeSSA(), and success().

◆ maximizeSSA() [3/4]

LogicalResult circt::maximizeSSA ( Region & region,
SSAMaximizationStrategy & strategy,
PatternRewriter & rewriter )

Considers all blocks within a region for SSA maximization, following a provided strategy.

This removes any implicit dataflow of the values defined by selected blocks within the region. The function adds new block arguments wherever necessary to carry the region's values explicitly between blocks. Succeeds when it was possible to convert all of the values defined by selected blocks into maximal SSA form.

Definition at line 188 of file MaximizeSSA.cpp.

References failure(), circt::SSAMaximizationStrategy::maximizeBlock(), maximizeSSA(), and success().

◆ maximizeSSA() [4/4]

LogicalResult circt::maximizeSSA ( Value value,
PatternRewriter & rewriter )

Converts a single value within a function into maximal SSA form.

This removes any implicit dataflow of this specific value within the enclosing function. The function adds new block arguments wherever necessary to carry the value explicitly between blocks. Succeeds when it was possible to convert the value into maximal SSA form.

Definition at line 85 of file MaximizeSSA.cpp.

References addArgToTerminator(), failure(), getDefiningBlock(), and success().

Referenced by maximizeSSA(), maximizeSSA(), maximizeSSA(), maximizeSSANoMem(), and circt::handshake::HandshakeLowering::runSSAMaximization().

◆ operator!=()

bool circt::operator!= ( uint64_t a,
const FVInt & b )
inline

Definition at line 685 of file FVInt.h.

◆ operator&() [1/2]

FVInt circt::operator& ( const APInt & a,
const FVInt & b )
inline

Definition at line 672 of file FVInt.h.

◆ operator&() [2/2]

FVInt circt::operator& ( uint64_t a,
const FVInt & b )
inline

Definition at line 666 of file FVInt.h.

◆ operator*() [1/2]

FVInt circt::operator* ( const APInt & a,
const FVInt & b )
inline

Definition at line 676 of file FVInt.h.

◆ operator*() [2/2]

FVInt circt::operator* ( uint64_t a,
const FVInt & b )
inline

Definition at line 670 of file FVInt.h.

◆ operator+() [1/2]

FVInt circt::operator+ ( const APInt & a,
const FVInt & b )
inline

Definition at line 675 of file FVInt.h.

◆ operator+() [2/2]

FVInt circt::operator+ ( uint64_t a,
const FVInt & b )
inline

Definition at line 669 of file FVInt.h.

◆ operator-() [1/2]

FVInt circt::operator- ( const APInt & a,
const FVInt & b )
inline

Definition at line 682 of file FVInt.h.

◆ operator-() [2/2]

FVInt circt::operator- ( uint64_t a,
const FVInt & b )
inline

Definition at line 678 of file FVInt.h.

References circt::FVInt::getBitWidth().

◆ operator<<()

raw_ostream & circt::operator<< ( raw_ostream & os,
const FVInt & value )
inline

Definition at line 687 of file FVInt.h.

References circt::FVInt::print().

◆ operator==() [1/2]

bool circt::operator== ( const FieldInfo & a,
const FieldInfo & b )
inline

Definition at line 32 of file FieldInfo.h.

References circt::FieldInfo::name, and circt::FieldInfo::type.

◆ operator==() [2/2]

bool circt::operator== ( uint64_t a,
const FVInt & b )
inline

Definition at line 684 of file FVInt.h.

◆ operator^() [1/2]

FVInt circt::operator^ ( const APInt & a,
const FVInt & b )
inline

Definition at line 674 of file FVInt.h.

◆ operator^() [2/2]

FVInt circt::operator^ ( uint64_t a,
const FVInt & b )
inline

Definition at line 668 of file FVInt.h.

◆ operator|() [1/2]

FVInt circt::operator| ( const APInt & a,
const FVInt & b )
inline

Definition at line 673 of file FVInt.h.

◆ operator|() [2/2]

FVInt circt::operator| ( uint64_t a,
const FVInt & b )
inline

Definition at line 667 of file FVInt.h.

◆ parseFieldList()

ParseResult circt::parseFieldList ( AsmParser & p,
SmallVectorImpl< FieldInfo > & fields,
SmallVectorImpl< std::pair< llvm::SMLoc, StringAttr > > & duplicates )

Parse a list of named fields within <>, e.g.

<foo: i7, bar: i8>. Field names may be bare keywords or quoted strings. The location and name of every field whose name was already used by a preceding field is appended to duplicates, leaving it to the caller to report them.

Definition at line 15 of file FieldInfo.cpp.

References failure(), and success().

◆ parseFVInt()

ParseResult circt::parseFVInt ( AsmParser & p,
FVInt & result )

Parse a four-valued integer using an AsmParser.

This accepts the following formats:

  • 42/-42: positive or negative integer in decimal notation. The sign bit of the result indicates whether the value was negative. Cannot contain unknown X or Z digits.
  • h123456789ABCDEF0XZ: signless integer in hexadecimal notation. Can contain unknown X or Z digits.
  • b10XZ: signless integer in binary notation. Can contain unknown X or Z digits.

The result has enough bits to fully represent the parsed integer, and to have the sign bit encode whether the integer was written as a negative number in the input. The result's bit width may be larger than the minimum number of bits required to represent its value.

Definition at line 162 of file FVInt.cpp.

References failure(), success(), circt::FVInt::tryFromString(), and circt::FVInt::zext().

◆ parseImplicitSSAName() [1/2]

ParseResult circt::parseImplicitSSAName ( OpAsmParser & parser,
NamedAttrList & attrs )

Parse an attribute dictionary and ensure that it contains a name field by inferring its value from the SSA name of the operation's first result if necessary.

Definition at line 45 of file CustomDirectiveImpl.cpp.

References attrs, failure(), inferImplicitSSAName(), and success().

◆ parseImplicitSSAName() [2/2]

ParseResult circt::parseImplicitSSAName ( OpAsmParser & parser,
StringAttr & attr )

Parse an implicit SSA name string attribute.

If the name is not provided in the input text, its value is inferred from the SSA name of the operation's first result.

implicit-name ::= (name str-attr)?

Definition at line 14 of file CustomDirectiveImpl.cpp.

References failure(), isdigit, and success().

◆ parseImplicitSSANames()

ParseResult circt::parseImplicitSSANames ( OpAsmParser & parser,
ArrayAttr & attr )

Parse an array of implicit SSA name string attributes.

Each name is inferred from the corresponding SSA name of the operation's results.

Definition at line 32 of file CustomDirectiveImpl.cpp.

References isdigit, and success().

◆ parseInputPortList()

ParseResult circt::parseInputPortList ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & inputs,
SmallVectorImpl< Type > & inputTypes,
ArrayAttr & inputNames )

Parse a list of instance input ports.

input-list ::= ( ( input-element (, input-element )* )? ) input-element ::= identifier : value : type

Definition at line 15 of file CustomDirectiveImpl.cpp.

References failure(), and success().

◆ parseKeywordBool()

ParseResult circt::parseKeywordBool ( OpAsmParser & parser,
BoolAttr & attr,
StringRef trueKeyword,
StringRef falseKeyword )

Parse a boolean as one of two keywords.

The trueKeyword will result in a true boolean; the falseKeyword will result in a false boolean.

labeled-bool ::= (true-label | false-label)

Definition at line 136 of file CustomDirectiveImpl.cpp.

References success().

◆ parseOptionalBinaryOpTypes()

ParseResult circt::parseOptionalBinaryOpTypes ( OpAsmParser & parser,
Type & lhs,
Type & rhs )

Definition at line 113 of file CustomDirectiveImpl.cpp.

References failure(), and success().

◆ parseOptionalParameterList()

ParseResult circt::parseOptionalParameterList ( OpAsmParser & parser,
ArrayAttr & parameters )

Parse an parameter list if present.

module-parameter-list ::= < parameter-decl (, parameter-decl)* > parameter-decl ::= identifier : type parameter-decl ::= identifier : type = attribute

Definition at line 92 of file CustomDirectiveImpl.cpp.

References failure(), and success().

Referenced by parseHWModuleOp().

◆ parseOutputPortList()

ParseResult circt::parseOutputPortList ( OpAsmParser & parser,
SmallVectorImpl< Type > & resultTypes,
ArrayAttr & resultNames )

Parse a list of instance output ports.

output-list ::= ( ( output-element (, output-element )* )? ) output-element ::= identifier : type

Definition at line 56 of file CustomDirectiveImpl.cpp.

References failure(), and success().

◆ parseVariadicInvertibleOperands()

ParseResult circt::parseVariadicInvertibleOperands ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & operands,
Type & resultType,
mlir::DenseBoolArrayAttr & inverted,
NamedAttrList & attrDict )

Parse a variadic list of operands that may be prefixed with an optional not keyword.

If the not keyword is present, the corresponding element in the inverted attribute is set to true; otherwise, it is set to false.

Definition at line 160 of file CustomDirectiveImpl.cpp.

References failure(), and success().

◆ populateArcConversionPipeline()

void circt::populateArcConversionPipeline ( mlir::OpPassManager & pm,
const ArcConversionOptions & options = {} )

◆ populateArcOptimizationPipeline()

void circt::populateArcOptimizationPipeline ( mlir::OpPassManager & pm,
const ArcOptimizationOptions & options = {} )

◆ populateArcPreprocessingPipeline()

void circt::populateArcPreprocessingPipeline ( mlir::OpPassManager & pm,
const ArcPreprocessingOptions & options = {} )

◆ populateArcStateAllocationPipeline()

void circt::populateArcStateAllocationPipeline ( mlir::OpPassManager & pm,
const ArcStateAllocationOptions & options = {} )

◆ populateArcStateLoweringPipeline()

void circt::populateArcStateLoweringPipeline ( mlir::OpPassManager & pm,
const ArcStateLoweringOptions & options = {} )

◆ populateArcToLLVMPipeline()

void circt::populateArcToLLVMPipeline ( mlir::OpPassManager & pm,
const ArcToLLVMOptions & options = {} )

◆ populateArithToCombPatterns()

void circt::populateArithToCombPatterns ( mlir::RewritePatternSet & patterns,
TypeConverter & typeConverter )

Referenced by populateOpConversion().

◆ populateCombToArithConversionPatterns()

void circt::populateCombToArithConversionPatterns ( TypeConverter & converter,
RewritePatternSet & patterns )

◆ populateCombToLLVMConversionPatterns()

void circt::populateCombToLLVMConversionPatterns ( mlir::LLVMTypeConverter & converter,
RewritePatternSet & patterns )

Get the Comb to LLVM conversion patterns.

Referenced by circt::impl::ConvertToLLVMPass::convertFuncOp().

◆ populateCombToSMTConversionPatterns()

void circt::populateCombToSMTConversionPatterns ( TypeConverter & converter,
RewritePatternSet & patterns )

Get the HW to SMT conversion patterns.

◆ populateDatapathToSMTConversionPatterns()

void circt::populateDatapathToSMTConversionPatterns ( TypeConverter & converter,
RewritePatternSet & patterns )

Get the Datapath to SMT conversion patterns.

◆ populateGenericReducePatterns()

void circt::populateGenericReducePatterns ( MLIRContext * context,
ReducePatternSet & patterns,
std::optional< int64_t > maxNumRewrites = std::nullopt )

Populate reduction patterns that are not specific to certain operations or dialects.

The optional maxNumRewrites parameter allows callers to override the greedy rewrite budget used by reductions that rely on the canonicalizer pass.

Definition at line 110 of file GenericReductions.cpp.

References context, and createSimpleCanonicalizerPass().

◆ populateHWArithToHWConversionPatterns()

void circt::populateHWArithToHWConversionPatterns ( HWArithToHWTypeConverter & typeConverter,
RewritePatternSet & patterns )

Get the HWArith to HW conversion patterns.

Definition at line 434 of file HWArithToHW.cpp.

◆ populateHWToLLVMConversionPatterns()

void circt::populateHWToLLVMConversionPatterns ( mlir::LLVMTypeConverter & converter,
RewritePatternSet & patterns,
Namespace & globals,
DenseMap< std::pair< Type, ArrayAttr >, mlir::LLVM::GlobalOp > & constAggregateGlobalsMap,
std::optional< HWToLLVMArraySpillCache > & spillCacheOpt )

Get the HW to LLVM conversion patterns.

Note: The spill cache may only be used when conversion pattern rollback is disabled.

◆ populateHWToLLVMTypeConversions()

void circt::populateHWToLLVMTypeConversions ( mlir::LLVMTypeConverter & converter,
mlir::DataLayout & layout )

Get the HW to LLVM type conversions.

Referenced by circt::impl::ConvertToLLVMPass::convertFuncOp().

◆ populateHWToSMTConversionPatterns()

void circt::populateHWToSMTConversionPatterns ( TypeConverter & converter,
RewritePatternSet & patterns,
bool forSMTLIBExport )

Get the HW to SMT conversion patterns.

Definition at line 370 of file HWToSMT.cpp.

◆ populateHWToSMTTypeConverter()

void circt::populateHWToSMTTypeConverter ( TypeConverter & converter)

Get the HW to SMT type conversions.

Definition at line 265 of file HWToSMT.cpp.

◆ populateLlhdToCorePipeline()

void circt::populateLlhdToCorePipeline ( mlir::OpPassManager & pm,
const LlhdToCorePipelineOptions & options )

◆ populateMooreToCorePipeline()

void circt::populateMooreToCorePipeline ( mlir::OpPassManager & pm)

Convert Moore dialect IR into core dialect IR.

◆ populateSMTToZ3LLVMConversionPatterns()

void circt::populateSMTToZ3LLVMConversionPatterns ( RewritePatternSet & patterns,
TypeConverter & converter,
SMTGlobalsHandler & globals,
const LowerSMTToZ3LLVMOptions & options )

Add the SMT to LLVM IR conversion patterns to 'patterns'.

A 'SMTGlobalHandler' object has to be passed which acts as a symbol cache for LLVM globals and functions.

◆ populateSMTToZ3LLVMTypeConverter()

void circt::populateSMTToZ3LLVMTypeConverter ( TypeConverter & converter)

Populate the given type converter with the SMT to LLVM type conversions.

◆ populateVerifToSMTConversionPatterns()

void circt::populateVerifToSMTConversionPatterns ( TypeConverter & converter,
RewritePatternSet & patterns,
Namespace & names,
bool risingClocksOnly,
SmallVectorImpl< Operation * > & propertylessBMCOps )

Get the Verif to SMT conversion patterns.

◆ populateVerilogToMoorePipeline()

void circt::populateVerilogToMoorePipeline ( mlir::OpPassManager & pm)

Optimize and simplify the Moore dialect IR.

◆ preprocessVerilog()

mlir::LogicalResult circt::preprocessVerilog ( llvm::SourceMgr & sourceMgr,
mlir::MLIRContext * context,
mlir::TimingScope & ts,
llvm::raw_ostream & os,
const ImportVerilogOptions * options = nullptr )

Run the files in a source manager through Slang's Verilog preprocessor and emit the result to the given output stream.

References context.

◆ printFieldList()

void circt::printFieldList ( AsmPrinter & p,
ArrayRef< FieldInfo > fields )

Print a list of fields within <>, e.g. <foo: i7, bar: i8>.

Definition at line 38 of file FieldInfo.cpp.

References circt::FieldInfo::name, and circt::FieldInfo::type.

◆ printFVInt()

void circt::printFVInt ( AsmPrinter & p,
const FVInt & value )

Print a four-valued integer usign an AsmPrinter.

This produces the following output formats:

  • Decimal notation if the integer has no unknown bits. The sign bit is used to determine whether the value is printed as negative number or not.
  • Hexadecimal notation with a leading h if the integer the bits in each hex digit are either all known, all X, or all Z.
  • Binary notation with a leading b in all other cases.

Definition at line 147 of file FVInt.cpp.

References circt::FVInt::getBitWidth(), circt::FVInt::isNegative(), and circt::FVInt::tryToString().

◆ printImplicitSSAName() [1/2]

void circt::printImplicitSSAName ( OpAsmPrinter & p,
Operation * op,
DictionaryAttr attrs,
ArrayRef< StringRef > extraElides = {} )

Print an attribute dictionary and elide the name field if its value matches the SSA name of the operation's first result.

Definition at line 91 of file CustomDirectiveImpl.cpp.

References attrs, and elideImplicitSSAName().

◆ printImplicitSSAName() [2/2]

void circt::printImplicitSSAName ( OpAsmPrinter & p,
Operation * op,
StringAttr attr )

Print an implicit SSA name string attribute.

If the given string attribute does not match the SSA name of the operation's first result, the name is explicitly printed. Prints a leading space in front of name if any name is present.

implicit-name ::= (name str-attr)?

Definition at line 73 of file CustomDirectiveImpl.cpp.

References isdigit.

◆ printImplicitSSANames()

void circt::printImplicitSSANames ( OpAsmPrinter & p,
Operation * op,
ArrayAttr attr )

Print an array of implicit SSA name string attributes.

The names are represented by the SSA result names and therefore require no additional output.

Definition at line 68 of file CustomDirectiveImpl.cpp.

◆ printInputPortList()

void circt::printInputPortList ( OpAsmPrinter & p,
Operation * op,
OperandRange inputs,
TypeRange inputTypes,
ArrayAttr inputNames )

Print a list of instance input ports.

Definition at line 42 of file CustomDirectiveImpl.cpp.

◆ printKeywordBool()

void circt::printKeywordBool ( OpAsmPrinter & printer,
Operation * op,
BoolAttr attr,
StringRef trueKeyword,
StringRef falseKeyword )

Print a boolean as one of two keywords.

If the boolean is true, the trueKeyword is used; if it is false, the falseKeyword is used.

labeled-bool ::= (true-label | false-label)

Definition at line 151 of file CustomDirectiveImpl.cpp.

◆ printOptionalBinaryOpTypes()

void circt::printOptionalBinaryOpTypes ( OpAsmPrinter & p,
Operation * op,
Type lhs,
Type rhs )

Print/parse binary operands type only when types are different.

optional-bin-op-types := type($lhs) (, type($rhs))?

Definition at line 128 of file CustomDirectiveImpl.cpp.

◆ printOptionalParameterList()

void circt::printOptionalParameterList ( OpAsmPrinter & p,
Operation * op,
ArrayAttr parameters )

Print a parameter list for a module or instance.

Definition at line 125 of file CustomDirectiveImpl.cpp.

Referenced by printModuleOp().

◆ printOutputPortList()

void circt::printOutputPortList ( OpAsmPrinter & p,
Operation * op,
TypeRange resultTypes,
ArrayAttr resultNames )

Print a list of instance output ports.

Definition at line 80 of file CustomDirectiveImpl.cpp.

◆ printVariadicInvertibleOperands()

void circt::printVariadicInvertibleOperands ( OpAsmPrinter & printer,
Operation * op,
OperandRange operands,
Type resultType,
mlir::DenseBoolArrayAttr inverted,
DictionaryAttr attrDict )

Print a variadic list of operands that may be prefixed with an optional not keyword.

If the corresponding element in isInverted is true, the not keyword is printed before the operand; otherwise, it is omitted.

Definition at line 184 of file CustomDirectiveImpl.cpp.

◆ registerAllDialects()

void circt::registerAllDialects ( mlir::DialectRegistry & registry)
inline

Definition at line 60 of file InitAllDialects.h.

◆ registerAllPasses()

void circt::registerAllPasses ( )
inline

◆ registerAllTranslations()

◆ registerFromVerilogTranslation()

void circt::registerFromVerilogTranslation ( )

Register the import-verilog MLIR translation.

Entry point as an MLIR translation.

Definition at line 453 of file ImportVerilog.cpp.

References context, circt::ImportVerilogOptions::debugInfo, importVerilog(), and circt::ImportVerilogOptions::warningOptions.

◆ removeElementsAtIndices()

template<typename T>
SmallVector< T > circt::removeElementsAtIndices ( ArrayRef< T > input,
const llvm::BitVector & indicesToDrop )
static

Remove elements from the input array corresponding to set bits in indicesToDrop, returning the elements not mentioned.

Definition at line 35 of file Utils.h.

References assert().

Referenced by cloneWithErasedPorts(), and erasePorts().

◆ replaceOpAndCopyNamehint()

void circt::replaceOpAndCopyNamehint ( PatternRewriter & rewriter,
Operation * op,
Value newValue )

A wrapper of PatternRewriter::replaceOp to propagate "sv.namehint" attribute.

If a replaced op has a "sv.namehint" attribute, this function propagates the name to the new value.

Definition at line 73 of file Naming.cpp.

Referenced by canonicalizeLogicalCstWithConcat(), canonicalizeXorIcmpTrue(), convertDivModUByPowerOfTwo(), emulateBinaryOpForUnknownBits(), extractOperandFromFullyAssociative(), foldCommonMuxOperation(), lowerVariadicAndInverterOpConversion(), OrOfMuxToMuxChain::matchAndRewrite(), and tryFlatteningOperands().

◆ replaceOpWithNewOpAndCopyNamehint()

template<typename OpTy, typename... Args>
OpTy circt::replaceOpWithNewOpAndCopyNamehint ( PatternRewriter & rewriter,
Operation * op,
Args &&... args )
static

A wrapper of PatternRewriter::replaceOpWithNewOp to propagate "sv.namehint" attribute.

If a replaced op has a "sv.namehint" attribute, this function propagates the name to the new value.

Definition at line 41 of file Naming.h.

Referenced by canonicalizeIdempotentInputs(), combineEqualityICmpWithKnownBitsAndConstant(), combineEqualityICmpWithXorOfConstant(), circt::comb::convertSubToAdd(), extractFromAdd(), extractFromReplicate(), foldCommonMuxOperation(), and matchAndRewriteCompareConcat().

◆ sextZeroWidth()

APInt circt::sextZeroWidth ( APInt value,
unsigned width )

A safe version of APInt::sext that will NOT assert on zero-width signed APSInts.

Instead of asserting, this will zero extend.

Definition at line 18 of file APInt.cpp.

◆ transformReduce() [1/2]

template<class IterTy, class ResultTy, class ReduceFuncTy, class TransformFuncTy>
ResultTy circt::transformReduce ( MLIRContext * context,
IterTy begin,
IterTy end,
ResultTy init,
ReduceFuncTy reduce,
TransformFuncTy transform )
static

Wrapper for llvm::parallelTransformReduce that performs the transform_reduce serially when MLIR multi-threading is disabled.

Does not add a ParallelDiagnosticHandler like mlir::parallelFor.

Definition at line 81 of file Utils.h.

References context.

Referenced by getAllBuriedRegs(), LowerLayersPass::runOnOperation(), ResolveTracesPass::runOnOperation(), and transformReduce().

◆ transformReduce() [2/2]

template<class RangeTy, class ResultTy, class ReduceFuncTy, class TransformFuncTy>
ResultTy circt::transformReduce ( MLIRContext * context,
RangeTy && r,
ResultTy init,
ReduceFuncTy reduce,
TransformFuncTy transform )
static

Range wrapper.

Definition at line 97 of file Utils.h.

References context, and transformReduce().

◆ verifyNotInNonProceduralRegion()

LogicalResult circt::verifyNotInNonProceduralRegion ( Operation * op)

Returns success if the operation has no closer surrounding parent marked as non-procedural region than its closest parent marked as procedural region.

Also returns success if no parent is marked as either procedural or non-procedural region.

Definition at line 26 of file ProceduralRegionTrait.cpp.

References success().

Referenced by circt::ProceduralOp< ConcreteType >::verifyTrait().

◆ verifyNotInProceduralRegion()

LogicalResult circt::verifyNotInProceduralRegion ( Operation * op)

Returns success if the operation has no closer surrounding parent marked as procedural region than its closest parent marked as non-procedural region.

Also returns success if no parent is marked as either procedural or non-procedural region.

Definition at line 15 of file ProceduralRegionTrait.cpp.

References success().

Referenced by circt::NonProceduralOp< ConcreteType >::verifyTrait().

Variable Documentation

◆ circtBugReportMsg

const char* circt::circtBugReportMsg
constexpr
Initial value:
=
"PLEASE submit a bug report to https://github.com/llvm/circt and include "
"the crash backtrace.\n"

A generic bug report message for CIRCT-related projects.

Definition at line 11 of file Version.h.