Skip to content

Commit

Permalink
Fix CSignal simulation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
t-wallet committed Oct 25, 2024
1 parent d7f2f3a commit 0df8f56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clash-protocols/src/Protocols/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ instance (C.KnownDomain dom) => Simulate (CSignal dom a) where
type SimulateChannels (CSignal dom a) = 1

simToSigFwd Proxy list = C.fromList_lazy list
simToSigBwd Proxy () = def
simToSigBwd Proxy () = pure ()
sigToSimFwd Proxy sig = C.sample_lazy sig
sigToSimBwd Proxy _ = ()

Expand All @@ -484,7 +484,7 @@ instance (C.NFDataX a, C.ShowX a, Show a, C.KnownDomain dom) => Drivable (CSigna
in Circuit (\_ -> ((), fwd1))

sampleC SimulationConfig{resetCycles, ignoreReset} (Circuit f) =
let sampled = CE.sample_lazy (snd (f ((), def)))
let sampled = CE.sample_lazy (snd (f ((), pure ())))
in if ignoreReset then drop resetCycles sampled else sampled

{- | Simulate a circuit. Includes samples while reset is asserted.
Expand Down

0 comments on commit 0df8f56

Please sign in to comment.