
GR716-DS-UM, May 2019, Version 1.29
301
www.cobham.com/gaisler
GR716
33.4
Time-code distribution
Time-codes are control codes that consists of two control flags (bits 7:6) and a time value (bits 5:0),
and they are used to distribute time over the SpaceWire network. The current time value (value of lat-
est received or transmitted time-code), and control flags, can be read from the Time-code register
(TC).
33.4.1 Receiving time-codes
When a control-code is received, and either the control flags (bits 7:6) have value “00”, or both con-
trol flag filtering and interrupt receive is disabled (CTRL.TF bit, and INTCTRL.IR bit both set to 0),
then the received control code is considered to be a Time-Code. If Time-Code reception is enabled
(CTRL.TR bit set to 1) then the received time value is stored in the TC.TIMECNT field. If the
received time value equals TC.1 (modulo 64), then the Time-Code is considered valid.
When a valid Time-Code is received, in addition to the time value being updated, the received control
flags are stored to the TC.TCTRL field. Also, when a valid Time-Code is received, the TICKOUT
output signal is asserted for one system clock cycle, the STS.TO bit is set to 1, and an AMBA inter-
rupt is generated if the CTRL.IE bit and CTRL.TQ bit are both set to 1.
For all received control codes, Time-Codes or not, the control flags together with the time value are
outputted on the TIMEOUT[7:0] signals, and the TICKOUTRAW signal is asserted for one system
clock cycle.
33.4.2 Transmitting time-codes
Time-codes can be transmitted either through the AMBA APB registers.
In order to send a Time-code, Time-Code transmission must be enabled by setting the CTRL.TT bit to
1. To transmit a time-code through the register interface the CTRL.TI bit should be written to 1. When
the bit is written the current time value (TC.TIMECNT field) is incremented, and a Time-Code con-
sisting of the new time value together with the current control flags (TC.TCTRL field) is sent. The
CTRL.TI bit will stay high until the Time-Code has been transmitted. If time-code transmission is dis-
abled, writing the CTRL.TI bit has no effect.
To transmit a time-code using the TICKIN signal the sender must wait until the TICKINDONE output
is low, then assert TICKIN. When TICKINDONE is asserted again, the TICKIN signal should be de-
asserted the same cycle. Following this procedure will make the core transmit a Time-Code consisting
of the current control flags and the current time value + 1 (modulo 64). This also requires that time-
code transmission is enabled through the CTRL.TT bit.
To transmit a Time-Code using the TICKINRAW signal the sender must wait until TICKINDONE is
low, then assert TICKINRAW and place the value of the Time-Code to be sent on the TIMEIN[7:0]
signals. When TICKINDONE is asserted again, the TICKINRAW signal should be de-asserted the
same cycle. Note that sending Time-Codes by using TICKINRAW does not require that Time-Code
transmission is enabled from the Control register. However, in order to send Time-Codes with control
flags different than “00”, interrupt transmit must be disabled (INTCTRL.IT bit set to 0). If interrupt
transmit is enabled then control codes “10” are interpreted as interrupt-codes, while control codes
“01” and “11” are discarded.
Note that the link interface must be in run-state in order to be able to send a Time-Code.
33.5
Interrupt distribution
The core supports interrupt distribution functionality. Whether or not this functionality is imple-
mented is indicated by the CTRL.ID bit, and the number of supported interrupt numbers is indicated
by the INTCFG.NUMINT field. Either 1, 2, 4, or 32 interrupt numbers (in the range 0-31) can be sup-
ported. When less than 32 interrupt numbers are supported it is programmable through the INTCFG