Skip to content

Conversation

teqdruid
Copy link
Contributor

Fixes all of the bitrot. Doesn't fix ESI stuff which was expectedly broken.

Fixes all of the bitrot. Doesn't fix ESI stuff which was expectedly
broken.
@teqdruid teqdruid added the PyCDE Python CIRCT Design Entry API label Nov 19, 2023
@teqdruid teqdruid merged commit bee0a8d into main Nov 19, 2023
@teqdruid teqdruid deleted the dev/teqdruid/pycde/nov23-fix branch November 19, 2023 04:14
if isinstance(owner, ir.Block) and isinstance(owner.owner, hw.HWModuleOp):
block_arg = ir.BlockArgument(self.value)
mod_type = hw.ModuleType(owner.owner.module_type.value)
mod_type = hw.ModuleType(ir.TypeAttr(owner.owner.module_type).value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just FYI- these explicit casts were necessitated from the most recent LLVM bump which changed some things related to the automatic casting of builtin types and attributes. In the latest LLVM, you can enable the automatic casting by depending on the builtin dialect Python files like I mentioned here: #6404 (comment)

There is still some discussion about how automatic casting for builtin dialect should work upstream: llvm/llvm-project#72338. In a future LLVM bump, we might be able to get the automatic casting behavior for free again, or we might decide upstream that we need to include the builtin dialect's Python files like we've done for the CIRCTPythonModules target in lib/Bindings/Python.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I saw that comment awhile back (but couldn't remember where it was). We do this sort of downcasting all over the place (when the type is well known), so it was easier/most consistent to just do it this way. I haven't been following the upstream discussion, but would rather wait for it to be settled then use it appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PyCDE Python CIRCT Design Entry API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants