Skip to content

Commit

Permalink
[CAPI][Python][Arc, HW] Register Arc and HW passes (#7790)
Browse files Browse the repository at this point in the history
Expose Arc and HW passes to CAPI and Python bindings.
  • Loading branch information
yassinz authored Nov 19, 2024
1 parent da2c0f5 commit 3f6cbf6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/circt-c/Dialect/HW.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef struct HWModulePort HWModulePort;
//===----------------------------------------------------------------------===//

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(HW, hw);
MLIR_CAPI_EXPORTED void registerHWPasses(void);

//===----------------------------------------------------------------------===//
// Type API.
Expand Down
3 changes: 3 additions & 0 deletions lib/Bindings/Python/CIRCTModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "CIRCTModules.h"

#include "circt-c/Conversion.h"
#include "circt-c/Dialect/Arc.h"
#include "circt-c/Dialect/Comb.h"
#include "circt-c/Dialect/Debug.h"
#include "circt-c/Dialect/ESI.h"
Expand Down Expand Up @@ -37,11 +38,13 @@
namespace py = pybind11;

static void registerPasses() {
registerArcPasses();
registerCombPasses();
registerSeqPasses();
registerSVPasses();
registerFSMPasses();
registerHWArithPasses();
registerHWPasses();
registerHandshakePasses();
mlirRegisterConversionPasses();
mlirRegisterTransformsPasses();
Expand Down
1 change: 1 addition & 0 deletions lib/Bindings/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ declare_mlir_python_extension(CIRCTBindingsPythonExtension
SupportModule.cpp
SVModule.cpp
EMBED_CAPI_LINK_LIBS
CIRCTCAPIArc
CIRCTCAPIComb
CIRCTCAPIDebug
CIRCTCAPIEmit
Expand Down
1 change: 1 addition & 0 deletions lib/CAPI/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ add_circt_public_c_api_library(CIRCTCAPIHW
LINK_LIBS PUBLIC
MLIRCAPIIR
CIRCTHW
CIRCTHWTransforms
)

add_circt_public_c_api_library(CIRCTCAPILLHD
Expand Down
2 changes: 2 additions & 0 deletions lib/CAPI/Dialect/HW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Dialect/HW/HWInstanceGraph.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWPasses.h"
#include "circt/Dialect/HW/HWTypes.h"
#include "circt/Support/LLVM.h"
#include "mlir/CAPI/IR.h"
Expand All @@ -28,6 +29,7 @@ DEFINE_C_API_PTR_METHODS(HWInstanceGraphNode, igraph::InstanceGraphNode)
//===----------------------------------------------------------------------===//

MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(HW, hw, HWDialect)
void registerHWPasses() { registerPasses(); }

//===----------------------------------------------------------------------===//
// Type API.
Expand Down

0 comments on commit 3f6cbf6

Please sign in to comment.