CIRCT  19.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, ClockInverterIntrinsicOp,
52  ClockDividerIntrinsicOp, LTLAndIntrinsicOp, LTLOrIntrinsicOp,
53  LTLDelayIntrinsicOp, LTLConcatIntrinsicOp, LTLNotIntrinsicOp,
54  LTLImplicationIntrinsicOp, LTLEventuallyIntrinsicOp,
55  LTLClockIntrinsicOp, LTLDisableIntrinsicOp, Mux2CellIntrinsicOp,
56  Mux4CellIntrinsicOp, 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  // Property expressions.
64  StringConstantOp, FIntegerConstantOp, BoolConstantOp,
65  DoubleConstantOp, ListCreateOp, UnresolvedPathOp, PathOp>(
66  [&](auto expr) -> ResultType {
67  return thisCast->visitExpr(expr, args...);
68  })
69  .Default([&](auto expr) -> ResultType {
70  return thisCast->visitInvalidExpr(op, args...);
71  });
72  }
73 
74  /// This callback is invoked on any non-expression operations.
75  ResultType visitInvalidExpr(Operation *op, ExtraArgs... args) {
76  op->emitOpError("unknown FIRRTL expression");
77  abort();
78  }
79 
80  /// This callback is invoked on any expression operations that are not handled
81  /// by the concrete visitor.
82  ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args) {
83  return ResultType();
84  }
85 
86  /// This fallback is invoked on any unary expr that isn't explicitly handled.
87  /// The default implementation delegates to the unhandled expression fallback.
88  ResultType visitUnaryExpr(Operation *op, ExtraArgs... args) {
89  return static_cast<ConcreteType *>(this)->visitUnhandledExpr(op, args...);
90  }
91 
92  /// This fallback is invoked on any binary expr that isn't explicitly handled.
93  /// The default implementation delegates to the unhandled expression fallback.
94  ResultType visitBinaryExpr(Operation *op, ExtraArgs... args) {
95  return static_cast<ConcreteType *>(this)->visitUnhandledExpr(op, args...);
96  }
97 
98 #define HANDLE(OPTYPE, OPKIND) \
99  ResultType visitExpr(OPTYPE op, ExtraArgs... args) { \
100  return static_cast<ConcreteType *>(this)->visit##OPKIND##Expr(op, \
101  args...); \
102  }
103 
104  // Basic expressions.
105  HANDLE(ConstantOp, Unhandled);
106  HANDLE(SpecialConstantOp, Unhandled);
107  HANDLE(AggregateConstantOp, Unhandled);
108  HANDLE(BundleCreateOp, Unhandled);
109  HANDLE(VectorCreateOp, Unhandled);
110  HANDLE(FEnumCreateOp, Unhandled);
111  HANDLE(SubfieldOp, Unhandled);
112  HANDLE(SubindexOp, Unhandled);
113  HANDLE(SubaccessOp, Unhandled);
114  HANDLE(IsTagOp, Unhandled);
115  HANDLE(SubtagOp, Unhandled);
116  HANDLE(TagExtractOp, Unhandled);
117  HANDLE(MultibitMuxOp, Unhandled);
118  HANDLE(OpenSubfieldOp, Unhandled);
119  HANDLE(OpenSubindexOp, Unhandled);
120  HANDLE(ObjectSubfieldOp, Unhandled);
121 
122  // Arithmetic and Logical Binary Primitives.
123  HANDLE(AddPrimOp, Binary);
124  HANDLE(SubPrimOp, Binary);
125  HANDLE(MulPrimOp, Binary);
126  HANDLE(DivPrimOp, Binary);
127  HANDLE(RemPrimOp, Binary);
128  HANDLE(AndPrimOp, Binary);
129  HANDLE(OrPrimOp, Binary);
130  HANDLE(XorPrimOp, Binary);
131 
132  // Comparisons.
133  HANDLE(LEQPrimOp, Binary);
134  HANDLE(LTPrimOp, Binary);
135  HANDLE(GEQPrimOp, Binary);
136  HANDLE(GTPrimOp, Binary);
137  HANDLE(EQPrimOp, Binary);
138  HANDLE(NEQPrimOp, Binary);
139 
140  // Misc Binary Primitives.
141  HANDLE(CatPrimOp, Binary);
142  HANDLE(DShlPrimOp, Binary);
143  HANDLE(DShlwPrimOp, Binary);
144  HANDLE(DShrPrimOp, Binary);
145 
146  // Unary operators.
147  HANDLE(AsSIntPrimOp, Unary);
148  HANDLE(AsUIntPrimOp, Unary);
149  HANDLE(AsAsyncResetPrimOp, Unary);
150  HANDLE(AsClockPrimOp, Unary);
151  HANDLE(CvtPrimOp, Unary);
152  HANDLE(NegPrimOp, Unary);
153  HANDLE(NotPrimOp, Unary);
154  HANDLE(AndRPrimOp, Unary);
155  HANDLE(OrRPrimOp, Unary);
156  HANDLE(XorRPrimOp, Unary);
157 
158  HANDLE(ElementwiseOrPrimOp, Unhandled);
159  HANDLE(ElementwiseAndPrimOp, Unhandled);
160  HANDLE(ElementwiseXorPrimOp, Unhandled);
161 
162  // Intrinsic Expr.
163  HANDLE(IsXIntrinsicOp, Unhandled);
164  HANDLE(PlusArgsValueIntrinsicOp, Unhandled);
165  HANDLE(PlusArgsTestIntrinsicOp, Unhandled);
166  HANDLE(SizeOfIntrinsicOp, Unhandled);
167  HANDLE(ClockGateIntrinsicOp, Unhandled);
168  HANDLE(ClockInverterIntrinsicOp, Unhandled);
169  HANDLE(ClockDividerIntrinsicOp, Unhandled);
170  HANDLE(LTLAndIntrinsicOp, Unhandled);
171  HANDLE(LTLOrIntrinsicOp, Unhandled);
172  HANDLE(LTLDelayIntrinsicOp, Unhandled);
173  HANDLE(LTLConcatIntrinsicOp, Unhandled);
174  HANDLE(LTLNotIntrinsicOp, Unhandled);
175  HANDLE(LTLImplicationIntrinsicOp, Unhandled);
176  HANDLE(LTLEventuallyIntrinsicOp, Unhandled);
177  HANDLE(LTLClockIntrinsicOp, Unhandled);
178  HANDLE(LTLDisableIntrinsicOp, Unhandled);
179  HANDLE(Mux4CellIntrinsicOp, Unhandled);
180  HANDLE(Mux2CellIntrinsicOp, Unhandled);
181  HANDLE(HasBeenResetIntrinsicOp, Unhandled);
182 
183  // Miscellaneous.
184  HANDLE(BitsPrimOp, Unhandled);
185  HANDLE(HeadPrimOp, Unhandled);
186  HANDLE(InvalidValueOp, Unhandled);
187  HANDLE(MuxPrimOp, Unhandled);
188  HANDLE(PadPrimOp, Unhandled);
189  HANDLE(ShlPrimOp, Unhandled);
190  HANDLE(ShrPrimOp, Unhandled);
191  HANDLE(TailPrimOp, Unhandled);
192  HANDLE(VerbatimExprOp, Unhandled);
193  HANDLE(RefSendOp, Unhandled);
194  HANDLE(RefResolveOp, Unhandled);
195  HANDLE(RefSubOp, Unhandled);
196  HANDLE(RWProbeOp, Unhandled);
197  HANDLE(XMRRefOp, Unhandled);
198  HANDLE(XMRDerefOp, Unhandled);
199 
200  // Conversions.
201  HANDLE(HWStructCastOp, Unhandled);
202  HANDLE(UninferredResetCastOp, Unhandled);
203  HANDLE(ConstCastOp, 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  FPGAProbeIntrinsicOp, VerifAssertIntrinsicOp,
231  VerifAssumeIntrinsicOp, UnclockedAssumeIntrinsicOp,
232  VerifCoverIntrinsicOp, LayerBlockOp>(
233  [&](auto opNode) -> ResultType {
234  return thisCast->visitStmt(opNode, args...);
235  })
236  .Default([&](auto expr) -> ResultType {
237  return thisCast->visitInvalidStmt(op, args...);
238  });
239  }
240 
241  /// This callback is invoked on any non-Stmt operations.
242  ResultType visitInvalidStmt(Operation *op, ExtraArgs... args) {
243  op->emitOpError("unknown firrtl stmt");
244  abort();
245  }
246 
247  /// This callback is invoked on any Stmt operations that are not handled
248  /// by the concrete visitor.
249  ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args) {
250  return ResultType();
251  }
252 
253 #define HANDLE(OPTYPE) \
254  ResultType visitStmt(OPTYPE op, ExtraArgs... args) { \
255  return static_cast<ConcreteType *>(this)->visitUnhandledStmt(op, args...); \
256  }
257 
258  HANDLE(AttachOp);
259  HANDLE(ConnectOp);
260  HANDLE(StrictConnectOp);
261  HANDLE(RefDefineOp);
262  HANDLE(ForceOp);
263  HANDLE(PrintFOp);
264  HANDLE(SkipOp);
265  HANDLE(StopOp);
266  HANDLE(WhenOp);
267  HANDLE(AssertOp);
268  HANDLE(AssumeOp);
269  HANDLE(CoverOp);
270  HANDLE(PropAssignOp);
271  HANDLE(RefForceOp);
272  HANDLE(RefForceInitialOp);
273  HANDLE(RefReleaseOp);
274  HANDLE(RefReleaseInitialOp);
275  HANDLE(FPGAProbeIntrinsicOp);
276  HANDLE(VerifAssertIntrinsicOp);
277  HANDLE(VerifAssumeIntrinsicOp);
278  HANDLE(VerifCoverIntrinsicOp);
279  HANDLE(UnclockedAssumeIntrinsicOp);
280  HANDLE(LayerBlockOp);
281 
282 #undef HANDLE
283 };
284 
285 /// ExprVisitor is a visitor for FIRRTL declaration nodes.
286 template <typename ConcreteType, typename ResultType = void,
287  typename... ExtraArgs>
288 class DeclVisitor {
289 public:
290  ResultType dispatchDeclVisitor(Operation *op, ExtraArgs... args) {
291  auto *thisCast = static_cast<ConcreteType *>(this);
292  return TypeSwitch<Operation *, ResultType>(op)
293  .template Case<InstanceOp, ObjectOp, MemOp, NodeOp, RegOp, RegResetOp,
294  WireOp, VerbatimWireOp>([&](auto opNode) -> ResultType {
295  return thisCast->visitDecl(opNode, args...);
296  })
297  .Default([&](auto expr) -> ResultType {
298  return thisCast->visitInvalidDecl(op, args...);
299  });
300  }
301 
302  /// This callback is invoked on any non-Decl operations.
303  ResultType visitInvalidDecl(Operation *op, ExtraArgs... args) {
304  op->emitOpError("unknown firrtl decl");
305  abort();
306  }
307 
308  /// This callback is invoked on any Decl operations that are not handled
309  /// by the concrete visitor.
310  ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args) {
311  return ResultType();
312  }
313 
314 #define HANDLE(OPTYPE) \
315  ResultType visitDecl(OPTYPE op, ExtraArgs... args) { \
316  return static_cast<ConcreteType *>(this)->visitUnhandledDecl(op, args...); \
317  }
318 
319  HANDLE(InstanceOp);
320  HANDLE(ObjectOp);
321  HANDLE(MemOp);
322  HANDLE(NodeOp);
323  HANDLE(RegOp);
324  HANDLE(RegResetOp);
325  HANDLE(WireOp);
326  HANDLE(VerbatimWireOp);
327 #undef HANDLE
328 };
329 
330 /// FIRRTLVisitor allows you to visit all of the expr/stmt/decls with one class
331 /// declaration.
332 ///
333 /// Clients call dispatchVisitor to invoke the dispatch, and may implement
334 /// visitInvalidOp() to get notified about non-FIRRTL dialect nodes and
335 /// visitUnhandledOp() to get notified about FIRRTL dialect ops that are not
336 /// handled specifically.
337 template <typename ConcreteType, typename ResultType = void,
338  typename... ExtraArgs>
340  : public ExprVisitor<ConcreteType, ResultType, ExtraArgs...>,
341  public StmtVisitor<ConcreteType, ResultType, ExtraArgs...>,
342  public DeclVisitor<ConcreteType, ResultType, ExtraArgs...> {
343 public:
344  /// This is the main entrypoint for the FIRRTLVisitor.
345  ResultType dispatchVisitor(Operation *op, ExtraArgs... args) {
346  return this->dispatchExprVisitor(op, args...);
347  }
348 
349  /// Special handling for generic intrinsic op which aren't quite expressions
350  /// nor statements in the usual FIRRTL sense.
351  /// Refactor into specific visitor instead of adding more here.
352  ResultType visitIntrinsicOp(GenericIntrinsicOp *op, ExtraArgs... args) {
353  return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
354  }
355 
356  // Chain from each visitor onto the next one.
357  ResultType visitInvalidExpr(Operation *op, ExtraArgs... args) {
358  return this->dispatchStmtVisitor(op, args...);
359  }
360  ResultType visitInvalidStmt(Operation *op, ExtraArgs... args) {
361  return this->dispatchDeclVisitor(op, args...);
362  }
363  ResultType visitInvalidDecl(Operation *op, ExtraArgs... args) {
364  return static_cast<ConcreteType *>(this)->visitInvalidOp(op, args...);
365  }
366 
367  // Default to chaining visitUnhandledXXX to visitUnhandledOp.
368  ResultType visitUnhandledExpr(Operation *op, ExtraArgs... args) {
369  return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
370  }
371  ResultType visitUnhandledStmt(Operation *op, ExtraArgs... args) {
372  return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
373  }
374  ResultType visitUnhandledDecl(Operation *op, ExtraArgs... args) {
375  return static_cast<ConcreteType *>(this)->visitUnhandledOp(op, args...);
376  }
377 
378  /// visitInvalidOp is an override point for non-FIRRTL dialect operations.
379  ResultType visitInvalidOp(Operation *op, ExtraArgs... args) {
380  return ResultType();
381  }
382 
383  /// visitUnhandledOp is an override point for FIRRTL dialect ops that the
384  /// concrete visitor didn't bother to implement.
385  ResultType visitUnhandledOp(Operation *op, ExtraArgs... args) {
386  return ResultType();
387  }
388 };
389 } // namespace firrtl
390 } // namespace circt
391 
392 #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(ClockDividerIntrinsicOp, 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(ClockInverterIntrinsicOp, Unhandled)
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(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 visitIntrinsicOp(GenericIntrinsicOp *op, ExtraArgs... args)
Special handling for generic intrinsic op which aren't quite expressions nor statements in the usual ...
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(UnclockedAssumeIntrinsicOp)
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)
HANDLE(FPGAProbeIntrinsicOp)
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