Commit Graph

13 Commits

Author SHA1 Message Date
Martin Erhart 175e30d32f [RTG] Rely on textual pass pipeline in Python and CAPI
The textual pass pipeline has a bit more overhead due to the string parsing, but it reduces the required maintenance as we don't have to write CAPI and Python bindings for all the pass options.
2025-07-29 17:48:13 +01:00
Hideto Ueno 640daf0c92
[HW][AIG] Add InstancePath CAPI and use native structures for AIG longest path analysis (#8760)
This commit refactors the AIG longest path analysis C API to use native C structures instead of JSON strings, providing better performance and type safety.

The API changes replace `aigLongestPathCollectionGetPath` returning JSON with `aigLongestPathCollectionGetDataflowPath` returning native objects. New opaque handle types are added including `AIGLongestPathObject`, `AIGLongestPathHistory`, and `AIGLongestPathDataflowPath`. Comprehensive APIs are provided for accessing path data, history, and object properties. 

InstancePath C API support is introduced in `circt-c/Support/InstanceGraph.h`. Currently `InstancePathCache` itself is not provided, as the use of LongestPathAnalysis is read-only and there is no need to mutate/construct InstancePath. Unfortunately due to that testing of CAPI of InstancePath got a bit tricky. For now AIGLongestPathAnalysis is used to produce InstancePath in CAPI.

The Python binding updates refactor Object, DataflowPath, and LongestPathHistory classes to use the native C API. JSON parsing dependencies and from_json_string() methods are removed. Proper property accessors using the new C API are added while maintaining backward compatibility for existing Python interfaces. So the existing integration tests cover most of the APIs. 

Testing updates include comprehensive coverage in the existing C API tests in `test/CAPI/aig.c`. A new `test/CAPI/support.c` is added for InstancePath API testing. Python integration tests are updated to work with the new API.

This change improves performance by eliminating JSON serialization/deserialization overhead and provides a more robust, type-safe interface for accessing longest path analysis results.
2025-07-22 11:30:43 -07:00
Hideto Ueno 1fb38a58ea
[circt-synth] [Synthesis] Add synthesis pipeline and refactor the lib structure (#8681)
This commit introduces a standardized synthesis pipeline and restructures the codebase:

* Creates a new SynthesisPipeline class to define the default synthesis pipeline. This pipeline serves both circt-synth and is exposed through the C API for Python bindings.
* Added a dedicated Synthesis directory under `lib/` to house synthesis-related code. This architectural change is aimed to promote synthesis capabilities to a first-class component within CIRCT rather than limiting it to the circt-synth tool.
2025-07-10 16:16:11 -07:00
Maksim Levental d07c799f60
[LLVM] bump to 9deb08a and integrate upstream SMT C APIs (#8424) 2025-04-17 15:26:22 -04:00
Clo91eaf 257426e53b [ExportSMTLIB] Implement C API
Signed-off-by: Clo91eaf <Clo91eaf@qq.com>
2025-02-22 12:25:31 +08:00
Maksim Levental ca92024004
[CAPI] disambiguate mlirRegisterConversionPasses (#8072) 2025-01-13 16:40:28 -05:00
Martin Erhart bb16f8968b
[RTG][RTGTest] Add CAPI and a basic lowering pipeline (#7882) 2024-12-04 21:39:10 +00:00
Sprite a01f3db3cc [Firtool][CAPI] Add C-API for Firtool lib 2023-09-30 21:53:23 +08:00
Nandor Licker ac141282dc
[Seq] Merge Seq-to-SV lowering passes (#5901)
The pattern rewriter can be applied alongside the FIR register lowering transforms to eliminate the need for two separate passes.
2023-08-22 22:12:11 +03:00
Sprite 1a71c4d957 [ExportFIRRTL] Implement C API 2023-06-13 23:46:35 +08:00
George Lyon b03db32b0f
[CAPI] Modernize dialect registration (#560) 2021-02-10 10:41:18 -08:00
George Lyon eb092323e6
[ExportVerilog][SV] C API (#481)
Co-authored-by: George <989903+GeorgeLyon@users.noreply.github.com>
2021-01-20 15:42:02 -08:00
George Lyon 2a9eb3506d
Create a minimal C API (#196)
* Enable cloning llvm submodule over HTTP

* Introduce C API

* Undo unrelated changes

* clang-format

* More format

* Add Header Comments

* Format

* Add basic test

* Add missing incantation

* Format

Co-authored-by: George <>
2020-11-04 11:37:51 -08:00