Skip to content

[ImportVerilog][CAPI] Add interfaces to allow external use #8563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SpriteOvO
Copy link
Member

This PR adds C-API for ImportVerilog stuff to allow external use.

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder there is better direction. I understand we did the same thing for firtool but the maintainability has not been good. Instead I'm curios we can use some string serialization (similar to what we are doing for ExportVerilog lowering option) or MLIR attribute as a way to pass option .

@SpriteOvO
Copy link
Member Author

@uenoku I do agree that the maintainability of such options structs is poor.

@sequencer If we change the options structs to something like a CLI arguments string, would that be acceptable to you guys?

@sequencer
Copy link
Contributor

sequencer commented Jun 15, 2025

If we change the options structs to something like a CLI arguments string, would that be acceptable to you guys?

I think we only need to expose these options to C-API to allow external program to use import Verilog as library.

For C-API about MlirImportVerilogOptions, it can be safe and looks more like what https://github.com/llvm/circt/blob/firtool-1.122.0/include/circt-c/Firtool/Firtool.h does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants