copilot-libraries-0.2: A Haskell-embedded DSL for monitoring hard real-time distributed systems.

Copilot.Library.Clocks

Description

A library that generates new clocks based on a base period. Usage, supposing v is a Copilot variable, then clk ( period 3 ) ( phase 1 ) is equivalent to a stream of values like: cycle [False, True, False] that generates a stream of values False True False False True False False True False ... 0 1 2 3 4 5 6 7 8 That is true every 3 ticks (the period) starting on the 1st tick (the phase). Constraints: The period must be greater than 0. The phase must be greater than or equal to 0. The phase must be less than the period.

Documentation

clk :: Integral a => Period a -> Phase a -> Stream BoolSource

clk1 :: (Integral a, Typed a) => Period a -> Phase a -> Stream BoolSource

period :: Integral a => a -> Period aSource

phase :: Integral a => a -> Phase aSource