CIRCT 20.0.0git
Loading...
Searching...
No Matches
SeqModule.cpp
Go to the documentation of this file.
1//===- SeqModule.cpp - Seq API nanobind 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
11#include "circt-c/Dialect/Seq.h"
12#include "mlir/Bindings/Python/NanobindAdaptors.h"
13
14#include "NanobindUtils.h"
15#include "mlir-c/Support.h"
16#include <nanobind/nanobind.h>
17
18namespace nb = nanobind;
19
20using namespace circt;
21using namespace mlir::python::nanobind_adaptors;
22
23/// Populate the seq python module.
25 m.doc() = "Seq dialect Python native extension";
26
27 mlir_type_subclass(m, "ClockType", seqTypeIsAClock)
28 .def_classmethod(
29 "get",
30 [](nb::object cls, MlirContext ctx) {
31 return cls(seqClockTypeGet(ctx));
32 },
33 nb::arg("cls"), nb::arg("context") = nb::none());
34
35 mlir_type_subclass(m, "ImmutableType", seqTypeIsAImmutable)
36 .def_classmethod("get",
37 [](nb::object cls, MlirType innerType) {
38 return cls(seqImmutableTypeGet(innerType));
39 })
40 .def_property_readonly("inner_type", [](MlirType self) {
42 });
43}
MLIR_CAPI_EXPORTED bool seqTypeIsAClock(MlirType type)
If the type is an clock type.
Definition Seq.cpp:22
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGetInnerType(MlirType type)
Creates a seq immutable type.
Definition Seq.cpp:38
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGet(MlirType type)
Creates a seq immutable type.
Definition Seq.cpp:34
MLIR_CAPI_EXPORTED bool seqTypeIsAImmutable(MlirType type)
If the type is an immutable type.
Definition Seq.cpp:30
MLIR_CAPI_EXPORTED MlirType seqClockTypeGet(MlirContext ctx)
Creates an seq clock type.
Definition Seq.cpp:26
void populateDialectSeqSubmodule(nanobind::module_ &m)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.