CIRCT  20.0.0git
Namespaces | Classes | Enumerations | Functions | Variables
circt Namespace Reference

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

Namespaces

 aig
 
 analysis
 
 arc
 
 calyx
 
 calyxToFSM
 
 chirrtl
 
 comb
 
 dc
 
 debug
 
 detail
 
 emit
 
 esi
 
 ExportSMTLIB
 
 ExportSystemC
 
 ExportVerilog
 
 firrtl
 
 firtool
 
 fsm
 
 handshake
 
 handshaketodc
 
 hw
 
 hwarith
 
 igraph
 
 ImportVerilog
 
 kanagawa
 
 llhd
 
 ltl
 
 moore
 
 msft
 
 om
 
 parsing_util
 
 pipeline
 
 pipelinetocalyx
 
 pretty
 
 python
 
 reduce
 
 rtg
 
 scfToCalyx
 
 scftocalyx
 
 scheduling
 
 seq
 
 sim
 
 smt
 
 ssp
 
 sv
 
 systemc
 
 test
 
 verif
 

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  ImportVerilogOptions
 Options that control how Verilog input files are parsed and processed. 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
 
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  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  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...
 
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...
 
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
 

Enumerations

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. More...
 
std::unique_ptr< mlir::Pass > createInsertMergeBlocksPass ()
 
void populateCombToArithConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns)
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertCombToArithPass ()
 
void populateCombToLLVMConversionPatterns (mlir::LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Get the Comb to LLVM conversion patterns. More...
 
void populateCombToSMTConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns)
 Get the HW to SMT conversion patterns. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertToArcsPass (const ConvertToArcsOptions &options={})
 
std::unique_ptr< mlir::Pass > createDCToHWPass ()
 
std::unique_ptr< mlir::Pass > createExportChiselInterfacePass (llvm::raw_ostream &os)
 
std::unique_ptr< mlir::Pass > createExportSplitChiselInterfacePass (mlir::StringRef outputDirectory="./")
 
std::unique_ptr< mlir::Pass > createExportChiselInterfacePass ()
 
std::unique_ptr< mlir::Pass > createTestApplyLoweringOptionPass (llvm::StringRef options)
 
std::unique_ptr< mlir::Pass > createTestApplyLoweringOptionPass ()
 
std::unique_ptr< mlir::Pass > createHWLowerInstanceChoicesPass ()
 
std::unique_ptr< mlir::Pass > createPrepareForEmissionPass ()
 
std::unique_ptr< mlir::Pass > createLegalizeAnonEnumsPass ()
 
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. More...
 
mlir::LogicalResult exportSplitVerilog (mlir::ModuleOp module, llvm::StringRef dirname)
 Export a module containing HW, and SV dialect code, as one file per SV module. More...
 
std::unique_ptr< mlir::Pass > createLowerFIRRTLToHWPass (bool enableAnnotationWarning=false, firrtl::VerificationFlavor assertionFlavor=firrtl::VerificationFlavor::None)
 This is the pass constructor. More...
 
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. More...
 
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)
 Get the HW to LLVM type conversions. More...
 
void populateHWToLLVMConversionPatterns (mlir::LLVMTypeConverter &converter, RewritePatternSet &patterns, Namespace &globals, DenseMap< std::pair< Type, ArrayAttr >, mlir::LLVM::GlobalOp > &constAggregateGlobalsMap)
 Get the HW to LLVM conversion patterns. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertHWToLLVMPass ()
 Create an HW to LLVM conversion pass. More...
 
void populateHWToSMTConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns)
 Get the HW to SMT conversion patterns. More...
 
void populateHWToSMTTypeConverter (TypeConverter &converter)
 Get the HW to SMT type conversions. More...
 
std::unique_ptr< mlir::OperationPass< hw::HWModuleOp > > createLowerHWToSVPass ()
 
std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > createConvertHWToSystemCPass ()
 Create a HW to SystemC dialects conversion pass. More...
 
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. More...
 
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. More...
 
void registerFromVerilogTranslation ()
 Register the import-verilog MLIR translation. More...
 
std::string getSlangVersion ()
 Return a human-readable string describing the slang frontend version linked into CIRCT. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createLoopScheduleToCalyxPass ()
 Create a LoopSchedule to Calyx conversion pass. More...
 
std::unique_ptr< mlir::Pass > createLowerLTLToCorePass ()
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertMooreToCorePass ()
 Create an Moore to Comb/HW/LLHD conversion pass. More...
 
std::unique_ptr< mlir::Pass > createPipelineToHWPass (const PipelineToHWOptions &options={})
 Create an SCF to Calyx conversion pass. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createSCFToCalyxPass ()
 Create an SCF to Calyx conversion pass. More...
 
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. More...
 
void populateSMTToZ3LLVMConversionPatterns (RewritePatternSet &patterns, TypeConverter &converter, SMTGlobalsHandler &globals, const LowerSMTToZ3LLVMOptions &options)
 Add the SMT to LLVM IR conversion patterns to 'patterns'. More...
 
void populateVerifToSMTConversionPatterns (TypeConverter &converter, RewritePatternSet &patterns, Namespace &names)
 Get the Verif to SMT conversion patterns. More...
 
std::unique_ptr< OperationPass< hw::HWModuleOp > > createLowerVerifToSVPass ()
 Create the Verif to SV conversion pass. More...
 
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. More...
 
void printInputPortList (OpAsmPrinter &p, Operation *op, OperandRange inputs, TypeRange inputTypes, ArrayAttr inputNames)
 Print a list of instance input ports. More...
 
ParseResult parseOutputPortList (OpAsmParser &parser, SmallVectorImpl< Type > &resultTypes, ArrayAttr &resultNames)
 Parse a list of instance output ports. More...
 
void printOutputPortList (OpAsmPrinter &p, Operation *op, TypeRange resultTypes, ArrayAttr resultNames)
 Print a list of instance output ports. More...
 
ParseResult parseOptionalParameterList (OpAsmParser &parser, ArrayAttr &parameters)
 Parse an parameter list if present. More...
 
void printOptionalParameterList (OpAsmPrinter &p, Operation *op, ArrayAttr parameters)
 Print a parameter list for a module or instance. More...
 
void registerAllDialects (mlir::DialectRegistry &registry)
 
void registerAllPasses ()
 
void registerAllTranslations ()
 
void populateGenericReducePatterns (MLIRContext *context, ReducePatternSet &patterns)
 Populate reduction patterns that are not specific to certain operations or dialects. More...
 
APInt sextZeroWidth (APInt value, unsigned width)
 A safe version of APInt::sext that will NOT assert on zero-width signed APSInts. More...
 
APSInt extOrTruncZeroWidth (APSInt value, unsigned width)
 A safe version of APSInt::extOrTrunc that will NOT assert on zero-width signed APSInts. More...
 
ParseResult parseImplicitSSAName (OpAsmParser &parser, StringAttr &attr)
 Parse an implicit SSA name string attribute. More...
 
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. More...
 
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. More...
 
void printImplicitSSAName (OpAsmPrinter &p, Operation *op, StringAttr attr)
 Print an implicit SSA name string attribute. More...
 
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. More...
 
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. More...
 
void printOptionalBinaryOpTypes (OpAsmPrinter &p, Operation *op, Type lhs, Type rhs)
 Print/parse binary operands type only when types are different. More...
 
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. More...
 
void printKeywordBool (OpAsmPrinter &printer, Operation *op, BoolAttr attr, StringRef trueKeyword, StringRef falseKeyword)
 Print a boolean as one of two keywords. More...
 
llvm::raw_ostream & debugHeader (llvm::StringRef str, int width=80)
 Write a "header"-like string to the debug stream with a certain width. More...
 
llvm::raw_ostream & debugPassHeader (const mlir::Pass *pass, int width=80)
 Write a boilerplate header for a pass to the debug stream. More...
 
llvm::raw_ostream & debugFooter (int width=80)
 Write a boilerplate footer to the debug stream to indicate that a pass has ended. More...
 
inline ::llvm::hash_code hash_value (const FieldRef &fieldRef)
 Get a hash code for a FieldRef. More...
 
static std::optional< APInt > getConstantInt (Attribute operand)
 Determine the integer value of a constant operand. More...
 
static bool isConstantZero (Attribute operand)
 Determine whether a constant operand is a zero value. More...
 
static bool isConstantOne (Attribute operand)
 Determine whether a constant operand is a one value. More...
 
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. More...
 
ParseResult parseFVInt (AsmParser &p, FVInt &result)
 Parse a four-valued integer using an AsmParser. More...
 
LogicalResult convertAttributeToJSON (llvm::json::OStream &json, Attribute attr)
 Convert a simple attribute to JSON. More...
 
Attribute convertJSONToAttribute (MLIRContext *context, llvm::json::Value &value, llvm::json::Path p)
 Convert arbitrary JSON to an MLIR Attribute. More...
 
bool isUselessName (StringRef name)
 Return true if this is a possibly useless temporary name. More...
 
StringRef chooseName (StringRef a, StringRef b)
 Choose a good name for an item from two options. More...
 
StringAttr chooseName (StringAttr a, StringAttr b)
 Choose a good name for an item from two options. More...
 
StringAttr chooseName (Operation *a, Operation *b)
 Choose the better name between two ops. More...
 
std::unique_ptr< Pass > createSimpleCanonicalizerPass ()
 Create a simple canonicalizer pass. More...
 
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. More...
 
bool isAncestorOfValueOwner (Operation *op, Value value)
 Return true if a Value is created "underneath" an operation. More...
 
const char * getCirctVersion ()
 
const char * getCirctVersionComment ()
 
std::unique_ptr< mlir::Pass > createMapArithToCombPass ()
 
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. More...
 
std::unique_ptr< mlir::Pass > createMaximizeSSAPass ()
 
std::unique_ptr< mlir::Pass > createPrintOpCountPass ()
 
std::unique_ptr< mlir::Pass > createMemoryBankingPass (std::optional< unsigned > bankingFactor=std::nullopt)
 
std::unique_ptr< mlir::Pass > createIndexSwitchToIfPass ()
 
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. More...
 
LogicalResult maximizeSSA (Operation *op, SSAMaximizationStrategy &strategy, PatternRewriter &rewriter)
 Considers all of an operation's results for SSA maximization, following a provided strategy. More...
 
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. More...
 
LogicalResult maximizeSSA (Region &region, SSAMaximizationStrategy &strategy, PatternRewriter &rewriter)
 Considers all blocks within a region for SSA maximization, following a provided strategy. More...
 
std::unique_ptr< mlir::Pass > createPrintOpCountPass (llvm::raw_ostream &os)
 

Variables

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

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

Enumeration Type Documentation

◆ OpCountEmissionFormat

Enumerator
Readable 
ReadableSorted 
JSON 

Definition at line 30 of file Passes.h.

Function Documentation

◆ 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 23 of file Path.cpp.

References append().

Referenced by 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().

◆ convertAttributeToJSON()

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

Convert a simple attribute to JSON.

Definition at line 25 of file JSON.cpp.

◆ convertJSONToAttribute()

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

Convert arbitrary JSON to an MLIR Attribute.

◆ createAffineToLoopSchedule()

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

Definition at line 651 of file AffineToLoopSchedule.cpp.

◆ 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 406 of file CalyxToFSM.cpp.

◆ createCalyxToHWPass()

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

Definition at line 486 of file CalyxToHW.cpp.

◆ createCFToHandshakePass()

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

Definition at line 1769 of file CFToHandshake.cpp.

◆ createConvertCombToArithPass()

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

Definition at line 343 of file CombToArith.cpp.

◆ createConvertFSMToSVPass()

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

Definition at line 748 of file FSMToSV.cpp.

◆ createConvertHWToBTOR2Pass() [1/2]

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

Definition at line 1049 of file HWToBTOR2.cpp.

◆ createConvertHWToBTOR2Pass() [2/2]

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

Definition at line 1044 of file HWToBTOR2.cpp.

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

◆ createConvertHWToLLVMPass()

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

Create an HW to LLVM conversion pass.

Definition at line 691 of file HWToLLVM.cpp.

◆ createConvertHWToSystemCPass()

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

Create a HW to SystemC dialects conversion pass.

Definition at line 344 of file HWToSystemC.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 1755 of file MooreToCore.cpp.

◆ createConvertToArcsPass()

std::unique_ptr< OperationPass< ModuleOp > > circt::createConvertToArcsPass ( const ConvertToArcsOptions &  options = {})

Definition at line 521 of file ConvertToArcs.cpp.

◆ createDCToHWPass()

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

Definition at line 914 of file DCToHW.cpp.

◆ createExportChiselInterfacePass() [1/2]

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

Definition at line 325 of file ExportChiselInterface.cpp.

References createExportChiselInterfacePass().

◆ createExportChiselInterfacePass() [2/2]

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

◆ createExportSplitChiselInterfacePass()

std::unique_ptr< mlir::Pass > circt::createExportSplitChiselInterfacePass ( mlir::StringRef  outputDirectory = "./")

◆ createExportSplitVerilogPass()

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

◆ createExportVerilogPass() [1/3]

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

Definition at line 7050 of file ExportVerilog.cpp.

References createExportVerilogPass().

◆ createExportVerilogPass() [2/3]

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

Definition at line 7046 of file ExportVerilog.cpp.

◆ createExportVerilogPass() [3/3]

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

◆ createFlattenMemRefCallsPass()

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

Definition at line 469 of file FlattenMemRefs.cpp.

◆ createFlattenMemRefPass()

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

Definition at line 465 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 1776 of file CFToHandshake.cpp.

◆ createHandshakeToHWPass()

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

Definition at line 2031 of file HandshakeToHW.cpp.

◆ createHWArithToHWPass()

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

Definition at line 464 of file HWArithToHW.cpp.

◆ createHWLowerInstanceChoicesPass()

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

Definition at line 115 of file HWLowerInstanceChoices.cpp.

◆ createIndexSwitchToIfPass()

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

Definition at line 113 of file IndexSwitchToIf.cpp.

◆ createInsertMergeBlocksPass()

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

Definition at line 375 of file InsertMergeBlocks.cpp.

◆ createLegalizeAnonEnumsPass()

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

Definition at line 209 of file LegalizeAnonEnums.cpp.

◆ createLoopScheduleToCalyxPass()

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

Create a LoopSchedule to Calyx conversion pass.

Definition at line 1671 of file LoopScheduleToCalyx.cpp.

◆ createLowerArcToLLVMPass()

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

Definition at line 689 of file LowerArcToLLVM.cpp.

◆ createLowerFirMemPass()

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

Definition at line 84 of file LowerFirMem.cpp.

◆ createLowerFIRRTLToHWPass()

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

This is the pass constructor.

Definition at line 583 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 166 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 845 of file SeqToSV.cpp.

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

◆ createLowerSimToSVPass()

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

Definition at line 370 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 ( )

Definition at line 194 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 ( std::optional< unsigned >  bankingFactor = std::nullopt)

Definition at line 393 of file MemoryBanking.cpp.

◆ createPipelineToHWPass()

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

Create an SCF to Calyx conversion pass.

Definition at line 503 of file PipelineToHW.cpp.

◆ createPrepareForEmissionPass()

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

Definition at line 1376 of file PrepareForEmission.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 314 of file RemoveGroupsFromFSM.cpp.

◆ createSCFToCalyxPass()

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

Create an SCF to Calyx conversion pass.

Definition at line 2846 of file SCFToCalyx.cpp.

◆ createSimpleCanonicalizerPass()

std::unique_ptr< Pass > circt::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.

Referenced by detail::populatePrepareForExportVerilog().

◆ createTestApplyLoweringOptionPass() [1/2]

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

Definition at line 46 of file ApplyLoweringOptions.cpp.

◆ createTestApplyLoweringOptionPass() [2/2]

std::unique_ptr<mlir::Pass> circt::createTestApplyLoweringOptionPass ( llvm::StringRef  options)

◆ debugFooter()

llvm::raw_ostream & circt::debugFooter ( int  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 35 of file Debug.cpp.

◆ debugHeader()

llvm::raw_ostream & circt::debugHeader ( llvm::StringRef  str,
int  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 18 of file Debug.cpp.

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

◆ debugPassHeader()

llvm::raw_ostream & circt::debugPassHeader ( const mlir::Pass *  pass,
int  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().

◆ 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 81 of file CustomDirectiveImpl.cpp.

References 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().

◆ getCirctVersion()

const char* circt::getCirctVersion ( )

◆ getCirctVersionComment()

const char* circt::getCirctVersionComment ( )

◆ getConstantInt()

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

Determine the integer value of a constant operand.

Definition at line 18 of file FoldUtils.h.

Referenced by isConstantOne(), and isConstantZero().

◆ getSlangVersion()

std::string circt::getSlangVersion ( )

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

Definition at line 34 of file ImportVerilog.cpp.

◆ hash_value() [1/2]

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

◆ hash_value() [2/2]

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

◆ 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.

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 40 of file CustomDirectiveImpl.cpp.

References circt::calyx::direction::get(), 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 25 of file Utils.h.

Referenced by LowerLayersPass::runOnModuleBody().

◆ isConstantOne()

static bool circt::isConstantOne ( Attribute  operand)
inlinestatic

Determine whether a constant operand is a one value.

Definition at line 34 of file FoldUtils.h.

References getConstantInt().

◆ isConstantZero()

static bool circt::isConstantZero ( Attribute  operand)
inlinestatic

Determine whether a constant operand is a zero value.

Definition at line 27 of file FoldUtils.h.

References getConstantInt().

Referenced by eraseIfPredFalse().

◆ 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().

◆ 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 maximizeSSA(), and strategy.

◆ 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 maximizeSSA(), and strategy.

◆ 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 maximizeSSA(), and strategy.

◆ 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(), and getDefiningBlock().

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

◆ operator!=()

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

Definition at line 651 of file FVInt.h.

◆ operator&() [1/2]

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

Definition at line 638 of file FVInt.h.

◆ operator&() [2/2]

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

Definition at line 632 of file FVInt.h.

◆ operator*() [1/2]

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

Definition at line 642 of file FVInt.h.

◆ operator*() [2/2]

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

Definition at line 636 of file FVInt.h.

◆ operator+() [1/2]

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

Definition at line 641 of file FVInt.h.

◆ operator+() [2/2]

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

Definition at line 635 of file FVInt.h.

◆ operator-() [1/2]

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

Definition at line 648 of file FVInt.h.

◆ operator-() [2/2]

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

Definition at line 644 of file FVInt.h.

References circt::FVInt::getBitWidth().

◆ operator<<()

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

Definition at line 653 of file FVInt.h.

References circt::FVInt::print().

◆ operator==()

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

Definition at line 650 of file FVInt.h.

◆ operator^() [1/2]

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

Definition at line 640 of file FVInt.h.

◆ operator^() [2/2]

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

Definition at line 634 of file FVInt.h.

◆ operator|() [1/2]

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

Definition at line 639 of file FVInt.h.

◆ operator|() [2/2]

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

Definition at line 633 of file FVInt.h.

◆ 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 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 32 of file CustomDirectiveImpl.cpp.

References inferImplicitSSAName().

◆ 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 isdigit.

◆ 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 circt::calyx::direction::get(), and parseInputPort().

◆ 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 118 of file CustomDirectiveImpl.cpp.

References circt::calyx::direction::get().

◆ parseOptionalBinaryOpTypes()

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

Definition at line 95 of file CustomDirectiveImpl.cpp.

◆ 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 circt::calyx::direction::get().

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 circt::calyx::direction::get().

◆ populateCombToArithConversionPatterns()

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

◆ populateCombToLLVMConversionPatterns()

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

Get the Comb to LLVM conversion patterns.

◆ populateCombToSMTConversionPatterns()

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

Get the HW to SMT conversion patterns.

Definition at line 261 of file CombToSMT.cpp.

◆ populateGenericReducePatterns()

void circt::populateGenericReducePatterns ( MLIRContext *  context,
ReducePatternSet patterns 
)

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

Definition at line 56 of file GenericReductions.cpp.

References createSimpleCanonicalizerPass().

◆ populateHWArithToHWConversionPatterns()

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

Get the HWArith to HW conversion patterns.

Definition at line 421 of file HWArithToHW.cpp.

◆ populateHWToLLVMConversionPatterns()

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

Get the HW to LLVM conversion patterns.

◆ populateHWToLLVMTypeConversions()

void circt::populateHWToLLVMTypeConversions ( mlir::LLVMTypeConverter &  converter)

Get the HW to LLVM type conversions.

◆ populateHWToSMTConversionPatterns()

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

Get the HW to SMT conversion patterns.

Definition at line 284 of file HWToSMT.cpp.

◆ populateHWToSMTTypeConverter()

void circt::populateHWToSMTTypeConverter ( TypeConverter &  converter)

Get the HW to SMT type conversions.

Definition at line 181 of file HWToSMT.cpp.

References circt::calyx::direction::get().

◆ 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.

Definition at line 1268 of file LowerSMTToZ3LLVM.cpp.

References ADD_ONE_TO_ONE_PATTERN, and ADD_VARIADIC_PATTERN.

◆ populateSMTToZ3LLVMTypeConverter()

void circt::populateSMTToZ3LLVMTypeConverter ( TypeConverter &  converter)

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

Definition at line 1247 of file LowerSMTToZ3LLVM.cpp.

References circt::calyx::direction::get().

◆ populateVerifToSMTConversionPatterns()

void circt::populateVerifToSMTConversionPatterns ( TypeConverter &  converter,
RewritePatternSet &  patterns,
Namespace names 
)

Get the Verif to SMT conversion patterns.

Definition at line 425 of file VerifToSMT.cpp.

◆ 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.

◆ 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 73 of file CustomDirectiveImpl.cpp.

References 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 55 of file CustomDirectiveImpl.cpp.

References isdigit.

◆ 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 133 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 110 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.

◆ registerAllDialects()

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

Definition at line 56 of file InitAllDialects.h.

◆ registerAllPasses()

void circt::registerAllPasses ( )
inline

Definition at line 48 of file InitAllPasses.h.

References circt::esi::registerESIPasses(), and registerPasses().

◆ registerAllTranslations()

void circt::registerAllTranslations ( )
inline

◆ registerFromVerilogTranslation()

void circt::registerFromVerilogTranslation ( )

Register the import-verilog MLIR translation.

Entry point as an MLIR translation.

Definition at line 383 of file ImportVerilog.cpp.

References circt::ImportVerilogOptions::debugInfo, circt::calyx::direction::get(), and importVerilog().

◆ 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.

Variable Documentation

◆ circtBugReportMsg

constexpr 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.