CIRCT 23.0.0git
Loading...
Searching...
No Matches
SynthDialect.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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
14#include "mlir/IR/DialectImplementation.h"
15
16using namespace circt;
17using namespace synth;
18
19void SynthDialect::initialize() {
20 addAttributes<
21#define GET_ATTRDEF_LIST
22#include "circt/Dialect/Synth/SynthAttributes.cpp.inc"
23 >();
24
25 addOperations<
26#define GET_OP_LIST
27#include "circt/Dialect/Synth/Synth.cpp.inc"
28 >();
29}
30
31Operation *SynthDialect::materializeConstant(OpBuilder &builder,
32 Attribute value, Type type,
33 Location loc) {
34 // Integer constants.
35 if (auto intType = dyn_cast<IntegerType>(type))
36 if (auto attrValue = dyn_cast<IntegerAttr>(value))
37 return hw::ConstantOp::create(builder, loc, type, attrValue);
38 return nullptr;
39}
40
41#include "circt/Dialect/Synth/SynthDialect.cpp.inc"
42
43#define GET_ATTRDEF_CLASSES
44#include "circt/Dialect/Synth/SynthAttributes.cpp.inc"
45
46#include "circt/Dialect/Synth/SynthEnums.cpp.inc"
create(data_type, value)
Definition hw.py:433
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition synth.py:1