Skip to content

Commit e1448d9

Browse files
committed
WIP
1 parent cf8c1ae commit e1448d9

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

bittide/tests/Tests/ProgrammableMux.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Protocols
1111
import Bittide.ProgrammableMux (programmableMux)
1212
import Bittide.SharedTypes (withByteOrderings)
1313
import Clash.Class.BitPackC (ByteOrder (..))
14+
import Clash.Class.BitPackC.Padding (packWordC)
1415
import Data.Maybe (fromJust)
1516
import Protocols.Hedgehog (defExpectOptions)
1617
import Protocols.MemoryMap
@@ -54,10 +55,11 @@ because we use a bus datawidth of 64 bits instead of the usual 32 bits.
5455
prop_ProgrammableMux :: Property
5556
prop_ProgrammableMux = H.property $ do
5657
switchCycle <- H.forAll $ genUnsigned @64 (Range.linear 100 200)
58+
busByteOrder <- H.forAll $ Gen.element [BigEndian, LittleEndian]
5759
regByteOrder <- H.forAll $ Gen.element [BigEndian, LittleEndian]
5860
let
5961
dut =
60-
withByteOrderings BigEndian regByteOrder
62+
withByteOrderings busByteOrder regByteOrder
6163
$ withClockResetEnable @System clockGen resetGen enableGen
6264
$ circuit
6365
$ \wb -> do
@@ -76,8 +78,8 @@ prop_ProgrammableMux = H.property $ do
7678
counterAddr = fromIntegral (fromJust counterLoc).value.address `div` 8
7779
armAddr = fromIntegral (fromJust armLoc).value.address `div` 8
7880

79-
switchCycleBv = pack switchCycle
80-
armBv = resize $ pack True
81+
switchCycleBv = pack $ packWordC @8 busByteOrder switchCycle
82+
armBv = pack $ packWordC @8 busByteOrder True
8183
requests = fmap (,0) [Write counterAddr maxBound switchCycleBv, Write armAddr maxBound armBv]
8284

8385
(resets, outLink) =

0 commit comments

Comments
 (0)