-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Wishbone wrapper for the True Dual Port block ram, issue #472 #535
base: staging
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,6 +176,23 @@ exposeWbTransactions maybeSampleLength (Circuit master) (Circuit slave) = | |
Just n -> sampleN_lazy n | ||
Nothing -> sample_lazy | ||
|
||
exposeDoubleWbTransactions :: | ||
(KnownDomain dom, Eq a, KnownNat addrW, ShowX a, KnownNat (BitSize a)) => | ||
Maybe Int -> | ||
Circuit ((),()) (Wishbone dom mode addrW a, Wishbone dom mode addrW a) -> | ||
Circuit (Wishbone dom mode addrW a, Wishbone dom mode addrW a) () -> | ||
( [Transaction addrW (DivRU (BitSize a) 8) a] | ||
, [Transaction addrW (DivRU (BitSize a) 8) a] ) | ||
exposeDoubleWbTransactions maybeSampleLength (Circuit master) (Circuit slave) = | ||
let ~((_), (m2sA, m2sB)) = master (((), ()), (s2mA, s2mB)) | ||
~((s2mA, s2mB), ()) = slave ((m2sA, m2sB), ()) | ||
in ( uncurry wbToTransaction $ L.unzip $ sampleF $ bundle (m2sA, s2mA) | ||
, uncurry wbToTransaction $ L.unzip $ sampleF $ bundle (m2sB, s2mB)) | ||
where | ||
sampleF = case maybeSampleLength of | ||
Just n -> sampleN_lazy n | ||
Nothing -> sample_lazy | ||
|
||
Comment on lines
+179
to
+195
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should be able to replace this by using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to do something similar to |
||
-- | Transform a `WishboneMasterRequest` into `WishboneM2S` | ||
wbMasterRequestToM2S :: | ||
forall addrW a . | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see I've been copying this around too.. Shame on me!
Can we make a generic, re-usable function for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that this function occurs multiple times, with a slightly changed form. I will make a generic during refactoring.