Skip to content

Commit

Permalink
fixup! (DROPME) Fix up debugging ILA
Browse files Browse the repository at this point in the history
  • Loading branch information
rslawson committed Feb 21, 2025
1 parent b26de43 commit a26b402
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions bittide-instances/src/Bittide/Instances/Hitl/Demo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import Clash.Cores.Xilinx.Ila (Depth (..), IlaConfig (..), ila, ilaConfig)
import Clash.Cores.Xilinx.VIO (vioProbe)
import Clash.Cores.Xilinx.Xpm.Cdc (xpmCdcArraySingle, xpmCdcSingle)
import Clash.Functor.Extra ((<<$>>))
import Clash.Sized.Extra (unsignedToSigned)
import Clash.Xilinx.ClockGen (clockWizardDifferential)
import Protocols
import Protocols.Wishbone
Expand Down Expand Up @@ -206,6 +207,9 @@ dut refClk refRst skyClk rxNs rxPs allProgrammed miso jtagIn =
:> "dd_ebReadys"
-- Other
:> "dd_transceiversFailedAfterUp"
:> "dd_nFincs"
:> "dd_nFdecs"
:> "dd_netFincs"
:> Nil
)
{ depth = D16384
Expand All @@ -220,6 +224,9 @@ dut refClk refRst skyClk rxNs rxPs allProgrammed miso jtagIn =
allStable
(bundle $ xpmCdcArraySingle bittideClk refClk <$> ebReadys)
transceiversFailedAfterUp
nFincs
nFdecs
(fmap unsignedToSigned nFincs - fmap unsignedToSigned nFdecs)

captureFlag =
riseEvery
Expand All @@ -228,6 +235,38 @@ dut refClk refRst skyClk rxNs rxPs allProgrammed miso jtagIn =
enableGen
(SNat @(PeriodToCycles Basic125 (Milliseconds 1)))

nFincs :: Signal Basic125 (Unsigned 32)
nFincs =
regEn
refClk
refRst
enableGen
(0 :: Unsigned 32)
( isFalling
refClk
refRst
enableGen
False
((== Just SpeedUp) <$> callistoResult.maybeSpeedChangeC)
)
(satSucc SatBound <$> nFincs)

nFdecs :: Signal Basic125 (Unsigned 32)
nFdecs =
regEn
refClk
refRst
enableGen
(0 :: Unsigned 32)
( isFalling
refClk
refRst
enableGen
False
((== Just SlowDown) <$> callistoResult.maybeSpeedChangeC)
)
(satSucc SatBound <$> nFdecs)

-- Step 1, wait for SPI:
(_, _, spiState, spiOut) =
withClockResetEnable refClk spiRst enableGen
Expand Down

0 comments on commit a26b402

Please sign in to comment.