-
Notifications
You must be signed in to change notification settings - Fork 312
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
[LLHD][Arc] Indexing and slicing lowering from Verilog to LLVM IR #8065
Comments
Hi @AndreyVV-100 To work around this, SROA can be run before sig2reg but only structs and arrays are supported upstream yet. I have a prototype branch with some limited integer support that should be enough for your case here in case you want to try it out: https://github.com/maerhart/circt/tree/mix-and-match I hope I'll find the time to upstream that sometime soon. |
Hi @maerhart! Thank you for the answer! I tried module Mod (input clk, input a, input b, output logic[3:0] c);
always_ff @(posedge clk) begin
c[1:0] = {a, b};
end
endmodule Is it planned to be supported by SROA or arcilator? Can it be made by bit blasting? If so, I can try to patch your branch. |
Yes, I restricted the SROA bit blasting the case when only individual bits are accessed. It would also work for slices, but it's not an optimal solution if the slice offset is known statically (since you'd only need to cut the original integer at the start and endpoint of the slice). For dynamic slices, we'd need to cut at all possible start at endpoints which will almost bit blast the entire integer if the slice is short, so it'd be fine there. If the slice is almost as big as the original integer, though, we could also do quite a lot better than just bit blasting. Implementing this more optimal strategy will probably require a dedicated pass that does some analysis to figure out these cut points, but having a simple bit blasing implementation that we can improve upon later would also be quite nice 😄 You'd also need to add support for slices to the ResolveDynamicSignalAliases pass there to get it working E2E (because SROA only supports static indices). |
Hi! I'm trying to use circt for lowering to LLVM IR. I found such a construction in some example:
I used this pipeline:
But I got error body contains non-pure operation in
arcilator
. Also I had same error when I tried to use slicing instead of indexing. What needs to be done to runarcilator
successfully?The text was updated successfully, but these errors were encountered: