-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb513f9
commit ad42dc5
Showing
11 changed files
with
375 additions
and
200 deletions.
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
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,15 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
module Register where | ||
|
||
import Clash.Prelude | ||
|
||
topEntity | ||
:: Clock System | ||
-> Reset System | ||
-> Enable System | ||
-> Signal System (Signed 4) | ||
-> Signal System (Signed 4) | ||
|
||
topEntity = exposeClockResetEnable reg | ||
where | ||
reg i = register 0 i |
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,31 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
module RegisterFail where | ||
|
||
import Clash.Prelude | ||
|
||
topEntity | ||
:: Clock System | ||
-> Reset System | ||
-> Enable System | ||
-> Signal System (Signed 4) | ||
-> Signal System (Signed 4) | ||
|
||
topEntity = exposeClockResetEnable regFail | ||
where | ||
reg i = register 0 i | ||
|
||
count :: | ||
HiddenClockResetEnable dom => | ||
Signal dom (Signed 3) | ||
count = | ||
register 0 ((+1) <$> count) | ||
|
||
regFail :: | ||
HiddenClockResetEnable dom => | ||
Signal dom (Signed 4) -> | ||
Signal dom (Signed 4) | ||
|
||
regFail = | ||
mux ((== 4) <$> count) 0 . reg | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
packages: . .. ../../clash-ghc ../../clash-lib ../../clash-prelude ../../clash-ffi ../../clash-prelude-hedgehog | ||
|
||
write-ghc-environment-files: always | ||
|
||
--package * | ||
-- ghc-options: -fPIC -shared |
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
Oops, something went wrong.