CIRCT 24.0.0git
Loading...
Searching...
No Matches
ProbeDialect.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
13
14using namespace circt;
15using namespace mlir;
16using namespace probe;
17
18namespace {
19struct ProbeHWModulePortTypeInterface : public hw::HWModulePortTypeInterface {
21
22 LogicalResult
23 verifyHWModulePortType(function_ref<InFlightDiagnostic()> emitError,
25 Type type) const override {
26 if (!isa<probe::RefType>(type) || direction == hw::ModulePort::Output)
27 return success();
28 return emitError() << "probe refs are only supported on output ports";
29 }
30};
31} // namespace
32
33void ProbeDialect::initialize() {
34 registerOps();
35 registerTypes();
36 addInterfaces<ProbeHWModulePortTypeInterface>();
37}
38
39// Dialect implementation generated from `ProbeDialect.td`
40#include "circt/Dialect/Probe/ProbeDialect.cpp.inc"
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
HWModulePortTypeInterface(mlir::Dialect *dialect)
Definition HWTypes.h:39