CIRCT  18.0.0git
Macros | Functions
FIRRTLOps.cpp File Reference
#include "circt/Dialect/FIRRTL/FIRRTLOps.h"
#include "circt/Dialect/FIRRTL/CHIRRTLDialect.h"
#include "circt/Dialect/FIRRTL/FIRRTLAnnotations.h"
#include "circt/Dialect/FIRRTL/FIRRTLAttributes.h"
#include "circt/Dialect/FIRRTL/FIRRTLTypes.h"
#include "circt/Dialect/FIRRTL/FIRRTLUtils.h"
#include "circt/Dialect/FIRRTL/FIRRTLVisitors.h"
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Dialect/HW/HWTypes.h"
#include "circt/Support/CustomDirectiveImpl.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/FormatVariadic.h"
#include "circt/Dialect/FIRRTL/FIRRTL.cpp.inc"
Include dependency graph for FIRRTLOps.cpp:

Go to the source code of this file.

Macros

#define GET_OP_CLASSES
 

Functions

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. More...
 
template<typename RetTy = FIRRTLType, typename... Args>
static RetTy emitInferRetTypeError (std::optional< Location > loc, const Twine &message, Args &&...args)
 Emit an error if optional location is non-null, return null of return type. More...
 
static MemOp::PortKind getMemPortKindFromType (FIRRTLType type)
 Return the kind of port this is given the port type from a 'mem' decl. More...
 
constexpr const char * toString (Flow flow)
 
void getAsmBlockArgumentNamesImpl (Operation *op, mlir::Region &region, OpAsmSetValueNameFn setNameFn)
 Get a special name to use when printing the entry block arguments of the region contained by an operation in this dialect. More...
 
static ParseResult parseNameKind (OpAsmParser &parser, firrtl::NameKindEnumAttr &result)
 A forward declaration for NameKind attribute parser. More...
 
static ParseResult parseCircuitOpAttrs (OpAsmParser &parser, NamedAttrList &resultAttrs)
 
static void printCircuitOpAttrs (OpAsmPrinter &p, Operation *op, DictionaryAttr attr)
 
static SmallVector< PortInfogetPortImpl (FModuleLike module)
 
static hw::ModulePort::Direction dirFtoH (Direction dir)
 
static SmallVector< hw::PortInfo > getPortListImpl (FModuleLike module)
 
static hw::PortInfo getPortImpl (FModuleLike module, size_t idx)
 
static void insertPorts (FModuleLike op, ArrayRef< std::pair< unsigned, PortInfo >> ports, bool supportsInternalPaths=false)
 Inserts the given ports. More...
 
static void erasePorts (FModuleLike op, const llvm::BitVector &portIndices)
 Erases the ports that have their corresponding bit set in portIndices. More...
 
template<typename T >
static void eraseInternalPaths (T op, const llvm::BitVector &portIndices)
 
static void buildModule (OpBuilder &builder, OperationState &result, StringAttr name, ArrayRef< PortInfo > ports, ArrayAttr annotations, bool withAnnotations=true)
 
static void buildModuleWithoutAnnos (OpBuilder &builder, OperationState &result, StringAttr name, ArrayRef< PortInfo > ports)
 
static bool printModulePorts (OpAsmPrinter &p, Block *block, ArrayRef< Direction > portDirections, ArrayRef< Attribute > portNames, ArrayRef< Attribute > portTypes, ArrayRef< Attribute > portAnnotations, ArrayRef< Attribute > portSyms, ArrayRef< Attribute > portLocs)
 Print a list of module ports in the following form: in x: !firrtl.uint<1> [{class = "DontTouch}], out "_port": !firrtl.uint<2> More...
 
static ParseResult parseModulePorts (OpAsmParser &parser, bool hasSSAIdentifiers, bool supportsSymbols, SmallVectorImpl< OpAsmParser::Argument > &entryArgs, SmallVectorImpl< Direction > &portDirections, SmallVectorImpl< Attribute > &portNames, SmallVectorImpl< Attribute > &portTypes, SmallVectorImpl< Attribute > &portAnnotations, SmallVectorImpl< Attribute > &portSyms, SmallVectorImpl< Attribute > &portLocs)
 Parse a list of module ports. More...
 
static void printParameterList (ArrayAttr parameters, OpAsmPrinter &p)
 Print a paramter list for a module or instance. More...
 
static void printFModuleLikeOp (OpAsmPrinter &p, FModuleLike op)
 
static ParseResult parseOptionalParameters (OpAsmParser &parser, SmallVectorImpl< Attribute > &parameters)
 Parse an parameter list if present. More...
 
static ParseResult parseFModuleLikeOp (OpAsmParser &parser, OperationState &result, bool hasSSAIdentifiers)
 
static LogicalResult verifyInternalPaths (FModuleLike op, std::optional<::mlir::ArrayAttr > internalPaths)
 
static LogicalResult verifyPortSymbolUses (FModuleLike module, SymbolTableCollection &symbolTable)
 
static ParseResult parseClassLike (OpAsmParser &parser, OperationState &result, bool hasSSAIdentifiers)
 
static void printClassLike (OpAsmPrinter &p, ClassLike op)
 
static size_t getAddressWidth (size_t depth)
 
static void forceableAsmResultNames (Forceable op, StringRef name, OpAsmSetValueNameFn setNameFn)
 Helper for naming forceable declarations (and their optional ref result). More...
 
static LogicalResult checkConnectFlow (Operation *connect)
 Check if the source and sink are of appropriate flow. More...
 
static bool isConstFieldDriven (FIRRTLBaseType type, bool isFlip=false, bool outerTypeIsConst=false)
 Checks if the type has any 'const' leaf elements . More...
 
static LogicalResult checkConnectConditionality (FConnectLike connect)
 Checks that connections to 'const' destinations are not dependent on non-'const' conditions in when blocks. More...
 
static Attribute getAttr (ArrayRef< NamedAttribute > attrs, StringRef name)
 Get an attribute by name from a list of named attributes. More...
 
static bool checkAggConstant (Operation *op, Attribute attr, FIRRTLBaseType type)
 
template<typename OpTy >
ParseResult parseSubfieldLikeOp (OpAsmParser &parser, OperationState &result)
 
template<typename OpTy >
static void printSubfieldLikeOp (OpTy op, ::mlir::OpAsmPrinter &printer)
 
template<typename OpTy >
static LogicalResult verifySubfieldLike (OpTy op)
 
static bool isSameIntTypeKind (Type lhs, Type rhs, int32_t &lhsWidth, int32_t &rhsWidth, bool &isConstResult, std::optional< Location > loc)
 If LHS and RHS are both UInt or SInt types, the return true and fill in the width of them if known. More...
 
static FIRRTLBaseType inferMuxReturnType (FIRRTLBaseType high, FIRRTLBaseType low, bool isConstCondition, std::optional< Location > loc)
 Infer the result type for a multiplexer given its two operand types, which may be aggregates. More...
 
static ParseResult parseElideAnnotations (OpAsmParser &parser, NamedAttrList &resultAttrs)
 Parse an optional attribute dictionary, adding an empty 'annotations' attribute if not specified. More...
 
static void printElideAnnotations (OpAsmPrinter &p, Operation *op, DictionaryAttr attr, ArrayRef< StringRef > extraElides={})
 
static ParseResult parseElidePortAnnotations (OpAsmParser &parser, NamedAttrList &resultAttrs)
 Parse an optional attribute dictionary, adding empty 'annotations' and 'portAnnotations' attributes if not specified. More...
 
static void printElidePortAnnotations (OpAsmPrinter &p, Operation *op, DictionaryAttr attr, ArrayRef< StringRef > extraElides={})
 
static void printNameKind (OpAsmPrinter &p, Operation *op, firrtl::NameKindEnumAttr attr, ArrayRef< StringRef > extraElides={})
 
static ParseResult parseFIRRTLImplicitSSAName (OpAsmParser &parser, NamedAttrList &resultAttrs)
 
static void printFIRRTLImplicitSSAName (OpAsmPrinter &p, Operation *op, DictionaryAttr attrs)
 
static ParseResult parseMemOp (OpAsmParser &parser, NamedAttrList &resultAttrs)
 
static void printMemOp (OpAsmPrinter &p, Operation *op, DictionaryAttr attr)
 Always elide "ruw" and elide "annotations" if it exists or if it is empty. More...
 
static ParseResult parseClassInterface (OpAsmParser &parser, Type &result)
 
static void printClassInterface (OpAsmPrinter &p, Operation *, ClassType type)
 
static ParseResult parseElideEmptyName (OpAsmParser &p, NamedAttrList &resultAttrs)
 
static void printElideEmptyName (OpAsmPrinter &p, Operation *op, DictionaryAttr attr, ArrayRef< StringRef > extraElides={})
 
static ParseResult parsePrintfAttrs (OpAsmParser &p, NamedAttrList &resultAttrs)
 
static void printPrintfAttrs (OpAsmPrinter &p, Operation *op, DictionaryAttr attr)
 
static ParseResult parseStopAttrs (OpAsmParser &p, NamedAttrList &resultAttrs)
 
static void printStopAttrs (OpAsmPrinter &p, Operation *op, DictionaryAttr attr)
 
static ParseResult parseVerifAttrs (OpAsmParser &p, NamedAttrList &resultAttrs)
 
static void printVerifAttrs (OpAsmPrinter &p, Operation *op, DictionaryAttr attr)
 
static void genericAsmResultNames (Operation *op, OpAsmSetValueNameFn setNameFn)
 

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 5694 of file FIRRTLOps.cpp.

Function Documentation

◆ buildModule()

static void buildModule ( OpBuilder &  builder,
OperationState &  result,
StringAttr  name,
ArrayRef< PortInfo ports,
ArrayAttr  annotations,
bool  withAnnotations = true 
)
static

◆ buildModuleWithoutAnnos()

static void buildModuleWithoutAnnos ( OpBuilder &  builder,
OperationState &  result,
StringAttr  name,
ArrayRef< PortInfo ports 
)
static

Definition at line 870 of file FIRRTLOps.cpp.

References builder, and buildModule().

◆ checkAggConstant()

static bool checkAggConstant ( Operation *  op,
Attribute  attr,
FIRRTLBaseType  type 
)
static

Definition at line 3642 of file FIRRTLOps.cpp.

◆ checkConnectConditionality()

static LogicalResult checkConnectConditionality ( FConnectLike  connect)
static

Checks that connections to 'const' destinations are not dependent on non-'const' conditions in when blocks.

Looks up the value's defining op until the defining op is null or a declaration of the value. If a SubAccessOp is encountered with a 'const' input, originalFieldType is made 'const'.

Definition at line 3041 of file FIRRTLOps.cpp.

References Python.support::connect(), isConstFieldDriven(), and value.

◆ checkConnectFlow()

static LogicalResult checkConnectFlow ( Operation *  connect)
static

◆ dirFtoH()

static hw::ModulePort::Direction dirFtoH ( Direction  dir)
static

Definition at line 526 of file FIRRTLOps.cpp.

References assert(), circt::firrtl::In, Input, circt::firrtl::Out, and Output.

Referenced by getPortImpl(), and getPortListImpl().

◆ emitInferRetTypeError()

template<typename RetTy = FIRRTLType, typename... Args>
static RetTy emitInferRetTypeError ( std::optional< Location >  loc,
const Twine &  message,
Args &&...  args 
)
static

Emit an error if optional location is non-null, return null of return type.

Definition at line 90 of file FIRRTLOps.cpp.

◆ eraseInternalPaths()

template<typename T >
static void eraseInternalPaths ( op,
const llvm::BitVector &  portIndices 
)
static

Definition at line 749 of file FIRRTLOps.cpp.

References empty, circt::calyx::direction::get(), and removeElementsAtIndices().

◆ erasePorts()

static void erasePorts ( FModuleLike  op,
const llvm::BitVector &  portIndices 
)
static

Erases the ports that have their corresponding bit set in portIndices.

Definition at line 708 of file FIRRTLOps.cpp.

References assert(), circt::calyx::direction::get(), circt::calyx::direction::packAttribute(), removeElementsAtIndices(), and circt::firrtl::direction::unpackAttribute().

◆ forceableAsmResultNames()

static void forceableAsmResultNames ( Forceable  op,
StringRef  name,
OpAsmSetValueNameFn  setNameFn 
)
static

Helper for naming forceable declarations (and their optional ref result).

Definition at line 2822 of file FIRRTLOps.cpp.

◆ genericAsmResultNames()

static void genericAsmResultNames ( Operation *  op,
OpAsmSetValueNameFn  setNameFn 
)
static

Definition at line 5266 of file FIRRTLOps.cpp.

◆ getAddressWidth()

static size_t getAddressWidth ( size_t  depth)
static

Definition at line 2569 of file FIRRTLOps.cpp.

◆ getAsmBlockArgumentNamesImpl()

void getAsmBlockArgumentNamesImpl ( Operation *  op,
mlir::Region &  region,
OpAsmSetValueNameFn  setNameFn 
)

Get a special name to use when printing the entry block arguments of the region contained by an operation in this dialect.

Definition at line 298 of file FIRRTLOps.cpp.

◆ getAttr()

static Attribute getAttr ( ArrayRef< NamedAttribute >  attrs,
StringRef  name 
)
static

Get an attribute by name from a list of named attributes.

Same as above, but casts the attribute to a specific type.

Aborts if the attribute does not exist.

Definition at line 3429 of file FIRRTLOps.cpp.

Referenced by omClassTypeGetName(), omEvaluatorValueGetPrimitive(), and StructuralHasher::update().

◆ getMemPortKindFromType()

static MemOp::PortKind getMemPortKindFromType ( FIRRTLType  type)
static

Return the kind of port this is given the port type from a 'mem' decl.

Definition at line 115 of file FIRRTLOps.cpp.

References circt::firrtl::addr, circt::firrtl::clk, circt::firrtl::data, circt::firrtl::en, circt::firrtl::mask, circt::firrtl::rdata, circt::firrtl::wdata, circt::firrtl::wmask, and circt::firrtl::wmode.

◆ getPortImpl() [1/2]

static SmallVector<PortInfo> getPortImpl ( FModuleLike  module)
static

Definition at line 507 of file FIRRTLOps.cpp.

References circt::firrtl::AnnotationSet::forPort().

◆ getPortImpl() [2/2]

static hw::PortInfo getPortImpl ( FModuleLike  module,
size_t  idx 
)
static

Definition at line 571 of file FIRRTLOps.cpp.

References dirFtoH(), and circt::calyx::direction::get().

◆ getPortListImpl()

static SmallVector<hw::PortInfo> getPortListImpl ( FModuleLike  module)
static

◆ inferMuxReturnType()

static FIRRTLBaseType inferMuxReturnType ( FIRRTLBaseType  high,
FIRRTLBaseType  low,
bool  isConstCondition,
std::optional< Location >  loc 
)
static

Infer the result type for a multiplexer given its two operand types, which may be aggregates.

This essentially performs a pairwise comparison of fields and elements, as follows:

  • Identical operands inferred to their common type
  • Integer operands inferred to the larger one if both have a known width, a widthless integer otherwise.
  • Vectors inferred based on the element type.
  • Bundles inferred in a pairwise fashion based on the field types.

Definition at line 4767 of file FIRRTLOps.cpp.

References circt::calyx::direction::get(), circt::firrtl::FIRRTLBaseType::getAllConstDroppedType(), circt::firrtl::FIRRTLBaseType::getBitWidthOrSentinel(), circt::firrtl::FIRRTLBaseType::getConstType(), circt::firrtl::FIRRTLBaseType::isConst(), and numElements.

◆ insertPorts()

static void insertPorts ( FModuleLike  op,
ArrayRef< std::pair< unsigned, PortInfo >>  ports,
bool  supportsInternalPaths = false 
)
static

Inserts the given ports.

The insertion indices are expected to be in order. Insertion occurs in-order, such that ports with the same insertion index appear in the module in the same order they appeared in the list.

Definition at line 608 of file FIRRTLOps.cpp.

References assert(), empty, circt::calyx::direction::get(), circt::calyx::direction::packAttribute(), and circt::firrtl::direction::unpackAttribute().

◆ isConstFieldDriven()

static bool isConstFieldDriven ( FIRRTLBaseType  type,
bool  isFlip = false,
bool  outerTypeIsConst = false 
)
static

Checks if the type has any 'const' leaf elements .

If isFlip is true, the const leaf is not considered to be driven.

Definition at line 3017 of file FIRRTLOps.cpp.

References circt::firrtl::FIRRTLBaseType::isConst(), and circt::firrtl::FIRRTLBaseType::isPassive().

Referenced by checkConnectConditionality().

◆ isSameIntTypeKind()

static bool isSameIntTypeKind ( Type  lhs,
Type  rhs,
int32_t &  lhsWidth,
int32_t &  rhsWidth,
bool &  isConstResult,
std::optional< Location >  loc 
)
static

If LHS and RHS are both UInt or SInt types, the return true and fill in the width of them if known.

If unknown, return -1 for the widths. The constness of the result is also returned, where if both lhs and rhs are const, then the result is const.

On failure, this reports and error and returns false. This function should not be used if you don't want an error reported.

Definition at line 4366 of file FIRRTLOps.cpp.

Referenced by circt::firrtl::impl::inferAddSubResult(), circt::firrtl::impl::inferBitwiseResult(), and circt::firrtl::impl::verifySameOperandsIntTypeKind().

◆ parseCircuitOpAttrs()

static ParseResult parseCircuitOpAttrs ( OpAsmParser &  parser,
NamedAttrList &  resultAttrs 
)
static

Definition at line 348 of file FIRRTLOps.cpp.

◆ parseClassInterface()

static ParseResult parseClassInterface ( OpAsmParser &  parser,
Type &  result 
)
static

Definition at line 5199 of file FIRRTLOps.cpp.

◆ parseClassLike()

static ParseResult parseClassLike ( OpAsmParser &  parser,
OperationState &  result,
bool  hasSSAIdentifiers 
)
static

◆ parseElideAnnotations()

static ParseResult parseElideAnnotations ( OpAsmParser &  parser,
NamedAttrList &  resultAttrs 
)
static

Parse an optional attribute dictionary, adding an empty 'annotations' attribute if not specified.

Definition at line 5083 of file FIRRTLOps.cpp.

Referenced by parseElidePortAnnotations(), and parseFIRRTLImplicitSSAName().

◆ parseElideEmptyName()

static ParseResult parseElideEmptyName ( OpAsmParser &  p,
NamedAttrList &  resultAttrs 
)
static

Definition at line 5215 of file FIRRTLOps.cpp.

Referenced by parsePrintfAttrs(), parseStopAttrs(), and parseVerifAttrs().

◆ parseElidePortAnnotations()

static ParseResult parseElidePortAnnotations ( OpAsmParser &  parser,
NamedAttrList &  resultAttrs 
)
static

Parse an optional attribute dictionary, adding empty 'annotations' and 'portAnnotations' attributes if not specified.

Definition at line 5107 of file FIRRTLOps.cpp.

References parseElideAnnotations().

Referenced by parseMemOp().

◆ parseFIRRTLImplicitSSAName()

static ParseResult parseFIRRTLImplicitSSAName ( OpAsmParser &  parser,
NamedAttrList &  resultAttrs 
)
static

Definition at line 5164 of file FIRRTLOps.cpp.

References circt::inferImplicitSSAName(), and parseElideAnnotations().

◆ parseFModuleLikeOp()

static ParseResult parseFModuleLikeOp ( OpAsmParser &  parser,
OperationState &  result,
bool  hasSSAIdentifiers 
)
static

Definition at line 1248 of file FIRRTLOps.cpp.

◆ parseMemOp()

static ParseResult parseMemOp ( OpAsmParser &  parser,
NamedAttrList &  resultAttrs 
)
static

Definition at line 5185 of file FIRRTLOps.cpp.

References parseElidePortAnnotations().

◆ parseModulePorts()

static ParseResult parseModulePorts ( OpAsmParser &  parser,
bool  hasSSAIdentifiers,
bool  supportsSymbols,
SmallVectorImpl< OpAsmParser::Argument > &  entryArgs,
SmallVectorImpl< Direction > &  portDirections,
SmallVectorImpl< Attribute > &  portNames,
SmallVectorImpl< Attribute > &  portTypes,
SmallVectorImpl< Attribute > &  portAnnotations,
SmallVectorImpl< Attribute > &  portSyms,
SmallVectorImpl< Attribute > &  portLocs 
)
static

Parse a list of module ports.

If port names are SSA identifiers, then this will populate entryArgs.

Definition at line 1034 of file FIRRTLOps.cpp.

References assert(), circt::calyx::direction::get(), circt::hw::InnerSymbolTable::getInnerSymbolAttrName(), and isdigit.

Referenced by parseClassLike().

◆ parseNameKind()

static ParseResult parseNameKind ( OpAsmParser &  parser,
firrtl::NameKindEnumAttr &  result 
)
static

A forward declaration for NameKind attribute parser.

Definition at line 5136 of file FIRRTLOps.cpp.

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

◆ parseOptionalParameters()

static ParseResult parseOptionalParameters ( OpAsmParser &  parser,
SmallVectorImpl< Attribute > &  parameters 
)
static

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 1223 of file FIRRTLOps.cpp.

◆ parsePrintfAttrs()

static ParseResult parsePrintfAttrs ( OpAsmParser &  p,
NamedAttrList &  resultAttrs 
)
static

Definition at line 5234 of file FIRRTLOps.cpp.

References parseElideEmptyName().

◆ parseStopAttrs()

static ParseResult parseStopAttrs ( OpAsmParser &  p,
NamedAttrList &  resultAttrs 
)
static

Definition at line 5244 of file FIRRTLOps.cpp.

References parseElideEmptyName().

◆ parseSubfieldLikeOp()

template<typename OpTy >
ParseResult parseSubfieldLikeOp ( OpAsmParser &  parser,
OperationState &  result 
)

◆ parseVerifAttrs()

static ParseResult parseVerifAttrs ( OpAsmParser &  p,
NamedAttrList &  resultAttrs 
)
static

Definition at line 5253 of file FIRRTLOps.cpp.

References parseElideEmptyName().

◆ printCircuitOpAttrs()

static void printCircuitOpAttrs ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr 
)
static

Definition at line 357 of file FIRRTLOps.cpp.

◆ printClassInterface()

static void printClassInterface ( OpAsmPrinter &  p,
Operation *  ,
ClassType  type 
)
static

Definition at line 5207 of file FIRRTLOps.cpp.

◆ printClassLike()

static void printClassLike ( OpAsmPrinter &  p,
ClassLike  op 
)
static

◆ printElideAnnotations()

static void printElideAnnotations ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr,
ArrayRef< StringRef >  extraElides = {} 
)
static

Definition at line 5092 of file FIRRTLOps.cpp.

Referenced by printFIRRTLImplicitSSAName().

◆ printElideEmptyName()

static void printElideEmptyName ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr,
ArrayRef< StringRef >  extraElides = {} 
)
static

Definition at line 5224 of file FIRRTLOps.cpp.

Referenced by printPrintfAttrs(), printStopAttrs(), and printVerifAttrs().

◆ printElidePortAnnotations()

static void printElidePortAnnotations ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr,
ArrayRef< StringRef >  extraElides = {} 
)
static

Definition at line 5121 of file FIRRTLOps.cpp.

Referenced by printMemOp().

◆ printFIRRTLImplicitSSAName()

static void printFIRRTLImplicitSSAName ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attrs 
)
static

◆ printFModuleLikeOp()

static void printFModuleLikeOp ( OpAsmPrinter &  p,
FModuleLike  op 
)
static

Definition at line 1152 of file FIRRTLOps.cpp.

◆ printMemOp()

static void printMemOp ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr 
)
static

Always elide "ruw" and elide "annotations" if it exists or if it is empty.

Definition at line 5190 of file FIRRTLOps.cpp.

References printElidePortAnnotations().

◆ printModulePorts()

static bool printModulePorts ( OpAsmPrinter &  p,
Block *  block,
ArrayRef< Direction portDirections,
ArrayRef< Attribute >  portNames,
ArrayRef< Attribute >  portTypes,
ArrayRef< Attribute >  portAnnotations,
ArrayRef< Attribute >  portSyms,
ArrayRef< Attribute >  portLocs 
)
static

Print a list of module ports in the following form: in x: !firrtl.uint<1> [{class = "DontTouch}], out "_port": !firrtl.uint<2>

When there is no block specified, the port names print as MLIR identifiers, wrapping in quotes if not legal to print as-is. When there is no block specified, this function always return false, indicating that there was no issue printing port names.

If there is a block specified, then port names will be printed as SSA values. If there is a reason the printed SSA values can't match the true port name, then this function will return true. When this happens, the caller should print the port names as a part of the attr-dict.

Definition at line 957 of file FIRRTLOps.cpp.

References empty.

Referenced by printClassLike().

◆ printNameKind()

static void printNameKind ( OpAsmPrinter &  p,
Operation *  op,
firrtl::NameKindEnumAttr  attr,
ArrayRef< StringRef >  extraElides = {} 
)
static

Definition at line 5153 of file FIRRTLOps.cpp.

◆ printParameterList()

static void printParameterList ( ArrayAttr  parameters,
OpAsmPrinter &  p 
)
static

Print a paramter list for a module or instance.

Definition at line 1136 of file FIRRTLOps.cpp.

References value.

◆ printPrintfAttrs()

static void printPrintfAttrs ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr 
)
static

Definition at line 5239 of file FIRRTLOps.cpp.

References printElideEmptyName().

◆ printStopAttrs()

static void printStopAttrs ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr 
)
static

Definition at line 5248 of file FIRRTLOps.cpp.

References printElideEmptyName().

◆ printSubfieldLikeOp()

template<typename OpTy >
static void printSubfieldLikeOp ( OpTy  op,
::mlir::OpAsmPrinter &  printer 
)
static

Definition at line 4018 of file FIRRTLOps.cpp.

◆ printVerifAttrs()

static void printVerifAttrs ( OpAsmPrinter &  p,
Operation *  op,
DictionaryAttr  attr 
)
static

Definition at line 5257 of file FIRRTLOps.cpp.

References printElideEmptyName().

◆ removeElementsAtIndices()

template<typename T >
static SmallVector<T> 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 51 of file FIRRTLOps.cpp.

References assert().

Referenced by eraseInternalPaths(), and erasePorts().

◆ toString()

constexpr const char* toString ( Flow  flow)
constexpr

◆ verifyInternalPaths()

static LogicalResult verifyInternalPaths ( FModuleLike  op,
std::optional<::mlir::ArrayAttr >  internalPaths 
)
static

Definition at line 1398 of file FIRRTLOps.cpp.

◆ verifyPortSymbolUses()

static LogicalResult verifyPortSymbolUses ( FModuleLike  module,
SymbolTableCollection &  symbolTable 
)
static

Definition at line 1472 of file FIRRTLOps.cpp.

◆ verifySubfieldLike()

template<typename OpTy >
static LogicalResult verifySubfieldLike ( OpTy  op)
static

Definition at line 4045 of file FIRRTLOps.cpp.