clash-protocols
Safe HaskellNone
LanguageGHC2021

Protocols.Experimental.Df

Description

Experimental simulation support for Protocols.Df.

Synopsis

Documentation

Simulation functions

drive :: forall (dom :: Domain) a. KnownDomain dom => SimulationConfig -> [Maybe a] -> Circuit () (Df dom a) Source #

Emit values given in list. Emits no data while reset is asserted. Not synthesizable.

stall Source #

Arguments

:: forall (dom :: Domain) a. (KnownDomain dom, HasCallStack) 
=> SimulationConfig 
-> StallAck

Acknowledgement to send when LHS does not send data. Stall will act transparently when reset is asserted.

-> [Int] 
-> Circuit (Df dom a) (Df dom a) 

Stall every valid Df packet with a given number of cycles. If there are more valid packets than given numbers, passthrough all valid packets without stalling. Not synthesizable.

For a generalized version of stall, check out stallC.

sample :: forall (dom :: Domain) b. KnownDomain dom => SimulationConfig -> Circuit () (Df dom b) -> [Maybe b] Source #

Sample protocol to a list of values. Drops values while reset is asserted. Not synthesizable.

For a generalized version of sample, check out sampleC.

simulate Source #

Arguments

:: forall (dom :: Domain) a b. KnownDomain dom 
=> SimulationConfig

Simulation configuration. Use def for sensible defaults.

-> (Clock dom -> Reset dom -> Enable dom -> Circuit (Df dom a) (Df dom b))

Circuit to simulate.

-> [Maybe a]

Inputs

-> [Maybe b]

Outputs

Simulate a single domain protocol. Not synthesizable.

For a generalized version of simulate, check out simulateC.

Orphan instances

Backpressure (Df dom a) Source # 
Instance details

Methods

boolsToBwd :: Proxy (Df dom a) -> [Bool] -> Bwd (Df dom a) Source #

(KnownDomain dom, NFDataX a, ShowX a, Show a) => Drivable (Df dom a) Source # 
Instance details

Associated Types

type ExpectType (Df dom a) 
Instance details

Defined in Protocols.Experimental.Df

type ExpectType (Df dom a) = [a]

Methods

toSimulateType :: Proxy (Df dom a) -> ExpectType (Df dom a) -> SimulateFwdType (Df dom a) Source #

fromSimulateType :: Proxy (Df dom a) -> SimulateFwdType (Df dom a) -> ExpectType (Df dom a) Source #

driveC :: SimulationConfig -> SimulateFwdType (Df dom a) -> Circuit () (Df dom a) Source #

sampleC :: SimulationConfig -> Circuit () (Df dom a) -> SimulateFwdType (Df dom a) Source #

(KnownDomain dom, NFDataX a, ShowX a, Show a) => Simulate (Df dom a) Source # 
Instance details

Associated Types

type SimulateFwdType (Df dom a) 
Instance details

Defined in Protocols.Experimental.Df

type SimulateFwdType (Df dom a) = [Maybe a]
type SimulateBwdType (Df dom a) 
Instance details

Defined in Protocols.Experimental.Df

type SimulateBwdType (Df dom a) = [Ack]
type SimulateChannels (Df dom a) 
Instance details

Defined in Protocols.Experimental.Df

type SimulateChannels (Df dom a) = 1

Methods

simToSigFwd :: Proxy (Df dom a) -> SimulateFwdType (Df dom a) -> Fwd (Df dom a) Source #

simToSigBwd :: Proxy (Df dom a) -> SimulateBwdType (Df dom a) -> Bwd (Df dom a) Source #

sigToSimFwd :: Proxy (Df dom a) -> Fwd (Df dom a) -> SimulateFwdType (Df dom a) Source #

sigToSimBwd :: Proxy (Df dom a) -> Bwd (Df dom a) -> SimulateBwdType (Df dom a) Source #

stallC :: SimulationConfig -> Vec (SimulateChannels (Df dom a)) (StallAck, [Int]) -> Circuit (Df dom a) (Df dom a) Source #