CIRCT  19.0.0git
VerifDialect.cpp
Go to the documentation of this file.
1 //===- VerifDialect.cpp - Verif dialect implementation --------------------===//
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 
10 #include "circt/Dialect/HW/HWOps.h"
12 #include "mlir/IR/Builders.h"
13 #include "mlir/IR/DialectImplementation.h"
14 
15 using namespace circt;
16 using namespace verif;
17 
18 void VerifDialect::initialize() {
19  addOperations<
20 #define GET_OP_LIST
21 #include "circt/Dialect/Verif/Verif.cpp.inc"
22  >();
23 }
24 
25 Operation *VerifDialect::materializeConstant(OpBuilder &builder,
26  Attribute value, Type type,
27  Location loc) {
28  if (auto intType = dyn_cast<IntegerType>(type))
29  if (auto attrValue = dyn_cast<IntegerAttr>(value))
30  return builder.create<hw::ConstantOp>(loc, type, attrValue);
31  return nullptr;
32 }
33 
34 #include "circt/Dialect/Verif/VerifDialect.cpp.inc"
Builder builder
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
Definition: verif.py:1