Message generation method and apparatus

By acquiring the raw data of customized circuits and generating tracing messages, the problem of the ARM CoreSight system being unable to trace signals of customized circuits is solved, realizing effective tracing of customized circuits, which is suitable for performance analysis and optimization of motor control chips.

CN121705104BActive Publication Date: 2026-05-05合肥智芯半导体有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
合肥智芯半导体有限公司
Filing Date
2026-01-09
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

The ARM CoreSight system cannot track signals from custom circuits within the SoC.

Method used

A message generation method is provided, which obtains the raw data output by a customized circuit, retrieves the corresponding target message from multiple message types based on the data type of the information payload, and retrieves at least two target message fields that match the data type from multiple message fields of the target message to generate a tracking message.

Benefits of technology

It enables effective tracking of customized circuits, solving the problem that the ARM CoreSight system cannot track signals of customized circuits, and is suitable for performance analysis and optimization of motor control chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121705104B_ABST
    Figure CN121705104B_ABST
Patent Text Reader

Abstract

This invention discloses a message generation method and apparatus applied in the field of integrated circuits. The method can, based on the type of information payload output by a customized circuit, obtain at least two target message fields matching the type from multiple message fields, and generate a tracking message based on the information payload and the at least two target message fields. Thus, according to the characteristics of the customized circuit, the information payload output by the customized circuit is mapped to a tracking message, enabling the tracking of the customized circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of integrated circuits, specifically to a message generation method and apparatus. Background Technology

[0002] ARM system-on-a-chip (SoC) features the ARM CoreSight system, which is used for debugging and tracing the SoC. However, the ARM CoreSight system cannot trace signals from custom circuits within the SoC. These custom circuits refer to circuits designed by the user based on their specific requirements.

[0003] There is an urgent need for a solution that can track messages from customized circuits. Summary of the Invention

[0004] This application proposes a message generation method and apparatus, the technical solution of which includes:

[0005] On the one hand, a message generation method is provided, which includes:

[0006] Obtain the raw data output by the customized circuit;

[0007] Based on the data type of the information payload in the original data, the target message corresponding to the data type is obtained from multiple message types;

[0008] Retrieve at least two target message fields that match the data type from multiple message fields of the target message;

[0009] A tracking message is generated based on the information payload and at least two target message fields.

[0010] Optional, customized circuitry includes a processor, bus, and phase-locked loop;

[0011] Data types include: processor instruction classes, processor read / write classes, bus classes, phase-locked loop read / write classes, circuit signal classes, timestamp or error classes;

[0012] When the data type is instruction, the target message is an instruction message;

[0013] When the data type is processor data read / write class, the target message is a read / write data class message;

[0014] When the data type is a bus type or a phase-locked loop read / write type, the target message is a data acquisition message;

[0015] When the data type is circuit signal, the target message is an integrated circuit tracing message;

[0016] When the data type is timestamp, the target message is a timestamp message;

[0017] When the data type includes an error class, the target message is: Error Message.

[0018] Optionally, when the information payload is a jump instruction, the target message is: a branch message;

[0019] When the information payload is a pause instruction, the target message is: pause instruction message.

[0020] Optionally, jump instructions include direct jump instructions or indirect jump instructions.

[0021] Optionally, when the information payload is write data to the processor, the target message is: write data message;

[0022] When the information payload is read data from the processor, the target message is: read data message.

[0023] Optionally, when the data type is a processor instruction class, a processor read / write class, or a circuit signal class,

[0024] If the information payload does not meet the synchronization conditions, the target message is a message without synchronization conditions;

[0025] If the information payload meets the synchronization condition, then the target message is a message with the synchronization condition.

[0026] Optionally, when the information payload is a jump instruction or a pause instruction, at least two target message fields include a first field set, which includes a first timestamp field, a source field, a transmission code field, and an instruction count field.

[0027] Among them, the first timestamp field is the time when the tracking message was generated; the transmission code field is the type of the target message; and the instruction count field is the total number of instructions that the processor has executed sequentially since the previous tracking message on the same channel of the processor.

[0028] Optionally, if the information payload meets the synchronization conditions, at least two target message fields may also include a synchronization condition field and an absolute address field, and the field value of the synchronization condition field is the synchronization reason for the information payload meeting the synchronization conditions.

[0029] When the information payload is an indirect jump instruction and the synchronization condition is not met, at least two target message fields also include a relative address field.

[0030] Optionally, the data type is the processor's read / write class;

[0031] If the information payload does not meet the synchronization conditions, at least two target message fields include a second field set and a relative address field. The second field set includes a first timestamp field, a data field, a data size field, a source field, and a transmission code field.

[0032] When the information payload satisfies the synchronization condition, at least two target message fields include a second set of fields, a synchronization condition field, and an absolute address field.

[0033] Among them, the first timestamp field is the time when the tracking message was generated; the data field is the data content; the data size field is the bit width of the data content; the transmission code field is the type of the target message; and the synchronization condition field is the synchronization reason why the information payload meets the synchronization condition.

[0034] Optionally, when the target message is a data acquisition message, at least two target message fields include: a first timestamp field, a data acquisition data (DQDATA) field, an identification tag field, and a transmission code field;

[0035] The value of the identifier tag field indicates the source of the information payload, and the value of the transmission code field indicates the type of the target message.

[0036] Optionally, when the data type is bus type, the information payload includes first bus data and second bus data. The first bus data includes: control signals and first bus data content; the second bus data includes: control signals and second bus data content.

[0037] The DQDATA field includes a first subfield and a second subfield, wherein the field value of the first subfield is the control signal and the first bus data content, and the field value of the second subfield is the second bus data content;

[0038] The control signal is used to indicate the processing method for the first bus data and the second bus data.

[0039] Optionally, in the case of a read / write type of phase-locked loop, the information payload includes the phase-locked loop data content;

[0040] The DQDATA field includes a first subfield and a second subfield. The field value of the first subfield is the phase-locked loop data content, and the field value of the second subfield is the attribute data of the information payload.

[0041] The data content of the phase-locked loop is the data content obtained from the phase-locked loop's memory.

[0042] Optionally, the target message is an integrated circuit tracing message;

[0043] When the information payload does not meet the synchronization conditions, at least two target message fields include: a third field set and a first signal content field. The third field set includes a first timestamp field, a signal source field, and a transmission code field.

[0044] When the information payload meets the synchronization conditions, at least two target message fields include: a third field set, a second signal content field, and a synchronization condition field;

[0045] Among them, the field value of the first timestamp field is the time when the tracking message is generated; the field value of the transmission code field represents the synchronization type of the target message; the field value of the synchronization condition field is the synchronization reason that the information payload meets the synchronization condition; the field value of the first signal content field is the relative value of the circuit signals of multiple circuit channels; and the field value of the second signal content field is the circuit signals of multiple circuit channels.

[0046] Optionally, the target message is a timestamp message;

[0047] At least two target message fields include: a second timestamp field and a transmission code field;

[0048] The second timestamp field has an external timestamp value, and the transmission code field has a value that represents the type of the target message.

[0049] Optionally, the target message is: an error message;

[0050] At least two target message fields include: a first timestamp field, an error code field, an error type field, and a transmission code field;

[0051] Among them, the first timestamp field is the time when the tracking message was generated; the error code field is the tracking message that generated the error; the error type field is the reason why the tracking message generated the error; and the transmission code field is the type of the target message.

[0052] Optionally, the synchronization conditions include: a synchronization enable signal, which indicates that the message corresponding to the received information payload is a message with synchronization conditions.

[0053] Optionally, the method also includes:

[0054] Generate a dataset based on attribute data of information payload;

[0055] Based on the information payload and at least two target message fields, a tracking message is generated, including:

[0056] Generate a tracking message based on the dataset and at least two target message fields.

[0057] Optionally, obtain the raw data output by the customized circuit, including:

[0058] Select the target tracking source from multiple tracking sources in the customized circuit;

[0059] Receive raw data from the target tracking source.

[0060] Optionally, the enable signal is used to indicate at least one of the following:

[0061] A trace message indicating the instructions generated by the processor;

[0062] A trace message indicating the data content generated by the processor;

[0063] Instructs the generation of trace messages with a data type of bus;

[0064] A tracking message indicating the content of the phase-locked loop data that generates the phase-locked loop;

[0065] Indicates the generation of a trace message with a data type of circuit signal;

[0066] Instructs the generation of a tracking message with a timestamp data type.

[0067] Optionally, an enable signal can be used to indicate that the first timestamp field is prohibited in tracking messages.

[0068] In cases where the enable signal indicates a trace message for generating the processor's instructions, the enable signal is also used to indicate at least one of the following:

[0069] The instruction generates a tracking message with an information payload of type 1, the first type including at least one of a target instruction and a pause instruction, the target instruction including a direct jump instruction and an indirect jump instruction;

[0070] A trace message indicating the information payload of the first channel output of the generator processor;

[0071] In cases where the enable signal indicates a trace message that generates the data content of the processor, the enable signal is also used to indicate at least one of the following:

[0072] Instructs the generation of a trace message with an information payload of type 2, where type 2 includes processor read and / or write classes;

[0073] A tracking message indicating the information payload of the second channel output of the generator processor;

[0074] In the case where the enable signal indicates a tracking message for generating phase-locked loop data content, the enable signal is also used to indicate a tracking message for generating information payload of type 3, where type 2 includes read and / or write types of the phase-locked loop.

[0075] When the enable signal indicates that a trace message of type circuit signal is generated, the enable signal is also used to indicate that a trace message of target edge information payload is generated, including no edge, rising edge, falling edge, or double edge.

[0076] Optional, customized circuitry includes a general-purpose timer module (GTM).

[0077] On the other hand, a message generation apparatus is provided to implement the message generation method described above.

[0078] In summary, this application provides a message generation method and apparatus. This method can, based on the data type of the information payload output by a customized circuit, obtain a target message corresponding to the data type from multiple message types, then obtain at least two target message fields matching the data type from multiple message fields in the target message, and generate a tracking message based on the information payload and the at least two target message fields. This maps the information payload output by the customized circuit to a tracking message, enabling the tracking of the customized circuit.

[0079] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0080] Figure 1 This is a flowchart of a message generation method provided in an embodiment of this application;

[0081] Figure 2 This is a schematic diagram of a message tracking circuit provided in an embodiment of this application. Detailed Implementation

[0082] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0083] Currently, it is possible to analyze the chip's operational status based on its internal signals. These internal signals can include at least one of program flow, data flow, bus flow, and signal flow. The chip's operational status can include whether there are errors in the chip's operation and the efficiency of the chip's program execution.

[0084] The internal signals of a chip can be obtained through debugging and tracing. Debugging refers to pausing the chip under certain conditions during its operation by setting conditional breakpoints and single-stepping, then reading the chip's internal signals to obtain the chip's current state and thus confirm the execution status of the chip program.

[0085] The tracking method refers to pre-setting trigger tracking conditions in the tracking circuit. When these conditions are met, the tracking circuit captures the internal signals of the running chip, packages these signals into a specific information packet, and outputs this packet to an external tool via an output port. The external tool can then parse the received packet to obtain the chip's internal signals and analyze the chip's operation based on these signals. The output port can be a pin.

[0086] Compared to debugging methods, tracing methods can acquire the chip's internal signals without stopping its operation, and the acquired internal signals are continuous. For some chips (such as motor control chips or GTMs), debugging methods require the control chip to stop operating, which may damage the motor and hinder signal flow observation. Therefore, tracing methods are suitable for performance analysis and optimization of motor control chips.

[0087] ARM system chips have an ARM CoreSight system, which is used for debugging and tracing the SoC. However, the ARM CoreSight system cannot trace signals from custom circuits within the SoC.

[0088] Here, "customized circuit" refers to a circuit designed by the user based on specific requirements. This customized circuit is not an ARM core, and the bus flow within it is not the same as the bus flow of an Advanced Microcontroller Bus Architecture (AMBA) bus. The signal flow in the customized circuit is also not the same as the signal flow of a subsystem within an ARM core. For example, this customized circuit could be a motor control circuit. Similarly, the processors of certain subsystems within a System-on-a-Chip (SoC) are customized. Therefore, there is a pressing need for a way to track customized circuits. GTM provides a general-purpose timer platform for complex applications in the automotive industry, such as powertrain, power steering, chassis, and transmission control. GTM offers various timer functions and also incorporates a programmable core similar to a Reduced Instruction Set Computer (RISC) for data processing and complex output sequence generation. GTM can run on a minimal central processing unit (CPU) and can free up as much CPU time as possible while handling interrupt service requests, reducing CPU load.

[0089] In this embodiment, the customized circuit can be a GTM (Government Transmission Timing), which may include a processor, a bus, a phase-locked loop (PLL), an input / output (I / O) module, and a time base unit (TBU). The bus can be an advanced routing unit (ARU) bus.

[0090] The processor can be a multi-channel sequencer (MCS). The number of MCSs varies depending on the version of GTM, with a maximum of 10 MCSs and each MCS having 8 channels.

[0091] Each channel of the MCS can be viewed as a single processor task scheduled at a specific point in time. At most one channel's instructions can be executed in a single clock cycle. The MCS can operate at a 200 MHz clock with a 7-stage pipeline. Each MCS is equipped with program memory and data memory, both of which can be random access memory (RAM). These two RAMs are shared by the eight channels in the MCS, and the MCS can request ARU bus read / write operations on data from other modules in the customized circuitry. The MCS has a total of 71 instructions, which can be divided into six groups: data transfer, ARU bus data transfer, computation, testing, control flow, and other instruction categories. The MCS instruction format is 32 bits.

[0092] Although the customized circuit has up to 10 MCSs, in order to consider the tracking bandwidth, the embodiments of this application only track the instructions and data of one MCS.

[0093] This customized circuit has two ARU buses, and embodiments of this application can track both ARU buses simultaneously. The ARU buses are designed to provide a flexible and resource-efficient method for connecting data sources in the customized circuit to data destinations in the customized circuit.

[0094] The submodules connected to the ARU bus may include: a processor, a timer input module (TIM), an aru-connected timer output module (ATOM), a phase-locked loop, a broadcast module (BRC), and a parameter storage module (PSM).

[0095] These submodules can read and write data to each other via the ARU bus, with a data width of 53 bits. Each piece of data transmitted on the ARU bus has a unique source address. The ARU bus will sequentially poll for read requests, and then establish a connection to input data from the data source to the data destination.

[0096] I / O modules may include TIM, timer output module (TOM), ATOM, and timer input output module (TIO).

[0097] TIM is used to filter and capture input signals. TOM generates simple pulse width modulation (PWM) signals, while ATOM can generate complex PWM signals without the intervention of a central processing unit (CPU), making it more powerful than TOM.

[0098] TIO functions similarly to TIM, TOM, and ATOM. Using TIO can reduce design complexity and functional requirements, aiming to provide alternative solutions to existing functions.

[0099] A phase-locked loop (PLL) can be a digital PLL module (DPLL), which is used for frequency multiplication. It generates a high-frequency micro-tooth signal from a low-frequency input signal to increase the resolution of the input signal.

[0100] The input signal trigger (TRIGGER) and status (STATE) signals can represent position information of linear or angular motion, mass flow rate, temperature, pressure, or liquid level.

[0101] The DPLL has three memories, which can be RAM, all used to store parameters used during DPLL operation. The first RAM stores the parameters required for DPLL calculation, the second RAM stores local variables and STATE signal characterization data during DPLL calculation, and the third RAM stores the characterization data of the trigger input signal. Due to bandwidth limitations, this embodiment only tracks the RAM of one DPLL.

[0102] Sensor pattern evaluation (SPE) is used to evaluate the input of three Hall sensors to determine the engine rotation direction of the DPLL in hybrid engine applications and to work with TOM to support the drive of brushless direct current (BLDC) motors.

[0103] The GTM has four time base units: a first time base unit (TBU0), a second time base unit (TBU1), a third time base unit (TBU2), and a fourth time base unit (TBU3). The first time base unit (TBU0) has a bit width of 27 bits, while the second, third, and fourth time base units (TBU1, TBU2, and TBU3) each have a bit width of 24 bits. This embodiment tracks the timestamp of one TBU.

[0104] Figure 1This is a flowchart of a message generation method provided in an embodiment of this application, applied to a message tracing circuit, which is a message generation device; as follows: Figure 1 As shown, the method includes:

[0105] Step 101: Obtain the raw data output by the customized circuit.

[0106] The message tracing circuit is connected to a custom circuit to obtain raw data from the tracing port of the custom circuit.

[0107] Step 102: Based on the data type of the information payload in the original data, obtain the target message corresponding to the data type from multiple message types.

[0108] After acquiring the raw data output by the customized circuit, the message tracing circuit can extract the target message corresponding to the data type from multiple message types based on the data type of the information payload in the raw data.

[0109] The message tracing circuit can pre-store the correspondence between types and messages, and can retrieve the target message corresponding to the data type from this correspondence.

[0110] Step 103: Obtain at least two target message fields that match the data type from the multiple message fields of the target message.

[0111] A message tracing circuit can retrieve at least two target message fields that match the data type from multiple message fields in a target message. As specified in the Nexus standard, a target message includes multiple message fields.

[0112] Step 104: Generate a tracking message based on the information payload and at least two target message fields.

[0113] In summary, this application provides a message generation method. This method can, based on the data type of the information payload in the raw data output by a customized circuit, obtain a target message corresponding to the data type from multiple message types, then obtain at least two target message fields matching the data type from multiple message fields in the target message, and generate a tracking message based on the information payload and the at least two target message fields. This maps the information payload output by the customized circuit to a tracking message, enabling the tracking of the customized circuit.

[0114] refer to Figure 1 The method may include:

[0115] Step 101: Obtain the raw data output by the customized circuit.

[0116] The message tracing circuit is connected to a custom circuit to obtain raw data from the tracing port of the custom circuit.

[0117] If the trace port is the trace port for processor instructions, the raw data output by the trace port includes: instruction valid signal, instruction content, source data, and instruction address.

[0118] The information payload in the raw data can be instruction content. The processor instruction trace port can include an instruction content output port and an instruction address output port. The instruction content output port outputs the instruction content, and the instruction address output port outputs the instruction address. The instruction address can be the content of dbg_mcs_addr[11:0]. The source data indicates which channel of the processor the information payload originates from.

[0119] If the trace port is a trace port for processor data, the raw data output by the trace port includes: data valid signal, data content, read signal / write signal, absolute address of data content, and source data of data content.

[0120] The information payload in the raw data can be: data content, the absolute address of the data content has a bit width of 13-bit, and the actual bit width of the data content has a bit width of 32-bit.

[0121] If the tracking port is a bus data tracking port, then the raw data output by the tracking port includes: bus valid signal, first bus data and second bus data.

[0122] The information payload in the original data may include: first bus data and second bus data. Each bus data in the first and second bus data includes a control signal and bus data content, and the control signal in the first and second bus data is the same. The control signal is used to indicate the processing method of the bus data content in the first and second bus data, for example, reading or writing the bus data content in the first and second bus data.

[0123] The control signal has a bit width of 5-bit, and the actual bit width of the bus data content in the first bus data and the second bus data is 24-bit. Therefore, the bit width of the first bus data and the second bus data is 29-bit.

[0124] If the tracking port is the tracking port for PLL data, the raw data output by the tracking port includes: tracking valid signal, read type signal or write type signal, whether the access to the RAM in the DPLL comes from GTM or an external device, PLL data address, and PLL data content.

[0125] The information payload in the original data is the phase-locked loop (PLL) data content. This PLL data content is retrieved from the PLL's memory (RAM) and stored in the RAM of the tracked PLL. The PLL data address refers to the storage address of the PLL data content in the PLL's RAM. The bit width of the PLL data address is 8-bit, 10-bit, or 13-bit. The actual bit width of the PLL data content is 24-bit.

[0126] If the tracking port is a circuit signal tracking port, the raw data output by the tracking port includes either the circuit signal or the matching signal of the circuit channel. The information payload in the raw data may include either the circuit signal or the matching signal of the circuit channel.

[0127] In the embodiments of this application, the circuit channel can be TIM, TOM, ATOM, TIO, SPE, TRIGGER active slope interrupt (TASI) or STATE active slope interrupt (SASI), TBU0_match, TBU1_match, TBU2_match and TBU3_match.

[0128] For TIM, TOM, ATOM, and TIO in the I / O module, the circuit signals output by their circuit channels are 0, 1, or PWM waveforms.

[0129] Although SPE is not used as an I / O output in GTM, SPE has multiple channels and each channel has a value of 0 or 1.

[0130] The TASI and SASI of a phase-locked loop are two independent circuit channels, and the circuit signal of each circuit channel is 0 or 1.

[0131] `TBU0_match` configures a fixed value into the register group. If the output timestamp value of GTM TBU0 matches this fixed value, the channel changes from 0 to 1; otherwise, it returns 0. This also applies to `TBU1_match`, `TBU2_match`, and `TBU3_match`.

[0132] If the tracking port is a timestamp tracking port, the raw data output by the tracking port includes: external timestamp, and the information payload in the raw data includes the external timestamp.

[0133] The external timestamp can be the timestamp of the time base unit, which is the time of the customized circuit. By tracking the timestamp output by the time base unit in the customized circuit, the off-chip device can align the first timestamp in the tracking message with the timestamp of the time base unit, thereby more clearly knowing the order and time of occurrence of the customized circuit and the tracking message.

[0134] Alternatively, the external timestamp can be an ARM Coresight timestamp to align with the first timestamp within the ARM Coresight system and the tracking message.

[0135] Step 102: Based on the data type of the information payload in the original data, obtain the target message corresponding to the data type from multiple message types.

[0136] After acquiring the information payload output by the customized circuit, the message field acquisition circuit can retrieve the target message corresponding to the data type from multiple message types based on the data type of the information payload.

[0137] The message field acquisition circuit can pre-store the correspondence between types and messages, and can then retrieve the target message corresponding to the data type from this correspondence.

[0138] In the embodiments of this application, the data types may include: processor instruction classes, processor read / write classes, bus classes, phase-locked loop read / write classes, circuit signal classes, timestamps, or error classes.

[0139] When the data type is instruction, the target message is an instruction message. Instruction messages can include jump instructions or pause instructions, and jump instructions can include direct jump instructions or indirect jump instructions.

[0140] When the information payload is a jump instruction, the target message is a branch message; when the information payload is a pause instruction, the target message is a suspend instruction message.

[0141] Optionally, when the information payload is a direct jump instruction, the target message is a direct branch message; when the information payload is an indirect jump instruction, the target message is an indirect branch message.

[0142] When the data type is a processor instruction class, if the information payload does not meet the synchronization condition, the target message is a message without the synchronization condition; if the information payload meets the synchronization condition, the target message is a message with the synchronization condition.

[0143] Table 1 shows the target messages corresponding to different data types. Referring to Table 1, the data type of the information payload is the processor's instruction class: when the information payload is an indirect jump instruction and the information payload meets the synchronization condition, the target message is: an indirect branch message with synchronization condition, which is the indirect branch with synchronization condition in the Nexus standard.

[0144] When the information payload is an indirect jump instruction and the information payload does not meet the synchronization conditions, the target message is: an indirect branch message without synchronization conditions, which is the indirect branch message in the Nexus standard.

[0145] When the information payload is a direct jump instruction and the information payload meets the synchronization conditions, the target message is: a direct branch message with synchronization conditions, which is the DirectBranch with Sync Message in the Nexus standard.

[0146] When the information payload is a direct jump instruction and the information payload does not meet the synchronization conditions, the target message is: a direct branch message without synchronization conditions, which is the direct branch message in the Nexus standard.

[0147] When the information payload is a pause instruction and the information payload meets the synchronization conditions, the target message is: Suspend Instruction with Sync Message, which is not set in the Nexus standard.

[0148] When the information payload is a pause command and the information payload does not meet the synchronization conditions, the target message is: a pause command message without synchronization conditions. This message is not set in the Nexus standard.

[0149] Table 1 Target messages corresponding to different data types

[0150]

[0151] In this embodiment, if a processor channel needs to retrieve data from other hardware, that channel will execute a pause instruction. This means that the channel needs to remain in a waiting state for an extended period until the pause instruction ends. Without tracking the pause instruction, it is impossible to estimate the waiting time required to execute it. This significantly hinders the estimation of the sequential execution time of the program flow, making it impossible to accurately predict the execution status of the program flow and thus preventing further program optimization.

[0152] Therefore, in addition to tracking direct jump instructions and indirect jump instructions, this embodiment of the application also needs to track pause instructions. Table 2 shows the time information corresponding to different instructions. Referring to Table 2, assuming that the message tracing circuit tracks the first jump instruction J1 executed by the processor, and the timestamp of the first jump instruction J1 is T1, then the processor executes the addition instruction and the subtraction instruction. After that, the message tracing circuit sequentially tracks the first pause instruction S1, the second pause instruction S2, and the second jump instruction J2 executed by the processor.

[0153] In this context, the timestamp of the first pause instruction S1 is T2, the timestamp of the second pause instruction S2 is T3, and the timestamp of the second jump instruction J2 is T4. Since the off-chip device pre-stores the instructions executed by the processor between the first jump instruction J1 and the first pause instruction S1 (i.e., addition and subtraction instructions), and can estimate the execution time t1 and t2 of the addition and subtraction instructions, the waiting time required to execute the first pause instruction S1 can be calculated as T3-T2, and the waiting time required to execute the second pause instruction S2 can be calculated as T4-T3, based on the timestamps T1 (first jump instruction J1), T1 (addition instruction), T2 (subtraction instruction), T3 (second pause instruction S2), and T4 (second jump instruction J2). Because the waiting times required to execute the pause instructions are known, optimization can be performed on pause instructions with long waiting times. If the pause instruction messages are not tracked, then timestamps T2 and T3 cannot be obtained from Table 2, and therefore the waiting time for the first pause instruction S1 and the second pause instruction S2 cannot be obtained.

[0154] Furthermore, since the pause instruction is a sequentially executed instruction, when the information payload does not meet the synchronization condition, it is not necessary to provide a jump address, only an instruction count field. Therefore, referring to direct branch messages without synchronization conditions and direct branch messages with synchronization conditions, this application adds pause instruction messages without synchronization conditions and pause instruction messages with synchronization conditions. The instruction count field is the sequential instruction counter (I-CNT) field.

[0155] Table 2. Time information corresponding to different instructions

[0156]

[0157] The message tracking circuit can determine that the message payload meets the synchronization conditions if the message payload satisfies the following synchronization reasons. Table 3 shows several synchronization reasons and the field values ​​of the synchronization condition field corresponding to each synchronization reason. As can be seen from Table 3, when the synchronization reason is Exit from System Reset, the field value of the synchronization condition field is 0b0001.

[0158] Table 3 lists multiple synchronization reasons and the field values ​​of the corresponding synchronization condition fields.

[0159]

[0160] The synchronization condition can also include a synchronization enable signal, which indicates that all messages corresponding to the received information payloads are messages with synchronization conditions. That is, upon receiving a synchronization enable signal, it is determined that all messages corresponding to the received information payloads are messages with synchronization conditions.

[0161] The synchronization enable signal can be pre-configured in the register group, and the synchronization enable signal is a new synchronization reason added based on the requirements of this application.

[0162] For example, for a periodic message counter, when the count value of the periodic tracking message counter reaches a preset value, it can be determined that the information payload meets the synchronization condition. The synchronization reason can be the periodic tracking message counter. This periodic message counter is used to count tracking messages without synchronization conditions. For example, if this periodic tracking message counter is 8 bits wide, the preset value can be 63, meaning that 63 tracking messages without synchronization conditions have been sent since the last tracking message with synchronization conditions.

[0163] For a sequential instruction counter, if the sequential instruction counter overflows, it can be determined that the information payload meets the synchronization condition, and the synchronization reason is the sequential instruction counter.

[0164] For tracking enabled, if the original data to which the information payload belongs is the first original data tracked in response to the tracking enable signal, then the information payload satisfies the synchronization condition. Furthermore, the synchronization reason is tracking enabled.

[0165] In some embodiments of this application, the message tracking circuit can obtain the data type of the information payload from the instruction content.

[0166] Optionally, the message tracking circuit can determine that the data type of the information payload is an instruction class based on the first value of dbg_mcs_data[31:28] in the instruction content dbg_mcs_data[31:0].

[0167] In some embodiments, the message tracking circuit can also obtain a second value of dbg_mcs_data[19:18] and determine whether the data type of the information payload is a direct jump instruction or an indirect jump instruction based on the first and second values.

[0168] Table 4 shows the instruction contents of jump instructions. Referring to Table 4, direct jump instructions can include jump (JMP), jump set (JBS), jump clear (JBC), and subroutine call (CALL). Indirect jump instructions can include return (RET), indirect jump (JMPI), indirect jump set (JumpSet Indirect (JBSI), indirect jump clear (JBCI), and indirect subroutine call (Call Indirect (CALLI)).

[0169] JMP represents an unconditional jump to memory location dbg_mcs_data[15:2]<<2. JBS represents a jump to memory location dbg_mcs_data[15:2]<<2 when a bit in the instruction content is set. JBC represents a jump to memory location dbg_mcs_data[15:2]<<2 when a bit in the instruction content is cleared. CALL represents an unconditional jump to subroutine memory location dbg_mcs_data[15:2]<<2. The << operator represents a left shift.

[0170] RET indicates a return from a subroutine to the original call flow, loading the jump address from the top of the stack. JMPI indicates an unconditional indirect jump to an address provided by a general-purpose register. JBSI indicates an indirect jump to an address provided by a general-purpose register when a bit in the instruction is set. JBCI indicates an indirect jump to an address provided by a general-purpose register when a bit in the instruction is cleared. CALLI indicates a subroutine call, unconditionally jumping to an address provided by a general-purpose register.

[0171] When the first value of the instruction content in the information payload is 1110 and dbg_mcs_data[19:16] is 00XX, the data type of the information payload is a direct jump instruction. Here, X represents any value, such as 0 or 1.

[0172] If the first value of the instruction content in the information payload is 1110, and dbg_mcs_data[19:16] is X1XX or 1XXX, then the data type of the information payload is an indirect jump instruction.

[0173] Since tracing the program flow only requires identifying direct jump instructions, indirect jump instructions, and pause instructions, it does not need to identify the specific instructions. Table 4 summarizes that: when the first value is 1110 and the second value is 00, the message tracing circuit can determine that the data type of the information payload is a direct jump instruction. When the first value is 1110 and the second value is not 00, the message tracing circuit can determine that the data type of the information payload is an indirect jump instruction.

[0174] Table 4. Instruction content of jump instructions

[0175]

[0176] In particular, when the data type of the information payload is conditional jump (such as JBS, JBSI, JBC or JBCI), if the information payload meets the jump conditions, then the information payload needs to generate a trace message; if the information payload does not meet the jump conditions, then the information payload does not need to generate a trace message.

[0177] For example, when the data type of the information payload is JBS or JBSI, if the dbg_mcs_data[23:20]th bit of the instruction content dbg_mcs_data[27:24] is 1'b1, then the information payload meets the jump condition. This JBS / JBSI instruction needs to generate a trace message. If it is not 1'b1, then the information payload does not meet the jump condition, and this JBS / JBSI instruction does not need to generate a trace message.

[0178] For example, when the data type of the information payload is JBC or JBCI, if the dbg_mcs_data[23:20]th bit of the instruction content dbg_mcs_data[27:24] is 1'b0, then the information payload meets the jump condition, and the JBC / JBCI instruction needs to be traced to generate a message; otherwise, the information payload does not meet the jump condition, and the JBC / JBCI instruction does not need to generate a trace message.

[0179] Table 5 shows the field values ​​for pause instructions. Referring to Table 5, pause instructions can include Wait until register match (WURM), Wait until extended register match (WURMX), Wait until extended register change (WURCX), Wait until cyclic event (WUCE), ARU Read (ARD), ARU Read Indirect (ARDI), ARU Write (AWR), ARU Write Indirect (AWRI), Non-blocking ARU Read (NARD), and Non-blocking ARU Read Indirect (NARDI).

[0180] ARD indicates that the ARU read address is read directly from the instruction content, and the current MCS channel is paused until the ARU read transfer is completed.

[0181] ARDI indicates that the read address of the ARU is read indirectly from the general-purpose register, pausing the current MCS channel until the ARU read transfer is complete.

[0182] AWR indicates that the write address of the ARU is directly read from the instruction content, pausing the current MCS channel until the ARU write transfer is complete.

[0183] AWRI indicates that the write address of the ARU is indirectly read from the general-purpose register, and the current MCS channel is paused until the ARU write transfer is completed.

[0184] NARD indicates that the ARU's read address is read directly from the instruction content, pausing the current MCS channel until the ARU selects the required MCS channel.

[0185] NARDI represents the indirect reading of the ARU's read address from the general-purpose register, pausing the current MCS channel until the ARU selects the desired MCS channel.

[0186] Referring to Table 5, when the first value is 1011 or 1111, the message tracking circuit can determine that the data type of the information payload is a pause instruction.

[0187] Table 5. Command content of the pause command

[0188]

[0189] Although MCS channel operations may pause due to read / write requests on its bus master interface, which can be considered a pause instruction, the pause time is very short and does not affect the overall program flow timing estimate; therefore, this type of instruction is not tracked. This type of instruction includes Bus Read (BRD), Bus Write (BWR), Bus Read Indirect (BRDI), and Bus Write Indirect (BWRI).

[0190] It should be noted that since the processor does not perform branch prediction execution, nor does it need to analyze its prediction history and prediction failure cancellation messages, this application embodiment only uses Direct Branch Message, Indirect Branch Message, Direct Branch with Sync Message, and Indirect Branch with Sync Message.

[0191] In some embodiments of this application, when the data type is processor data read / write class, the target message is a read / write data class message.

[0192] When the information payload is processor write data, the target message is: write data message; when the information payload is processor read data, the target message is: read data message.

[0193] When the data type is a processor read / write type, if the information payload does not meet the synchronization condition, the target message is a message without the synchronization condition. If the information payload meets the synchronization condition, the target message is a message with the synchronization condition.

[0194] Therefore, referring to Table 1 above, when the information payload is the processor's write data and the information payload meets the synchronization conditions, the target message is: a write data message with synchronization conditions, which is the write data message with synchronization conditions in the Nexus standard (Data Write with Sync Message).

[0195] When the information payload is the processor's write data and the information payload does not meet the synchronization conditions, the target message is: a write data message without synchronization conditions, which is the data write message in the Nexus standard.

[0196] When the information payload is read data from the processor and the information payload satisfies the synchronization condition, the target message is: a read data message with synchronization condition, which is the data read with synchronization condition (Data Read with Sync Message) in the Nexus standard.

[0197] When the information payload is read data from the processor and the information payload does not meet the synchronization conditions, the target message is: a read data message without synchronization conditions, which is the data read message in the Nexus standard.

[0198] In this embodiment, when the tracking port is a processor data tracking port, the tracking port outputs a read type signal / write type signal. Therefore, if the original data includes a read type signal, the message tracking circuit can determine that the data type of the information payload is processor read type, and the information payload is processor read data. If the original data includes a write type signal, the message tracking circuit can determine that the data type of the information payload is processor write type, and the information payload is processor write data.

[0199] Referring to Table 1, when the data type is a bus type or a phase-locked loop read / write type, the target message is a data acquisition message, which is the data acquisition message in the Nexus standard.

[0200] Since there are no access addresses to be traced on the bus and there is no correlation between the bus data, the data acquisition messages in the Nexus standard are used, which is simple, clear and does not waste hardware area and tracing bandwidth.

[0201] Since different phase-locked loops (PLLs) store different types of data in their RAM, the amount of data read / written from the PLL's RAM is relatively small and the addresses may be discontinuous. Therefore, it is not very meaningful to use read data messages or write data messages to compress the PLL data addresses, and it wastes the hardware area of ​​absolute storage addresses and synchronization conditions. Therefore, the data acquisition messages in the Nexus standard are adopted, which are simple, clear and do not waste hardware area.

[0202] When the tracking port is a bus data tracking port, the message tracking circuit can determine that the data type of the information payload is bus type.

[0203] When the tracking port is the tracking port for phase-locked loop (PLL) data, the message tracking circuit can determine that the data type of the information payload is a PLL read / write type.

[0204] In some embodiments of this application, when the data type is a circuit signal, the target message is an integrated circuit tracking message.

[0205] When the data type is circuit signal, if the information payload does not meet the synchronization condition, the target message is a message without the synchronization condition; if the information payload meets the synchronization condition, the target message is a message with the synchronization condition.

[0206] Referring to Table 1, when the data type is circuit signal and the information payload meets the synchronization conditions, the target message is: In-circuit Trace with Sync Message with synchronization conditions, which is the In-circuit Trace with Sync Message in the Nexus standard.

[0207] When the data type is circuit signal and the information payload does not meet the synchronization conditions, the target message is: an integrated circuit trace message without synchronization conditions, which is the integrated circuit trace message in the Nexus standard.

[0208] Tracking circuit signals actually involves tracking the changing circuit signals, rather than constantly sending circuit signals. When a circuit signal changes with a rising or falling edge, the message tracking circuit will track the changing circuit signal.

[0209] Since the circuit signal of each circuit channel is either 0 or 1, or has rising and falling edge variations, the TASI and SASI and TBU matching signals of TIM, TOM, ATOM, TIO, SPE, and DPLL are all suitable for tracing circuit signals using integrated circuit tracing messages.

[0210] For TBU0_match, a fixed value is configured in the register group. If the output timestamp value of GTM TBU0 matches this fixed value, a match signal 1'b1 is issued; otherwise, a mismatch signal 1'b0 is issued. This also applies to TBU1_match, TBU2_match, and TBU3_match.

[0211] Referring to Table 1, when the data type is timestamp, the target message is a timestamp message.

[0212] Furthermore, since the first timestamp field in the tracking message has a fixed bit width, the message tracking circuit can track the timestamp of one time base unit (or ARM Coresight system) every target number of first timestamp fields. For example, the bit width of the first timestamp field in the tracking message can be 8 bits, and correspondingly, the number of targets can be 256.

[0213] Referring to Table 1, when the data type includes an error class, the target message is: Error Message.

[0214] Step 103: Obtain at least two target message fields that match the data type from the multiple message fields of the target message.

[0215] After acquiring a target message, the message tracing circuit can retrieve at least two target message fields that match the data type from multiple message fields in the target message. In the Nexus standard, the target message includes multiple message fields.

[0216] When the information payload is a jump instruction or a pause instruction, at least two target message fields include a first set of fields, which may include a first timestamp field, a source field, a transmission code field, and an instruction count field.

[0217] Table 6 shows the multiple message fields included in the target message for a processor instruction class, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field. Referring to Table 6, the first timestamp field value is the time when the tracking message was generated. By comparing the first timestamp fields in multiple tracking messages, the chronological order and time interval between the multiple tracking messages can be determined.

[0218] In this embodiment of the application, the message tracking circuit can use the time of receiving the received information payload as the time of generating the tracking message.

[0219] The source field value indicates the source of the information payload. This value can be source data, which indicates which processor channel the instruction (i.e., a jump instruction or a pause instruction) originated from. For example, the source data is 3'h0, indicating that the instruction originated from processor channel 0.

[0220] The transfer code (TCODE) field has a value that represents the type of the target message.

[0221] For example, if the target message is a direct branch message without synchronization conditions, the transmission code represents the synchronization type as no synchronization conditions and direct branch. If the target message is a direct branch message with synchronization conditions, the transmission code represents the synchronization type as with synchronization conditions and direct branch.

[0222] If the target message is an indirect branch message without synchronization conditions, the transmission code represents the synchronization type as either without synchronization conditions or indirect branch. If the target message is an indirect branch message with synchronization conditions, the transmission code represents the synchronization type as either with synchronization conditions or indirect branch.

[0223] If the target message is a pause instruction message without synchronization conditions, the transmission code indicates that the synchronization type is without synchronization conditions and that it is a pause class. If the target message is a pause instruction message with synchronization conditions, the transmission code indicates that the synchronization type is with synchronization conditions and that it is a pause class.

[0224] The instruction count field contains the number of instructions executed sequentially. It represents the total number of instructions executed sequentially by the MCS in the same channel since the previous trace message. For indirect branch messages and direct branch messages without synchronization conditions, as well as pause instruction messages without synchronization conditions, the instruction count field can be located from the previous trace message in the same channel of the same MCS to the address of the currently executing instruction.

[0225] When the information payload is a jump instruction or a pause instruction, and the synchronization condition is met, at least two target message fields may also include a synchronization condition field and an absolute address field.

[0226] The value of the synchronization condition field is the synchronization reason why the information payload satisfies the synchronization condition, that is, which synchronization reason the information payload satisfies the synchronization condition. The value of the absolute address field is the absolute address of the instruction.

[0227] That is, when the information payload is a direct jump instruction or a pause instruction, and the information payload does not meet the synchronization condition, at least two target message fields include: a first field set. When the information payload is a direct jump instruction, an indirect jump instruction, or a pause instruction, and the information payload meets the synchronization condition, at least two target message fields include a first field set, a synchronization condition field, and an absolute address field.

[0228] When the information payload is an indirect jump instruction and the synchronization condition is not met, at least two target message fields may also include a relative address field. That is, when the information payload is an indirect jump instruction and the synchronization condition is not met, at least two target message fields may include a first field set and a relative address field.

[0229] Referring to Table 6, the value of the relative address field is the relative address of the instruction. It is obtained by XORing the absolute address of the instruction with the absolute address of the instruction in the same channel of the same MCS, thereby compressing it into a relative address.

[0230] Table 6 lists the processor instruction class, the multiple message fields included in the target message, the bit width of each message field, whether a message field is a target message field, and the reasons why a message field is a target message field.

[0231]

[0232] In this embodiment, when the information payload is a jump instruction, the absolute address of the instruction is the jump destination address of the jump instruction. When the information payload is a pause instruction, the absolute address of the instruction is the instruction address of the pause instruction, which is the address output by the instruction address output port.

[0233] Referring to Table 4 above, if the information payload is a direct jump instruction, the jump destination address of the direct jump instruction is the third value in the instruction content. The third value is the data in dbg_mcs_data[15:2], which indicates that the jump is to dbg_mcs_data[15:2].

[0234] If the information payload is an indirect jump instruction, the jump destination address of the indirect jump instruction is the instruction address dbg_mcs_addr[13:0] of the next valid instruction in the same channel of the same MCS, which represents the jump to the address dbg_mcs_addr[13:0] of the next valid instruction in the same channel of the same MCS.

[0235] Since MCS only accesses addresses in word alignment and not in byte alignment, the program and data addresses of the MCS tracing output ports are only output as 14-bit word-aligned addresses. If the address were in byte alignment, the word-aligned address would need to be shifted left by two bits to become a 16-bit byte-aligned address. For bandwidth optimization, it's unnecessary to trace the byte-aligned address where the last two bits are always 0; therefore, only the 14-bit word-aligned address is traced.

[0236] In this embodiment, if the data type is a direct jump instruction and the information payload does not meet the synchronization condition, there is no need to set a relative address field in the direct branch message without synchronization condition. Since the instruction count field can be used to identify which direct jump address has been executed, the off-chip tool can obtain the jump destination address from the stored instruction content corresponding to the direct jump address based on the direct jump address. Therefore, there is no need to track the jump destination address of the output direct jump instruction.

[0237] Because the destination address of an indirect jump instruction is not in the instruction content but in a general-purpose register, it cannot be directly read from the instruction content. Therefore, after the indirect jump instruction is executed, the instruction address of the next valid instruction in the same channel of the same MCS needs to be obtained before the trace message of the indirect jump instruction can be output.

[0238] In this embodiment, data stream tracking is relatively simple. When the processor data tracking port outputs a read / write valid signal, the message tracking circuit captures the data output by the processor data tracking port.

[0239] In some embodiments of this application, the data type is a processor read / write type; when the information payload does not meet the synchronization conditions, at least two target message fields may include a second field set and a relative address field. The second field set may include a first timestamp field, a data field, a data size field, a source field, and a transmission code field. When the information payload meets the synchronization conditions, at least two target message fields include the second field set, a synchronization condition field, and an absolute address field.

[0240] Table 7 shows the multiple message fields included in the target message for processor read / write classes, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field. Referring to Table 7, the data field's value is the data content. The data size field's value is the actual bit width of the data content. The source field's value is the source data, indicating which channel of the processor the data content originates from. The transmission code field's value is the transmission code, indicating the type of the target message. When the target message is a write data message with synchronization conditions, a write data message without synchronization conditions, a read data message with synchronization conditions, or a read data message without synchronization conditions, the type of the tracking message corresponding to this information payload can include the synchronization type and the data type. The synchronization type can be with or without synchronization conditions.

[0241] For example, if the target message is a write data message without synchronization conditions, the transport code represents the absence of synchronization conditions and the write class. If the target message is a write data message with synchronization conditions, the transport code represents the presence of synchronization conditions and the write class.

[0242] If the target message is a read data message without synchronization conditions, the transmission code represents the absence of synchronization conditions and the read class. If the target message is a read data message with synchronization conditions, the transmission code represents the presence of synchronization conditions and the read class.

[0243] Table 7 lists the read / write classes for data types of the processor, the multiple message fields included in the target message, the bit width of each message field, whether a message field is a target message field, and the reasons why a message field is a target message field.

[0244]

[0245] Table 8 shows the multiple message fields included in the target message when the target message is a data acquisition message, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field. Referring to Table 8, when the target message is a data acquisition message, at least two target message fields include: a first timestamp field, a DQDATA field, an identification tag (ID tag) field, and a transmission code field.

[0246] In the case where the data type of the information payload is bus type, the field value of the DQDATA field is the first bus data and the second bus data.

[0247] The DQDATA field can include a first subfield and a second subfield. The value of the first subfield is the first bus data content from the control signals and the first bus data. The value of the second subfield is the second bus data content from the second bus data.

[0248] The first subfield can be represented as DQDATA0[28:0], which is used to store 5-bit control signals and 24-bit first bus data content. The second subfield can be represented as DQDATA1[23:0], which is used to store 24-bit second bus data content.

[0249] Because the control signals in the first bus data and the second bus data are the same, the DQDATA field only needs to store the control signal of one bus data.

[0250] In the case of a read / write type for phase-locked loop (PLL), the first subfield's value is the PLL data content, and the second subfield's value is the attribute data of the information payload. This attribute data includes read / write type signals, whether the access to the RAM in the DPLL comes from the GTM or an external device, and the PLL data address.

[0251] Since both the first and second subfields are variable-length fields, the most significant 0 bits can be truncated and not transmitted. Therefore, the DQDATA field only needs to consider the longest bit width. Dividing the DQDATA field into two subfields also allows for more flexible adaptation to the difference in data volume between bus data and PLL data.

[0252] The identifier tag field value indicates the source of the information payload; its source data is one of the two buses and three phase-locked loops. The transmission code field value is the transmission code, which indicates the type of the target message, i.e., a data acquisition message.

[0253] Table 8 lists the multiple message fields included in the target message when the target message is a data acquisition message, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field.

[0254]

[0255] In some embodiments of this application, the target message is an integrated circuit tracking message. When the information payload does not meet the synchronization conditions, at least two target message fields may include: a third field set and a first signal content field. The third field set includes a first timestamp field, a signal source field, and a transmission code field. The value of the transmission code field characterizes the synchronization type of the tracking message corresponding to the information payload. This synchronization type is used to characterize whether the information payload meets the synchronization conditions.

[0256] For example, if the tracking message corresponding to the information payload is an integrated circuit tracking message with synchronization conditions, then the transmission code indicates that synchronization conditions are present. If the tracking message corresponding to the information payload is an integrated circuit tracking message without synchronization conditions, then the transmission code indicates that synchronization conditions are absent. The field value of the synchronization condition field is the synchronization reason why the information payload satisfies the synchronization conditions.

[0257] When the information payload meets the synchronization conditions, at least two target message fields include: a third field set, a second signal content field, and a synchronization condition field.

[0258] Table 9 shows the multiple message fields included in the target message when the data type is circuit signal, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field. Referring to Table 9, the signal content field may include a first signal content field and a second signal content field.

[0259] The second signal content field contains the circuit signals of multiple circuit channels. The content of the second signal field can be represented by F-CKDATA[15:0].

[0260] The "1'b1" in the second signal content field indicates that the signal of this circuit channel is at a high level; the "1'b0" in the second signal content field indicates that the signal of this circuit channel is at a low level.

[0261] The field value of the first signal content field is the relative value of the circuit signals of multiple circuit channels. The first signal content field can be represented by U-CKDATA[15:0], which represents the compressed relative value. U-CKDATA[15:0] is obtained by XORing the circuit signal in the previous integrated circuit tracking message from the same source with the valid circuit signal in this current message.

[0262] Since the first signal content field is a variable-length field, the most significant bit (0) can be truncated and transmitted, thus reducing the amount of data transmitted. Furthermore, because we are more concerned with the rise or fall edge changes of circuit signals, if the circuit signal does not change, then if the information payload does not meet the synchronization conditions, the unchanged circuit signal can be chosen not to be transmitted and truncated as the most significant bit (0).

[0263] By configuring a single circuit channel, the tracking of the circuit signal of that circuit channel is triggered when the output circuit signal is: no edge (off), rising edge, falling edge, or double edge.

[0264] If a circuit channel is configured to track the two edges of the output of that circuit channel, then “1’b1” in the first signal content field indicates a level change (0→1 or 1→0) for that circuit channel.

[0265] If a circuit channel is configured to track the rising edge of the output of that circuit channel, then “1'b1” in the first signal content field indicates the rising edge (0→1) of that circuit channel.

[0266] If a circuit channel is configured to track the rising edge of the output of that circuit channel, then “1'b1” in the first signal content field indicates the rising edge (1→0) of that circuit channel.

[0267] If a circuit channel is configured to track the edgeless output of that circuit channel, then that circuit channel will be tracked when it is off, and the corresponding position in the first signal content field will always be 1'b0.

[0268] This application supports tracking circuit signals of up to 32 circuit channels, which are divided into 4 groups, denoted as ICS0[7:0], ICS1[7:0], ICS2[7:0], and ICS4[7:0]. Since TIM, TOM, ATOM, and TIO in customized circuits are typically grouped into sets of 8 circuit channels, for example, TIM[7:0], if there is a correlation between the 8 circuit channels in a group, i.e., they change simultaneously, only one integrated circuit tracking message is needed to send the circuit signals of those 8 circuit channels to the external device. This eliminates the need to generate 8 separate tracking messages for each of the 8 circuit channels and send them sequentially to the external device.

[0269] The field value of the signal source field represents the source of the information payload, indicating which circuit channels the circuit signal originates from. For example, the circuit signal originates from {ICS0[7:0]and ICS2[7:0]} or {ICS1[7:0]and ICS3[7:0]}.

[0270] This application embodiment sets up two first-in-first-out (FIFO) queues to buffer integrated circuit tracing messages. Each FIFO queue can buffer circuit signals from up to 16 circuit channels. To improve hardware utilization, if only 16 circuit channels are being traced, ICS0[7:0] and ICS1[7:0] can be prioritized. Therefore, ICS0[7:0] and ICS1[7:0] are set on different channels. In addition, the signal source field is defined with two bits to reserve two possible future expansion sources, such as supporting circuit information tracing up to 8 groups with a total of 64 channels.

[0271] For example, the field value of the signal source field is 2'b00, indicating that the circuit signal originates from 8 circuit channels ICS2 and 8 circuit channels ICS0, which corresponds to integrated circuit trace message 1.

[0272] The field value of the signal source field is 2'b01, indicating that the circuit signal originates from 8 circuit channels ICS3 and 8 circuit channels ICS1, which corresponds to integrated circuit trace message 2.

[0273] Table 9 lists the multiple message fields included in the target message when the data type is circuit signal, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field.

[0274]

[0275] In some embodiments of this application, the target message is a timestamp message, and at least two target message fields include: a second timestamp field and a transmission code field.

[0276] The second timestamp field has an external timestamp value, which can be the timestamp of ARMCoresight or the timestamp of the time base unit in GTM, such as TBU0[26:0], TBU0[23:0], TBU1[23:0], TBU2[23:0], and TBU3[23:0]. The transmission code field represents the transmission code, which is the type of the target message, i.e., the timestamp.

[0277] Table 10 shows the multiple message fields included in the target message when the data type is timestamp, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field.

[0278] Table 10 shows the multiple message fields included in the target message when the data type is timestamp, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field.

[0279]

[0280] In some embodiments of this application, the target message is an error message. At least two target message fields may include: a first timestamp field, an error code field, an error type field, and a transmission code field.

[0281] Table 11 shows the multiple message fields included in the target message when the data type is error, the bit width of each message field, whether the message field is a target message field, and the reason why the message field is a target message field. Referring to Table 11, the field value of the transmission code field represents the transmission code, which is the type of the target message, i.e., an error message. The field value of the error code field is the error code, for example, this error code is used to represent at least one of the following: an overflow in the first-in-first-out queue causing the corresponding tracking message to be lost, and a tracking message that generated an error. The field value of the error type field represents the error cause, i.e., the reason why the tracking message generated an error, such as the tracking message being lost because the first-in-first-out queue was full.

[0282] For example, error codes can indicate that a processor's read / write operation caused a FIFO queue overflow, resulting in the loss of the corresponding trace message; error codes can indicate that an instruction class's FIFO queue overflow caused a FIFO queue overflow, resulting in the loss of the corresponding trace message; error codes can indicate that a circuit signal class's FIFO queue overflow caused a FIFO queue overflow, resulting in the loss of the corresponding trace message; error codes can indicate that a timestamp's FIFO queue overflow caused a FIFO queue overflow, resulting in the loss of the corresponding trace message; error codes can indicate that a bus class's FIFO queue overflow caused a FIFO queue overflow, resulting in the loss of the corresponding trace message; and error codes can indicate that a phase-locked loop's read / write operation caused a FIFO queue overflow, resulting in the loss of the corresponding trace message.

[0283] Table 11 lists the multiple message fields included in the target message when the data type is error, the bit width of each message field, whether a message field is a target message field, and the reason why a message field is a target message field.

[0284]

[0285] Step 104: Generate a tracking message based on the information payload and at least two target message fields.

[0286] In some embodiments of this application, the message tracking circuit can generate a data set based on the attribute data of the information payload, and generate a tracking message based on the data set and at least two target message fields.

[0287] When the data type is a direct jump instruction or a pause instruction, and the information payload does not meet the synchronization conditions, at least one first attribute data in the attribute data includes source data, and at least one second attribute data in the attribute data includes: the time when the tracking message was generated (i.e., the first timestamp), the number of sequentially executed instructions, and the transmission code.

[0288] Therefore, the message tracing circuit can combine at least one first attribute data and at least one second attribute data to obtain a data set.

[0289] When the data type is a jump instruction (direct jump instruction or indirect jump instruction) and the information payload meets the synchronization conditions, at least one first attribute data includes source data and the absolute address of the instruction, and at least one second attribute data includes: the time of trace message generation, the number of sequentially executed instructions, the synchronization reason, and the transmission code. Therefore, the message tracing circuit can combine at least one first attribute data and at least one second attribute data to generate a data set.

[0290] When the data type is an indirect jump instruction and the information payload does not meet the synchronization conditions, at least one first attribute data includes source data, and at least one second attribute data includes: the time of message generation, the number of sequentially executed instructions, the relative address of the indirect jump instruction, and the transmission code. Therefore, the message tracing circuit can combine at least one first attribute data and at least one second attribute data to generate a data set.

[0291] When the data type is a pause instruction and the information payload meets the synchronization conditions, at least one second attribute data includes: the synchronization reason, the transmission code, the time of trace message generation, and the number of sequentially executed instructions. At least one first attribute data includes the source data and the instruction's absolute address. Therefore, the message tracing circuit can generate a data set from at least one first attribute data and at least one second attribute data.

[0292] In the case where the data type is processor read / write and the information payload does not meet the synchronization conditions, the information payload includes data content, and at least one first attribute data includes the relative address of the source data and the data content. At least one second attribute data includes: the time of message generation, the actual bit width of the data content, and the transmission code.

[0293] Therefore, the message tracing circuit can convert the absolute address of the data content to a relative address and merge the data content, at least one first attribute data, and at least one second attribute data to generate a data set.

[0294] When the data type is processor read / write and the information payload meets the synchronization conditions, the information payload includes data content, and at least one first attribute data includes the source data and the absolute address of the data content. At least one second attribute data includes: the time of message generation, the actual bit width of the data content, the synchronization reason, and the transmission code.

[0295] Therefore, the message tracing circuit can combine data content, at least one first attribute data, and at least one second attribute data to generate a data set.

[0296] When the data type of the information payload is bus-type, the information payload consists of first bus data and second bus data, and at least one second attribute data includes: the time of message generation, source data, and transmission code. Therefore, the message tracking circuit can combine the information payload and at least one second attribute data to generate a data set.

[0297] In the case of a read / write class of the PLL data type for the information payload, the information payload is the PLL data content, and at least one first attribute data includes: the read / write class, whether the access to the RAM in the DPLL comes from the GTM or an external device, and the PLL data address. At least one second attribute data includes: the time of message generation, the source data, and the transmission code. Therefore, the message tracing circuit can use the information payload, at least one first attribute data, and at least one second attribute data to generate a data set.

[0298] When the data type is a circuit signal and the information payload does not meet the synchronization conditions, the information payload includes circuit signals. At least one second attribute data includes: the time of message generation, source data, and transmission code. Therefore, the message tracking circuit can convert the information payload into relative values ​​of circuit signals and combine them based on these relative values, along with at least one second attribute data, to generate a dataset.

[0299] When the data type is circuit signal and the information payload meets the synchronization conditions, the information payload includes circuit signals. At least one second attribute data includes: the time of message generation, source data, synchronization reason, and transmission code. Therefore, the message tracking circuit can combine the information payload and at least one second attribute data to generate a dataset.

[0300] When the data type is timestamp, the message payload includes an external timestamp, and at least one second attribute data includes a transmission code. Therefore, the message tracking circuit can combine the message payload and at least one second attribute data to generate a data set.

[0301] When the data type is error, at least one second attribute data includes the time the trace message was generated, the cause of the error, the error code, and the transmission code. Therefore, the message tracing circuit can use at least one second attribute data as the generated data set.

[0302] In some embodiments of this application, the message tracing circuit acquires multiple message start and end (MSE) values, assigns all data in the dataset to the corresponding target message fields, generates multiple message destinations (MDOs) based on at least two target message fields, and packages the multiple MDOs using multiple MSEs to obtain the tracing message.

[0303] In this context, MDO represents the content of the tracking message, and MSE represents the status of the tracking message. For example, a tracking message may include 12 data units, each of which may include a 2-bit MSE and an 8-bit MDO. The MDO in the first data unit can be the field value of the [1:0]th bit of the Source (SRC) field and the Transmission Code (TCODE) field. The MSE in the first data unit represents the start message; for example, MSE can be represented as 2'b00.

[0304] The MDO in the second data unit includes the data in the [2]th bit of the Source (SRC) field, the Synchronization Condition (SYNC) field, and the data in the [2:0]th bit of the Data Size (DSZ) field. Since the data packet has not yet ended, the MSE in the second data unit represents normal message transfer. This MSE can be represented as 2'b00.

[0305] The MDO in the seventh data unit includes the data in the full address (F-ADDR) field

[31] . Since the variable field at the end of the packet is the F-ADDR field, the MSE in the seventh data unit represents the end packet. For example, the MSE can be represented as 2'b01.

[0306] The MDO in the last data unit includes the first timestamp (TSTAMP) field. Since this data unit is the last data unit of the message, the MSE in the last data unit represents the end message. For example, the MSE can be represented as 2'b11.

[0307] Optionally, the message tracing circuitry can acquire multiple MSEs based on the data type of the message payload. Alternatively, the message tracing circuitry can acquire multiple MSEs based on the transmission code.

[0308] For example, when the data type is a direct jump instruction and the information payload does not meet the synchronization conditions, the message tracing circuit can assign the source data to the source field, assign the time when the tracing message was generated to the first timestamp field, assign the number of sequentially executed instructions to the instruction count field, and assign the transmission code to the transmission code field.

[0309] In some embodiments of this application, the message tracing circuit can select a target tracing source from a plurality of tracing sources in a customized circuit and receive the information payload from the target tracing source. This can reduce the number of tracing sources.

[0310] In some embodiments of this application, the message tracking circuit may receive an enable signal, which indicates at least one of the following:

[0311] A trace message indicating the instructions generated by the processor;

[0312] A trace message indicating the data content generated by the processor;

[0313] Instructs the generation of trace messages with a data type of bus;

[0314] A tracking message indicating the content of the phase-locked loop data that generates the phase-locked loop;

[0315] Indicates the generation of a trace message with a data type of circuit signal;

[0316] Instructs the generation of a tracking message with a timestamp data type.

[0317] In some embodiments of this application, where the enable signal indicates a trace message of instructions generated by the processor, the enable signal is also used to indicate at least one of the following:

[0318] The instruction generates a tracking message with an information payload of type 1, the first type including at least one of a target instruction and a pause instruction, the target instruction including a direct jump instruction and an indirect jump instruction;

[0319] A trace message indicating the information payload of the first channel output of the generator processor.

[0320] In cases where the enable signal indicates a trace message that generates the data content of the processor, the enable signal is also used to indicate at least one of the following:

[0321] Instructs the generation of a trace message with an information payload of type 2, where type 2 includes processor read and / or write classes;

[0322] The trace message indicates the information payload of the second channel output of the generator.

[0323] In the embodiments of this application, the first channel and the second channel may be different. For example, assuming the processor has 8 channels, the first channel may be channel 0 and channel 7, and the second channel may include channel 1 and channel 2.

[0324] In the case where the enable signal indicates a trace message for generating the PLL data content of the PLL, the enable signal is also used to indicate a trace message for generating an information payload of a third type, which includes read and / or write types of the PLL.

[0325] When the enable signal indicates the generation of a trace message of bus type, it can also be used to indicate individual trace enable for two buses, such as tracing one bus.

[0326] For example, if the enable signal is used to indicate the generation of trace messages for the processor's instructions, then the message trace circuit will only generate trace messages corresponding to the instruction content output by all program flow channels of the processor, and whose data type is the processor's instruction class.

[0327] The enable signal is also used to indicate the generation of trace messages for processor instructions and to indicate the generation of trace messages for information payloads of data type target instruction. Then the message trace circuit generates trace messages for instruction content output by all program flow channels of the processor, and the data type is target instruction.

[0328] The enable signal indicates the generation of trace messages for the processor's instructions, the generation of trace messages for the information payload of the target instruction data type, and the generation of trace messages for the information payload output by the processor's first channel. Then, the message tracing circuit generates trace messages for the instruction content of the processor's target instruction data type, output by the processor's first channel.

[0329] The enable signal is also used to indicate the generation of trace messages for processor instructions and to indicate the generation of trace messages for information payloads of data type pause instructions. Then the message trace circuit generates trace messages for instruction content output by all program flow channels of the processor, and the data type is pause instructions.

[0330] The enable signal indicates the generation of trace messages for the processor's instructions, the generation of trace messages for the information payload of the data type of a pause instruction, and the generation of trace messages for the information payload of the processor's first channel output. Then the message tracing circuit generates a trace message for the instruction content of the processor's pause instruction, which is output by the processor's first channel.

[0331] The enable signal is used to indicate the generation of trace messages for the processor's data content. Then, the message tracing circuit only generates trace messages for the data content of read and write types output by all data stream channels of the processor.

[0332] The enable signal is also used to indicate the generation of trace messages for data content of the processor and to indicate the generation of trace messages for data content of the processor's read type. Then the message tracing circuit generates trace messages for data content of the processor's read type.

[0333] The enable signal indicates the generation of a trace message for the processor's data content, the generation of a trace message for the processor's read-type data content, and the generation of a trace message for the information payload output by the processor's second channel. Then, the message tracing circuit generates a trace message for the processor's second channel output, which is a trace message for the processor's read-type data content.

[0334] In this embodiment of the application, the enable signal is also used to indicate that the first timestamp field is prohibited in the tracking message, which can reduce the bandwidth requirements of the output.

[0335] When the enable signal indicates that a tracing message of type circuit signal is generated, the enable signal is also used to indicate that a tracing message with a target edge information payload is generated. The target edge may include no edge, rising edge, falling edge, or double edge.

[0336] When the enable signal indicates that a trace message of type circuit signal is generated, the enable signal is also used to indicate that a trace message of at least one of TBU1_match, TBU1_match, TBU2_match and TBU3_match is generated.

[0337] The enable signal is also used to indicate the tracking of external timestamps.

[0338] In this embodiment, the enable signal can be a synchronization enable signal, which can make the trace messages corresponding to data types with synchronization conditions (processor read / write type, processor instruction type and circuit signal type) all trace messages with synchronization conditions. This can be used to verify the correctness of trace messages without synchronization conditions and the correct trace after an error. However, since the message with synchronization conditions only outputs the absolute value, it will use more bandwidth.

[0339] refer to Figure 2 The message tracing circuit 100 may include a tracing source selector 10 and multiple capture circuits 20. The tracing source selector 10 is used to select a target tracing source from multiple tracing sources in the customized circuit 200 and send the raw data output by the target tracing source to the multiple capture circuits 20. Each capture circuit 20 is used to capture raw data from the corresponding tracing source in the customized circuit.

[0340] By pre-configuring the tracking source selector 10, only the data of the target tracking source is tracked, thereby reducing the number of tracking sources.

[0341] In this embodiment, the multiprocessor can track only the instructions and data of a single processor, and the multi-channel circuit signals can track only the circuit signals of fewer channels. The customized circuit has at least hundreds of circuit signals, including TIM, TOM, ATOM, TIO, SPE, DPLL's TASI, DPLL's SASI, TBU0, TBU1, TBU2, and TBU3_match. However, in this embodiment, the tracking source selector 10 can only select to track up to 32 channels through the ARM tracking port, and select 4 circuit signals from the selected 32 circuit signals to be directly output to the port for tracking.

[0342] Furthermore, the ARM Coresight timestamp and the timestamps of multiple time base units (such as TBU0, TBU1, TBU2 and TBU3) only track one of the timestamps. The RAM of the three DPLLs can only select one to track, and at most two ARU channels can be tracked at the same time.

[0343] In this embodiment of the application, the message tracking circuit further includes a tracking control circuit 30, which is used to control whether the plurality of capture circuits 20 receive raw data.

[0344] The tracking control circuit 30 is used to: enable the target acquisition circuit 20 among the multiple acquisition circuits 20 to receive raw data when the cross-trigger interface (CTI) in the ARM tracking circuit is enabled; and control the target acquisition circuit 20 to stop receiving raw data when the CTI is disabled. The target acquisition circuit 20 can be at least one of the multiple acquisition circuits 20. The ARM tracking circuit is an ARM CoreSight System.

[0345] When a tracking enable signal is received, the target capture circuit 20 in the multiple capture circuits 20 is enabled to receive raw data. When a tracking disable signal is received, the target capture circuit 20 is controlled to stop receiving raw data.

[0346] The tracking enable signal can be a hardware breakpoint in the tracking target MCS of the customized circuit, and the tracking disable signal can be another hardware breakpoint in the tracking target MCS of the customized circuit 200.

[0347] Each MCS processor in GTM has two hardware breakpoints. When the running MCS meets the conditions set by the hardware breakpoint and the breakpoint is set to not stop, the hardware breakpoint will trigger a signal but will not stop GTM. Therefore, the trigger signals of the two breakpoints can be used as the start or end of tracing, respectively. The conditions for setting a hardware breakpoint can be set to a program address or a range of program addresses, a data address or a range of data addresses, or a data value.

[0348] Alternatively, the tracking enable signal and tracking disable signal can be configured in register group 40 in software, and the tracking control circuit 30 can obtain the tracking enable signal and tracking disable signal from register group 40.

[0349] In summary, this application provides a message generation method. This method can, based on the data type of the information payload output by a customized circuit, obtain a target message corresponding to the data type from multiple message types, then obtain at least two target message fields matching the data type from multiple message fields in the target message, and generate a tracking message based on the information payload and the at least two target message fields. This maps the information payload output by the customized circuit to a tracking message, enabling the tracking of the customized circuit.

[0350] refer to Figure 2 The message tracking circuit may also include multiple data processing circuits 50, multiple target queues 60, multiple message packaging circuits 70, and message sending circuits 80. The multiple data processing circuits 50, multiple capture circuits 20, multiple target queues 60, and multiple message packaging circuits 70 correspond one-to-one.

[0351] Each data processing circuit 50 is used to acquire raw data from the corresponding capture circuit 20, extract information payload from the raw data, generate a data set based on the attribute data of the information payload, and send at least one first target data in the data set to the corresponding target queue 60.

[0352] Each target queue 60 is used to store at least one first target data in the corresponding data set, and the at least one first target data is generated based on the raw data output by the customized circuit 200.

[0353] Each message packaging circuit 70 is used to obtain at least one first target data stored in the corresponding target queue 60, and obtain a tracking message based on the at least one first target data. The tracking message includes multiple MDOs and an MSE corresponding to each MDO. The multiple MDOs include at least one first target data.

[0354] The message sending circuit 80 is used to send tracking messages.

[0355] In some embodiments of this application, the message sending circuit 80 is used to send trace messages via the advanced trace bus (ATB). By reusing the ATB in the ARM trace circuit, the message trace circuit does not need to set up a dedicated trace output interface and transmission protocol for customized circuits, thereby reducing hardware costs.

[0356] In some embodiments of this application, a first target queue 60 among a plurality of target queues 60 is used to store first target data in a data set of similar types. A second target queue 60 among a plurality of target queues 60 is used to store first target data in a data set of one type.

[0357] Similar data sets refer to data sets whose information payloads have similar data types. In other words, the information payloads in the original data corresponding to the first target data that the first target queue 60 can store have similar data types.

[0358] Since the first target queue 60 stores the first target data from multiple similar data sets, compared to setting a target queue 60 for each type of data set, the number of target queues 60 that need to be set is reduced, thereby reducing hardware costs.

[0359] In the embodiments of this application, similar types may include: processor read / write classes, processor instruction classes, or circuit signal classes. Specifically, processor read / write classes include processor read classes and processor write classes. Processor instruction classes include: direct jump instructions, indirect jump instructions, and pause instructions.

[0360] In some embodiments of this application, at least one first target data may further include at least one reference attribute data.

[0361] The bit width occupied by each reference attribute data in the first target queue 60 is smaller than the bit width occupied by the reference attribute data in the tracking message. Reference attribute data refers to data that needs to be stored in the first target queue 60 and whose bit width can be compressed within the first target queue 60.

[0362] In some embodiments of this application, the reference attribute data may include at least one of the following: transmission code, synchronization condition, data element size, data size, indirect jump type, and source data.

[0363] Optionally, when the reference attribute data is a transmission code, the bit width occupied by the reference attribute data (i.e., the transmission code) in the first target queue 60 is positively correlated with the number of tracking messages corresponding to the data in the first target queue 60.

[0364] For example, the number of tracking messages corresponding to the data that the first target queue 60 needs to store includes four types: write data messages with asynchronous conditions, write data messages without asynchronous conditions, read data messages with asynchronous conditions, and read data messages without asynchronous conditions.

[0365] When the reference attribute data is a synchronization condition, the bit width occupied by the reference attribute data in the first target queue 60 is positively correlated with the number of synchronization conditions required.

[0366] When the reference attribute data includes the size of the data elements, the bit width occupied by the reference attribute data in the first target queue 60 is positively correlated with the number of data elements required.

[0367] When the reference attribute data includes the data size, and the actual bit width of the currently tracked processor reads or writes in a single operation varies, the bit width occupied by the reference attribute data in the first target queue 60 is positively correlated with the total number of actual bit widths that vary for the currently tracked processor.

[0368] When the data type of the original data is an indirect jump instruction, the reference attribute data includes indirect jump types. The bit width occupied by the reference attribute data in the first target queue is positively correlated with the number of indirect jump types required.

[0369] When similar types of data have different source data, the reference attribute data includes the source data, and the bit width occupied by the reference attribute data in the first target queue is positively correlated with the number of sources required.

[0370] It should be noted that there can be multiple synchronization conditions required, and the synchronization condition included in the reference attribute data is one of these multiple synchronization conditions. There can also be multiple data element sizes required, and the data element size included in the reference attribute data is one of these multiple data element sizes. Finally, there can be multiple data sizes required, and the data size included in the reference attribute data is one of these multiple data sizes.

[0371] Similar types of data with different source data refer to the fact that the data payloads from the same source data are of similar data types.

[0372] The target queue corresponding to message packaging circuit 70 is the first target queue. Message packaging circuit 70 is used for:

[0373] Based on the data type of the information payload in the original data, the target message corresponding to the data type is obtained from multiple message types, and at least two target message fields matching the data type are obtained from multiple message fields of the target message.

[0374] Each reference attribute data is transformed, and the transformed reference attribute data is assigned to the corresponding target message field. The bit width of the transformed reference attribute data is equal to the standard bit width of the target message field.

[0375] All data in the first target data except for the reference attribute data, as well as at least one second target data, are assigned to the corresponding target message field;

[0376] Multiple MDOs are generated based on at least two target message fields, and multiple MSEs are used to package the multiple MDOs to obtain the tracking message.

[0377] The second target data refers to attribute data in the data set other than at least one first target data. Optionally, the message packaging circuit 70 can acquire at least one second target data, multiple MSEs, a target message, and at least two target message fields from the data set based on the data type of the information payload and whether the information payload meets the synchronization conditions.

[0378] For example, assuming the target message field corresponding to the reference attribute data is the TCODE field, the reference attribute data stored in the target queue is 2'b01, and the parameter attribute data after conversion by the message packaging circuit 70 is 010000, then the parameter of the TCODE field is 6'b010000. This achieves the goal of using a smaller bit-width encoding for storage in the first target queue 60, while the message packaging circuit 70 can decode the complete multi-bit-width field.

[0379] In some embodiments of this application, the second target data is identical in similar data sets, therefore it is unnecessary to store the second target data in the first target queue 60. For example, if the sources corresponding to similar types of data are all the same, the source data of the information payload does not need to be stored in the first target queue 60. If the sizes (i.e., bit widths) of similar types of data are all the same, the data size of the information payload does not need to be stored in the first target queue 60. If the synchronization reasons for similar types of data are all the same, the synchronization reason and synchronization type of the information payload do not need to be stored in the first target queue 60. For example, the synchronization reason is receiving a synchronization enable signal.

[0380] Since the second target data is identical in similar data sets, it is unnecessary to store the second target data in the first target queue 60, thereby reducing the amount of data required to be stored in the first target queue 60. Simultaneously, the message packaging circuit 70 can add the second target data during the generation of the tracking message, thus ensuring the integrity of the tracking message sent to the off-chip device.

[0381] For example, for trace messages corresponding to the processor's read / write classes, since the bit width of the information payloads corresponding to write data messages without synchronization conditions, read data messages without synchronization conditions, write data messages with synchronization conditions, and read data messages with synchronization conditions are all the same, it is not necessary to store the data size field of the trace messages of the processor's read / write classes in the corresponding first target queue 60.

[0382] Since there is no need to store the second target data, 60 bits of the first target queue are saved. Assuming the second target data is a TCODE, 6 bits of width can be saved directly. Table 6 shows the types of tracking messages, applicable fields, and scalability.

[0383] In some embodiments of this application, a second target queue 60 among multiple target queues 60 is used to store first target data in a data set of one type. That is, the information payloads in the original data corresponding to the first target data that the second target queue 60 can store are of the same type.

[0384] The data types stored in the multiple secondary target queues 60 may include: bus type, phase-locked loop read / write type, timestamp, and error type.

[0385] In some embodiments of this application, the bit width occupied by the specified attribute data in the first target data in the second target queue is smaller than the bit width occupied by the specified attribute data in the tracking message. When the information payload is error data, the specified attribute data includes error types, and the bit width occupied by the specified attribute data in the second target queue is positively correlated with the number of required error types. When the information payload is error data, the specified attribute data includes error codes, and the bit width occupied by the specified attribute data in the second target queue is positively correlated with the number of required error codes.

[0386] It should be noted that multiple error codes can be required, and the value of the error code field is one of the multiple error codes. Multiple error types can also be required, and the value of the error type field is one of the multiple error types.

[0387] In the event that a tracking message is lost due to the target queue, the information payload corresponding to the tracking message becomes erroneous data, and the tracking message itself becomes erroneous data.

[0388] When the target queue 60 corresponding to the message packaging circuit 70 is the second target queue 60, the message packaging circuit 70 is used for:

[0389] Based on the data type of the information payload in the original data, the target message corresponding to the data type is obtained from multiple message types, and at least two target message fields matching the data type are obtained from multiple message fields of the target message.

[0390] Acquire multiple third-target data and multiple MSEs;

[0391] The specified attribute data is transformed, and the transformed specified attribute data is assigned to the corresponding target message field. The bit width of the transformed specified attribute data is equal to the standard bit width of the corresponding target message field.

[0392] All data in the first target data except for the specified attribute data, as well as at least one third target data, are assigned to the corresponding target message field;

[0393] Multiple MDOs are generated based on at least two target message fields, and multiple MDOs are packaged using multiple MSEs to obtain a tracking message. The third target data is data not stored in the second target queue.

[0394] Table 12 shows the fields, size, and descriptions of indirect branch messages with synchronization conditions.

[0395] Table 12. Fields, size, and descriptions of indirect branch messages with synchronization conditions.

[0396]

[0397] Table 13 shows the fields, size, and descriptions of indirect branch messages without synchronization conditions.

[0398] Table 13. Fields, size, and descriptions of indirect branch messages without synchronization conditions.

[0399]

[0400] Table 14 shows the fields, size, and descriptions of direct branch messages with synchronization conditions.

[0401] Table 14. Fields, size, and descriptions of direct branch messages with synchronization conditions.

[0402]

[0403] Table 15 shows the fields, size, and descriptions of a direct branch message without synchronization conditions.

[0404] Table 15. Fields, size, and descriptions of direct branch messages without synchronization conditions.

[0405]

[0406] Table 16 shows the fields, size, and descriptions of the pause instruction message with synchronization conditions.

[0407] Table 16. Fields, size, and descriptions of pause instruction messages with synchronization conditions.

[0408]

[0409] Table 17 shows the fields, size, and descriptions of a pause instruction message without synchronization conditions.

[0410] Table 17. Fields, size, and descriptions of pause instruction messages without synchronization conditions.

[0411]

[0412] Table 18 shows the fields, size, and descriptions of the read data messages with synchronization conditions.

[0413] Table 18. Fields, size, and descriptions of read data messages with synchronization conditions.

[0414]

[0415] Table 19 shows the fields, size, and descriptions of a read data message without synchronization conditions.

[0416] Table 19. Fields, size, and descriptions of read data messages without synchronization conditions.

[0417]

[0418] Table 20 shows the fields, size, and descriptions of the write data messages with synchronization conditions.

[0419] Table 20 lists the fields, size, and descriptions of write data messages with synchronization conditions.

[0420]

[0421] Table 21 shows the fields, size, and descriptions of a write data message without synchronization conditions.

[0422] Table 21. Fields, size, and descriptions of write data messages without synchronization conditions.

[0423]

[0424] Table 22 shows the fields, size, and descriptions of the fields included in the data acquisition message.

[0425] Table 22 Fields, size, and descriptions of data acquisition messages

[0426]

[0427] Table 23 shows the fields, size, and descriptions of integrated circuit messages without synchronization conditions.

[0428] Table 23. Fields, size, and descriptions of integrated circuit messages without synchronization conditions.

[0429]

[0430] Table 24 shows the fields, size, and descriptions of integrated circuit messages with synchronization conditions.

[0431] Table 24. Fields, size, and descriptions of integrated circuit messages with synchronization conditions.

[0432]

[0433] Table 25 shows the fields, size, and descriptions of the timestamp messages.

[0434] Table 25: Fields, Size, and Descriptions of Timestamped Messages

[0435]

[0436] Table 26 shows the fields, size, and descriptions of the fields included in the error message.

[0437] Table 26 lists the fields, size, and descriptions of the fields included in the error messages.

[0438]

[0439] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0440] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0441] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0442] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0443] Furthermore, the terms "first," "second," etc., used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance, or implicitly specifying the number of technical features indicated in this embodiment. Therefore, features defined with terms such as "first" and "second" in the embodiments of this application can explicitly or implicitly indicate that the embodiment includes at least one of those features. In the description of this application, the word "multiple" means at least two or more, such as two, three, four, etc., unless otherwise explicitly and specifically defined in the embodiments.

[0444] In this application, unless otherwise explicitly specified or limited in the embodiments, the terms "installation," "connection," "joining," and "fixing" appearing in the embodiments should be interpreted broadly. For example, a connection can be a fixed connection, a detachable connection, or an integral part; it can also be a mechanical connection, an electrical connection, etc. Of course, it can also be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication between two components, or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific implementation.

[0445] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0446] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A message generation method, characterized in that, The method includes: Obtain the raw data output by the customized circuit; Based on the data type of the information payload in the original data, the target message corresponding to the data type is obtained from multiple message types; Obtain at least two target message fields that match the data type from among the multiple message fields of the target message; A tracking message is generated based on the information payload and at least two of the target message fields.

2. The method according to claim 1, characterized in that, The customized circuit includes a processor, a bus, and a phase-locked loop; The data types include: processor instruction classes, processor read / write classes, bus classes, phase-locked loop read / write classes, circuit signal classes, timestamps, or error classes; When the data type is the instruction class, the target message is an instruction class message; When the data type is the processor's data read / write class, the target message is a read / write data class message; When the data type is the bus type or the read / write type of the phase-locked loop, the target message is a data acquisition message; When the data type is the circuit signal type, the target message is an integrated circuit tracing message; When the data type is the timestamp, the target message is a timestamp message; If the data type includes an error class, the target message is: an error message.

3. The method according to claim 2, characterized in that, When the information payload is a jump instruction, the target message is: a branch message; When the information payload is a pause instruction, the target message is: a pause instruction message.

4. The method according to claim 3, characterized in that, The jump instruction includes a direct jump instruction or an indirect jump instruction.

5. The method according to claim 2, characterized in that, When the information payload is write data of the processor, the target message is: write data message; When the information payload is read data from the processor, the target message is: a read data message.

6. The method according to claim 3, characterized in that, When the data type is the processor's instruction class, the processor's read / write class, or the circuit signal class, If the information payload does not meet the synchronization conditions, then the target message is a message without synchronization conditions; If the information payload satisfies the synchronization condition, then the target message is a message with synchronization conditions.

7. The method according to claim 2, characterized in that, When the information payload is a jump instruction or a pause instruction, at least two of the target message fields include a first field set, which includes a first timestamp field, a source field, a transmission code field, and an instruction count field. Wherein, the field value of the first timestamp field is the time when the tracking message was generated; the field value of the transmission code field represents the data type of the information payload; and whether the information payload meets the synchronization condition; the field value of the instruction count field is the total number of instructions sequentially executed by the processor after the previous tracking message on the same channel of the processor.

8. The method according to claim 7, characterized in that, When the information payload meets the synchronization condition, at least two of the target message fields also include a synchronization condition field and an absolute address field, and the field value of the synchronization condition field is the synchronization reason why the information payload meets the synchronization condition; When the information payload is an indirect jump instruction and the synchronization condition is not met, at least two of the target message fields also include a relative address field.

9. The method according to claim 2, characterized in that, The data type is the read / write class of the processor; If the information payload does not meet the synchronization conditions, at least two of the target message fields include a second field set and a relative address field. The second field set includes a first timestamp field, a data field, a data size field, a source field, and a transmission code field. When the information payload satisfies the synchronization condition, at least two of the target message fields include the second field set, the synchronization condition field, and the absolute address field; Wherein, the field value of the first timestamp field is the time when the tracking message was generated; the field value of the data field is the data content; the field value of the data size field is the bit width of the data content; the field value of the transmission code field represents the type of the target message; and the field value of the synchronization condition field is the synchronization reason why the information payload satisfies the synchronization condition.

10. The method according to claim 2, characterized in that, When the target message is the data acquisition message, the at least two target message fields include: a first timestamp field, a DQDATA field, an identification tag field, and a transmission code field; The value of the identification tag field represents the source of the information payload, and the value of the transmission code field represents the type of the target message.

11. The method according to claim 10, characterized in that, When the data type is the bus type, the information payload includes first bus data and second bus data. The first bus data includes: control signals and first bus data content; the second bus data includes: the control signals and second bus data content. The DQDATA field includes a first subfield and a second subfield, wherein the field value of the first subfield is the control signal and the first bus data content, and the field value of the second subfield is the second bus data content; The control signal is used to indicate the processing method for the first bus data and the second bus data.

12. The method according to claim 10, characterized in that, When the data type is a read / write type of the phase-locked loop, the information payload includes phase-locked loop data content; The DQDATA field includes a first subfield and a second subfield, wherein the field value of the first subfield is the phase-locked loop data content, and the field value of the second subfield is the attribute data of the information payload; The phase-locked loop data content is the data content obtained from the phase-locked loop's memory.

13. The method according to claim 2, characterized in that, The target message is the integrated circuit tracking message; When the information payload does not meet the synchronization conditions, at least two of the target message fields include: a third field set and a first signal content field, wherein the third field set includes a first timestamp field, a signal source field, and a transmission code field; When the information payload satisfies the synchronization condition, at least two of the target message fields include: the third field set, the second signal content field, and the synchronization condition field; Wherein, the field value of the first timestamp field is the time when the tracking message was generated; the field value of the transmission code field represents the synchronization type of the target message; the field value of the synchronization condition field is the synchronization reason why the information payload satisfies the synchronization condition; the field value of the first signal content field is the relative value of the circuit signals of multiple circuit channels; and the field value of the second signal content field is the circuit signal of multiple circuit channels.

14. The method according to claim 2, characterized in that, The target message is a timestamp message; At least two of the target message fields include: a second timestamp field and a transmission code field; The second timestamp field has an external timestamp value, and the transmission code field has a value that represents the type of the target message.

15. The method according to claim 2, characterized in that, The target message is: Error Message; At least two of the target message fields include: a first timestamp field, an error code field, an error type field, and a transmission code field; Wherein, the field value of the first timestamp field is the time when the tracking message was generated; the field value of the error code field represents the tracking message that generated the error; the field value of the error type field represents the reason why the tracking message generated the error; and the field value of the transmission code field represents the type of the target message.

16. The method according to claim 6, characterized in that, The synchronization condition includes a synchronization enable signal, which indicates that the message corresponding to the received information payload is a message with synchronization conditions.

17. The method according to any one of claims 1 to 16, characterized in that, The method further includes: A data set is generated based on the attribute data of the information payload; Based on the information payload and at least two of the target message fields, a tracking message is generated, including: Based on the data set and at least two of the target message fields, a tracking message is generated.

18. The method according to any one of claims 1 to 16, characterized in that, The process of obtaining the raw data output by the customized circuit includes: Select the target tracking source from the multiple tracking sources in the customized circuit; Receive raw data from the target tracking source.

19. The method according to any one of claims 1 to 16, characterized in that, The method further includes: Receive an enable signal; wherein the enable signal is used to indicate at least one of the following: A trace message indicating the instructions generated by the processor; A trace message indicating the data content generated by the processor; Instructs the generation of trace messages with a data type of bus; A tracking message indicating the content of the phase-locked loop data that generates the phase-locked loop; Indicates the generation of a trace message with a data type of circuit signal; Instructs the generation of a tracking message with a timestamp data type.

20. The method according to claim 19, characterized in that, The enable signal is used to indicate that the first timestamp field is prohibited in the tracking message; In the case where the enable signal indicates a trace message for generating instructions from the processor, the enable signal is also used to indicate at least one of the following: The instruction generates a tracking message with an information payload of type 1, the first type including at least one of a target instruction and a pause instruction, the target instruction including a direct jump instruction and an indirect jump instruction; A trace message indicating the information payload of the first channel output of the generator processor; In the case where the enable signal indicates a trace message for generating the data content of the processor, the enable signal is also used to indicate at least one of the following: Instructs the generation of a trace message with an information payload of type 2, the second type including the processor's read and / or write classes; A tracking message indicating the information payload of the second channel output of the generator processor; In the case where the enable signal indicates a tracking message for generating phase-locked loop data content, the enable signal is also used to indicate the generation of a tracking message for an information payload of a third type, the second type including read and / or write types of the phase-locked loop. When the enable signal indicates the generation of a tracing message of type circuit signal, the enable signal is also used to indicate the generation of a tracing message with a target edge information payload, the target edge including no edge, rising edge, falling edge, or double edge.

21. The method according to any one of claims 1 to 16, characterized in that, The customized circuit includes a general-purpose timer module.

22. A message generation device, characterized in that, Implement the message generation method according to any one of claims 1-21.

Citation Information

Patent Citations

  • Chip data flow tracking system and method

    CN115481005A

  • Data mapping method and system for tracking information during conversion of different tracking protocol messages

    CN120980149A