Copyright | (c) 2011 National Institute of Aerospace / Galois Inc. |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Copilot.Library.Clocks
Description
This library generates new clocks based on a base period and phase.
Example Usage
Also see examples/Clock.hs
in the
Copilot repository.
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).
Documentation
Generate a clock that counts every n
ticks, starting at tick m
, by
using an array of size n
.
Arguments
:: (Integral a, Typed a) | |
=> Period a | Period |
-> Phase a | Phase |
-> Stream Bool |
This follows the same convention as clk
, but uses a counter variable of
integral type a rather than an array.