|Home > Fast Models components > Clocking components > ClockTimer|
A ClockTimer provides support for counting a number of ticks at the rate determined by the input clock. When the countdown reaches zero, the timer can send a signal to another component. That component can return a value that will cause the timer to start counting down again. Setting up a timer is very efficient, and no host processing time is used while a counter is counting down: when a timer is started, the scheduler precomputes the finish time. To use a ClockTimer connect the ClockTimer's 'timer_callback' port to a slave port that implements the 'signal()' behaviour and connect a clock signal to the clk_in port. Use the 'timer_control' port to start the timer counting down for a given number of ticks. This model is written in C++.
This component provides a mechanism for other components to schedule a callback after a number of ticks at a given ClockSignal rate.
An active ClockTimer component incurs no simulation overhead. For best performance, avoid having your performance-critical code frequently cancel timers or query the number of remaining ticks.
Table 3-56 Ports
||Slave||Determines the tick rate of the timer.|
||Master||Port on which a signal is sent after the number of scheduled ticks has elapsed.|
||Slave||Permits the timer to be set, canceled and queried.|