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

The power of Index #2813

Open
kleinreact opened this issue Sep 27, 2024 · 1 comment · May be fixed by #2816
Open

The power of Index #2813

kleinreact opened this issue Sep 27, 2024 · 1 comment · May be fixed by #2816
Labels

Comments

@kleinreact
Copy link
Contributor

The following code

module Top where

import Clash.Prelude

topEntity :: HiddenClockResetEnable System => Signal System (Index (2 ^ 61))
topEntity = pure 0

causes clash from master (currently 3b755b9) to get stuck and to eat up all my 64G of memory after about 15 minutes. Just run

cabal run -- clash-ghc:clash Top.hs  --verilog

from within the repository for reproduction. There seems to be an exponential rise in compile time that is directly related to the chosen exponent. Here are some compile times, produced via replacing the 61 in the code above with the given values.

Exponent Time (s)
24 0.698
25 0.754
26 0.890
27 1.204
28 1.763
29 3.191
30 6.050
31 11.397
32 25.777

Everything works, if I compile the file with my system clash tough, which still is at v1.8.1. I tested the behavior with GHC 9.6.4 and 9.8.2.

@kleinreact kleinreact added the bug label Sep 27, 2024
@kleinreact kleinreact changed the title Power your Index The power of Index Sep 27, 2024
@kleinreact
Copy link
Contributor Author

It looks like the issue was introduced by #2689, as compilation times are more or less constant before that PR got merged.

leonschoorl added a commit that referenced this issue Sep 30, 2024
There was confusion between the size in bits and the type level argument to Index.

Fixes #2813
leonschoorl added a commit that referenced this issue Sep 30, 2024
There was confusion between the size in bits and the type level argument to Index.

Fixes #2813
@leonschoorl leonschoorl linked a pull request Oct 1, 2024 that will close this issue
2 tasks
leonschoorl added a commit that referenced this issue Oct 1, 2024
There was confusion between the size in bits and the type level argument to Index.

Fixes #2813
kleinreact pushed a commit that referenced this issue Oct 7, 2024
There was confusion between the size in bits and the type level argument to Index.

Fixes #2813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant