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/InferTypeOpInterface.h"
26 #include "mlir/Interfaces/SideEffectInterfaces.h"
63 virtual bool hasX()
const {
return false; }
66 virtual bool hasZ()
const {
return false; }
68 virtual Attribute
attr()
const = 0;
103 bool hasX()
const override;
104 bool hasZ()
const override;
111 CaseBitPattern(ArrayRef<CasePatternBit> bits, MLIRContext *context);
158 template <
typename ConcreteType>
162 return mlir::OpTrait::impl::verifyAtLeastNRegions(op, 1);
167 template <
typename ConcreteType>
178 template <
typename ConcreteType>
189 template <
typename ConcreteType>
193 static LogicalResult
verifyTrait(Operation *op) {
return success(); }
199 #define GET_OP_CLASSES
200 #include "circt/Dialect/SV/SV.h.inc"
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
CaseBitPattern(ArrayRef< CasePatternBit > bits, MLIRContext *context)
Get a CasePattern from a specified list of CasePatternBit.
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
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)
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
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".
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