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

Investigage Drivable implementation for Wishbone #125

Open
lmbollen opened this issue Nov 26, 2024 · 0 comments
Open

Investigage Drivable implementation for Wishbone #125

lmbollen opened this issue Nov 26, 2024 · 0 comments

Comments

@lmbollen
Copy link
Member

Currently there is no nice way to actually test Wishbone circuits because their bidirectional nature does not work well with the current Drivable typeclass. We should investigate if there is a nice way to specify requests and response that matches the current Drivable typeclass.

A crude example of this could be implementing a data type similar to https://github.com/bittide/bittide-hardware/blob/staging/bittide/tests/Tests/Shared.hs#L57-L66 :

-- | Single datatype to represent successful and unsuccessful Wishbone transactions.
data Transaction addrW selWidth a
  = WriteSuccess (WishboneM2S addrW selWidth a) (WishboneS2M a)
  | ReadSuccess (WishboneM2S addrW selWidth a) (WishboneS2M a)
  | Error (WishboneM2S addrW selWidth a)
  | Retry (WishboneM2S addrW selWidth a)
  | Stall (WishboneM2S addrW selWidth a)
  | Ignored (WishboneM2S addrW selWidth a)
  | Illegal (WishboneM2S addrW selWidth a) (WishboneS2M a)
  deriving (Generic)

And a function:

wishboneMonitor :: forall dom addrW selWidth a .
 Circuit (Wishbone dom mode addrW a) () ->
 Circuit () (Wishbone dom mode addrW a) ->
 Circuit () (Df dom (Transaction addrW selWidth a))

That allows you to provide a master and slave to create a circuit that produces the transactions.
Instead of the custom Transaction it could also be simply ((WishboneM2S addrW selWidth a), (WishboneS2M a)) accompanied by utility functions.

It is very much still unclear what the best way to approach this is so feel free to discuss / experiment.
Ideally the solution would be accompanied by a way to imperatively construct "programs" consisting of sequences of requests.

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

No branches or pull requests

1 participant