13#ifndef CIRCT_DIALECT_SV_OPS_H
14#define CIRCT_DIALECT_SV_OPS_H
24#include "mlir/IR/OpImplementation.h"
25#include "mlir/IR/SymbolTable.h"
26#include "mlir/Interfaces/CallInterfaces.h"
27#include "mlir/Interfaces/InferTypeOpInterface.h"
28#include "mlir/Interfaces/SideEffectInterfaces.h"
65 virtual bool hasX()
const {
return false; }
68 virtual bool hasZ()
const {
return false; }
70 virtual Attribute
attr()
const = 0;
105 bool hasX()
const override;
106 bool hasZ()
const override;
148 exprAttr(CaseExprPatternAttr::get(ctx)) {}
171template <
typename ConcreteType>
175 static LogicalResult
verifyTrait(Operation *op) {
return success(); }
197 ArrayRef<StringAttr> macroSymbols,
198 llvm::function_ref<
void(StringAttr, std::function<
void()>,
199 std::function<
void()>)>
201 llvm::function_ref<
void(
size_t)> thenCtor,
202 llvm::function_ref<
void()> defaultCtor);
207#define GET_OP_CLASSES
208#include "circt/Dialect/SV/SV.h.inc"
static std::unique_ptr< Context > context
CaseBitPattern(IntegerAttr attr)
Get a CasePattern with a correctly encoded attribute.
CasePatternBit getBit(size_t bitNumber) const
Return the specified bit, bit 0 is the least significant bit.
bool hasZ() const override
Return true if this pattern has an Z.
static bool classof(const CasePattern *S)
Attribute attr() const override
bool hasX() const override
Return true if this pattern has an X.
static bool classof(const CasePattern *S)
Attribute attr() const override
CaseDefaultPattern(MLIRContext *ctx)
static bool classof(const CasePattern *S)
CaseEnumPattern(hw::EnumFieldAttr attr)
hw::EnumFieldAttr enumAttr
StringRef getFieldValue() const
Attribute attr() const override
static bool classof(const CasePattern *S)
CaseExprPatternAttr exprAttr
CaseExprPattern(MLIRContext *ctx)
Attribute attr() const override
CasePatternKind getKind() const
CasePattern(CasePatternKind kind)
const CasePatternKind kind
virtual bool hasZ() const
Return true if this pattern has an Z.
virtual Attribute attr() const =0
virtual bool hasX() const
Return true if this pattern has an X.
This class provides a verifier for ops that are expecting their parent to be one of the given parent ...
static LogicalResult verifyTrait(Operation *op)
CasePatternBit
This describes the bit in a pattern, 0/1/x/z.
bool isExpression(Operation *op)
Return true if the specified operation is an expression.
char getLetter(CasePatternBit bit)
Return the letter for the specified pattern bit, e.g. "0", "1", "x" or "z".
void createNestedIfDefs(ArrayRef< StringAttr > macroSymbols, llvm::function_ref< void(StringAttr, std::function< void()>, std::function< void()>)> ifdefCtor, llvm::function_ref< void(size_t)> thenCtor, llvm::function_ref< void()> defaultCtor)
Create nested ifdef operations for a list of macro symbols.
bool is2StateExpression(Value v)
Returns if the expression is known to be 2-state (binary)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
std::unique_ptr< CasePattern > pattern