Skip to content

Conversation

@Scheremo
Copy link
Contributor

@Scheremo Scheremo commented Oct 10, 2025

Add end-to-end support for SystemVerilog chandle:

  • Import from Slang as moore.chandle.
  • Lower to !llvm.ptr in MooreToCore.
  • Treat ref<chandle> as a by-ref SSA value (no hw.inout).
  • Default-initialize to llvm.mlir.zero : !llvm.ptr.

@Scheremo Scheremo marked this pull request as ready for review October 10, 2025 06:27
@Scheremo Scheremo marked this pull request as draft October 10, 2025 07:15
@Scheremo Scheremo force-pushed the pr-moore-chandle branch 3 times, most recently from a4a251e to 0c42566 Compare October 10, 2025 08:16
Add end-to-end support for SystemVerilog `chandle`:
- Import from Slang as `moore.chandle`.
- Lower to `!llvm.ptr` in MooreToCore.
- Treat `ref<chandle>` as a *by-ref SSA* value (no `hw.inout`).
- Default-initialize to `llvm.mlir.zero : !llvm.ptr`.

I also had to add `getDependentDialects` in MooreToCore to make this work.
Please do let me know if this is the wrong place to do this, I got this from
[this MLIR page](https://mlir.llvm.org/docs/PassManagement/?utm_source=chatgpt.com#dependent-dialects)
@Scheremo Scheremo marked this pull request as ready for review October 10, 2025 08:19
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.

Really cool, thanks for adding support for this! Just a thought on that !hw.inout wrapping a !llvm.ptr being broken in general. Guess we really need that !llhd.ref<T> type 😁

@Scheremo Scheremo merged commit 22db386 into llvm:main Oct 10, 2025
7 checks passed
Scheremo pushed a commit to Scheremo/circt that referenced this pull request Oct 10, 2025
…ering

Re-lands llvm#9077 which was reverted because it was unsquashed.

Add end-to-end support for SystemVerilog `chandle`:
- Import from Slang as `moore.chandle`.
- Lower to `!llvm.ptr` in MooreToCore.
- Treat `ref<chandle>` as a *by-ref SSA* value (no `hw.inout`).
- Default-initialize to `llvm.mlir.zero : !llvm.ptr`.

I also had to add `getDependentDialects` in MooreToCore to make this work.
Please do let me know if this is the wrong place to do this, I got this from
[this MLIR page](https://mlir.llvm.org/docs/PassManagement/?utm_source=chatgpt.com#dependent-dialects)
Scheremo pushed a commit to Scheremo/circt that referenced this pull request Oct 10, 2025
…ering

Re-lands llvm#9077 which was reverted because it was unsquashed.

Add end-to-end support for SystemVerilog `chandle`:
- Import from Slang as `moore.chandle`.
- Lower to `!llvm.ptr` in MooreToCore.
- Treat `ref<chandle>` as a *by-ref SSA* value (no `hw.inout`).
- Default-initialize to `llvm.mlir.zero : !llvm.ptr`.
Scheremo pushed a commit that referenced this pull request Oct 10, 2025
…ering

Re-lands #9077 which was reverted because it was unsquashed.

Add end-to-end support for SystemVerilog `chandle`:
- Import from Slang as `moore.chandle`.
- Lower to `!llvm.ptr` in MooreToCore.
- Treat `ref<chandle>` as a *by-ref SSA* value (no `hw.inout`).
- Default-initialize to `llvm.mlir.zero : !llvm.ptr`.
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.

2 participants