Skip to content

Commit

Permalink
Probe GTH resets
Browse files Browse the repository at this point in the history
  • Loading branch information
leonschoorl committed Dec 19, 2024
1 parent b02a607 commit 7b153b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bittide-instances/src/Bittide/Instances/Hitl/Transceivers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ transceiversUpTest refClkDiff sysClkDiff syncIn rxns rxps miso =
failAfterUp = isFalling sysClk testRst enableGen False allUp
failAfterUpSticky = sticky sysClk testRst failAfterUp

rst_alls_bv = fmap pack $ bundle $ map unsafeToActiveHigh transceivers.rst_alls
rst_rxs_bv = fmap pack $ bundle $ map unsafeToActiveHigh transceivers.rst_rxs

startTest = isJust <$> maybeFpgaIndex
fpgaIndex = fromMaybe 0 <$> maybeFpgaIndex

Expand Down Expand Up @@ -293,6 +296,9 @@ transceiversUpTest refClkDiff sysClkDiff syncIn rxns rxps miso =
:> "probe_startTest"
:> "probe_syncInRst"

:> "probe_rst_alls"
:> "probe_rst_rxs"

:> "dbgDataRx6" :> "dbgDataRx5" :> "dbgDataRx4" :> "dbgDataRx3" :> "dbgDataRx2" :> "dbgDataRx1" :> "dbgDataRx0"
:> "dbgDataExp6" :> "dbgDataExp5" :> "dbgDataExp4" :> "dbgDataExp3" :> "dbgDataExp2" :> "dbgDataExp1" :> "dbgDataExp0"

Expand All @@ -316,6 +322,9 @@ transceiversUpTest refClkDiff sysClkDiff syncIn rxns rxps miso =
startTest
(unsafeToActiveHigh syncInRst)

rst_alls_bv
rst_rxs_bv

dbgDataRx6 dbgDataRx5 dbgDataRx4 dbgDataRx3 dbgDataRx2 dbgDataRx1 dbgDataRx0
dbgDataExp6 dbgDataExp5 dbgDataExp4 dbgDataExp3 dbgDataExp2 dbgDataExp1 dbgDataExp0

Expand All @@ -332,9 +341,12 @@ transceiversUpTest refClkDiff sysClkDiff syncIn rxns rxps miso =
, unsafeToActiveHigh sysRst
, startTest
, unsafeToActiveHigh syncInRst
, milliseconds1
, rst_alls_bv
, rst_rxs_bv

,bundle (dbgDataRx6, dbgDataRx5, dbgDataRx4, dbgDataRx3, dbgDataRx2, dbgDataRx1, dbgDataRx0)
,bundle (dbgDataExp6, dbgDataExp5, dbgDataExp4, dbgDataExp3, dbgDataExp2, dbgDataExp1, dbgDataExp0)
-- ,bundle (dbgDataRx6, dbgDataRx5, dbgDataRx4, dbgDataRx3, dbgDataRx2, dbgDataRx1, dbgDataRx0)
-- ,bundle (dbgDataExp6, dbgDataExp5, dbgDataExp4, dbgDataExp3, dbgDataExp2, dbgDataExp1, dbgDataExp0)

)
timeSucc = countSucc @(Unsigned 16, Index (PeriodToCycles Basic125 (Milliseconds 1)))
Expand Down
8 changes: 8 additions & 0 deletions bittide/src/Bittide/Transceiver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ data Outputs n tx rx txS free = Outputs
-- ^ See 'Output.linkReady'
, stats :: Vec n (Signal free ResetManager.Statistics)
-- ^ See 'Output.stats'
, rst_alls :: Vec n (Reset free)
, rst_rxs :: Vec n (Reset free)
}

data Output tx rx txS free serializedData = Output
Expand Down Expand Up @@ -227,6 +229,8 @@ data Output tx rx txS free serializedData = Output
-- doing so. I.e., 'linkUp' implies 'linkReady'. Note that this
, stats :: Signal free ResetManager.Statistics
-- ^ Statistics exported by 'ResetManager.resetManager'. Useful for debugging.
, rst_all :: Reset free
, rst_rx :: Reset free
}

data Input tx rx ref free rxS serializedData = Input
Expand Down Expand Up @@ -317,6 +321,8 @@ transceiverPrbsN opts inputs@Inputs{clock, reset, refClock} =
linkUps = map (.linkUp) outputs
, linkReadys = map (.linkReady) outputs
, stats = map (.stats) outputs
, rst_alls = map (.rst_all) outputs
, rst_rxs = map (.rst_rx) outputs
}
where
-- XXX: Replacing 'zipWithN' with '<$>' and '<*>' triggers a combination of:
Expand Down Expand Up @@ -482,6 +488,8 @@ transceiverPrbsWith gthCore opts args@Input{clock, reset} =
, linkUp
, linkReady
, stats
, rst_all
, rst_rx
}

linkUp =
Expand Down

0 comments on commit 7b153b6

Please sign in to comment.