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

[HWArith] Lowering to HW with type aliases #7961

Open
teqdruid opened this issue Dec 9, 2024 · 1 comment
Open

[HWArith] Lowering to HW with type aliases #7961

teqdruid opened this issue Dec 9, 2024 · 1 comment
Labels
HWArith The `hwarith` dialect

Comments

@teqdruid
Copy link
Contributor

teqdruid commented Dec 9, 2024

hw.type_scope @pycde {
  hw.typedecl @MMIOIntermediateCmd : !hw.struct<offset: ui32>
}
hw.module @MMIOAxiReadWriteMux(out cmd : !hw.typealias<@pycde::@MMIOIntermediateCmd, !hw.struct<offset: ui32>>) {
  %2 = hw.constant 0 : i32
  %3 = hwarith.cast %2 : (i32) -> ui32
  %4 = hw.struct_create (%3) : !hw.typealias<@pycde::@MMIOIntermediateCmd, !hw.struct<offset: ui32>>
  hw.output %4: !hw.typealias<@pycde::@MMIOIntermediateCmd, !hw.struct<offset: ui32>>
}
$ circt-opt hwarith_debug.mlir --lower-hwarith-to-hw
hwarith_debug.mlir:7:8: error: 'hw.struct_create' op structure field `"offset"` type does not match
  %4 = hw.struct_create (%3) : !hw.typealias<@pycde::@MMIOIntermediateCmd, !hw.struct<offset: ui32>>
       ^
hwarith_debug.mlir:7:8: note: see current operation: %1 = "hw.struct_create"(%0) : (i32) -> !hw.typealias<@pycde::@MMIOIntermediateCmd, !hw.struct<offset: ui32>>
@teqdruid teqdruid added the HWArith The `hwarith` dialect label Dec 9, 2024
@teqdruid
Copy link
Contributor Author

This was actually a relatively easy issue to fix. PR coming.

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

No branches or pull requests

1 participant