Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was inspired by the
clash-cores
PR #7 Add RGMII core which uses this construction but keeps the output clock as aSignal domDDR Bit
. With the newddrOutClock
, we can correctly declare the thing to be a clock.There's a qualitative difference between
Clock
andSignal _ Bit
. In a nutshell, a signal is relative to a clock, it has setup and hold constraints and carries data. All of these don't apply to a clock. You could say a clock leads and a signal follows. The resulting output on the pin is no different, it's just about correctly declaring what something is in the Haskell world.The new
ddrForwardClock
function gets a DDR output primitive as an argument. If you look atclash-prelude
, the only directly fitting one isClash.Explicit.DDR.ddrOut
(if you apply the reset value first). However, in a PR that I will create soon, the API forClash.Intel.DDR
andClash.Xilinx.DDR
is changed to accomodate the signature introduced in this PR. Even with the current code, it's possible to adapt the vendor primitives to fitddrForwardClock
, but soon it will be a natural fit.Still TODO: