-
Notifications
You must be signed in to change notification settings - Fork 53
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
static-inline
generates incorrect guards
#1442
Comments
I'm reading the static inlining code and I'm not sure if it makes sense. It doesn't seem to implement the inlining technique described in #1344. Specifically, the approach in that overview is that we should keep track of the current relative time when compiling a control operator and only update the guards once we reach an enable. The current inlining code seems to transform each control operator separately and then |
Hm, nevermind, I'm wrong. |
The problem seems to be the assignment:
If I remove this, the example works. This was initiated by me trying to rewrite the static-mult-dot-product test but I see that it's already a test but it doesn't define assignments in the way I wrote them here. |
Also, note that this test doesn't work with Icarus for some reason. Running the following command produces an array of all zeroes which means something is wrong:
|
A further problem is that the inlining process cannot inline the |
I see. Just so we're on the same page:
|
So, for the last point, running:
generates:
Note that we end up generating two FSMs because the inliner did not merge the |
That's right! That's the difference between a bottom-up vs top-down approach. Currently, the pass goes down to the innermost control operator and compiles it fully before popping back up. I will note that the nice thing is that I don't think the generated code would get any better, especially after running guard simplification. You could consider opening an issue about this and working on it as a part of the QoR/overall compiler improvement push later and not block static proposal being done on this working. |
Ah, I see what you're saying. In my mind, this was actually expected since the |
@calebmkim Got it! Looks like there are two separate issues here. One, you've already summarized in #1447. The other one is to do with how guards work in groups which is a bonafide bug and needs to be fixed. Does that make sense? |
Sorry, I'm not quite clear on what you're referring to here? I think the |
Sorry, that PR does not fix that problem. We should have a higher-level error before we hit lowering: #1444 |
@calebmkim can you check if this does no longer generates the false guard and close this issue |
For the following program:
The following command:
Generates:
Note that the guard for
idx.write_en
is false which means the program will never write a value intoidx
.The text was updated successfully, but these errors were encountered: