CIRCT  19.0.0git
Namespaces | Macros | Functions
HWTypes.cpp File Reference
#include "circt/Dialect/HW/HWTypes.h"
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Dialect/HW/HWDialect.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWSymCache.h"
#include "circt/Support/LLVM.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/StorageUniquerSupport.h"
#include "mlir/IR/Types.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/TypeSwitch.h"
#include "circt/Dialect/HW/HWTypes.cpp.inc"
Include dependency graph for HWTypes.cpp:

Go to the source code of this file.

Namespaces

 circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
 
 circt::hw
 
 circt::hw::detail
 

Macros

#define GET_TYPEDEF_CLASSES
 
#define GET_TYPEDEF_LIST
 

Functions

static ParseResult parseHWElementType (Type &result, AsmParser &p)
 Parse and print nested HW types nicely. More...
 
static void printHWElementType (Type element, AsmPrinter &p)
 
bool circt::hw::detail::operator== (const FieldInfo &a, const FieldInfo &b)
 
llvm::hash_code circt::hw::detail::hash_value (const FieldInfo &fi)
 
static ParseResult parseFields (AsmParser &p, SmallVectorImpl< FieldInfo > &parameters)
 Parse a list of unique field names and types within <>. More...
 
static void printFields (AsmPrinter &p, ArrayRef< FieldInfo > fields)
 Print out a list of named fields surrounded by <>. More...
 
static std::pair< uint64_t, SmallVector< uint64_t > > getFieldIDsStruct (const StructType &st)
 
bool circt::hw::detail::operator== (const OffsetFieldInfo &a, const OffsetFieldInfo &b)
 
llvm::hash_code circt::hw::detail::hash_value (const OffsetFieldInfo &fi)
 
static LogicalResult parseArray (AsmParser &p, Attribute &dim, Type &inner)
 
static Type computeCanonicalType (Type type)
 
static StringRef dirToStr (ModulePort::Direction dir)
 
static ModulePort::Direction strToDir (StringRef str)
 
static ParseResult parsePorts (AsmParser &p, SmallVectorImpl< ModulePort > &ports)
 Parse a list of field names and types within <>. More...
 
static void printPorts (AsmPrinter &p, ArrayRef< ModulePort > ports)
 Print out a list of named fields surrounded by <>. More...
 

Macro Definition Documentation

◆ GET_TYPEDEF_CLASSES

#define GET_TYPEDEF_CLASSES

Definition at line 34 of file HWTypes.cpp.

◆ GET_TYPEDEF_LIST

#define GET_TYPEDEF_LIST

Function Documentation

◆ computeCanonicalType()

static Type computeCanonicalType ( Type  type)
static

Definition at line 759 of file HWTypes.cpp.

◆ dirToStr()

static StringRef dirToStr ( ModulePort::Direction  dir)
static

Definition at line 976 of file HWTypes.cpp.

◆ getFieldIDsStruct()

static std::pair<uint64_t, SmallVector<uint64_t> > getFieldIDsStruct ( const StructType &  st)
static

Definition at line 331 of file HWTypes.cpp.

◆ parseArray()

static LogicalResult parseArray ( AsmParser &  p,
Attribute &  dim,
Type &  inner 
)
static

Definition at line 550 of file HWTypes.cpp.

◆ parseFields()

static ParseResult parseFields ( AsmParser &  p,
SmallVectorImpl< FieldInfo > &  parameters 
)
static

Parse a list of unique field names and types within <>.

E.g.: <foo: i7, bar: i8>

Definition at line 243 of file HWTypes.cpp.

◆ parseHWElementType()

static ParseResult parseHWElementType ( Type &  result,
AsmParser &  p 
)
static

Parse and print nested HW types nicely.

These helper methods allow eliding the "hw." prefix on array, inout, and other types when in a context that expects HW subelement types.

Definition at line 164 of file HWTypes.cpp.

◆ parsePorts()

static ParseResult parsePorts ( AsmParser &  p,
SmallVectorImpl< ModulePort > &  ports 
)
static

Parse a list of field names and types within <>.

E.g.: <input foo: i7, output bar: i8>

Definition at line 999 of file HWTypes.cpp.

◆ printFields()

static void printFields ( AsmPrinter &  p,
ArrayRef< FieldInfo fields 
)
static

Print out a list of named fields surrounded by <>.

Definition at line 275 of file HWTypes.cpp.

◆ printHWElementType()

static void printHWElementType ( Type  element,
AsmPrinter &  p 
)
static

Definition at line 184 of file HWTypes.cpp.

◆ printPorts()

static void printPorts ( AsmPrinter &  p,
ArrayRef< ModulePort ports 
)
static

Print out a list of named fields surrounded by <>.

Definition at line 1016 of file HWTypes.cpp.

◆ strToDir()

static ModulePort::Direction strToDir ( StringRef  str)
static

Definition at line 987 of file HWTypes.cpp.