9#ifndef CIRCT_DIALECT_SIM_SIMTYPES_H
10#define CIRCT_DIALECT_SIM_SIMTYPES_H
12#include "mlir/IR/BuiltinAttributes.h"
13#include "mlir/IR/BuiltinTypes.h"
14#include "mlir/IR/Types.h"
15#include "llvm/ADT/ArrayRef.h"
16#include "llvm/ADT/SmallVector.h"
25enum class DPIDirection : uint32_t;
44 return a.dir == b.dir && a.name == b.name && a.type == b.type;
47 return llvm::hash_combine(
static_cast<uint32_t
>(arg.
dir), arg.
name, arg.
type);
54 using KeyTy = llvm::ArrayRef<DPIArgument>;
57 return std::equal(key.begin(), key.end(),
arguments.begin(),
62 return llvm::hash_combine_range(key.begin(), key.end());
66 construct(mlir::TypeStorageAllocator &allocator,
const KeyTy &key);
85#define GET_TYPEDEF_CLASSES
86#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 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