Skip to content
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

[SV] Add DPI import op #7005

Merged
merged 2 commits into from
May 16, 2024
Merged

[SV] Add DPI import op #7005

merged 2 commits into from
May 16, 2024

Conversation

uenoku
Copy link
Member

@uenoku uenoku commented May 8, 2024

This PR adds an op sv.func.dpi.import for "emitting" DPI import statement. sv.func.dpi.import doesn't declare function but it takes a function symbol to emit import statement. This design is similar to what sv.macro.ref/def does and it enables us to decouple function declaration and emission.

// CHECK-LABEL: import "DPI-C" linkage_name = function void function_declare1(
// CHECK-NEXT:    input [1:0] in_0,
// CHECK-NEXT:                out_0,
// CHECK-NEXT:                in_1,
// CHECK-NEXT:    output out_1
// CHECK-NEXT: );
sv.func.dpi.import linkage "linkage_name" @function_declare1

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me!

@uenoku uenoku changed the base branch from dev/hidetou/prepare-nfc to main May 16, 2024 07:53
@uenoku uenoku merged commit 1a404d6 into main May 16, 2024
4 checks passed
@uenoku uenoku deleted the dev/hidetou/dpi-import branch May 16, 2024 09:53
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.

None yet

2 participants