3.3.4. ClockTimer64 component

The ClockTimer64 component provides a mechanism for other components to schedule a callback after a number of ticks at a given ClockSignal rate.

Figure 3.3 shows a view of the component in System Canvas.

Figure 3.4. ClockTimer64 in System Canvas

ClockTimer64 in System Canvas

This component is written in C++.

Ports

Table 3.4 provides a brief description of the ClockTimer64 component ports.

Table 3.5. ClockTimer ports

NamePort protocolTypeDescription
timer_callbackTimerCallback64masterport on which a signal is sent after the number of scheduled ticks has elapsed
timer_controlTimerControl64slavepermits the timer to be set, canceled and queried
clk_inClockSignalslavedetermines the tick rate of the timer

TimerControl64 protocol

The TimerControl64 protocol is used to control the actions of a ClockTimer64 component. It permits a timer to be set to schedule a callback after a given number of ticks at the rate of the clock input.

If a timer is set while it is counting, it starts counting the new number of ticks without sending the original callback. Cancelling a timer when it is not active has no effect.

The TimerControl64 protocol has the following behaviors:

set(uint64_t ticks) : void

sets the timer to countdown the given number of ticks

cancel()

cancels an active timer, preventing the callback being invoked

isSet() : bool

checks whether a timer is set to generate a callback

remaining() : uint64_t

returns how many ticks remain before the callback is invoked.

TimerCallback64 protocol

The TimerCallback64 protocol is used to invoke a behavior on the component which set the timer. The timer_control port of the timer must not be used during the invoked behavior.

signal() : uint64_t

Invoked by the timer when the timer countdown expires. The invoked behavior returns the number of ticks after which it is called again or 0 to make the timer one-shot.

Parameters

The ClockTimer64 component has no parameters.

Registers

The ClockTimer64 component has no registers.

Debug features

The ClockTimer64 component has no debug features.

Verification and testing

This component has been tested using internal unit tests.

Performance

An active ClockTimer64 component incurs no simulation overhead. For best performance, avoid having your performance-critical code frequently cancel timers or query the number of remaining ticks.

Library dependencies

The ClockTimer64 component has no dependencies on external libraries.

Copyright © 2008-2013 ARM. All rights reserved.ARM DUI 0423O
Non-ConfidentialID060613