From 4469a95ca583ba21c972376d82c643b057ea362e Mon Sep 17 00:00:00 2001 From: Martin Erhart Date: Sun, 24 Nov 2024 13:52:59 +0000 Subject: [PATCH] [RTG] Add Python Bindings --- .../circt/Dialect/RTGTest/IR/RTGTestOps.td | 1 - .../Bindings/Python/dialects/rtg.py | 67 ++++++++ lib/Bindings/Python/CIRCTModule.cpp | 23 +++ lib/Bindings/Python/CIRCTModules.h | 5 + lib/Bindings/Python/CMakeLists.txt | 90 +++++++---- lib/Bindings/Python/RTGModule.cpp | 62 ++++++++ lib/Bindings/Python/RTGTestModule.cpp | 34 +++++ lib/Bindings/Python/RTGToolModule.cpp | 143 ++++++++++++++++++ lib/Bindings/Python/dialects/RTGOps.td | 14 ++ lib/Bindings/Python/dialects/RTGTestOps.td | 14 ++ lib/Bindings/Python/dialects/rtg.py | 6 + lib/Bindings/Python/dialects/rtgtest.py | 6 + lib/Bindings/Python/rtgtool_support.py | 5 + 13 files changed, 443 insertions(+), 27 deletions(-) create mode 100644 integration_test/Bindings/Python/dialects/rtg.py create mode 100644 lib/Bindings/Python/RTGModule.cpp create mode 100644 lib/Bindings/Python/RTGTestModule.cpp create mode 100644 lib/Bindings/Python/RTGToolModule.cpp create mode 100644 lib/Bindings/Python/dialects/RTGOps.td create mode 100644 lib/Bindings/Python/dialects/RTGTestOps.td create mode 100644 lib/Bindings/Python/dialects/rtg.py create mode 100644 lib/Bindings/Python/dialects/rtgtest.py create mode 100644 lib/Bindings/Python/rtgtool_support.py diff --git a/include/circt/Dialect/RTGTest/IR/RTGTestOps.td b/include/circt/Dialect/RTGTest/IR/RTGTestOps.td index e64f6c8ac21e..697cf6c38571 100644 --- a/include/circt/Dialect/RTGTest/IR/RTGTestOps.td +++ b/include/circt/Dialect/RTGTest/IR/RTGTestOps.td @@ -20,7 +20,6 @@ class RTGTestOp traits = []> : def CPUDeclOp : RTGTestOp<"cpu_decl", [ Pure, - ConstantLike, ContextResourceDefining, ]> { let summary = "declare a CPU"; diff --git a/integration_test/Bindings/Python/dialects/rtg.py b/integration_test/Bindings/Python/dialects/rtg.py new file mode 100644 index 000000000000..d19789c4ddb9 --- /dev/null +++ b/integration_test/Bindings/Python/dialects/rtg.py @@ -0,0 +1,67 @@ +# REQUIRES: bindings_python +# RUN: %PYTHON% %s | FileCheck %s + +import circt + +from circt.dialects import rtg, rtgtest +from circt.ir import Context, Location, Module, InsertionPoint, Block, StringAttr, TypeAttr +from circt.passmanager import PassManager +from circt import rtgtool_support as rtgtool + +with Context() as ctx, Location.unknown(): + circt.register_dialects(ctx) + m = Module.create() + with InsertionPoint(m.body): + cpuTy = rtgtest.CPUType.get() + dictTy = rtg.DictType.get( + ctx, + [StringAttr.get('cpu0'), StringAttr.get('cpu1')], [cpuTy, cpuTy]) + + target = rtg.TargetOp('target_name', TypeAttr.get(dictTy)) + targetBlock = Block.create_at_start(target.bodyRegion, []) + with InsertionPoint(targetBlock): + cpu0 = rtgtest.CPUDeclOp(cpuTy, 0) + cpu1 = rtgtest.CPUDeclOp(cpuTy, 1) + rtg.YieldOp([cpu0, cpu1]) + + test = rtg.TestOp('test_name', TypeAttr.get(dictTy)) + Block.create_at_start(test.bodyRegion, [cpuTy, cpuTy]) + + # CHECK: rtg.target @target_name : !rtg.dict { + # CHECK: [[V0:%.+]] = rtgtest.cpu_decl 0 + # CHECK: [[V1:%.+]] = rtgtest.cpu_decl 1 + # CHECK: rtg.yield [[V0]], [[V1]] : !rtgtest.cpu, !rtgtest.cpu + # CHECK: } + # CHECK: rtg.test @test_name : !rtg.dict { + # CHECK: ^bb{{.*}}(%{{.*}}: !rtgtest.cpu, %{{.*}}: !rtgtest.cpu): + # CHECK: } + print(m) + + m = Module.create() + with InsertionPoint(m.body): + seq = rtg.SequenceOp('sequence_name') + Block.create_at_start(seq.bodyRegion, []) + + test = rtg.TestOp('test_name', TypeAttr.get(rtg.DictType.get())) + block = Block.create_at_start(test.bodyRegion, []) + with InsertionPoint(block): + seq_closure = rtg.SequenceClosureOp('sequence_name', []) + rtg.InvokeSequenceOp(seq_closure) + + # CHECK: rtg.test @test_name : !rtg.dict<> { + # CHECK-NEXT: rtg.sequence_closure + # CHECK-NEXT: rtg.invoke_sequence + # CHECK-NEXT: } + print(m) + + pm = PassManager() + options = rtgtool.Options( + output_format=rtgtool.OutputFormat.ELABORATED_MLIR, + debug_mode=True, + ) + rtgtool.populate_randomizer_pipeline(pm, options) + pm.run(m.operation) + + # CHECK: rtg.test @test_name : !rtg.dict<> { + # CHECK-NEXT: } + print(m) diff --git a/lib/Bindings/Python/CIRCTModule.cpp b/lib/Bindings/Python/CIRCTModule.cpp index 3a2aa7cb3576..b23074708fa2 100644 --- a/lib/Bindings/Python/CIRCTModule.cpp +++ b/lib/Bindings/Python/CIRCTModule.cpp @@ -21,6 +21,10 @@ #include "circt-c/Dialect/LTL.h" #include "circt-c/Dialect/MSFT.h" #include "circt-c/Dialect/OM.h" +#include "circt-c/Dialect/RTG.h" +#ifdef CIRCT_INCLUDE_TESTS +#include "circt-c/Dialect/RTGTest.h" +#endif #include "circt-c/Dialect/SV.h" #include "circt-c/Dialect/Seq.h" #include "circt-c/Dialect/Verif.h" @@ -45,6 +49,7 @@ static void registerPasses() { registerFSMPasses(); registerHWArithPasses(); registerHWPasses(); + registerRTGPasses(); registerHandshakePasses(); mlirRegisterConversionPasses(); mlirRegisterTransformsPasses(); @@ -96,6 +101,16 @@ PYBIND11_MODULE(_circt, m) { mlirDialectHandleRegisterDialect(om, context); mlirDialectHandleLoadDialect(om, context); + MlirDialectHandle rtg = mlirGetDialectHandle__rtg__(); + mlirDialectHandleRegisterDialect(rtg, context); + mlirDialectHandleLoadDialect(rtg, context); + +#ifdef CIRCT_INCLUDE_TESTS + MlirDialectHandle rtgtest = mlirGetDialectHandle__rtgtest__(); + mlirDialectHandleRegisterDialect(rtgtest, context); + mlirDialectHandleLoadDialect(rtgtest, context); +#endif + MlirDialectHandle seq = mlirGetDialectHandle__seq__(); mlirDialectHandleRegisterDialect(seq, context); mlirDialectHandleLoadDialect(seq, context); @@ -143,6 +158,14 @@ PYBIND11_MODULE(_circt, m) { circt::python::populateDialectSeqSubmodule(seq); py::module om = m.def_submodule("_om", "OM API"); circt::python::populateDialectOMSubmodule(om); + py::module rtg = m.def_submodule("_rtg", "RTG API"); + circt::python::populateDialectRTGSubmodule(rtg); + py::module rtgtool = m.def_submodule("_rtgtool", "RTGTool API"); + circt::python::populateDialectRTGToolSubmodule(rtgtool); +#ifdef CIRCT_INCLUDE_TESTS + py::module rtgtest = m.def_submodule("_rtgtest", "RTGTest API"); + circt::python::populateDialectRTGTestSubmodule(rtgtest); +#endif py::module sv = m.def_submodule("_sv", "SV API"); circt::python::populateDialectSVSubmodule(sv); py::module support = m.def_submodule("_support", "CIRCT support"); diff --git a/lib/Bindings/Python/CIRCTModules.h b/lib/Bindings/Python/CIRCTModules.h index 230b36c864f9..a082a8445e5c 100644 --- a/lib/Bindings/Python/CIRCTModules.h +++ b/lib/Bindings/Python/CIRCTModules.h @@ -22,6 +22,11 @@ void populateDialectESISubmodule(pybind11::module &m); void populateDialectHWSubmodule(pybind11::module &m); void populateDialectMSFTSubmodule(pybind11::module &m); void populateDialectOMSubmodule(pybind11::module &m); +void populateDialectRTGSubmodule(pybind11::module &m); +void populateDialectRTGToolSubmodule(pybind11::module &m); +#ifdef CIRCT_INCLUDE_TESTS +void populateDialectRTGTestSubmodule(pybind11::module &m); +#endif void populateDialectSeqSubmodule(pybind11::module &m); void populateDialectSVSubmodule(pybind11::module &m); void populateSupportSubmodule(pybind11::module &m); diff --git a/lib/Bindings/Python/CMakeLists.txt b/lib/Bindings/Python/CMakeLists.txt index 8259f5fe7b43..08764cecaf82 100644 --- a/lib/Bindings/Python/CMakeLists.txt +++ b/lib/Bindings/Python/CMakeLists.txt @@ -9,38 +9,57 @@ add_compile_definitions("MLIR_PYTHON_PACKAGE_PREFIX=circt.") ################################################################################ # Declare native Python extension ################################################################################ +set(LLVM_OPTIONAL_SOURCES + RTGTestModule.cpp +) + +set(PYTHON_BINDINGS_SOURCES + CIRCTModule.cpp + ESIModule.cpp + HWModule.cpp + OMModule.cpp + RTGModule.cpp + RTGToolModule.cpp + MSFTModule.cpp + SeqModule.cpp + SupportModule.cpp + SVModule.cpp +) + +set(PYTHON_BINDINGS_LINK_LIBS + CIRCTCAPIArc + CIRCTCAPIComb + CIRCTCAPIDebug + CIRCTCAPIEmit + CIRCTCAPIESI + CIRCTCAPIExportVerilog + CIRCTCAPIFSM + CIRCTCAPIHW + CIRCTCAPIHWArith + CIRCTCAPIHandshake + CIRCTCAPILTL + CIRCTCAPIMSFT + CIRCTCAPIOM + CIRCTCAPIRTG + CIRCTCAPISV + CIRCTCAPISeq + CIRCTCAPIVerif + CIRCTCAPIConversion + CIRCTCAPIRtgTool + MLIRCAPITransforms +) +if (CIRCT_INCLUDE_TESTS) + list(APPEND PYTHON_BINDINGS_SOURCES RTGTestModule.cpp) + list(APPEND PYTHON_BINDINGS_LINK_LIBS CIRCTCAPIRTGTest) +endif() declare_mlir_python_extension(CIRCTBindingsPythonExtension MODULE_NAME _circt SOURCES - CIRCTModule.cpp - ESIModule.cpp - HWModule.cpp - OMModule.cpp - MSFTModule.cpp - SeqModule.cpp - SupportModule.cpp - SVModule.cpp + ${PYTHON_BINDINGS_SOURCES} EMBED_CAPI_LINK_LIBS - CIRCTCAPIArc - CIRCTCAPIComb - CIRCTCAPIDebug - CIRCTCAPIEmit - CIRCTCAPIESI - CIRCTCAPIExportVerilog - CIRCTCAPIFSM - CIRCTCAPIHW - CIRCTCAPIHWArith - CIRCTCAPIHandshake - CIRCTCAPILTL - CIRCTCAPIMSFT - CIRCTCAPIOM - CIRCTCAPISV - CIRCTCAPISeq - CIRCTCAPIVerif - CIRCTCAPIConversion - MLIRCAPITransforms + ${PYTHON_BINDINGS_LINK_LIBS} PRIVATE_LINK_LIBS LLVMSupport ) @@ -56,6 +75,7 @@ declare_mlir_python_sources(CIRCTBindingsPythonSources SOURCES __init__.py support.py + rtgtool_support.py ) ################################################################################ @@ -117,6 +137,24 @@ declare_mlir_dialect_python_bindings( dialects/om.py DIALECT_NAME om) +declare_mlir_dialect_python_bindings( + ADD_TO_PARENT CIRCTBindingsPythonSources.Dialects + ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" + TD_FILE dialects/RTGOps.td + SOURCES + dialects/rtg.py + DIALECT_NAME rtg) + +if (CIRCT_INCLUDE_TESTS) + declare_mlir_dialect_python_bindings( + ADD_TO_PARENT CIRCTBindingsPythonSources.Dialects + ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" + TD_FILE dialects/RTGTestOps.td + SOURCES + dialects/rtgtest.py + DIALECT_NAME rtgtest) +endif() + declare_mlir_dialect_python_bindings( ADD_TO_PARENT CIRCTBindingsPythonSources.Dialects ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" diff --git a/lib/Bindings/Python/RTGModule.cpp b/lib/Bindings/Python/RTGModule.cpp new file mode 100644 index 000000000000..b70fead0df18 --- /dev/null +++ b/lib/Bindings/Python/RTGModule.cpp @@ -0,0 +1,62 @@ +//===- RTGModule.cpp - RTG API pybind module ------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "CIRCTModules.h" + +#include "circt-c/Dialect/RTG.h" + +#include "mlir/Bindings/Python/PybindAdaptors.h" + +#include +#include +#include +namespace py = pybind11; + +using namespace circt; +using namespace mlir::python::adaptors; + +/// Populate the rtg python module. +void circt::python::populateDialectRTGSubmodule(py::module &m) { + m.doc() = "RTG dialect Python native extension"; + + mlir_type_subclass(m, "SequenceType", rtgTypeIsASequence) + .def_classmethod( + "get", + [](py::object cls, MlirContext ctxt) { + return cls(rtgSequenceTypeGet(ctxt)); + }, + py::arg("self"), py::arg("ctxt") = nullptr); + + mlir_type_subclass(m, "SetType", rtgTypeIsASet) + .def_classmethod( + "get", + [](py::object cls, MlirType elementType) { + return cls(rtgSetTypeGet(elementType)); + }, + py::arg("self"), py::arg("element_type")); + + mlir_type_subclass(m, "DictType", rtgTypeIsADict) + .def_classmethod( + "get", + [](py::object cls, MlirContext ctxt, py::list entryNames, + py::list entryTypes) { + std::vector names; + std::vector types; + for (auto type : entryNames) + names.push_back(type.cast()); + for (auto type : entryTypes) + types.push_back(type.cast()); + assert(names.size() == types.size() && + "number of entry names and entry types must match"); + return cls( + rtgDictTypeGet(ctxt, types.size(), names.data(), types.data())); + }, + py::arg("self"), py::arg("ctxt") = nullptr, + py::arg("entry_names") = py::list(), + py::arg("entry_types") = py::list()); +} diff --git a/lib/Bindings/Python/RTGTestModule.cpp b/lib/Bindings/Python/RTGTestModule.cpp new file mode 100644 index 000000000000..b2c2e496ac75 --- /dev/null +++ b/lib/Bindings/Python/RTGTestModule.cpp @@ -0,0 +1,34 @@ +//===- RTGTestModule.cpp - RTGTest API pybind module ----------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "CIRCTModules.h" + +#include "circt-c/Dialect/RTGTest.h" + +#include "mlir/Bindings/Python/PybindAdaptors.h" + +#include +#include +#include +namespace py = pybind11; + +using namespace circt; +using namespace mlir::python::adaptors; + +/// Populate the rtgtest python module. +void circt::python::populateDialectRTGTestSubmodule(py::module &m) { + m.doc() = "RTGTest dialect Python native extension"; + + mlir_type_subclass(m, "CPUType", rtgtestTypeIsACPU) + .def_classmethod( + "get", + [](py::object cls, MlirContext ctxt) { + return cls(rtgtestCPUTypeGet(ctxt)); + }, + py::arg("self"), py::arg("ctxt") = nullptr); +} diff --git a/lib/Bindings/Python/RTGToolModule.cpp b/lib/Bindings/Python/RTGToolModule.cpp new file mode 100644 index 000000000000..8134743b5cc6 --- /dev/null +++ b/lib/Bindings/Python/RTGToolModule.cpp @@ -0,0 +1,143 @@ +//===- RTGToolModule.cpp - RTG Tool API pybind module ---------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "CIRCTModules.h" + +#include "circt-c/RtgTool.h" + +#include "mlir/Bindings/Python/PybindAdaptors.h" + +#include +#include +#include +namespace py = pybind11; + +using namespace circt; + +namespace { +/// Wrapper around an CirctRtgToolOptions. +class PyRtgToolOptions { +public: + PyRtgToolOptions() { options = circtRtgToolOptionsCreateDefault(); } + PyRtgToolOptions(CirctRtgToolOutputFormat outputFormat, + std::optional seed, bool verifyPasses, + bool verbosePassExecution, bool debugMode, + const std::vector &unsupportedInstructions, + const std::string &unsupportedInstructionsFile) + : PyRtgToolOptions() { + setOutputFormat(outputFormat); + setSeed(seed); + setVerifyPasses(verifyPasses); + setVerbosePassExecution(verbosePassExecution); + setDebugMode(debugMode); + setUnsupportedInstructions(unsupportedInstructions); + setUnsupportedInstructionsFile(unsupportedInstructionsFile); + } + ~PyRtgToolOptions() { circtRtgToolOptionsDestroy(options); } + + operator CirctRtgToolOptions() const { return options; } + CirctRtgToolOptions get() const { return options; } + + void setOutputFormat(CirctRtgToolOutputFormat format) { + circtRtgToolOptionsSetOutputFormat(options, format); + } + + void setSeed(std::optional seed) { + if (!seed) + circtRtgToolOptionsUnsetSeed(options); + else + circtRtgToolOptionsSetSeed(options, *seed); + } + + void setVerifyPasses(bool enable) { + circtRtgToolOptionsSetVerifyPasses(options, enable); + } + + void setVerbosePassExecution(bool enable) { + circtRtgToolOptionsSetVerbosePassExecution(options, enable); + } + + void setDebugMode(bool enable) { + circtRtgToolOptionsSetDebugMode(options, enable); + } + + void + setUnsupportedInstructions(const std::vector &instructions) { + circtRtgToolOptionsSetUnsupportedInstructions( + options, instructions.size(), + const_cast(instructions.data())); + } + + void addUnsupportedInstruction(const std::string &instruction) { + circtRtgToolOptionsAddUnsupportedInstruction(options, instruction.c_str()); + } + + void setUnsupportedInstructionsFile(const std::string &filename) { + circtRtgToolOptionsSetUnsupportedInstructionsFile(options, + filename.c_str()); + } + +private: + CirctRtgToolOptions options; +}; +} // namespace + +/// Populate the rtgtool python module. +void circt::python::populateDialectRTGToolSubmodule(py::module &m) { + m.doc() = "RTGTool Python native extension"; + + py::enum_(m, "OutputFormat") + .value("MLIR", CIRCT_RTGTOOL_OUTPUT_FORMAT_MLIR) + .value("ELABORATED_MLIR", CIRCT_RTGTOOL_OUTPUT_FORMAT_ELABORATED_MLIR) + .value("ASM", CIRCT_RTGTOOL_OUTPUT_FORMAT_ASM); + + py::class_(m, "Options") + .def(py::init<>()) + .def(py::init, bool, + bool, bool, const std::vector &, + const std::string &>(), + py::arg("output_format") = CIRCT_RTGTOOL_OUTPUT_FORMAT_ASM, + py::arg("seed") = std::nullopt, py::arg("verify_passes") = true, + py::arg("verbose_pass_execution") = false, + py::arg("debug_mode") = false, + py::arg("unsupported_instructions") = std::vector(), + py::arg("unsupported_instructions_file") = "") + .def("set_output_format", &PyRtgToolOptions::setOutputFormat, + "Specify the output format of the tool", py::arg("format")) + .def("set_seed", &PyRtgToolOptions::setSeed, + "Specify the seed for all RNGs used in the tool", py::arg("seed")) + .def("set_verify_passes", &PyRtgToolOptions::setVerifyPasses, + "Specify whether the verifiers should be run after each pass", + py::arg("enable")) + .def("set_verbose_pass_execution", + &PyRtgToolOptions::setVerbosePassExecution, + "Specify whether passes should run in verbose mode", + py::arg("enable")) + .def("set_debug_mode", &PyRtgToolOptions::setDebugMode, + "Specify whether passes that support a debug mode should use it", + py::arg("enable")) + .def("set_unsupported_instructions", + &PyRtgToolOptions::setUnsupportedInstructions, + "Set the list of of instructions unsupported by the assembler", + py::arg("instructions")) + .def("add_unsupported_instruction", + &PyRtgToolOptions::addUnsupportedInstruction, + "Add the instruction given by name to the list of instructions not " + "supported by the assembler", + py::arg("instruction_name")) + .def("set_unsupported_instructions_file", + &PyRtgToolOptions::setUnsupportedInstructionsFile, + "Register a file containing a comma-separated list of instruction " + "names which are not supported by the assembler.", + py::arg("filename")); + + m.def("populate_randomizer_pipeline", + [](MlirPassManager pm, const PyRtgToolOptions &options) { + circtRtgToolRandomizerPipeline(pm, options.get()); + }); +} diff --git a/lib/Bindings/Python/dialects/RTGOps.td b/lib/Bindings/Python/dialects/RTGOps.td new file mode 100644 index 000000000000..aadcbdb8887a --- /dev/null +++ b/lib/Bindings/Python/dialects/RTGOps.td @@ -0,0 +1,14 @@ +//===- RTGOps.td - Entry point for RTG bindings ------------*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef BINDINGS_PYTHON_RTG_OPS +#define BINDINGS_PYTHON_RTG_OPS + +include "circt/Dialect/RTG/IR/RTG.td" + +#endif // BINDINGS_PYTHON_RTG_OPS diff --git a/lib/Bindings/Python/dialects/RTGTestOps.td b/lib/Bindings/Python/dialects/RTGTestOps.td new file mode 100644 index 000000000000..b7c0ac0d671e --- /dev/null +++ b/lib/Bindings/Python/dialects/RTGTestOps.td @@ -0,0 +1,14 @@ +//===- RTGTestOps.td - Entry point for RTGTest bindings ----*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef BINDINGS_PYTHON_RTGTEST_OPS +#define BINDINGS_PYTHON_RTGTEST_OPS + +include "circt/Dialect/RTGTest/IR/RTGTest.td" + +#endif // BINDINGS_PYTHON_RTGTEST_OPS diff --git a/lib/Bindings/Python/dialects/rtg.py b/lib/Bindings/Python/dialects/rtg.py new file mode 100644 index 000000000000..b615bffe963a --- /dev/null +++ b/lib/Bindings/Python/dialects/rtg.py @@ -0,0 +1,6 @@ +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +from ._rtg_ops_gen import * +from .._mlir_libs._circt._rtg import * diff --git a/lib/Bindings/Python/dialects/rtgtest.py b/lib/Bindings/Python/dialects/rtgtest.py new file mode 100644 index 000000000000..cfc6167bd6f4 --- /dev/null +++ b/lib/Bindings/Python/dialects/rtgtest.py @@ -0,0 +1,6 @@ +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +from ._rtgtest_ops_gen import * +from .._mlir_libs._circt._rtgtest import * diff --git a/lib/Bindings/Python/rtgtool_support.py b/lib/Bindings/Python/rtgtool_support.py new file mode 100644 index 000000000000..4a1fff5d84bc --- /dev/null +++ b/lib/Bindings/Python/rtgtool_support.py @@ -0,0 +1,5 @@ +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +from ._mlir_libs._circt._rtgtool import *