CIRCT  19.0.0git
Public Types | Public Member Functions | Protected Attributes | List of all members
circt::esi::ESIAPIType Class Reference

#include <APIUtilities.h>

Collaboration diagram for circt::esi::ESIAPIType:
Collaboration graph

Public Types

using FieldInfo = hw::StructType::FieldInfo

Public Member Functions

 ESIAPIType (mlir::Type)
virtual ~ESIAPIType ()=default
bool operator== (const ESIAPIType &) const
mlir::Type getType () const
 Get the type back. More...
virtual bool isSupported () const
 Returns true if the type is currently supported. More...
llvm::ArrayRef< FieldInfogetFields () const
StringRef name () const
 For now, the name is just the type serialized. More...
uint64_t size () const
uint64_t typeID () const

Protected Attributes

llvm::SmallVector< FieldInfofieldTypes
 Cosim requires that everything be contained in a struct. More...
mlir::Type type
std::string cachedName
std::optional< uint64_t > cachedID

Detailed Description

Definition at line 31 of file APIUtilities.h.

Member Typedef Documentation

◆ FieldInfo

using circt::esi::ESIAPIType::FieldInfo = hw::StructType::FieldInfo

Definition at line 33 of file APIUtilities.h.

Constructor & Destructor Documentation

◆ ESIAPIType()

circt::esi::ESIAPIType::ESIAPIType ( mlir::Type  )

Definition at line 63 of file APIUtilities.cpp.

References fieldTypes, circt::calyx::direction::get(), and type.

◆ ~ESIAPIType()

virtual circt::esi::ESIAPIType::~ESIAPIType ( )

Member Function Documentation

◆ getFields()

llvm::ArrayRef<FieldInfo> circt::esi::ESIAPIType::getFields ( ) const

Definition at line 45 of file APIUtilities.h.

References fieldTypes.

◆ getType()

mlir::Type circt::esi::ESIAPIType::getType ( ) const

Get the type back.

Definition at line 40 of file APIUtilities.h.

References type.

◆ isSupported()

bool circt::esi::ESIAPIType::isSupported ( ) const

Returns true if the type is currently supported.

Definition at line 53 of file APIUtilities.cpp.

References circt::esi::isSupported(), and type.

◆ name()

StringRef circt::esi::ESIAPIType::name ( ) const

For now, the name is just the type serialized.

This works only because we only support ints.

Definition at line 108 of file APIUtilities.cpp.

References cachedName, circt::esi::emitName(), type, and typeID().

◆ operator==()

bool circt::esi::ESIAPIType::operator== ( const ESIAPIType that) const

Definition at line 79 of file APIUtilities.cpp.

References type.

◆ size()

uint64_t circt::esi::ESIAPIType::size ( ) const

◆ typeID()

uint64_t circt::esi::ESIAPIType::typeID ( ) const

Definition at line 119 of file APIUtilities.cpp.

References cachedID, circt::esi::esiApiVersion, and type.

Referenced by name().

Member Data Documentation

◆ cachedID

std::optional<uint64_t> circt::esi::ESIAPIType::cachedID

Definition at line 62 of file APIUtilities.h.

Referenced by typeID().

◆ cachedName

std::string circt::esi::ESIAPIType::cachedName

Definition at line 61 of file APIUtilities.h.

Referenced by name().

◆ fieldTypes

llvm::SmallVector<FieldInfo> circt::esi::ESIAPIType::fieldTypes

Cosim requires that everything be contained in a struct.

ESI doesn't so we wrap non-struct types in a struct.

Definition at line 58 of file APIUtilities.h.

Referenced by ESIAPIType(), and getFields().

◆ type

mlir::Type circt::esi::ESIAPIType::type

The documentation for this class was generated from the following files: