Skip to content

Commit

Permalink
Dont use records for ilaPlotSetup arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
lmbollen committed Feb 7, 2025
1 parent 24e1afe commit a0c291f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
33 changes: 12 additions & 21 deletions bittide-instances/src/Bittide/Instances/Hitl/IlaPlot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module Bittide.Instances.Hitl.IlaPlot (
-- * Interface Types
CaptureCondition (..),
isScheduledCaptureCondition,
IlaPlotSetup (..),
IlaControl (..),
PlotData (..),
RfStageChange (..),
Expand Down Expand Up @@ -204,23 +203,6 @@ isScheduledCaptureCondition = \case
UntilTrigger -> False
DataChange -> False

{- | All signals, as they are required for using clock control with
ILA plotting capabilities.
-}
data IlaPlotSetup dom = IlaPlotSetup
{ sysClk :: Clock dom
-- ^ The stable system clock.
, sysRst :: Reset dom
-- ^ The system's reset line.
, allReady :: Signal dom Bool
-- ^ A boolean signal indicating that all transceivers are ready. See
-- 'Bittide.Transceiver.Output.linkReady'.
, startTest :: Signal dom Bool
-- ^ The test start signal coming from the HITLT VIO interface.
, syncIn :: Signal dom Bool
-- ^ The signal connected to @SYNC_IN@.
}

{- | All signals, as they are required by the ILA trigger and capture
conditions. You must use 'ilaPlotSetup' for generating them.
-}
Expand Down Expand Up @@ -267,10 +249,19 @@ ilaPlotSetup ::
forall dom.
(HasCallStack) =>
(HasDefinedInitialValues dom, HasSynchronousReset dom) =>
-- | required input signals
IlaPlotSetup dom ->
-- | The stable system clock.
Clock dom ->
-- | The system's reset line.
Reset dom ->
-- | A boolean signal indicating that all transceivers are ready. See
-- 'Bittide.Transceiver.Output.linkReady'.
Signal dom Bool ->
-- | The test start signal coming from the HITLT VIO interface.
Signal dom Bool ->
-- | The signal connected to @SYNC_IN@.
Signal dom Bool ->
IlaControl dom
ilaPlotSetup IlaPlotSetup{..} = IlaControl{..}
ilaPlotSetup sysClk sysRst allReady startTest syncIn = IlaControl{..}
where
-- 'syncOutGenerator' is used to drive 'SYNC_OUT'.
syncOut =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import Bittide.Transceiver (transceiverPrbsN)
import Bittide.Hitl
import Bittide.Instances.Hitl.IlaPlot (
IlaControl (..),
IlaPlotSetup (..),
clockControlIla,
ilaPlotSetup,
)
Expand Down Expand Up @@ -764,7 +763,7 @@ swCcTopologyTest refClkDiff sysClkDiff syncIn rxns rxps miso jtagIn =
where
refClk = ibufds_gte3 refClkDiff :: Clock Ext200
(sysClk, sysRst) = clockWizardDifferential sysClkDiff noReset
ilaControl@IlaControl{..} = ilaPlotSetup IlaPlotSetup{..}
ilaControl@IlaControl{..} = ilaPlotSetup sysClk tbReset allReady startTest syncIn
startTest = isJust <$> testConfig

testCounter =
Expand Down

0 comments on commit a0c291f

Please sign in to comment.