Skip to content

[MooreToCore] Support for UnpackedArrayType emission #8276

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

Open
if-sc opened this issue Feb 26, 2025 · 1 comment
Open

[MooreToCore] Support for UnpackedArrayType emission #8276

if-sc opened this issue Feb 26, 2025 · 1 comment

Comments

@if-sc
Copy link

if-sc commented Feb 26, 2025

Currently, CIRCT's MooreToCore pass converts unpacked arrays to packed arrays (hw::ArrayType),
losing the unpacked semantics.

When we've attempted to preserve unpacked arrays by emitting hw::UnpackedArrayType,
MLIR raises "failed to legalize operation" errors.

Minimal Reproduction

When running circt-opt on the following input,

module a (
  input logic b[3:0]
);
endmodule

we get the following result:

module {
  hw.module @a(in %b : !hw.array<4xi1>) {
    hw.output
  }
}

as you can clearly see, the uarray is converted to a array.

@fabianschuiki
Copy link
Contributor

The errors you were seeing about legalization failure probably indicate that the lowering from HW/Comb to LLVM is missing a conversion pattern for the unpacked types. If you take a look at the ArcToLLVM lowering pass (used in the pipeline of arcilator.cpp), there is probably support for hw.array types, but not hw.uarray. Having lowering support for unpacked stuff would be fantastic!

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

No branches or pull requests

2 participants