Message tracking circuit and system
By designing message tracing circuits and systems, the problem of the ARM CoreSight system being unable to trace custom circuits in the SoC was solved, achieving efficient tracing of custom circuits and saving storage space and area.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 合肥智芯半导体有限公司
- Filing Date
- 2026-01-09
- Publication Date
- 2026-06-02
AI Technical Summary
The ARM CoreSight system cannot track signals from custom circuits within the SoC.
A message tracing circuit was designed, including a target queue, a message packing circuit, and a message sending circuit. By capturing and processing the raw data of the customized circuit, a target tracing message is generated and sent to an off-chip device using an advanced tracing bus.
This reduces the amount of data that the target queue needs to store, saves the bit width and area of multiple MSEs in the target queue, and enables effective tracking of customized circuits.
Smart Images

Figure CN121501585B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of integrated circuits, specifically to a message tracking circuit and system. 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 invention provides a message tracking circuit and system capable of tracking messages from a customized circuit. The technical solution includes:
[0005] On the one hand, a message tracing circuit is provided, which includes: multiple target queues, multiple message packing circuits, and a message sending circuit, wherein the multiple target queues are connected to the multiple message packing circuits in a one-to-one correspondence;
[0006] Each target queue 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.
[0007] Each message packaging circuit is used to obtain at least one first target data stored in the corresponding target queue, and obtain a target tracking message based on at least one first target data. The target tracking message includes multiple message data out (MDO), and message start and end (mse) corresponding to each MDO. The multiple MDOs include at least one first target data.
[0008] The message sending circuit is used to send target tracking messages.
[0009] Optionally, the message tracking circuit also includes: multiple capture circuits and multiple data processing circuits, wherein the multiple capture circuits are connected one-to-one with the multiple data processing circuits, and the multiple data processing circuits are connected one-to-one with the multiple target queues.
[0010] Each capture circuit is used to capture raw data from the corresponding tracking source in the customized circuit;
[0011] Each data processing circuit is used to obtain information payload from the raw data acquired by the corresponding capture circuit, 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.
[0012] Each target queue is used to store at least one first target data in the data set of the corresponding data processing circuit.
[0013] Optionally, the first target queue in a set of multiple target queues may be used to store the first target data in a set of data of similar types;
[0014] The second target queue in a set of multiple target queues is used to store the first target data in a data set of one type.
[0015] Optionally, at least one first target data includes at least one reference attribute data;
[0016] The bit width occupied by each reference attribute data in the first target queue is smaller than the bit width occupied by the reference attribute data in the target tracking message.
[0017] Optionally, the target queue corresponding to the message packaging circuit is the first target queue; the message packaging circuit is used for:
[0018] Based on the data type of the information payload, at least one second target data, multiple MSEs, and a first message format are obtained from the data set. The first message format includes multiple first fields and the standard bit width of each first field.
[0019] Each reference attribute data is transformed, and the transformed reference attribute data is assigned to the corresponding first field. The bit width of the transformed reference attribute data is equal to the standard bit width of the corresponding first field.
[0020] Assign all data other than the reference attribute data in at least one first target data, as well as at least one second target data, to the corresponding first field;
[0021] Multiple MDOs are generated based on multiple first fields, and multiple MSEs are used to package the multiple MDOs to obtain the target tracking message.
[0022] Optionally, the second target data may be identical in similar data sets.
[0023] Optionally, the reference attribute data may include at least one of the following: transmission code, synchronization condition, data element size, data size, and source data;
[0024] When the reference attribute data includes transmission codes, the bit width occupied by the reference attribute data in the first target queue is positively correlated with the number of tracking messages corresponding to the data in the first target queue;
[0025] When the reference attribute data includes synchronization conditions, the bit width occupied by the reference attribute data in the first target queue is positively correlated with the number of synchronization conditions required.
[0026] 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 is positively correlated with the number of data elements required.
[0027] When the reference attribute data includes the data size, the bit width occupied by the reference attribute data in the first target queue is positively correlated with the total number of actual bit widths of the currently tracked processor changes;
[0028] 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.
[0029] Optional, similar types include: processor read / write classes, processor instruction classes, or circuit signal classes.
[0030] Optionally, 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 target tracking message;
[0031] When the information payload is erroneous data, the specified attribute data includes the error type, 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.
[0032] When the information payload is erroneous 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 error codes required.
[0033] Optionally, the target queue corresponding to the message packaging circuit is the second target queue; the message packaging circuit is used for:
[0034] Acquire multiple third target data, multiple MSEs, and a second message format, the second message format including multiple second fields and the standard bit width of each second field;
[0035] The specified attribute data is transformed, and the transformed specified attribute data is assigned to the corresponding second field. The bit width of the transformed specified attribute data is equal to the standard bit width of the corresponding second field.
[0036] Assign all data in the first target data except for the specified attribute data, as well as at least one third target data, to the corresponding second field;
[0037] Multiple MDOs are generated based on multiple second fields, and multiple MSEs are used to package the multiple MDOs to obtain the target tracking message.
[0038] Optionally, a message sending circuit is provided for sending target tracking messages via the advanced trace bus (ATB).
[0039] On the other hand, a message tracing system is provided, including an ATB bus and a message tracing circuit as described above.
[0040] Optionally, the message tracing system may also include: a tracing output unit in the ARM tracing circuit;
[0041] The data transmission circuit is connected to the input terminal of the tracking output unit via ATB, and the output terminal of the tracking output unit is connected to an external device.
[0042] On the other hand, a chip is provided, including customized circuitry, and a message tracking system as described above.
[0043] Optional, customized circuitry includes: a generic timer module (GTM).
[0044] In summary, this application provides a message tracking circuit and system. Each target queue in the message tracking circuit stores at least one first target data from a dataset. Each message packaging circuit acquires at least one first target data stored in its corresponding target queue and obtains a target tracking message based on the at least one first target data. A message sending circuit sends the target tracking message, thereby enabling the tracking of tracking messages in the customized circuitry of the ARM chip.
[0045] The target tracking message includes multiple Management Object Detectors (MDOs) and a corresponding Target Sequence Execution Message (MSE) for each MDO. Each MDO includes at least one first target data item. Since the target queue only needs to store at least one first target data item, and the target tracking message sent to the external device by the message packaging circuit contains multiple MSEs, the amount of data required to be stored in the target queue is reduced while sending the complete tracking message to the external device. This saves the bit width and area occupied by multiple MSEs in the target queue. Furthermore, the more MSEs there are, the more bit width is saved in the target queue, resulting in a very significant area saving effect.
[0046] Additional aspects and advantages of the invention 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 the invention. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the structure of a message tracking circuit provided in an embodiment of this application;
[0048] Figure 2 This is a schematic diagram of another message tracking circuit provided in an embodiment of this application;
[0049] Figure 3 This is a schematic diagram of the structure of a message tracking system provided in an embodiment of this application;
[0050] Figure 4 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation
[0051] Embodiments of the present invention are described in detail below, examples of which are illustrated 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 the present invention, and should not be construed as limiting the present invention.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] 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), 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.
[0056] 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.
[0057] 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 Advanced Microcontroller Bus Architecture (AMBA) bus flow. Furthermore, the signal flow within it is not the same as the signal flow of a subsystem within the ARM core. For example, this customized circuit could be a motor control circuit, which could be a GTM (Gateway Motor Control). Similarly, the processors of certain subsystems within a System-on-a-Chip (SoC) are customized. Therefore, a method for tracing customized circuits is urgently needed.
[0058] The IEEE Industry Standards and Technology Organization-5001 standard (IEEE ISTO-5001) can be referred to as the Nexus standard. This Nexus standard is a mature, open-source trace standard that provides tracing capabilities for embedded systems. The Nexus standard includes a standard trace interface and trace messages forming a state machine protocol.
[0059] The Nexus standard has a complete range of message types and clearly defined message fields, which can greatly reduce the output bandwidth requirements (due to its data compression methods, variable-length message fields, and synchronization mechanisms).
[0060] The Nexus standard specifies that a trace message can include multiple message fields. For example, in the case of a trace message that is an indirect branch message with synchronization conditions, an indirect branch message with synchronization conditions can include a transfer code (TCODE) field, a source (srouce, src) field, a synchronization condition (SYNC) field, a number of sequentially executed programs field, and an absolute address field, etc.
[0061] Taking a trace message as an example of a write data message or a read data message with synchronization conditions, Table 1 shows the fields included in a write data message or a read data message with synchronization conditions. Referring to Table 1, Table 1 includes the minimum bit width (in bits), field name, field type, and field description of each field in the trace message.
[0062] Users can set the bit width of each field themselves. A minimum bit width of 0 means that the field can be omitted from the message, while a minimum bit width of 1 means that the field must be included in the message.
[0063] The field is named First Timestamp (TSTAMP), with a minimum bit width of 0 and a variable type, representing the first timestamp at which the tracking message was generated. The time when valid raw data is received can be used as the first timestamp at which the tracking message was generated. The embodiments of this application will be described below using the receipt of raw data as an example; this raw data refers to the received valid raw data.
[0064] The DATA field and the absolute address field containing the data are mandatory in the message, and the minimum bit width of the DATA field is 1. The TCODE field is 6 bits wide and is used to identify different types of tracking messages.
[0065] Table 1
[0066]
[0067] Table 2 shows the field values of the synchronization condition field and the corresponding synchronization reason for each field value. As can be seen from Table 2, when the synchronization condition field value (SYNC value) is 0b0001, the corresponding synchronization reason is Exit from SystemReset.
[0068] Table 2
[0069]
[0070] The synchronization reason for 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, when a synchronization enable signal is received, it is determined that all messages corresponding to the received information payloads are messages with synchronization conditions.
[0071] 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.
[0072] 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. Tracking messages corresponding to the same target queue share the same periodic message counter.
[0073] 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.
[0074] For tracking enabled, if the original data to which the information payload belongs is the first original data tracked by the message tracking circuit in response to the tracking enable signal, then the information payload can be determined to meet the synchronization condition. Furthermore, the synchronization reason is tracking enabled.
[0075] Figure 1 This is a schematic diagram of a message tracking circuit provided in an embodiment of this application, as shown below. Figure 1 As shown, the message tracking circuit 100 includes: multiple target queues 10, multiple message packing circuits 20, and message sending circuit 30.
[0076] Multiple target queues 10 are connected one-to-one with multiple message packing circuits 20, and each target queue 10 can be a first-in-first-out (FIFO) queue.
[0077] Each target queue 10 is used to store at least one first target data from the corresponding data set. The at least one first target data is generated based on the raw data output by the customized circuit. This raw data may be the output of the tracking port of the customized circuit.
[0078] In the case of program flow tracing for a multi-channel sequencer (MCS) in a custom circuit, the raw data may include instruction validity signals, instruction content, source data of the raw data, and instruction address.
[0079] The instruction address can be the content of dbg_mcs_addr[11:0] output by MCS. The source data is used to indicate which channel of MCS the original data originated from.
[0080] In the case of tracing the data flow in a custom circuit's MCS, the raw data may include a data valid signal, data content, read / write signals, the absolute address of the data content, and the source data of the data content. The data content is data read from or written to the MCS's random access memory (RAM). The source data indicates which channel of the MCS the raw data originated from.
[0081] In the case of data tracing on the bus of the advanced routing unit (ARU) in a custom circuit, the raw data may include: bus active signals and bus data.
[0082] Bus data refers to the data content transmitted on the ARU bus. Bus data can include first bus data and second bus data. Both first and second bus data can include control signals and bus data content. Control signals are used to indicate how the bus data content is processed. For example, reading or writing the bus data content.
[0083] In the case of tracking data in the RAM of a digital phase-locked loop (DPLL) module in a customized circuit, the raw data may include a track valid signal, a read-type signal or a write-type signal, whether the access to the RAM in the DPLL comes from the GTM or an external device, the PLL data address, and the PLL data content.
[0084] The phase-locked loop (PLL) data content is the data retrieved from the PLL's 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.
[0085] In the case of tracing circuit channels in a customized circuit, the raw data may include circuit signals or matching signals, and the information payload may be the circuit signals or matching signals.
[0086] The circuit channels can be timer input module (TIM), timer output module (TOM), aru-connected timeroutput module (ATOM), timer input output (TIO), sensor pattern evaluation (SPE), phase-locked loop trigger active slope interrupt (TASI) or state active slope interrupt (SASI), time base unit (TBU) 0_match, TBU1_match, TBU2_match, and TBU3_match.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] `TBU0_match` configures a fixed value into the register group. If the output of `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`.
[0091] In the case of tracking external timestamps, the raw data may include the external timestamp, and the information payload may include that external timestamp.
[0092] The external timestamp can be the timestamp of a time base unit, which represents the time of the custom circuit. By tracking the timestamp output by the time base unit in the custom circuit, the off-chip device can align the first timestamp in the trace message with the timestamp of the time base unit, thus gaining a clearer understanding of the order and timing of the custom circuit and the trace message. Alternatively, the external timestamp can be the ARM Coresight timestamp to align with the first timestamp in the ARM Coresight system and the trace message.
[0093] In the case where the tracking message is a write data message with synchronization conditions, at least one first target data may include a first timestamp, data content (i.e., information payload), absolute address, and synchronization conditions.
[0094] Each message packaging circuit 20 is used to obtain at least one first target data stored in the corresponding target queue 10, and obtain a target tracking message based on at least one first target data.
[0095] The target tracking message may include multiple MDOs and a corresponding MSE for each MDO, and the multiple MDOs may include at least one first target data.
[0096] In some embodiments of this application, the message packaging circuit 20 can generate multiple MDOs based on at least one first target data, and package the multiple MDOs using multiple MSEs to obtain a target tracking message.
[0097] In this embodiment, the message packaging circuit 20 can be either a combinational logic circuit or a register. Using a combinational logic circuit to package messages can save register area, but it will make the timing of subsequent arbitration steps more demanding. Using a register to package messages will occupy some register area, but it will allow for more flexible timing of subsequent arbitration steps. Therefore, whether to use a combinational logic circuit or a register to generate target tracking messages depends on whether register area needs to be optimized and whether the timing of subsequent arbitration steps is demanding.
[0098] The message sending circuit 30 is used to send target tracking messages.
[0099] Target tracking messages can include multiple consecutive packets. Each packet can include at least one data unit, and each data unit can include an MDO and an MSE. For example, the MDO can be 8 bits wide (binary digit), and the MSE can be 2 bits wide.
[0100] In this context, MDO represents the content of the tracking message, and MSE represents the status of the tracking message. Referring to Table 3, a target tracking message can include 12 data units, each of which can 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] Table 3
[0105]
[0106] Assuming multiple 2-bit MSEs are stored in target queue 10, then the multiple 2-bit MSEs in a single target tracking message occupy a significant amount of space in target queue 10. Assuming a target tracking message includes 10 data units, each containing a 2-bit MSE and an 8-bit MDO, and target queue 10 has a depth of 8, then the 2-bit MSEs in target queue 10 occupy 2 × 10 × 8 = 160 bits, representing a 20% occupancy rate.
[0107] In this embodiment, since the target queue 10 only needs to store at least one first target data, and the target tracking message sent by the message packaging circuit 20 to the external device contains multiple MSEs, the amount of data required to be stored in the target queue 10 is reduced while sending the complete tracking message to the external device. This saves the bit width and area occupied by multiple MSEs in the target queue 10, thereby reducing the area occupied by the tracking message in the target queue 10. Furthermore, the more MSEs there are, the more bit width of the target queue 10 is saved, resulting in a very significant area saving effect.
[0108] In summary, this application provides a message tracing circuit. Each target queue in the message tracing circuit is used to store at least one first target data in a corresponding data set. Each message packaging circuit is used to obtain at least one first target data stored in the corresponding target queue, and obtain a target tracing message based on at least one first target data. A message sending circuit is used to send the target tracing message, thereby realizing the tracing of tracing messages in the customized circuit of the ARM chip.
[0109] In some embodiments of this application, the target tracking message may include multiple MDOs and a corresponding MSE for each MDO. Each MDO includes at least one first target data. Since the target queue only needs to store at least one first target data, and the target tracking message sent by the message packaging circuit contains multiple MSEs, the amount of data required to be stored in the target queue is reduced while sending the complete tracking message to the off-chip device, saving the bit width and area occupied by multiple MSEs in the target queue. Furthermore, the more MSEs there are, the more bit width of the target queue is saved, resulting in a very significant area saving effect.
[0110] refer to Figure 2 The message tracking circuit may also include multiple capture circuits 40 and multiple data processing circuits 50.
[0111] Multiple capture circuits 40 are connected one-to-one with multiple data processing circuits 50, and multiple data processing circuits 50 are connected one-to-one with multiple target queues 10.
[0112] Each capture circuit 40 is used to capture raw data from the corresponding tracking source in the custom circuit 200.
[0113] Each data processing circuit 50 is used to acquire raw data from the corresponding capture circuit 40, 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 10.
[0114] In some embodiments of this application, the attribute data may include at least one second attribute data, and optionally, the attribute data may also include at least one first attribute data.
[0115] In some embodiments of this application, at least one second attribute data is data that is not present in the first attribute data and needs to be supplemented. For example, when the information payload meets the synchronization conditions, at least one second attribute data may include the synchronization reason. For example, the parameter of the synchronization reason may be: 0b0111.
[0116] Optionally, at least one second attribute data may also include the source of the information payload, which may be a trace source, for example, a circuit signal source, an ARU bus source, and a phase-locked loop source.
[0117] At least one second attribute data may also include the number of sequentially executed instructions, which represents the number of instructions sequentially executed by the MCS in the same channel after the previous trace message.
[0118] The information payload can be: instruction content, data content, bus data, circuit signals, matching signals, phase-locked loop data content, or external timestamps.
[0119] In this embodiment, when the data type of the information payload 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 may include the source data of the original data, and at least one second attribute data includes: the time of tracking message generation, the number of sequentially executed instructions, and the transmission code. Therefore, the data processing circuit 50 can merge at least one first attribute data and at least one second attribute data to generate a data set.
[0120] The generation time of the tracking message can be the time when the information payload of the original data is received. The transmission code represents the type of tracking message corresponding to the information payload.
[0121] The data processing circuit can obtain the data type of the information payload from the instruction content. For example, the data processing circuit can determine that the data payload data type is an instruction class based on the first value of dbg_mcs_data[31:28] in the instruction content dbg_mcs_data[31:0]. In some embodiments, the message tracking circuit can also obtain the second value of dbg_mcs_data[19:18] and determine whether the data payload data type is a direct jump instruction or an indirect jump instruction based on the first and second values.
[0122] 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. When the first value of the instruction content in the information payload is 1110 and dbg_mcs_data[19:16] is X1XX or 1XXX, the data type of the information payload is an indirect jump instruction. When the first value is 1011 or 1111, the data processing circuit 50 can determine that the data type of the information payload is a pause instruction.
[0123] When the data type of the information payload 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 the source data of the original data and the absolute address of the instruction; 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 data processing circuit 50 can merge at least one first attribute data and at least one second attribute data to generate a data set.
[0124] When the data type of the information payload is a jump instruction, the absolute address of the instruction is the jump destination address of the jump instruction. When the data type of 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 included in the original data.
[0125] If the data type of the information payload is a direct jump instruction, then the jump destination address of the direct jump instruction is the third value of 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].
[0126] If the data type of the information payload is an indirect jump instruction, then 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[11:0] of the next valid instruction in the same channel of the same MCS.
[0127] When the data type of the information payload is an indirect jump instruction and the information payload does not meet the synchronization condition, at least one first attribute data includes source data, and at least one second attribute data includes: the time of trace message generation, the number of sequentially executed instructions, the relative address of the indirect jump instruction, and the transmission code. Therefore, the data processing circuit 50 can combine at least one first attribute data and at least one second attribute data to generate a data set.
[0128] The relative address of an indirect jump instruction is obtained by XORing the absolute address of the indirect jump instruction with the absolute address of the instruction from the previous trace message in the same channel of the same MCS, thus compressing the relative address. This absolute address is the instruction address included in the original data.
[0129] When the data type of the information payload is a pause instruction and the information payload meets the synchronization conditions, at least one second attribute data includes: the synchronization reason, the time of trace message generation, the number of sequentially executed instructions, and the transmission code. At least one first attribute data includes the source data and the instruction absolute address. Therefore, the data processing circuit 50 can combine at least one first attribute data and at least one second attribute data to generate a data set.
[0130] When the data type of the information payload is processor read / write type, 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 source data of the data content and the relative address of the data content. At least one second attribute data includes: the time of tracking message generation, the actual bit width of the data content, and the transmission code.
[0131] Therefore, the data processing circuit 50 can compress the absolute address of the data content into 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.
[0132] When the data type of the information payload is processor read / write type, 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 of the data content 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.
[0133] Therefore, the data processing circuit 50 can merge the data content, at least one first attribute data, and at least one second attribute data to generate a data set.
[0134] If the original data includes a read signal, the data processing circuit 50 can determine that the data type of the information payload is the processor's read type, and that the information payload is the processor's read data. If the information payload includes a write signal, the data processing circuit 50 can determine that the data type of the information payload is the processor's write type, and that the information payload is the processor's write data. The processor is an MCS.
[0135] 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 data processing circuit 50 can generate a data set based on the information payload and at least one second attribute data.
[0136] When the tracking port of the customized circuit is the tracking port of the bus data, the data processing circuit 50 can determine that the data type of the information payload is bus type.
[0137] In the case of a read / write class of the PLL data type in 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 trace message generation, the source data, and the transmission code. Therefore, the data processing circuit 50 can combine the information payload, at least one first attribute data, and at least one second attribute data to generate a data set.
[0138] When the tracking port of the customized circuit is the tracking port of the phase-locked loop data, the data processing circuit 50 can determine that the data type of the information payload is a read / write type of the phase-locked loop.
[0139] When the data type of the information payload 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 data processing circuit 50 can convert the information payload into relative values of circuit signals and generate a data set based on the relative values of the circuit signals and at least one second attribute data.
[0140] The data processing circuit 50 can pre-store the source data of the circuit signal, which can be the channel identifier of the circuit channel of the output circuit signal.
[0141] When the data type of the information payload is a 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 data processing circuit 50 can merge the information payload and at least one second attribute data to generate a data set.
[0142] When the data type of the information payload is a timestamp, the information payload includes an external timestamp, and at least one second attribute data includes a transmission code. Therefore, the data processing circuit 50 can combine the information payload and at least one second attribute data to generate a data set.
[0143] When the data type of the information payload is error type, the corresponding tracking message is the tracking message that cannot be stored because the first-in-first-out queue is full. At least one second attribute data includes the tracking message generation time, error code, error type, and transmission code. Therefore, the data processing circuit 50 can use at least one second attribute data as the generated data set.
[0144] For example, the error code could represent at least one of the target queue where an overflow caused the corresponding trace message to be lost, and the trace message that generated the error. The error type is represented by the error cause; for example, the error cause could be that the first-in-first-out queue is full, resulting in the loss of the trace message corresponding to the information payload.
[0145] In some embodiments of this application, a first target queue 10 among a plurality of target queues 10 is used to store first target data in a data set of similar types.
[0146] 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 10 can store have similar data types.
[0147] Since the first target queue 10 stores the first target data from multiple similar data sets, compared to setting a target queue 10 for each type of data set, the number of target queues 10 that need to be set is reduced, thereby reducing hardware costs.
[0148] 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.
[0149] When the data type of the information payload is the processor's write class and the information payload does not meet the synchronization conditions, the trace message corresponding to the information payload can be called a write data message without synchronization conditions, that is, a write data message in the Nexus standard.
[0150] When the data type of the information payload is processor write-type and the information payload meets the synchronization conditions, the corresponding trace message can be called a write data message with synchronization conditions, i.e., the DataWrite With Sync Message in the Nexus standard. Data type "data write-type" means that the information payload is data written to RAM connected to the MCS.
[0151] When the data type of the information payload is processor read, and the information payload does not meet the synchronization conditions, processor read refers to data read from RAM connected to the MCS. The tracing message corresponding to this information payload can be called a read data message without synchronization conditions, i.e., a read data message (DataRead Message) in the Nexus standard.
[0152] When the data type of the information payload is processor read and the information payload meets the synchronization conditions, the tracking message corresponding to the information payload can be called a read data message with synchronization conditions, i.e., Data ReadWith Sync Message in the Nexus standard.
[0153] A write data message (or read data message) without synchronization conditions includes the following fields: transmission code field, source field, data size field, relative address field, data field, and first timestamp field. The source field's value characterizes the origin of the data content. The source field indicates which processor, or which channel of the processor, the information payload originates from.
[0154] The fields included in a write data message with synchronization conditions (or a read data message with synchronization conditions) are: transmission code field, source field, data size field, synchronization condition field, absolute address field, data field, and first timestamp field.
[0155] The transmission code field's value is a transmission code, which represents the type of tracking message corresponding to the information payload. Optionally, this transmission code can represent the synchronization type and data type. The synchronization type can be with or without synchronization conditions.
[0156] For example, if the tracking message corresponding to the information payload is a write data message without synchronization conditions, then the transmission code represents the absence of synchronization conditions and the write class. If the tracking message corresponding to the information payload is a write data message with synchronization conditions, then the transmission code represents the presence of synchronization conditions and the write class.
[0157] If the tracking message corresponding to the information payload is a read data message without synchronization conditions, then the transmission code represents the absence of synchronization conditions and the read class. If the tracking message corresponding to the information payload is a read data message with synchronization conditions, then the transmission code represents the presence of synchronization conditions and the read class.
[0158] The data size field represents the bit width of the data content, and the data field's value is the data content itself. The relative address field's value is the relative address of the data content, which is the XOR of the absolute address of the data content and the absolute address of the previous valid data content on the same channel within the same MCS, thus compressing it into a relative address. The absolute address field's value is the absolute address of the data content. The synchronization condition field's value is the synchronization reason why the information payload satisfies the synchronization condition; that is, which synchronization reason the information payload satisfies.
[0159] When the data type of the information payload is a direct jump instruction and the information payload does not meet the synchronization conditions, the tracing message corresponding to the information payload can be called a direct branch message without synchronization conditions, that is, a direct branch message in the Nexus standard.
[0160] Direct branch messages without synchronization conditions include the following fields: transmission code field, source field, instruction counter (I-CNT) field, and first timestamp field.
[0161] When the data type of the information payload is a direct jump instruction and the information payload meets the synchronization conditions, the tracing message corresponding to the information payload can be called a direct branch message with synchronization conditions, i.e., DirectBranch with Sync Message in the Nexus standard.
[0162] Direct branch messages with synchronization conditions include the following fields: transmission code field, source field, synchronization condition field, instruction count field, absolute address field, and first timestamp field.
[0163] The value of the transmission code field is the transmission code, which represents the type of tracking message corresponding to the information payload. For example, if the tracking message corresponding to the information payload is a direct branch message without synchronization conditions, then the transmission code represents the synchronization type as direct branch without synchronization conditions. If the tracking message corresponding to the information payload is a direct branch message with synchronization conditions, then the transmission code represents the synchronization type as direct branch with synchronization conditions.
[0164] The source field indicates the source of the information payload. This value can be source data, which indicates which channel of the MCS the instruction (e.g., a direct jump instruction) originates from. For example, source data is 3'h0, indicating the instruction originates from channel 0 of the MCS. The instruction count field indicates the number of instructions executed sequentially. The synchronization condition field indicates the synchronization reason why the information payload satisfies the synchronization condition, i.e., which synchronization reason the information payload satisfies. The absolute address field indicates the absolute address of the direct jump instruction.
[0165] When the data type of the information payload is an indirect jump instruction and the information payload does not meet the synchronization conditions, the tracing message corresponding to the information payload can be collectively referred to as an indirect branch message without synchronization conditions, i.e., an Indirect Branch Message in the Nexus standard.
[0166] Indirect branch messages without synchronization conditions include the following fields: transmission code field, source field, instruction count field, relative address field, and first timestamp field.
[0167] When the data type of the information payload is an indirect jump instruction and the information payload meets the synchronization condition, the tracking message corresponding to the information payload can be called an indirect branch message with synchronization condition, i.e., Indirect Branch with Sync Message in the Nexus standard.
[0168] Indirect branch messages with synchronization conditions include the following fields: transmission code field, source field, synchronization condition field, instruction count field, absolute address field, and first timestamp field.
[0169] If the tracking message corresponding to the information payload is an indirect branch message without synchronization conditions, then the transmission code represents the synchronization type as either without synchronization conditions or indirect branch. If the tracking message corresponding to the information payload is an indirect branch message with synchronization conditions, then the transmission code represents the synchronization type as either with synchronization conditions or indirect branch.
[0170] The relative address field's value is the relative address of the instruction. It is obtained by XORing the absolute address of the indirect jump instruction with the absolute address of the instruction from the previous trace message in the same channel within the same MCS, thus compressing it into a relative address. The absolute address field's value is the absolute address of the indirect jump instruction.
[0171] When the data type of the information payload is a pause instruction and the information payload does not meet the synchronization conditions, the tracking message corresponding to the information payload can be called a pause message without synchronization conditions.
[0172] Pause messages without synchronization conditions include the following fields: transmission code field, source field, instruction count field, and first timestamp field.
[0173] When the data type of the information payload is a pause instruction and the information payload meets the synchronization conditions, the tracking message corresponding to the information payload can be called a pause message with synchronization conditions.
[0174] Pause messages with synchronization conditions include the following fields: transmission code field, source field, synchronization condition field, instruction count field, absolute address field, and first timestamp field.
[0175] The value of the transmission code field is the transmission code, which represents the type of tracking message corresponding to the information payload. For example, if the tracking message corresponding to the information payload is a pause message without synchronization conditions, then the transmission code represents the synchronization type as "without synchronization conditions" and the pause class. If the tracking message corresponding to the information payload is a pause message with synchronization conditions, then the transmission code represents the synchronization type as "with synchronization conditions" and the pause class.
[0176] When the data type of the information payload is a circuit signal and the information payload does not meet the synchronization conditions, the trace message corresponding to the information payload can be called an integrated circuit trace message without synchronization conditions, i.e., the In-circuit Trace Message in the Nexus standard.
[0177] Integrated circuit tracing messages without synchronization conditions include the following fields: transmission code field, source field, relative value field of circuit signal, and first timestamp field. The source field value is the channel identifier of the circuit channel from which the output circuit signal originates. The source field value indicates which circuit channel the information payload originates from.
[0178] When the data type of the information payload is a circuit signal and the information payload meets the synchronization conditions, the tracking message corresponding to the information payload can be called an integrated circuit tracking message with synchronization conditions, i.e., In-circuit Trace with Sync Message in the Nexus standard.
[0179] Integrated circuit tracking messages with synchronization conditions include the following fields: transmission code field, source field, synchronization condition field, absolute value field of circuit signal, and first timestamp field.
[0180] The transmission code field contains a transmission code that represents the synchronization type of the tracking message corresponding to the information payload. For example, if the tracking message corresponding to the information payload is an integrated circuit tracking message with synchronization conditions, then the transmission code represents that it has synchronization conditions. If the tracking message corresponding to the information payload is an integrated circuit tracking message without synchronization conditions, then the transmission code represents that it does not have synchronization conditions. The absolute value field of the circuit signal contains the circuit signals of multiple circuit channels. The relative value field of the circuit signal contains the relative value of the circuit signals of multiple circuit channels. This relative value is obtained by XORing the circuit signal from the previous integrated circuit tracking message from the same source with the valid circuit signal of the current message.
[0181] Table 4 shows the names of similar types, similar tracking messages, and the reasons why the information payloads corresponding to various tracking messages can be considered similar types. Referring to Table 4, for circuit signal types, if each channel requires a target queue 10 to buffer the first target data, then if 32 channels of circuit signals need to be monitored, 32 target queues 10 are required. This approach wastes the area of the target queues 10 and increases the subsequent arbitration logic.
[0182] In this embodiment, if the transition edges of at least two first channels change simultaneously, the signals of these at least two channels can be represented by a single circuit signal, and these at least two first channels correspond to one target queue 10. This meets the requirement that target queue 10 can only have one data write per clock cycle.
[0183] Table 4
[0184]
[0185] In some embodiments of this application, at least one first target data may include at least one reference attribute data. The bit width occupied by each reference attribute data in the first target queue 10 is smaller than the bit width occupied by the reference attribute data in the target tracking message. Reference attribute data refers to data that needs to be stored in the first target queue 10 and whose bit width can be compressed within the first target queue 10.
[0186] 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.
[0187] 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 10 is positively correlated with the number of tracking messages corresponding to the data to be stored in the first target queue 10. For example, the number of tracking messages corresponding to the data to be stored in the first target queue 10 includes four messages: 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.
[0188] When the reference attribute data is a synchronization condition, the bit width occupied by the reference attribute data (i.e., the synchronization condition) in the first target queue 10 is positively correlated with the number of synchronization conditions required.
[0189] When the reference attribute data includes the size of the data elements, the bit width occupied by the reference attribute data (i.e., the size of the data elements) in the first target queue 10 is positively correlated with the number of data elements required.
[0190] When the reference attribute data includes the data size, and the actual bit width of the currently tracked processor reads or writes at one time varies, the bit width occupied by the reference attribute data (i.e., the data size) in the first target queue 10 is positively correlated with the total number of actual bit widths that the currently tracked processor changes.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] In some embodiments of this application, the target queue corresponding to the message packaging circuit 20 is a first target queue, and the message packaging circuit 20 is used for:
[0196] Based on the data type of the information payload, at least one second target data, multiple MSEs, and a first message format are obtained from the data set. The first message format includes multiple first fields and the size of each first field.
[0197] Each reference attribute data is transformed, and the transformed reference attribute data is assigned to the corresponding first field. The bit width of the transformed reference attribute data is equal to the standard bit width of the first field.
[0198] Assign all data other than the reference attribute data in at least one first target data, as well as at least one second target data, to the corresponding first field;
[0199] Multiple MDOs are generated based on multiple first fields, and multiple MSEs are used to package the multiple MDOs to obtain the target tracking message.
[0200] The second target data is attribute data in the data set other than at least one first target data, and the message packaging circuit 20 can pre-store the second target data.
[0201] For example, message packaging circuit 20 can assign data content to the corresponding data field.
[0202] Optionally, message packing circuit 20 is used to acquire at least one second target data, multiple MSEs, and a first message format from the data set based on the data type of the information payload and whether the information payload meets the synchronization conditions.
[0203] The first message format is the message format corresponding to the data type of the information payload and whether the information payload meets the synchronization condition. For example, if the data type of the information payload is an indirect jump instruction and the information payload meets the synchronization condition, the tracking message corresponding to the information payload is an indirect branch message with synchronization condition. Then, the first message format is the message format of an indirect branch message with synchronization condition, and the first message format includes multiple first fields, which are the fields included in an indirect branch message with synchronization condition.
[0204] When the data type of the information payload is an indirect jump instruction and the information payload does not meet the synchronization condition, the tracking message corresponding to the information payload is an indirect branch message without synchronization conditions. Then the first message format is the message format of an indirect branch message without synchronization conditions. The first message format includes multiple first fields, which are the fields included in an indirect branch message without synchronization conditions.
[0205] For example, assuming the first 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 20 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, while the message packaging circuit 20 can decode the complete multi-bit-width field.
[0206] Assuming a data unit includes a 2-bit MSE and an 8-bit MDO, the target queue 10 has a depth of 8, a data width of 32 bits, and a data address of 32 bits, Table 5 shows the first message format corresponding to a write data message with synchronization conditions as the type of information payload. Referring to Table 5, the first message format includes the TSTAMP field, DATA field, F-ADDR field, DSZ field, SYNC field, SRC field, and TCODE field, as well as the standard bit width of each first field.
[0207] Table 5
[0208]
[0209] 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 10. For example, if the source data corresponding to similar data types is identical, the source data of the information payload does not need to be stored in the first target queue. If the sizes of similar data types are identical, the data size of the information payload does not need to be stored in the first target queue. If the synchronization reasons for similar data types are identical, the synchronization reason and synchronization type of the information payload do not need to be stored in the first target queue. For example, the synchronization reason is receiving a synchronization enable signal.
[0210] 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 10, thereby reducing the amount of data required to be stored in the first target queue 10. Simultaneously, the message packaging circuit 20 can add the second target data during the generation of the target tracking message, thereby ensuring the integrity of the target tracking message sent to the external device.
[0211] For example, for trace messages corresponding to the processor's read / write classes, since the bit width of the information payload 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 field value of the data size field (i.e., the bit width of the data content) of the trace message of the processor's read / write classes in the corresponding first target queue 10.
[0212] Since there is no need to store the second target data, the bit width of the first target queue 10 is saved. Assuming the second target data is a TCODE, 6 bits of bit width can be saved directly. Table 6 shows the types of tracking messages, applicable fields, and scalability.
[0213] In some embodiments of this application, a second target queue 10 among multiple target queues 10 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 10 can store are of the same type.
[0214] The data types stored in the multiple second target queues 10 may include: bus type, phase-locked loop read / write type, timestamp, and error type.
[0215] When the data type of the information payload is bus-type, the corresponding tracing message is a data acquisition message, which is the data acquisition message in the Nexus standard. Because there are no access addresses to be traced on the bus, and there is no correlation between bus data, using the data acquisition message in the Nexus standard is simple, clear, and does not waste hardware area or tracing bandwidth.
[0216] When the data type of the information payload is a read / write type for a phase-locked loop (PLL), the corresponding tracking message is a data acquisition message. Since different 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, using read or write data messages to compress the PLL data addresses is not very meaningful and wastes hardware space allocated to absolute storage addresses and synchronization conditions. Therefore, using the data acquisition message from the Nexus standard is simple, clear, and does not waste hardware space.
[0217] The data acquisition message includes: first timestamp field, data acquisition data (DQDATA) field, identification tag (ID Tag) field, and transmission code field.
[0218] When 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.
[0219] The DQDATA field can include a first subfield and a second subfield. The value of the first subfield is the control signal and the bus data content from the first bus data. The value of the second subfield is the bus data content from the second bus data.
[0220] The first subfield can be represented as DQDATA0[28:0], which is used to store the 5-bit control signal and the 24-bit bus data content in the first bus data. The second subfield can be represented as DQDATA1[23:0], which is used to store the 24-bit bus data content in the second bus data.
[0221] 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.
[0222] The value of the transmission code field indicates the type of tracking message corresponding to the information payload. For example, the transmission code indicates a data acquisition message.
[0223] When the data type of the information payload is a phase-locked loop (PLL) read / write type, the field value of the first subfield is the PLL data content, and the field value of the second subfield is the attribute data of the information payload. This attribute data includes read type signal / write type signal, whether the access to the RAM in the DPLL comes from the GTM or an external device, and the PLL data address.
[0224] 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.
[0225] The field value of the identifier tag field represents the source of the information payload. The field value of the identifier tag field is the source data of the information payload, which is one of the two buses and three phase-locked loops.
[0226] When the data type of the information payload is a timestamp, the corresponding tracking message is a timestamp message.
[0227] A timestamped message may include a second timestamp field and a transmission code field. The value of the transmission code field indicates the type of tracking message corresponding to the information payload. For example, the transmission code represents a timestamp. The value of the second timestamp field is an external timestamp.
[0228] When the data type of the information payload is error, the corresponding trace message for the information payload is an error message.
[0229] Error messages may include: a first timestamp field, an error code (ECODE) field, an error type field, and a transmission code field.
[0230] The transmission code field's value indicates the type of tracking message corresponding to the information payload. For example, the transmission code represents an error message. The error code field's value is the error code, for example, the error code used to indicate a target queue where an overflow caused the corresponding tracking message to be lost. The error type field's value is the error type, such as the tracking message corresponding to the information payload being lost because the first-in-first-out queue was full.
[0231] 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.
[0232] For example, the required error codes may include error codes indicating that a first target queue overflow corresponding to a processor read / write class caused the corresponding trace message to be lost, error codes indicating that a first target queue overflow corresponding to an instruction class caused the corresponding trace message to be lost, error codes indicating that a first target queue overflow corresponding to a circuit signal class caused the corresponding trace message to be lost, error codes indicating that a second target queue overflow corresponding to a timestamp caused the corresponding trace message to be lost, error codes indicating that a second target queue overflow corresponding to a bus class caused the corresponding trace message to be lost, and error codes indicating that a second target queue overflow corresponding to a phase-locked loop read / write class caused the corresponding trace message to be lost.
[0233] 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 target 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.
[0234] For example, if a tracking message is lost due to a target queue, that tracking message is considered erroneous data.
[0235] When the target queue 10 corresponding to the message packaging circuit 20 is the second target queue 10, the message packaging circuit 20 is used for:
[0236] Acquire multiple third target data, multiple MSEs, and a second message format, the second message format including multiple second fields and the standard bit width of each second field;
[0237] The specified attribute data is transformed, and the transformed specified attribute data is assigned to the corresponding second field. The bit width of the transformed specified attribute data is equal to the standard bit width of the corresponding second field.
[0238] Assign all data in the first target data except for the specified attribute data, as well as at least one third target data, to the corresponding second field;
[0239] Multiple MDOs are generated based on multiple second fields, and multiple MSEs are used to package the multiple MDOs to obtain the target tracking message. Among them, the third target data is the data in the data set that is not stored in the second target queue.
[0240] The second message format is the format of the trace message corresponding to the information payload. For example, if the data type of the information payload is error, and the trace message corresponding to the information payload is an error message, then the second message format is the message format of the error message. The second message format includes multiple second fields, which are the fields included in the error message.
[0241] Table 6
[0242]
[0243] In some embodiments of this application, the message sending circuit 30 is used to send target tracking messages via the ATB bus. By reusing the ATB in the ARM tracking circuit, the message tracking circuit does not need to set up a dedicated tracking output interface and transmission protocol for customized circuits, thereby reducing hardware costs.
[0244] If a target tracking message is packaged first and then the complete target tracking message is stored in the reference queue, as shown in Table 7, the target tracking message can be stored in the reference queue in the manner shown in Table 7.
[0245] Table 7
[0246]
[0247] As shown in Table 7, a write data message with synchronization conditions requires 12 data units, each of which includes 2-bit MSE and 8-bit MDO. Therefore, using a reference queue to store a target tracking message, the reference queue has a bit width of 12 × 10 bits = 120 bits and a size of 120 bits × 8 depth = 960 bits.
[0248] In this embodiment, since the data-type tracing messages merge four types of tracing messages—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—data-type tracing only requires one first target queue 10 instead of four queues. The bit width of the first target queue 10 depends on the maximum bit width of the write data message with synchronization conditions or the read data message with synchronization conditions in the stored original data. Table 8 may include fields, the bit width occupied in the reference queue, and the bit width occupied in the first target queue 10. Referring to Table 8, the 2-bit MSE occupies a bit width of 24 bits in the reference queue and a bit width of 0 bits in the first target queue 10.
[0249] Table 8
[0250]
[0251] The bit width occupied by the first target queue 10 is: 0+2+3+2+0+32+32+8=79 bits;
[0252] Compared to the reference queue, the first target queue 10 saves 120-79=41 bits. The area saving rate of the first target queue 10 is 41 / 120=34%, and the total area saved is 41×8 queue depth=328 bits.
[0253] As can be seen from this example, after adopting the solution provided in this application, the area saving rate of the queue reaches 1 / 3, which greatly reduces the RTL area of the first target queue 10.
[0254] In this embodiment of the application, under the premise of ensuring the completeness and scalability of the tracking message, at least one first target data is written into the target queue 10, and then the target tracking message is generated through the message packaging circuit 20. Multiple strategies are used to compress the area of the target queue 10.
[0255] In this embodiment, by ensuring that only one message is valid per clock cycle and maintaining consistency in the information payload required for tracking messages, similar types of tracking messages are merged into a single target queue. This significantly reduces the number of messages in the first target queue 10 and the area consumed by subsequent message sending circuits, thereby achieving the goal of saving area.
[0256] In this embodiment, while ensuring the completeness and scalability of the tracking messages, the necessary data is first stored in the target queue 10, and then the message packaging circuit 20 packages the information payload and all attribute data of the information payload into a complete tracking message. Multiple strategies are employed to compress and store various fields such as 2-bit MSE, TCODE, and SRC of numerous tracking messages, significantly reducing the bit width and area of the target queue 10.
[0257] In summary, this application provides a message tracking circuit. Each target queue in the message tracking circuit is used to store at least one first target data in a dataset. Each message packaging circuit is used to obtain at least one first target data stored in the corresponding target queue, and obtain a target tracking message based on the at least one first target data. A message sending circuit is used to send the target tracking message, thereby realizing the tracking of tracking messages in the customized circuit of the ARM chip.
[0258] The target tracking message includes multiple MDOs and a corresponding MSE for each MDO. Each MDO includes at least one first target data. Since the target queue only needs to store at least one first target data, and the target tracking message sent by the message packaging circuit 20 to the external device contains multiple MSEs, the amount of data required to be stored in the target queue is reduced while sending the complete tracking message to the external device. This saves the bit width and area occupied by multiple MSEs in the target queue. Furthermore, the more MSEs there are, the more bit width is saved in the target queue, resulting in a very significant area saving effect.
[0259] This application provides a message tracking system 1000, such as... Figure 3 As shown, the message tracing system may include an ATB and a message tracing circuit 100.
[0260] Optionally, the message tracking system 1000 may also include a tracking output unit 300 in an ARM tracking circuit.
[0261] Among them, reference Figure 1 and Figure 4 The message sending circuit 30 in the message tracking circuit 100 is connected to the input terminal of the tracking output unit 300 via ATB, and the output terminal of the tracking output unit 300 is connected to the external device 400.
[0262] This application provides a chip, such as... Figure 4 As shown, it includes a customized circuit 200 and a message tracking system 1000.
[0263] Optional, custom circuitry includes: GTM.
[0264] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in 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.
[0265] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present 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.
[0266] Furthermore, in the embodiments of this application, the terms "first," "second," etc., used in the embodiments 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, in the embodiments of this application, features defined with terms such as "first" and "second" can explicitly or implicitly indicate that the embodiment includes at least one of those features. In the descriptions of the embodiments 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.
[0267] In the embodiments of 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 of two components, or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application based on the specific implementation.
[0268] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A message tracking circuit, characterized in that, The message tracking circuit includes: multiple target queues, multiple message packaging circuits, and a message sending circuit, wherein the multiple target queues are connected to the multiple message packaging circuits in a one-to-one correspondence. Each of the target queues is used to store at least one first target data in a corresponding data set, wherein the at least one first target data is generated based on the raw data output by the customized circuit; the first target queue among the multiple target queues is used to store first target data in data sets of similar types; and the second target queue among the multiple target queues is used to store first target data in data sets of one type. Each of the message packaging circuits is used to obtain at least one first target data stored in the corresponding target queue, and to obtain a target tracking message based on at least one first target data. The target tracking message includes multiple message data outputs (MDOs) and message start and end (MSE) corresponding to each MDO. The multiple MDOs include at least one first target data. The message sending circuit is used to send the target tracking message.
2. The message tracking circuit according to claim 1, characterized in that, The message tracking circuit further includes: multiple capture circuits and multiple data processing circuits, wherein the multiple capture circuits are connected to the multiple data processing circuits in a one-to-one correspondence, and the multiple data processing circuits are connected to the multiple target queues in a one-to-one correspondence. Each of the capture circuits is configured to capture the raw data from the corresponding tracking source in the customized circuit; Each of the data processing circuits is configured to obtain an information payload from the raw data acquired by the corresponding capture circuit, 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. Each of the target queues is used to store at least one first target data in the data set of the corresponding data processing circuit.
3. The message tracking circuit according to claim 2, characterized in that, At least one of the first target data includes at least one reference attribute data; The bit width occupied by each of the reference attribute data in the first target queue is smaller than the bit width occupied by the reference attribute data in the target tracking message.
4. The message tracking circuit according to claim 3, characterized in that, The target queue corresponding to the message packaging circuit is the first target queue; the message packaging circuit is used for: Based on the data type of the information payload, at least one second target data, multiple MSEs, and a first message format are obtained from the data set. The first message format includes multiple first fields and a standard bit width for each first field. Each of the reference attribute data is transformed, and the transformed reference attribute data is assigned to the corresponding first field. The bit width of the transformed reference attribute data is equal to the standard bit width of the corresponding first field. Assign at least one piece of data other than the reference attribute data in the first target data, and at least one piece of the second target data to the corresponding first field; Multiple MDOs are generated based on multiple first fields, and multiple MSEs are used to package the multiple MDOs to obtain the target tracking message.
5. The message tracking circuit according to claim 4, characterized in that, The second target data is the same in similar data sets.
6. The message tracking circuit according to claim 3, characterized in that, The reference attribute data includes at least one of the following: transmission code, synchronization condition, data element size, data size, and source data; When the reference attribute data includes the transmission code, the bit width occupied by the reference attribute data in the first target queue is positively correlated with the number of tracking messages corresponding to the data in the first target queue; When the reference attribute data includes the synchronization conditions, the bit width occupied by the reference attribute data in the first target queue is positively correlated with the number of required synchronization conditions; When the reference attribute data includes the data element size, the bit width occupied by the reference attribute data in the first target queue is positively correlated with the number of data element sizes required. When the reference attribute data includes the data size, the bit width occupied by the reference attribute data in the first target queue is positively correlated with the total number of actual bit widths of the currently tracked processor changes; When the source data of the similar types of data are different, 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.
7. The message tracking circuit according to any one of claims 1 to 6, characterized in that, The similar types include: processor read / write types, processor instruction types, or circuit signal types.
8. The message tracking circuit according to any one of claims 2 to 6, characterized in that, 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 target tracking message; When the information payload is erroneous 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 erroneous 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.
9. The message tracking circuit according to claim 8, characterized in that, The target queue corresponding to the message packaging circuit is the second target queue; the message packaging circuit is used for: Acquire multiple third target data, multiple MSEs, and a second message format, the second message format including multiple second fields and a standard bit width for each second field; The specified attribute data is transformed, and the transformed specified attribute data is assigned to the corresponding second field. The bit width of the transformed specified attribute data is equal to the standard bit width of the corresponding second field. All data in the first target data other than the specified attribute data, as well as at least one of the third target data, are assigned to the corresponding second field; Multiple MDOs are generated based on multiple second fields, and multiple MSEs are used to package the multiple MDOs to obtain the target tracking message.
10. The message tracking circuit according to any one of claims 1 to 6, characterized in that, The message sending circuit is used to send the target tracking message via the Advanced Tracking Bus (ATB).
11. A message tracking system, characterized in that, It includes an ATB bus and a message tracking circuit as described in any one of claims 1 to 10.
12. The message tracking system according to claim 11, characterized in that, The message tracking system also includes: a tracking output unit in the ARM tracking circuit; The message sending circuit is connected to the input terminal of the tracking output unit via the ATB, and the output terminal of the tracking output unit is connected to an external device.
13. A chip, characterized in that, This includes customized circuitry, and the message tracking system as described in claim 11 or 12.
14. The chip according to claim 13, characterized in that, The customized circuit includes a general-purpose timer module (GTM).