CIRCT  20.0.0git
RTGTestModule.cpp
Go to the documentation of this file.
1 //===- RTGTestModule.cpp - RTGTest API pybind module ----------------------===//
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 #include "CIRCTModules.h"
10 
12 
13 #include "mlir/Bindings/Python/PybindAdaptors.h"
14 
15 #include <pybind11/pybind11.h>
16 #include <pybind11/pytypes.h>
17 #include <pybind11/stl.h>
18 namespace py = pybind11;
19 
20 using namespace circt;
21 using namespace mlir::python::adaptors;
22 
23 /// Populate the rtgtest python module.
24 void circt::python::populateDialectRTGTestSubmodule(py::module &m) {
25  m.doc() = "RTGTest dialect Python native extension";
26 
27  mlir_type_subclass(m, "CPUType", rtgtestTypeIsACPU)
28  .def_classmethod(
29  "get",
30  [](py::object cls, MlirContext ctxt) {
31  return cls(rtgtestCPUTypeGet(ctxt));
32  },
33  py::arg("self"), py::arg("ctxt") = nullptr);
34 }
MLIR_CAPI_EXPORTED MlirType rtgtestCPUTypeGet(MlirContext ctxt)
Creates an RTGTest CPU type in the context.
Definition: RTGTest.cpp:30
MLIR_CAPI_EXPORTED bool rtgtestTypeIsACPU(MlirType type)
If the type is an RTGTest CPUType.
Definition: RTGTest.cpp:28
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21