background image

36-52 Vol. 3C

INTEL® PROCESSOR TRACE

36.4.2.14   Cycle Count Packet (CYC) Packet

Table 36-33. Cycle Count Packet Definition

Name

Cycle Count (CYC) Packet

Packet Format

Dependencies

IA32_RTIT_CTL.CYCEn && 

TriggerEn

Generation Sce-

nario

Can be sent at any time, though a maximum of one CYC packet is 

sent per core clock cycle. See Section 36.3.6 for CYC-eligible packets.

Description

The Cycle Counter field increments at the same rate as the processor core clock ticks, but with a variable length for-

mat (using a trailing EXP bit field) and a range-capped byte length. 

If the CYC value is less than 32, a 1-byte CYC will be generated, with Exp=0. If the CYC value is between 32 and 

4095 inclusive, a 2-byte CYC will be generated, with byte 0 Exp=1 and byte 1 Exp=0. And so on.

CYC provides the number of core clocks that have passed since the last CYC packet. CYC can be configured to be 

sent in every cycle in which an eligible packet is generated, or software can opt to use a threshold to limit the num-

ber of CYC packets, at the expense of some precision. These settings are configured using the

IA32_RTIT_CTL.CycThresh field (see Section 36.2.7.2). For details on Cycle-Accurate Mode, IPC calculation, etc, see 

Section 36.3.6.

When CycThresh=0, and hence no threshold is in use, then a CYC packet will be generated in any cycle in which any 

CYC-eligible packet is generated. The CYC packet will precede the other packets generated in the cycle, and provides 

the precise cycle time of the packets that follow.

In addition to these CYC packets generated with other packets, CYC packets can be sent stand-alone. These packets 

serve simply to update the decoder with the number of cycles passed, and are used to ensure that a wrap of the 

processor’s internal cycle counter doesn’t cause cycle information to be lost. These stand-alone CYC packets do not 

indicate the cycle time of any other packet or operation, and will be followed by another CYC packet before any 

other CYC-eligible packet is seen.

When CycThresh>0, CYC packets are generated only after a minimum number of cycles have passed since the last 

CYC packet. Once this threshold has passed, the behavior above resumes, where CYC will either be sent in the next 

cycle that produces other CYC-eligible packets, or could be sent stand-alone.

When using CYC thresholds, only the cycle time of the operation (instruction or event) that generates the CYC 

packet is truly known. Other operations simply have their execution time bounded: they completed at or after the 

last CYC time, and before the next CYC time.

Application

CYC provides the offset cycle time (since the last CYC packet) for the CYC-eligible packet that follows. If another CYC 

is encountered before the next CYC-eligible packet, the cycle values should be accumulated and applied to the next 

CYC-eligible packet.

If a CYC packet is generated by a TNT, note that the cycle time provided by the CYC packet applies to the first 

branch in the TNT packet.

7

6

5

4

3

2

1

0

0

Cycle Counter[4:0]

Exp

1

1

1

Cycle  Counter[11:5]

Exp

2

Cycle Counter[18:12]

Exp

...

... (if Exp = 1 in the previous byte)