13#ifndef CIRCT_DIALECT_SV_OPS_H
14#define CIRCT_DIALECT_SV_OPS_H
23#include "mlir/IR/OpImplementation.h"
24#include "mlir/IR/SymbolTable.h"
25#include "mlir/Interfaces/CallInterfaces.h"
26#include "mlir/Interfaces/InferTypeOpInterface.h"
27#include "mlir/Interfaces/SideEffectInterfaces.h"
64 virtual bool hasX()
const {
return false; }
67 virtual bool hasZ()
const {
return false; }
69 virtual Attribute
attr()
const = 0;
104 bool hasX()
const override;
105 bool hasZ()
const override;
147 exprAttr(CaseExprPatternAttr::get(ctx)) {}
174template <
typename ConcreteType>
178 return mlir::OpTrait::impl::verifyAtLeastNRegions(op, 1);
183template <
typename ConcreteType>
194template <
typename ConcreteType>
205template <
typename ConcreteType>
209 static LogicalResult
verifyTrait(Operation *op) {
return success(); }
231 ArrayRef<StringAttr> macroSymbols,
232 llvm::function_ref<
void(StringAttr, std::function<
void()>,
233 std::function<
void()>)>
235 llvm::function_ref<
void(
size_t)> thenCtor,
236 llvm::function_ref<
void()> defaultCtor);
241#define GET_OP_CLASSES
242#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 verifies that the specified op is not located in a procedural region.
static LogicalResult verifyTrait(Operation *op)
This class verifies that the specified op is located in a procedural region.
static LogicalResult verifyTrait(Operation *op)
Signals that an operations regions are procedural.
static LogicalResult verifyTrait(Operation *op)
This class provides a verifier for ops that are expecting their parent to be one of the given parent ...
static LogicalResult verifyTrait(Operation *op)
LogicalResult verifyInNonProceduralRegion(Operation *op)
Return true if the specified operation is not in a procedural region.
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)
LogicalResult verifyInProceduralRegion(Operation *op)
Return true if the specified operation is in a procedural region.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
std::unique_ptr< CasePattern > pattern