From 0df8f56e3e301e2923d21c70c724d9e5bde1c626 Mon Sep 17 00:00:00 2001 From: t-wallet Date: Fri, 25 Oct 2024 14:20:30 +0200 Subject: [PATCH] Fix CSignal simulation functions --- clash-protocols/src/Protocols/Internal.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clash-protocols/src/Protocols/Internal.hs b/clash-protocols/src/Protocols/Internal.hs index 786a77ef..76f46a71 100644 --- a/clash-protocols/src/Protocols/Internal.hs +++ b/clash-protocols/src/Protocols/Internal.hs @@ -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 _ = () @@ -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.