CIRCT 24.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
26Operation *SynthDialect::materializeConstant(OpBuilder &builder,
27 Attribute value, Type type,
28 Location loc) {
29 // Integer constants.
30 if (auto intType = dyn_cast<IntegerType>(type))
31 if (auto attrValue = dyn_cast<IntegerAttr>(value))
32 return hw::ConstantOp::create(builder, loc, type, attrValue);
33 return nullptr;
34}
35
36#include "circt/Dialect/Synth/SynthDialect.cpp.inc"
37
38#define GET_ATTRDEF_CLASSES
39#include "circt/Dialect/Synth/SynthAttributes.cpp.inc"
40
41#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