-
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
Implemented scatterUnitWB and gatherUnitWB #31
Conversation
86718ba
to
4c765a9
Compare
fe7f3e8
to
6f4130d
Compare
6d5ef19
to
6bb64aa
Compare
dbd4f8a
to
60b970a
Compare
87ab3d9
to
0204aa4
Compare
60b970a
to
6385e11
Compare
0204aa4
to
5f15986
Compare
3f7d068
to
693a235
Compare
a7c2549
to
c1a3b5d
Compare
2779b62
to
b2a3843
Compare
-- | Wishbone master-slave port scatterUnit. | ||
Signal dom (WishboneM2S 4 awSU) -> | ||
-- | (slave - master data scatterUnit , slave - master data calendar) | ||
(Signal dom (WishboneS2M 4), Signal dom (WishboneS2M bsCal)) |
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 don't understand why the scatter memory has a 32bit WB bus, but the calendar has a configurable-width WB bus. Why not?:
- Both configurable, or
- Both 32 bit
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.
We know that:
- The framewidth for now will be 64 bits since we have to send over the timing oracles(f.k.a. UGNs).
- The wishbone bus interface that accesses the s/g units will most likely be 32 bits since they're hooked up to rv32imc.
By enforcing the s/g unit bus to be 32 bits we can have a nice way to interface with the 64 bit s/g units (either using the upper or lower 32 bits).
However, the calendar wishbone bus has no requirements to constrain the amount of bytes on the bus and may not be hooked up to the same processor that the s/g bus is hooked up to.
To summarize:
- The s/g bus cannot be easily made configurable due to the 64 bit framewidth constraint
- There is no reason other than readability(?) to constrain the calendar bus to 32 bits.
bittide/tests/Tests/ScatterGather.hs
Outdated
-- | Generates a 'CalendarConfig' for the 'gatherUnitWB' or 'scatterUnitWB' | ||
genCalendarConfig :: | ||
forall bytes addressWidth calEntry maxDepth . | ||
( KnownNat bytes | ||
, 1 <= bytes | ||
, KnownNat maxDepth | ||
, 1 <= maxDepth | ||
, calEntry ~ Index maxDepth | ||
, KnownNat addressWidth) => | ||
SNat maxDepth -> | ||
Gen (CalendarConfig bytes addressWidth calEntry) | ||
genCalendarConfig sizeNat@(snatToNum -> dMax) = do | ||
dA <- Gen.enum 1 dMax | ||
dB <- Gen.enum 1 dMax | ||
case (TN.someNatVal dA, TN.someNatVal dB) of | ||
( SomeNat (snatProxy -> depthA) | ||
,SomeNat (snatProxy -> depthB)) -> do | ||
let | ||
regAddrBits = SNat @(NatRequiredBits (Regs calEntry (bytes * 8))) | ||
bsCalEntry = SNat @(BitSize calEntry) | ||
case | ||
( isInBounds d1 depthA sizeNat | ||
, isInBounds d1 depthB sizeNat | ||
, compareSNat regAddrBits (SNat @addressWidth) | ||
, compareSNat d1 bsCalEntry) of | ||
(InBounds, InBounds, SNatLE, SNatLE)-> go depthA depthB | ||
(a,b,c,d) -> error $ "genCalendarConfig: calEntry constraints not satisfied: (" | ||
<> show a <> ", " <> show b <> ", " <> show c <> ", " <> show d <> "), \n(depthA, depthB, maxDepth, calEntry bitsize) = (" | ||
<> show depthA <> ", " <> show depthB <> ", " <> show sizeNat <> ", " <> show bsCalEntry <> ")" | ||
where | ||
go :: forall depthA depthB . | ||
( LessThan depthA maxDepth | ||
, LessThan depthB maxDepth | ||
, NatFitsInBits (Regs calEntry (bytes * 8)) addressWidth) => | ||
SNat depthA -> | ||
SNat depthB -> | ||
Gen (CalendarConfig bytes addressWidth (Index maxDepth)) | ||
go SNat SNat = do | ||
calActive <- fromMaybe errmsg . fromList @depthA . P.take (natToNum @depthA) | ||
<$> Gen.shuffle @_ @(Index maxDepth) [0.. natToNum @(maxDepth-1)] | ||
calShadow <- fromMaybe errmsg . fromList @depthB . P.take (natToNum @depthB) <$> Gen.shuffle @_ @(Index maxDepth) [0.. natToNum @(maxDepth-1)] | ||
return $ CalendarConfig sizeNat calActive calShadow | ||
errmsg = errorX "genCalendarConfig: list to vector conversion failed" |
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.
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.
The generator in Tests.Calendar
requires a supplied generator for the elements, but for the scatter / gather tests, you want the entries in the calendar to be unique, which therefor uses a shuffled version of an incrementing list.
ac0d203
to
17bcc61
Compare
2af6104
to
be37d4e
Compare
17bcc61
to
d240a93
Compare
d4521ee
to
834edfe
Compare
57a1c3a
to
c7090c0
Compare
8d3c5bb
to
bfeede4
Compare
f8c8290
to
c27825b
Compare
2cab9fc
to
5049cbd
Compare
5ffaeb0
to
1679a92
Compare
ff53e82
to
704623d
Compare
e6c56ec
to
8595c53
Compare
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 think your test cases would be more readable if you export the the pre-type level fuzzed parts to top-level.
f50d345
to
40d20e6
Compare
40d20e6
to
719abf2
Compare
This PR implements a wishbone addressable scatter unit and a wishbone addressable gather unit.
TODO: