@@ -75,17 +75,12 @@ import qualified Prelude as P
7575import Clash.Prelude (type (<= ))
7676import Clash.Signal.Internal (Signal )
7777import qualified Clash.Prelude as C
78- import qualified Clash.Explicit.Prelude as CE
7978
8079-- me
8180import Protocols.Internal
8281import Protocols.DfLike (DfLike )
8382import qualified Protocols.DfLike as DfLike
8483
85- <<<<<<< HEAD
86- =======
87- import Debug.Trace
88- >>>>>>> cc790e6... Add AXI4 Lite types
8984
9085-- $setup
9186-- >>> import Protocols
@@ -165,52 +160,6 @@ instance (C.KnownDomain dom, C.NFDataX a, C.ShowX a, Show a) => Drivable (Df dom
165160 sampleC = sample
166161
167162
168- simulateRight SimulationConfig {.. } acks circ =
169- P. take timeoutAfter $
170- CE. sample_lazy $
171- P. snd $
172- toSignals circ (() , resetAndAcks)
173- where
174- resetAndAcks = C. fromList $ (P. map Ack (replicate resetCycles False ) <> acks)
175-
176- simulateLeft SimulationConfig {.. } fwds circ = CE. sample_lazy ackSig
177- where
178- (ackSig, () ) = toSignals circ (dataSig, () )
179- dataSig = C. fromList_lazy (ackedData resetCycles fwds (C. sample ackSig))
180-
181- ackedData resetN _ (_: acks) | resetN > 0 =
182- NoData : ackedData (resetN - 1 ) fwds acks
183- ackedData _ _ [] = C. errorX " Empty acks list."
184- ackedData _ [] (_: acks) = NoData : ackedData 0 [] acks
185- ackedData _ (dat: datas) (ack: acks) = case ack of
186- Ack True -> dat : ackedData 0 (datas) acks
187- Ack False -> dat : ackedData 0 (dat: datas) acks
188-
189-
190-
191- simulateManager SimulationConfig {.. } acks circ =
192- P. take timeoutAfter $
193- CE. sample_lazy $
194- P. snd $
195- toSignals circ (() , resetAndAcks)
196- where
197- resetAndAcks = C. fromList $ (P. map Ack (replicate resetCycles False ) <> acks)
198-
199- -- TODO: apply simulation config
200- simulateSubordinate SimulationConfig {.. } fwds circ = CE. sample_lazy ackSig
201- where
202- (ackSig, () ) = toSignals circ (dataSig, () )
203- dataSig = C. fromList_lazy (ackedData resetCycles fwds (C. sample ackSig))
204-
205- ackedData resetN _ (_: acks) | resetN > 0 =
206- NoData : ackedData (resetN - 1 ) fwds acks
207- ackedData _ [] (_: acks) = NoData : ackedData 0 [] acks
208- ackedData _ (dat: datas) (ack: acks) = case ack of
209- Ack True -> dat : ackedData 0 (datas) acks
210- Ack False -> dat : ackedData 0 (dat: datas) acks
211-
212-
213-
214163instance DfLike dom (Df dom ) a where
215164 type Data (Df dom ) a = Data a
216165 type Payload a = a
0 commit comments