-
Notifications
You must be signed in to change notification settings - Fork 154
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
Prelude.!!: index to large #2831
Comments
I don't understand how it got there, but it's calling whnf' on:
which simplifies to
Given
As the input Vec should be |
That expression ^ is just the body of the first alternative of the case in I would've expected clash would eliminate the case first, before evaluation the body of the unreachable alternative. |
So here's what's going on:
Because the subject is neither a data-constructor nor a primitive (nor a global function which returns a "zero-number" type).
to determine how evaluation will proceed. When We should probably check whether the |
Previously, the Clash compiler would try to reduce ``` splitAt d1 Nil ``` to something of type ``` (Vec 1 a, Vec (0-1) a) ``` by trying to project the head and the tail out of the `Nil` constructor. This of course does not work resulting in an out-of-bounds indexing error reported in: #2831 The compiler now reduces above expressions to: ``` undefined :: (Vec 1 a, Vec (0-1) a) ``` Which is morally equivalent to the run-time exception Haskell evaluation would have thrown if the circuit description was evaluated like a regular Haskell program. Fixes #2831
Previously, the Clash compiler would try to reduce ``` splitAt d1 Nil ``` to something of type ``` (Vec 1 a, Vec (0-1) a) ``` by trying to project the head and the tail out of the `Nil` constructor. This of course does not work resulting in an out-of-bounds indexing error reported in: #2831 The compiler now reduces above expressions to: ``` undefined :: (Vec 1 a, Vec (0-1) a) ``` Which is morally equivalent to the run-time exception Haskell evaluation would have thrown if the circuit description was evaluated like a regular Haskell program. Fixes #2831 (cherry picked from commit 10f26ff)
The following
results in
when compiling with
--verilog
.The text was updated successfully, but these errors were encountered: