CIRCT  19.0.0git
SeqModule.cpp
Go to the documentation of this file.
1 //===- SeqModule.cpp - Seq 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 "DialectModules.h"
10 
11 #include "circt-c/Dialect/Seq.h"
12 #include "mlir/Bindings/Python/PybindAdaptors.h"
13 
14 #include "PybindUtils.h"
15 #include "mlir-c/Support.h"
16 #include <pybind11/pybind11.h>
17 #include <pybind11/pytypes.h>
18 #include <pybind11/stl.h>
19 
20 namespace py = pybind11;
21 
22 using namespace circt;
23 using namespace mlir::python::adaptors;
24 
25 /// Populate the seq python module.
27  m.doc() = "Seq dialect Python native extension";
28 
29  mlir_type_subclass(m, "ClockType", seqTypeIsAClock)
30  .def_classmethod(
31  "get",
32  [](py::object cls, MlirContext ctx) {
33  return cls(seqClockTypeGet(ctx));
34  },
35  py::arg("cls"), py::arg("context") = py::none());
36 }
MLIR_CAPI_EXPORTED bool seqTypeIsAClock(MlirType type)
If the type is an clock type.
Definition: Seq.cpp:22
MLIR_CAPI_EXPORTED MlirType seqClockTypeGet(MlirContext ctx)
Creates an seq clock type.
Definition: Seq.cpp:24
void populateDialectSeqSubmodule(pybind11::module &m)
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
Definition: DebugAnalysis.h:21