CIRCT  18.0.0git
FIRRTLVisitors.h
Go to the documentation of this file.
1 //===- FIRRTLVisitors.h - FIRRTL Dialect Visitors ---------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines visitors that make it easier to work with FIRRTL IR.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef CIRCT_DIALECT_FIRRTL_FIRRTLVISITORS_H
14 #define CIRCT_DIALECT_FIRRTL_FIRRTLVISITORS_H
15 
17 #include "mlir/IR/BuiltinOps.h"
18 #include "llvm/ADT/TypeSwitch.h"
19 
20 namespace circt {
21 namespace firrtl {
22 
23 /// ExprVisitor is a visitor for FIRRTL expression nodes.
24 template <typename ConcreteType, typename ResultType = void,
25  typename... ExtraArgs>
26 class ExprVisitor {
27 public:
28  ResultType dispatchExprVisitor(Operation *op, ExtraArgs... args) {
29  auto *thisCast = static_cast<ConcreteType *>(this);
30  return TypeSwitch<Operation *, ResultType>(op)
31  // Basic Expressions
32  .template Case<
33  ConstantOp, SpecialConstantOp, AggregateConstantOp, InvalidValueOp,
34  SubfieldOp, SubindexOp, SubaccessOp, IsTagOp, SubtagOp,
35  BundleCreateOp, VectorCreateOp, FEnumCreateOp, MultibitMuxOp,
36  TagExtractOp, OpenSubfieldOp, OpenSubindexOp, ObjectSubfieldOp,
37  // Arithmetic and Logical Binary Primitives.
38  AddPrimOp, SubPrimOp, MulPrimOp, DivPrimOp, RemPrimOp, AndPrimOp,
39  OrPrimOp, XorPrimOp,
40  // Elementwise operations,
41  ElementwiseOrPrimOp, ElementwiseAndPrimOp, ElementwiseXorPrimOp,
42  // Comparisons.
43  LEQPrimOp, LTPrimOp, GEQPrimOp, GTPrimOp, EQPrimOp, NEQPrimOp,
44  // Misc Binary Primitives.
45  CatPrimOp, DShlPrimOp, DShlwPrimOp, DShrPrimOp,
46  // Unary operators.
47  AsSIntPrimOp, AsUIntPrimOp, AsAsyncResetPrimOp, AsClockPrimOp,
48  CvtPrimOp, NegPrimOp, NotPrimOp, AndRPrimOp, OrRPrimOp, XorRPrimOp,
49  // Intrinsic Expressions.
50  IsXIntrinsicOp, PlusArgsValueIntrinsicOp, PlusArgsTestIntrinsicOp,
51  SizeOfIntrinsicOp, ClockGateIntrinsicOp, LTLAndIntrinsicOp,
52  LTLOrIntrinsicOp, LTLDelayIntrinsicOp, LTLConcatIntrinsicOp,
53  LTLNotIntrinsicOp, LTLImplicationIntrinsicOp,
54  LTLEventuallyIntrinsicOp, LTLClockIntrinsicOp,
55  LTLDisableIntrinsicOp, Mux2CellIntrinsicOp, Mux4CellIntrinsicOp,
56  HasBeenResetIntrinsicOp,
57  // Miscellaneous.
58  BitsPrimOp, HeadPrimOp, MuxPrimOp, PadPrimOp, ShlPrimOp, ShrPrimOp,
59  TailPrimOp, VerbatimExprOp, HWStructCastOp, BitCastOp, RefSendOp,
60  RefResolveOp, RefSubOp, RWProbeOp, XMRRefOp, XMRDerefOp,
61  // Casts to deal with weird stuff
62  UninferredResetCastOp, ConstCastOp, RefCastOp,
63  mlir::UnrealizedConversionCastOp,
64  // Property expressions.
65  StringConstantOp, FIntegerConstantOp, BoolConstantOp,
66  DoubleConstantOp, ListCreateOp, UnresolvedPathOp, PathOp>(
67  [&](auto expr) -> ResultType {
68  return thisCast->visitExpr(expr, args...);
69  })
70  .Default([&](auto expr) -> ResultType {
71  return thisCast->visitInvalidExpr(op, args...);
72  });
73  }
74 
75  /// This callback is invoked on any non-expression operations.
76  ResultType visitInvalidExpr(Operation *op, ExtraArgs... args) {
77  op->emitOpError("unknown FIRRTL expression");
78  abort();
79  }
80 
81  /// This callback is invoked on any expression operations that are not handled
82  /// by the concrete visitor.
83  ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args) {
84  return ResultType();
85  }
86 
87  /// This fallback is invoked on any unary expr that isn't explicitly handled.
88  /// The default implementation delegates to the unhandled expression fallback.
89  ResultType visitUnaryExpr(Operation *op, ExtraArgs... args) {
90  return static_cast<ConcreteType *>(this)->visitUnhandledExpr(op, args...);
91  }
92 
93  /// This fallback is invoked on any binary expr that isn't explicitly handled.
94  /// The default implementation delegates to the unhandled expression fallback.
95  ResultType visitBinaryExpr(Operation *op, ExtraArgs... args) {
96  return static_cast<ConcreteType *>(this)->visitUnhandledExpr(op, args...);
97  }
98 
99 #define HANDLE(OPTYPE, OPKIND) \
100  ResultType visitExpr(OPTYPE op, ExtraArgs... args) { \
101  return static_cast<ConcreteType *>(this)->visit##OPKIND##Expr(op, \
102  args...); \
103  }
104 
105  // Basic expressions.
106  HANDLE(ConstantOp, Unhandled);
107  HANDLE(SpecialConstantOp, Unhandled);
108  HANDLE(AggregateConstantOp, Unhandled);
109  HANDLE(BundleCreateOp, Unhandled);
110  HANDLE(VectorCreateOp, Unhandled);
111  HANDLE(FEnumCreateOp, Unhandled);
112  HANDLE(SubfieldOp, Unhandled);
113  HANDLE(SubindexOp, Unhandled);
114  HANDLE(SubaccessOp, Unhandled);
115  HANDLE(IsTagOp, Unhandled);
116  HANDLE(SubtagOp, Unhandled);
117  HANDLE(TagExtractOp, Unhandled);
118  HANDLE(MultibitMuxOp, Unhandled);
119  HANDLE(OpenSubfieldOp, Unhandled);
120  HANDLE(OpenSubindexOp, Unhandled);
121  HANDLE(ObjectSubfieldOp, Unhandled);
122 
123  // Arithmetic and Logical Binary Primitives.
124  HANDLE(AddPrimOp, Binary);
125  HANDLE(SubPrimOp, Binary);
126  HANDLE(MulPrimOp, Binary);
127  HANDLE(DivPrimOp, Binary);
128  HANDLE(RemPrimOp, Binary);
129  HANDLE(AndPrimOp, Binary);
130  HANDLE(OrPrimOp, Binary);
131  HANDLE(XorPrimOp, Binary);
132 
133  // Comparisons.
134  HANDLE(LEQPrimOp, Binary);
135  HANDLE(LTPrimOp, Binary);
136  HANDLE(GEQPrimOp, Binary);
137  HANDLE(GTPrimOp, Binary);
138  HANDLE(EQPrimOp, Binary);
139  HANDLE(NEQPrimOp, Binary);
140 
141  // Misc Binary Primitives.
142  HANDLE(CatPrimOp, Binary);
143  HANDLE(DShlPrimOp, Binary);
144  HANDLE(DShlwPrimOp, Binary);
145  HANDLE(DShrPrimOp, Binary);
146 
147  // Unary operators.
148  HANDLE(AsSIntPrimOp, Unary);
149  HANDLE(AsUIntPrimOp, Unary);
150  HANDLE(AsAsyncResetPrimOp, Unary);
151  HANDLE(AsClockPrimOp, Unary);
152  HANDLE(CvtPrimOp, Unary);
153  HANDLE(NegPrimOp, Unary);
154  HANDLE(NotPrimOp, Unary);
155  HANDLE(AndRPrimOp, Unary);
156  HANDLE(OrRPrimOp, Unary);
157  HANDLE(XorRPrimOp, Unary);
158 
159  HANDLE(ElementwiseOrPrimOp, Unhandled);
160  HANDLE(ElementwiseAndPrimOp, Unhandled);
161  HANDLE(ElementwiseXorPrimOp, Unhandled);
162 
163  // Intrinsic Expr.
164  HANDLE(IsXIntrinsicOp, Unhandled);
165  HANDLE(PlusArgsValueIntrinsicOp, Unhandled);
166  HANDLE(PlusArgsTestIntrinsicOp, Unhandled);
167  HANDLE(SizeOfIntrinsicOp, Unhandled);
168  HANDLE(ClockGateIntrinsicOp, Unhandled);
169  HANDLE(LTLAndIntrinsicOp, Unhandled);
170  HANDLE(LTLOrIntrinsicOp, Unhandled);
171  HANDLE(LTLDelayIntrinsicOp, Unhandled);
172  HANDLE(LTLConcatIntrinsicOp, Unhandled);
173  HANDLE(LTLNotIntrinsicOp, Unhandled);
174  HANDLE(LTLImplicationIntrinsicOp, Unhandled);
175  HANDLE(LTLEventuallyIntrinsicOp, Unhandled);
176  HANDLE(LTLClockIntrinsicOp, Unhandled);
177  HANDLE(LTLDisableIntrinsicOp, Unhandled);
178  HANDLE(Mux4CellIntrinsicOp, Unhandled);
179  HANDLE(Mux2CellIntrinsicOp, Unhandled);
180  HANDLE(HasBeenResetIntrinsicOp, Unhandled);
181 
182  // Miscellaneous.
183  HANDLE(BitsPrimOp, Unhandled);
184  HANDLE(HeadPrimOp, Unhandled);
185  HANDLE(InvalidValueOp, Unhandled);
186  HANDLE(MuxPrimOp, Unhandled);
187  HANDLE(PadPrimOp, Unhandled);
188  HANDLE(ShlPrimOp, Unhandled);
189  HANDLE(ShrPrimOp, Unhandled);
190  HANDLE(TailPrimOp, Unhandled);
191  HANDLE(VerbatimExprOp, Unhandled);
192  HANDLE(RefSendOp, Unhandled);
193  HANDLE(RefResolveOp, Unhandled);
194  HANDLE(RefSubOp, Unhandled);
195  HANDLE(RWProbeOp, Unhandled);
196  HANDLE(XMRRefOp, Unhandled);
197  HANDLE(XMRDerefOp, Unhandled);
198 
199  // Conversions.
200  HANDLE(HWStructCastOp, Unhandled);
201  HANDLE(UninferredResetCastOp, Unhandled);
202  HANDLE(ConstCastOp, Unhandled);
203  HANDLE(mlir::UnrealizedConversionCastOp, Unhandled);
204  HANDLE(BitCastOp, Unhandled);
205  HANDLE(RefCastOp, Unhandled);
206 
207  // Property expressions.
208  HANDLE(StringConstantOp, Unhandled);
209  HANDLE(FIntegerConstantOp, Unhandled);
210  HANDLE(BoolConstantOp, Unhandled);
211  HANDLE(DoubleConstantOp, Unhandled);
212  HANDLE(ListCreateOp, Unhandled);
213  HANDLE(PathOp, Unhandled);
214  HANDLE(UnresolvedPathOp, Unhandled);
215 #undef HANDLE
216 };
217 
218 /// ExprVisitor is a visitor for FIRRTL statement nodes.
219 template <typename ConcreteType, typename ResultType = void,
220  typename... ExtraArgs>
221 class StmtVisitor {
222 public:
223  ResultType dispatchStmtVisitor(Operation *op, ExtraArgs... args) {
224  auto *thisCast = static_cast<ConcreteType *>(this);
225  return TypeSwitch<Operation *, ResultType>(op)
226  .template Case<AttachOp, ConnectOp, StrictConnectOp, RefDefineOp,
227  ForceOp, PrintFOp, SkipOp, StopOp, WhenOp, AssertOp,
228  AssumeOp, CoverOp, PropAssignOp, RefForceOp,
229  RefForceInitialOp, RefReleaseOp, RefReleaseInitialOp,
230  VerifAssertIntrinsicOp, VerifAssumeIntrinsicOp,
231  VerifCoverIntrinsicOp, GroupOp>(
232  [&](auto opNode) -> ResultType {
233  return thisCast->visitStmt(opNode, args...);
234  })
235  .Default([&](auto expr) -> ResultType {
236  return thisCast->visitInvalidStmt(op, args...);
237  });
238  }
239 
240  /// This callback is invoked on any non-Stmt operations.
241  ResultType visitInvalidStmt(Operation *op, ExtraArgs... args) {
242  op->emitOpError("unknown firrtl stmt");
243  abort();
244  }
245 
246  /// This callback is invoked on any Stmt operations that are not handled
247  /// by the concrete visitor.
248  ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args) {
249  return ResultType();
250  }
251 
252 #define HANDLE(OPTYPE) \
253  ResultType visitStmt(OPTYPE op, ExtraArgs... args) { \
254  return static_cast<ConcreteType *>(this)->visitUnhandledStmt(op, args...); \
255  }
256 
257  HANDLE(AttachOp);
258  HANDLE(ConnectOp);
259  HANDLE(StrictConnectOp);
260  HANDLE(RefDefineOp);
261  HANDLE(ForceOp);
262  HANDLE(PrintFOp);
263  HANDLE(SkipOp);
264  HANDLE(StopOp);
265  HANDLE(WhenOp);
266  HANDLE(AssertOp);
267  HANDLE(AssumeOp);
268  HANDLE(CoverOp);
269  HANDLE(PropAssignOp);
270  HANDLE(RefForceOp);
271  HANDLE(RefForceInitialOp);
272  HANDLE(RefReleaseOp);
273  HANDLE(RefReleaseInitialOp);
274  HANDLE(VerifAssertIntrinsicOp);
275  HANDLE(VerifAssumeIntrinsicOp);
276  HANDLE(VerifCoverIntrinsicOp);
277  HANDLE(GroupOp);
278 
279 #undef HANDLE
280 };
281 
282 /// ExprVisitor is a visitor for FIRRTL declaration nodes.
283 template <typename ConcreteType, typename ResultType = void,
284  typename... ExtraArgs>
285 class DeclVisitor {
286 public:
287  ResultType dispatchDeclVisitor(Operation *op, ExtraArgs... args) {
288  auto *thisCast = static_cast<ConcreteType *>(this);
289  return TypeSwitch<Operation *, ResultType>(op)
290  .template Case<InstanceOp, ObjectOp, MemOp, NodeOp, RegOp, RegResetOp,
291  WireOp, VerbatimWireOp>([&](auto opNode) -> ResultType {
292  return thisCast->visitDecl(opNode, args...);
293  })
294  .Default([&](auto expr) -> ResultType {
295  return thisCast->visitInvalidDecl(op, args...);
296  });
297  }
298 
299  /// This callback is invoked on any non-Decl operations.
300  ResultType visitInvalidDecl(Operation *op, ExtraArgs... args) {
301  op->emitOpError("unknown firrtl decl");
302  abort();
303  }
304 
305  /// This callback is invoked on any Decl operations that are not handled
306  /// by the concrete visitor.
307  ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args) {
308  return ResultType();
309  }
310 
311 #define HANDLE(OPTYPE) \
312  ResultType visitDecl(OPTYPE op, ExtraArgs... args) { \
313  return static_cast<ConcreteType *>(this)->visitUnhandledDecl(op, args...); \
314  }
315 
316  HANDLE(InstanceOp);
317  HANDLE(ObjectOp);
318  HANDLE(MemOp);
319  HANDLE(NodeOp);
320  HANDLE(RegOp);
321  HANDLE(RegResetOp);
322  HANDLE(WireOp);
323  HANDLE(VerbatimWireOp);
324 #undef HANDLE
325 };
326 
327 /// FIRRTLVisitor allows you to visit all of the expr/stmt/decls with one class
328 /// declaration.
329 ///
330 /// Clients call dispatchVisitor to invoke the dispatch, and may implement
331 /// visitInvalidOp() to get notified about non-FIRRTL dialect nodes and
332 /// visitUnhandledOp() to get notified about FIRRTL dialect ops that are not
333 /// handled specifically.
334 template <typename ConcreteType, typename ResultType = void,
335  typename... ExtraArgs>
337  : public ExprVisitor<ConcreteType, ResultType, ExtraArgs...>,
338  public StmtVisitor<ConcreteType, ResultType, ExtraArgs...>,
339  public DeclVisitor<ConcreteType, ResultType, ExtraArgs...> {
340 public:
341  /// This is the main entrypoint for the FIRRTLVisitor.
342  ResultType dispatchVisitor(Operation *op, ExtraArgs... args) {
343  return this->dispatchExprVisitor(op, args...);
344  }
345 
346  // Chain from each visitor onto the next one.
347  ResultType visitInvalidExpr(Operation *op, ExtraArgs... args) {
348  return this->dispatchStmtVisitor(op, args...);
349  }
350  ResultType visitInvalidStmt(Operation *op, ExtraArgs... args) {
351  return this->dispatchDeclVisitor(op, args...);
352  }
353  ResultType visitInvalidDecl(Operation *op, ExtraArgs... args) {
354  return static_cast<ConcreteType *>(this)->visitInvalidOp(op, args...);
355  }
356 
357  // Default to chaining visitUnhandledXXX to visitUnhandledOp.
358  ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args) {
359  return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
360  }
361  ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args) {
362  return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
363  }
364  ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args) {
365  return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
366  }
367 
368  /// visitInvalidOp is an override point for non-FIRRTL dialect operations.
369  ResultType visitInvalidOp(Operation *op, ExtraArgs... args) {
370  return ResultType();
371  }
372 
373  /// visitUnhandledOp is an override point for FIRRTL dialect ops that the
374  /// concrete visitor didn't bother to implement.
375  ResultType visitUnhandledOp(Operation *op, ExtraArgs... args) {
376  return ResultType();
377  }
378 };
379 } // namespace firrtl
380 } // namespace circt
381 
382 #endif // CIRCT_DIALECT_FIRRTL_FIRRTLVISITORS_H
ExprVisitor is a visitor for FIRRTL declaration nodes.
ResultType dispatchDeclVisitor(Operation *op, ExtraArgs... args)
ResultType visitInvalidDecl(Operation *op, ExtraArgs... args)
This callback is invoked on any non-Decl operations.
ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args)
This callback is invoked on any Decl operations that are not handled by the concrete visitor.
ExprVisitor is a visitor for FIRRTL expression nodes.
HANDLE(ListCreateOp, Unhandled)
HANDLE(DoubleConstantOp, Unhandled)
HANDLE(LTLNotIntrinsicOp, Unhandled)
HANDLE(PadPrimOp, Unhandled)
HANDLE(SubPrimOp, Binary)
HANDLE(ElementwiseXorPrimOp, Unhandled)
HANDLE(AddPrimOp, Binary)
HANDLE(BitsPrimOp, Unhandled)
HANDLE(RWProbeOp, Unhandled)
HANDLE(LTLAndIntrinsicOp, Unhandled)
HANDLE(OpenSubfieldOp, Unhandled)
HANDLE(BoolConstantOp, Unhandled)
HANDLE(AndRPrimOp, Unary)
HANDLE(HeadPrimOp, Unhandled)
HANDLE(LTPrimOp, Binary)
HANDLE(LTLDisableIntrinsicOp, Unhandled)
HANDLE(BitCastOp, Unhandled)
HANDLE(SubindexOp, Unhandled)
HANDLE(HasBeenResetIntrinsicOp, Unhandled)
HANDLE(SubfieldOp, Unhandled)
HANDLE(DShrPrimOp, Binary)
HANDLE(AsUIntPrimOp, Unary)
HANDLE(LTLDelayIntrinsicOp, Unhandled)
HANDLE(RefCastOp, Unhandled)
HANDLE(ElementwiseOrPrimOp, Unhandled)
HANDLE(MultibitMuxOp, Unhandled)
HANDLE(XorRPrimOp, Unary)
HANDLE(ConstCastOp, Unhandled)
HANDLE(Mux4CellIntrinsicOp, Unhandled)
HANDLE(StringConstantOp, Unhandled)
HANDLE(LTLConcatIntrinsicOp, Unhandled)
HANDLE(TagExtractOp, Unhandled)
HANDLE(UninferredResetCastOp, Unhandled)
HANDLE(XorPrimOp, Binary)
HANDLE(MulPrimOp, Binary)
HANDLE(LTLImplicationIntrinsicOp, Unhandled)
ResultType visitInvalidExpr(Operation *op, ExtraArgs... args)
This callback is invoked on any non-expression operations.
HANDLE(OrPrimOp, Binary)
ResultType dispatchExprVisitor(Operation *op, ExtraArgs... args)
HANDLE(RefSubOp, Unhandled)
HANDLE(RemPrimOp, Binary)
HANDLE(Mux2CellIntrinsicOp, Unhandled)
HANDLE(MuxPrimOp, Unhandled)
HANDLE(BundleCreateOp, Unhandled)
HANDLE(PlusArgsTestIntrinsicOp, Unhandled)
HANDLE(mlir::UnrealizedConversionCastOp, Unhandled)
HANDLE(FEnumCreateOp, Unhandled)
HANDLE(RefSendOp, Unhandled)
HANDLE(XMRDerefOp, Unhandled)
HANDLE(ShrPrimOp, Unhandled)
HANDLE(UnresolvedPathOp, Unhandled)
HANDLE(PlusArgsValueIntrinsicOp, Unhandled)
HANDLE(LTLOrIntrinsicOp, Unhandled)
HANDLE(CatPrimOp, Binary)
HANDLE(FIntegerConstantOp, Unhandled)
HANDLE(HWStructCastOp, Unhandled)
HANDLE(ClockGateIntrinsicOp, Unhandled)
HANDLE(OpenSubindexOp, Unhandled)
HANDLE(ObjectSubfieldOp, Unhandled)
HANDLE(InvalidValueOp, Unhandled)
HANDLE(SubaccessOp, Unhandled)
HANDLE(DShlPrimOp, Binary)
HANDLE(ShlPrimOp, Unhandled)
HANDLE(IsXIntrinsicOp, Unhandled)
HANDLE(RefResolveOp, Unhandled)
HANDLE(NotPrimOp, Unary)
HANDLE(XMRRefOp, Unhandled)
HANDLE(TailPrimOp, Unhandled)
HANDLE(GTPrimOp, Binary)
HANDLE(LTLClockIntrinsicOp, Unhandled)
HANDLE(GEQPrimOp, Binary)
HANDLE(ElementwiseAndPrimOp, Unhandled)
HANDLE(CvtPrimOp, Unary)
ResultType visitUnaryExpr(Operation *op, ExtraArgs... args)
This fallback is invoked on any unary expr that isn't explicitly handled.
HANDLE(SizeOfIntrinsicOp, Unhandled)
ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args)
This callback is invoked on any expression operations that are not handled by the concrete visitor.
HANDLE(NegPrimOp, Unary)
HANDLE(LEQPrimOp, Binary)
HANDLE(ConstantOp, Unhandled)
HANDLE(AsAsyncResetPrimOp, Unary)
HANDLE(DShlwPrimOp, Binary)
ResultType visitBinaryExpr(Operation *op, ExtraArgs... args)
This fallback is invoked on any binary expr that isn't explicitly handled.
HANDLE(OrRPrimOp, Unary)
HANDLE(AggregateConstantOp, Unhandled)
HANDLE(AndPrimOp, Binary)
HANDLE(AsClockPrimOp, Unary)
HANDLE(SpecialConstantOp, Unhandled)
HANDLE(VectorCreateOp, Unhandled)
HANDLE(LTLEventuallyIntrinsicOp, Unhandled)
HANDLE(DivPrimOp, Binary)
HANDLE(EQPrimOp, Binary)
HANDLE(NEQPrimOp, Binary)
HANDLE(SubtagOp, Unhandled)
HANDLE(VerbatimExprOp, Unhandled)
HANDLE(IsTagOp, Unhandled)
HANDLE(AsSIntPrimOp, Unary)
HANDLE(PathOp, Unhandled)
FIRRTLVisitor allows you to visit all of the expr/stmt/decls with one class declaration.
ResultType dispatchVisitor(Operation *op, ExtraArgs... args)
This is the main entrypoint for the FIRRTLVisitor.
ResultType visitInvalidOp(Operation *op, ExtraArgs... args)
visitInvalidOp is an override point for non-FIRRTL dialect operations.
ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args)
ResultType visitUnhandledOp(Operation *op, ExtraArgs... args)
visitUnhandledOp is an override point for FIRRTL dialect ops that the concrete visitor didn't bother ...
ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args)
ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args)
ResultType visitInvalidDecl(Operation *op, ExtraArgs... args)
ResultType visitInvalidExpr(Operation *op, ExtraArgs... args)
ResultType visitInvalidStmt(Operation *op, ExtraArgs... args)
ExprVisitor is a visitor for FIRRTL statement nodes.
HANDLE(VerifCoverIntrinsicOp)
HANDLE(RefForceInitialOp)
ResultType dispatchStmtVisitor(Operation *op, ExtraArgs... args)
HANDLE(StrictConnectOp)
HANDLE(VerifAssertIntrinsicOp)
ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args)
This callback is invoked on any Stmt operations that are not handled by the concrete visitor.
HANDLE(RefReleaseInitialOp)
ResultType visitInvalidStmt(Operation *op, ExtraArgs... args)
This callback is invoked on any non-Stmt operations.
HANDLE(VerifAssumeIntrinsicOp)
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
Definition: DebugAnalysis.h:21