CIRCT 24.0.0git
Loading...
Searching...
No Matches
MooreDialect.cpp
Go to the documentation of this file.
1//===- MooreDialect.cpp - Implement the Moore dialect ---------------------===//
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 implements the Moore dialect.
10//
11//===----------------------------------------------------------------------===//
12
15
16using namespace circt;
17using namespace circt::moore;
18
19//===----------------------------------------------------------------------===//
20// Dialect specification.
21//===----------------------------------------------------------------------===//
22
23void MooreDialect::initialize() {
24 // Register types and attributes.
25 registerTypes();
26 registerAttributes();
27
28 // Register operations.
29}
30
31Operation *MooreDialect::materializeConstant(OpBuilder &builder,
32 Attribute value, Type type,
33 Location loc) {
34 if (auto intType = dyn_cast<IntType>(type))
35 if (auto intValue = dyn_cast<FVIntegerAttr>(value))
36 return ConstantOp::create(builder, loc, intType, intValue);
37 if (auto timeType = dyn_cast<TimeType>(type))
38 if (auto timeValue = dyn_cast<IntegerAttr>(value))
39 return ConstantTimeOp::create(builder, loc, timeType, timeValue);
40 return nullptr;
41}
42
43#include "circt/Dialect/Moore/MooreDialect.cpp.inc"
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.