|
CIRCT 22.0.0git
|
#include "circt/Dialect/FIRRTL/FIRRTLTypes.h"#include "circt/Dialect/FIRRTL/FIRRTLOps.h"#include "circt/Dialect/FIRRTL/FIRRTLUtils.h"#include "circt/Dialect/HW/HWTypeInterfaces.h"#include "mlir/IR/DialectImplementation.h"#include "llvm/ADT/StringExtras.h"#include "llvm/ADT/StringSwitch.h"#include "llvm/ADT/TypeSwitch.h"#include "circt/Dialect/FIRRTL/FIRRTLTypes.cpp.inc"
Go to the source code of this file.
Macros | |
| #define | GET_TYPEDEF_CLASSES |
| #define | GET_TYPEDEF_LIST |
Enumerations | |
| enum | { IsPassiveBitMask = 0x1 , ContainsAnalogBitMask = 0x2 , HasUninferredWidthBitMask = 0x4 } |
Functions | |
| static LogicalResult | customTypePrinter (Type type, AsmPrinter &os) |
| Print a type with a custom printer implementation. | |
| static OptionalParseResult | customTypeParser (AsmParser &parser, StringRef name, Type &result) |
| Parse a type with a custom parser implementation. | |
| static ParseResult | parseType (Type &result, StringRef name, AsmParser &parser) |
| Parse a type defined by this dialect. | |
| static ParseResult | parseFIRRTLType (FIRRTLType &result, StringRef name, AsmParser &parser) |
Parse a FIRRTLType with a name that has already been parsed. | |
| static ParseResult | parseFIRRTLBaseType (FIRRTLBaseType &result, StringRef name, AsmParser &parser) |
| static ParseResult | parseFIRRTLPropertyType (PropertyType &result, StringRef name, AsmParser &parser) |
| static bool | areBundleElementsEquivalent (BundleType::BundleElement destElement, BundleType::BundleElement srcElement, bool destOuterTypeIsConst, bool srcOuterTypeIsConst, bool requiresSameWidth) |
| Helper to implement the equivalence logic for a pair of bundle elements. | |
| #define GET_TYPEDEF_CLASSES |
Definition at line 33 of file FIRRTLTypes.cpp.
| #define GET_TYPEDEF_LIST |
| anonymous enum |
Definition at line 666 of file FIRRTLTypes.cpp.
|
static |
Helper to implement the equivalence logic for a pair of bundle elements.
Note that the FIRRTL spec requires bundle elements to have the same orientation, but this only compares their passive types. The FIRRTL dialect differs from the spec in how it uses flip types for module output ports and canonicalizes flips in bundles, so only passive types can be compared here.
Definition at line 965 of file FIRRTLTypes.cpp.
References circt::firrtl::areTypesEquivalent().
Referenced by circt::firrtl::areTypesEquivalent().
|
static |
Parse a type with a custom parser implementation.
This only accepts a subset of all types in the dialect. Use parseType instead, which will call this function in turn, as appropriate.
Returns std::nullopt if the type name is not covered by the custom parsers. Otherwise returns success or failure as appropriate. On success, result is set to the resulting type.
Definition at line 214 of file FIRRTLTypes.cpp.
References assert(), elementType, circt::firrtl::isConst(), circt::firrtl::parseNestedBaseType(), circt::firrtl::parseNestedPropertyType(), and circt::firrtl::parseNestedType().
Referenced by parseType().
|
static |
Print a type with a custom printer implementation.
This only prints a subset of all types in the dialect. Use printNestedType instead, which will call this function in turn, as appropriate.
Definition at line 45 of file FIRRTLTypes.cpp.
References circt::firrtl::isConst(), and circt::firrtl::printNestedType().
Referenced by circt::firrtl::printNestedType().
|
static |
Definition at line 583 of file FIRRTLTypes.cpp.
References parseFIRRTLType().
Referenced by circt::firrtl::parseNestedBaseType().
|
static |
Definition at line 596 of file FIRRTLTypes.cpp.
References parseFIRRTLType().
Referenced by circt::firrtl::parseNestedPropertyType().
|
static |
Parse a FIRRTLType with a name that has already been parsed.
Note that only a subset of types defined in the FIRRTL dialect inherit from FIRRTLType. Use parseType to parse any of the defined types.
Definition at line 570 of file FIRRTLTypes.cpp.
References parseType().
Referenced by parseFIRRTLBaseType(), parseFIRRTLPropertyType(), and circt::firrtl::parseNestedType().
|
static |
Parse a type defined by this dialect.
This will first try the generated type parsers and then resort to the custom parser implementation. Emits an error and returns failure if name does not refer to a type defined in this dialect.
Definition at line 554 of file FIRRTLTypes.cpp.
References customTypeParser().
Referenced by parseFIRRTLType(), parseParameterList(), and Manifest::Impl::populateTypes().