Skip to content

Commit

Permalink
Making plotting ILA do the pulse shortening to single clock cycles it…
Browse files Browse the repository at this point in the history
…self.
  • Loading branch information
rslawson committed Oct 22, 2024
1 parent 971a46e commit 67d2191
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions bittide-instances/src/Bittide/Instances/Hitl/IlaPlot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,14 @@ callistoClockControlWithIla ::
Vec n (Signal sys (RelDataCount m)) ->
Signal sys (CallistoResult n)
callistoClockControlWithIla dynClk clk rst callistoCfg callistoCc IlaControl{..} mask ebs =
hwSeqX ilaInstance (muteDuringCalibration <$> calibrating <*> result)
hwSeqX ilaInstance (muteDuringCalibration <$> calibrating <*> output)
where
result = callistoCc clk rst enableGen callistoCfg mask ebs
output = callistoCc clk rst enableGen callistoCfg mask ebs

-- Condense multicycle speedchange outputs into a single cycle for the ILA
mscChanging = isRising clk rst enableGen False (isJust . maybeSpeedChange <$> output)
newMsc = mux mscChanging (maybeSpeedChange <$> output) (pure Nothing)
callistoOutputIla = (\record field -> record{maybeSpeedChange = field}) <$> output <*> newMsc

filterCounts vMask vCounts = flip map (zip vMask vCounts)
$ \(isActive, count) -> if isActive == high then count else 0
Expand Down Expand Up @@ -531,12 +536,12 @@ callistoClockControlWithIla dynClk clk rst callistoCfg callistoCc IlaControl{..}
height = SNat @AccWindowHeight
idcs =
unbundle
(filterIndicators <$> fmap bv2v mask <*> (stability <$> result))
(filterIndicators <$> fmap bv2v mask <*> (stability <$> callistoOutputIla))

-- get the points in time where the monitored values change
stableUpdates = changepoints clk rst enableGen <$> (fmap stable <$> idcs)
settledUpdates = changepoints clk rst enableGen <$> (fmap settled <$> idcs)
modeUpdate = changepoints clk rst enableGen (rfStageChange <$> result)
modeUpdate = changepoints clk rst enableGen (rfStageChange <$> callistoOutputIla)

combine eb stU seU ind =
(,,)
Expand All @@ -547,8 +552,8 @@ callistoClockControlWithIla dynClk clk rst callistoCfg callistoCc IlaControl{..}
noChange = fromMaybe NoChange . maybeSpeedChange
in PlotData
<$> bundle (zipWith4 combine ebsC stableUpdates settledUpdates idcs)
<*> accWindow height clk rst enableGen (noChange <$> result)
<*> mux modeUpdate (rfStageChange <$> result) (pure Stable)
<*> accWindow height clk rst enableGen (noChange <$> callistoOutputIla)
<*> mux modeUpdate (rfStageChange <$> callistoOutputIla) (pure Stable)

-- compress the elastic buffer data via only reporting the
-- differences since the last capture
Expand Down

0 comments on commit 67d2191

Please sign in to comment.