-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not inline let-bound recursive calls
This prevents `recToLetRec` from turning a globally recursive function into a local let-bound recursive function which can be synthesized to hardware. Fixes #2839 (cherry picked from commit 0072241)
- Loading branch information
1 parent
bace7a5
commit 68b6dc7
Showing
4 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FIXED: Clash errored saying it cannot translate a globally recursive function in code that originally only contains let-bound (local) recursion [#2839](https://github.com/clash-lang/clash-compiler/issues/2839). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module T2839 where | ||
|
||
import Clash.Explicit.Prelude | ||
import Clash.Explicit.Testbench | ||
|
||
topEntity :: | ||
Signal System (Unsigned 8) | ||
topEntity = register clk noReset enableGen 100 0 | ||
where | ||
cntr = register clk noReset enableGen (0 :: Unsigned 8) 0 | ||
done = (== 100) <$> cntr | ||
clk = tbClockGen $ not <$> done |