Draft
Conversation
962610a to
a872c3d
Compare
a872c3d to
f34b0f8
Compare
f34b0f8 to
a7a8671
Compare
3d207a5 to
ad42dc5
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The PR introduces a new
clash-testbenchframework, which offers extended test bench design capabilities on top of Clash.Test benches created with this framework can either be run naively in Haskell / Clash or with an external simulator via Clash-FFI. To this end, the framework automatically lifts the given Clash circuitry into a wrapping
IO-monad during test bench design. The test bench is then simulated fully inIO. This not only provides precise control over the simulation evaluation, but also avoids lazy evaluation effects (unsafePerformIOis not required due to the lift). Furthermore, anyIOinterface can be plugged to the simulated circuitry providing inputs or processing outputs during simulation.Simulation with external simulators is supported via Clash-FFI. In this case only the type interface of the circuity is used to automatically bind to the interface of corresponding externally provided modules. This allows for easy interaction with blackbox designs that are not available in Clash.
Some first example can be found in the
examplefolder. It currently produces two artifacts:The test bench design is shared among both interfaces. The foreign library variant technically can be used to also simulate the Clash-based implementation. This is, however, not supported yet.
The framework is still in a prototype stage and WIP (see the following list for some of the open TODOs).
TODOs