9#ifndef CIRCT_DIALECT_SIM_SIMTYPES_H
10#define CIRCT_DIALECT_SIM_SIMTYPES_H
13#include "mlir/IR/BuiltinAttributes.h"
14#include "mlir/IR/BuiltinTypes.h"
15#include "mlir/IR/Types.h"
16#include "llvm/ADT/ArrayRef.h"
17#include "llvm/ADT/SmallVector.h"
26enum class DPIDirection : uint32_t;
48 return llvm::hash_combine(
static_cast<uint32_t
>(arg.
dir), arg.
name, arg.
type);
55 using KeyTy = llvm::ArrayRef<DPIArgument>;
58 return std::equal(key.begin(), key.end(),
arguments.begin(),
63 return llvm::hash_combine_range(key.begin(), key.end());
67 construct(mlir::TypeStorageAllocator &allocator,
const KeyTy &key);
89#define GET_TYPEDEF_CLASSES
90#include "circt/Dialect/Sim/SimTypes.h.inc"
llvm::StringRef stringifyDPIDirectionKeyword(DPIDirection dir)
Return the keyword string for a DPIDirection (e.g. "in", "return").
std::optional< DPIDirection > parseDPIDirectionKeyword(llvm::StringRef keyword)
Parse a keyword string to a DPIDirection. Returns std::nullopt on failure.
bool isCallOperandDir(DPIDirection dir)
True if an argument with this direction is a call operand (input/inout/ref).
static bool operator==(const DPIArgument &a, const DPIArgument &b)
static llvm::hash_code hash_value(const DPIArgument &arg)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
A named and typed field of an aggregate type.
A single argument in a DPI function type.
llvm::SmallVector< DPIArgument > arguments
mlir::FunctionType cachedFuncType
llvm::SmallVector< size_t > inputToAbs
static llvm::hash_code hashKey(const KeyTy &key)
llvm::SmallVector< size_t > resultToAbs
llvm::ArrayRef< DPIArgument > getArguments() const
static DPIFunctionTypeStorage * construct(mlir::TypeStorageAllocator &allocator, const KeyTy &key)
mlir::FunctionType getCachedFunctionType() const
Return the cached MLIR FunctionType for the call shape.
bool operator==(const KeyTy &key) const
llvm::ArrayRef< DPIArgument > KeyTy