Device and method for analyzing STPv2 debugging data
Through the modularly designed parsing device, including reception, STP parsing and ATB decoding modules, the problem of difficult analysis of STPv2 protocol data flow is solved, and fast and efficient data analysis and information extraction is achieved, adapting to a variety of application scenarios.
Patent Information
- Application Number
- CN202311784509.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-07-01
AI Technical Summary
There is a lack of efficient way to parse STPv2 protocol data streams, especially ATB packets therein, making it difficult to extract meaningful system tracking and debugging information.
The analysis device adopts a modular design, including a receiving module, a STP analysis module and an ATB decoding module, analyzes the STPv2 protocol data through hardware circuits, identifies and extracts relevant information, and formats and outputs it.
It realizes fast and efficient parsing of STPv2 protocol data, can process large amounts of data, has flexible configuration and scalability, and supports the needs of different application scenarios.
Smart Images

Figure CN120238592A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to an apparatus and method for parsing STPv2 debugging data. Background Art
[0002] With the development of modern digital systems, it is necessary to perform detailed analysis and debugging of system performance. To meet this requirement, the Mobile Industry Processor Interface (MIPI) Alliance has developed the System Trace Protocol version 2 (STPv2) protocol for transmitting system trace and debugging information. However, due to the extremely large and complex data stream of the STPv2 protocol, it is necessary to parse it to obtain meaningful information. Currently, there is no good way to parse the data stream of the STPv2 protocol.
[0003] In view of this, overcoming the defects of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention
[0004] The technical problem to be solved by the present invention is: how to efficiently parse the STPv2 protocol and the Advanced Trace Bus (ATB) data packets therein.
[0005] The present invention adopts the following technical solutions:
[0006] In a first aspect, an apparatus for parsing STPv2 debugging data is provided, including: a receiving module, a parsing module, and an output module;
[0007] The receiving module is configured to receive STPv2 protocol data and transmit the STPv2 protocol data to the parsing module;
[0008] The parsing module is configured to parse the STPv2 protocol data and the ATB data packets therein, and obtain a parsing result;
[0009] The output module is configured to format and output the parsing result for further analysis and processing.
[0010] Preferably, the receiving module is configured to receive a slave interface valid signal from a peer device, and send a slave interface ready signal to the peer device based on the slave interface valid signal; wherein, after receiving the slave interface ready signal, the peer device sends a slave interface STP data signal and a slave interface end signal to the receiving module;
[0011] The receiving module is used to receive the slave interface STP data signal;
[0012] The receiving module is further used to receive the slave interface end signal, so as to determine that the last beat of data has been received through the slave interface end signal, and transmit the slave interface STP data signal to the parsing module for parsing.
[0013] Preferably, the parsing module includes an STP parsing module;
[0014] The STP parsing module is used to receive the STP_bypass signal, wherein the STP_bypass signal is used to indicate whether the STP parsing module needs to perform corresponding parsing processing;
[0015] When parsing processing is required, the STP parsing module is used to parse the data stream in the STPv2 protocol data to obtain a first parsing result, and send the first parsing result to a subsequent parsing module or an output module;
[0016] When parsing processing is not required, the STP parsing module directly sends the STPv2 protocol data to a subsequent parsing module.
[0017] Preferably, the parsing module further includes an ATB decoding module;
[0018] The ATB decoding module is used to receive the ATB_bypass signal, wherein the ATB_bypass signal is used to indicate whether the ATB decoding module needs to perform corresponding parsing processing;
[0019] When parsing processing is required, the ATB decoding module is used to extract relevant information from the ATB data packet to obtain a second parsing result; and send the second parsing result to the output module.
[0020] Preferably, the output module is used to receive the first parsing result or the second parsing result, format and output the first parsing result or the second parsing result for further analysis and processing.
[0021] In a second aspect, a method for parsing STPv2 debug data is provided, including:
[0022] The receiving module receives the STPv2 protocol data and transmits the STPv2 protocol data to the parsing module;
[0023] The parsing module parses the STPv2 protocol data and the ATB data packet therein, and obtains a parsing result;
[0024] The output module formats and outputs the parsing result for further analysis and processing.
[0025] Preferably, the parsing module includes an STP parsing module and an ATB decoding module. The parsing module parses the STPv2 protocol data and the ATB data packets therein, and the obtained parsing results include:
[0026] When the received STP_bypass signal is valid, the STP parsing module parses the data stream in the STPv2 protocol data to obtain a first parsing result;
[0027] When the received ATB_bypass signal is valid, the ATB decoding module extracts relevant information in the ATB data packet from the first parsing result to obtain a second parsing result.
[0028] Preferably, the STP parsing module parses the data stream in the STPv2 protocol data to obtain a first parsing result, including:
[0029] The STP parsing module receives the STPv2 protocol data;
[0030] The STP parsing module identifies the execution instruction in the STPv2 protocol data through a preset number of bits of the highest bit, and then performs subsequent parsing processes according to the execution instruction to obtain the corresponding first parsing result.
[0031] Preferably, the STP parsing module identifies the execution instruction in the STPv2 protocol data through a preset number of bits of the highest bit, and then performs subsequent parsing processes according to the execution instruction to obtain the corresponding first parsing result. Specifically:
[0032] When the execution instruction indicates valid and has a timestamp, 4 bits after the first ATB cell are used as TimeStamp_size, and subsequent multiple half-bytes are used as timestamps according to TimeStamp_size. After all ATB cells are extracted, all ATB cells are used as the first parsing result, and the first parsing result is sent to the ATB decoding module;
[0033] When the execution instruction indicates valid and does not have a timestamp, all ATB cells are directly extracted, all ATB cells are used as the first parsing result, and the first parsing result is sent to the ATB decoding module;
[0034] When the execution instruction indicates a fault, the ATB cell is discarded, and data is directly sent to the output module.
[0035] Preferably, the ATB decoding module extracts relevant information from the ATB data packet to obtain a second parsing result, including:
[0036] The ATB decoding module divides the data transmitted from the STP parsing module through the highest bit of each ATB cell into multiple packets, and each packet includes multiple ATB cells;
[0037] Each ATB cell is divided into m blocks, the bit width of each block is nbits, and the highest bit is the valid bit of the block;
[0038] By extracting the data in each block, the second parsing result is obtained. The second parsing result includes the flow direction of the transaction within the bus, the operation of the transaction, and the length of the data, and the second parsing result is sent to the output module.
[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0040] The present invention receives STPv2 protocol data through a receiving module and transmits the STPv2 protocol data to the parsing module; the parsing module parses the STPv2 protocol data and the ATB data packet therein and obtains a parsing result; the output module formats and outputs the parsing result for further analysis and processing. By parsing the STPv2 protocol data and the ATB data packet therein through the parsing module and implementing the parsing with a hardware circuit, the parsing speed is faster and the efficiency is higher, and a large amount of STPv2 protocol data and ATB data packets can be processed. At the same time, due to the modular design, the present invention can be flexibly configured and adjusted according to application scenarios and requirements, increasing the scalability and customization of the system. Description of the Drawings
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 It is a schematic structural diagram of a device for parsing STPv2 debug data provided by an embodiment of the present invention;
[0043] Figure 2 It is a specific schematic structural diagram of a device for parsing STPv2 debug data provided by an embodiment of the present invention;
[0044] Figure 3 It is a schematic flowchart of a method for parsing STPv2 debug data provided by an embodiment of the present invention;
[0045] Figure 4 It is a schematic parsing flowchart of a parsing module of a method for parsing STPv2 debug data provided by an embodiment of the present invention;
[0046] Figure 5 It is a schematic parsing diagram of an STP parsing module of a method for parsing STPv2 debug data provided by an embodiment of the present invention;
[0047] Figure 6 It is a schematic parsing diagram of an ATB decoding module of a method for parsing STPv2 debug data provided by an embodiment of the present invention;
[0048] Figure 7 It is a schematic flowchart of a method for parsing STPv2 debug data provided by an embodiment of the present invention. Detailed implementation manners
[0049] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0050] In the present invention, terms such as "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality of" is two or more.
[0051] In the present invention, unless otherwise clearly defined and limited, the term "connection" should be understood in a broad sense. For example, "connection" may be a fixed connection, a detachable connection, or integrated; it may be directly connected or indirectly connected through an intermediate medium.
[0052] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0053] STPv2 is a protocol defined by the MIPI Alliance for transmitting system trace and debug information. The STPv2 protocol aims to meet the requirements of modern digital systems for detailed performance analysis and debugging. The main features of the STPv2 protocol include:
[0054] Information Transmission: The STPv2 protocol is used to transmit system trace information between mobile devices and processors. This information includes executed instructions, system events, performance data, etc., which helps developers gain in-depth understanding of the system's operating conditions. Complexity: Due to the complexity of modern digital systems, the STP protocol supports the transmission of large volumes of large and complex data streams, providing comprehensive debugging and analysis capabilities. MIPI Standard: STP is one of the standards developed by the MIPI Alliance, which is dedicated to defining interface standards for mobile devices, covering various aspects such as processors, cameras, displays, etc. Tool Support: Parsing the data stream of the STP protocol usually requires specialized hardware and software tools. The MIPI Alliance may provide information about these tools, which developers can use to analyze and debug the system. Currently, there is no good way to efficiently parse the data of the STPv2 protocol.
[0055] To solve the above problems, an embodiment of the present invention provides a device for parsing STPv2 debug data, as Figure 1 shown, including: a receiving module, a parsing module, and an output module. Among them, the receiving module is used to receive STPv2 protocol data and transmit the STPv2 protocol data to the parsing module; the parsing module is used to parse the STPv2 protocol data and the ATB data packets therein, and obtain a parsing result; the output module is used to format and output the parsing result for further analysis and processing.
[0056] In some embodiments, the device for parsing STPv2 debug data is mainly used to parse STPv2 debug data and convert it into meaningful parsing results for further analysis and processing. Specifically:
[0057] Receiving Module: Used to receive STPv2 protocol data. The STPv2 protocol data can come from a peer device, including an upper-level system or a processor, and it contains data related to system trace and debugging information. The receiving module is responsible for extracting the STPv2 protocol data from the data stream and transmitting it to the parsing module for parsing and processing.
[0058] Parsing Module: Used to parse STPv2 protocol data. The parsing module needs to be able to identify various data packets and ATB data packets in the STPv2 protocol and convert them into meaningful parsing results. The parsing results can include information such as instructions, system events, performance data, etc., to support further analysis and debugging.
[0059] Output Module: Used to format and output the parsing result. The output module can display the parsing result in the form of graphs, reports, or other formats for more in-depth analysis and processing. The output module can also be integrated with other tools and systems to support more comprehensive analysis and debugging.
[0060] In this embodiment, a parsing module is used to parse the STPv2 protocol data and the ATB data packets therein. In this embodiment, the above modules can be designed using hardware circuits, so that the parsing speed is faster and the efficiency is higher, and a large amount of STPv2 protocol data and ATB data packets can be processed. At the same time, due to the modular design, this embodiment can also be flexibly configured and adjusted according to application scenarios and requirements, increasing the scalability and customization of the system.
[0061] The relationship between each module and the modules will be described below.
[0062] In some embodiments, as Figure 2 shown, the receiving module is used to receive the slave interface valid signal from the peer device, and send a slave interface ready signal to the peer device based on the slave interface valid signal; wherein, after receiving the slave interface ready signal, the peer device sends a slave interface STP data signal and a slave interface end signal to the receiving module; the receiving module is used to receive the slave interface STP data signal; the receiving module is also used to receive the slave interface end signal to determine that the last beat of data has been received through the slave interface end signal, so as to transmit the slave interface STP data signal to the parsing module for parsing.
[0063] Among them, the slave interface valid signal, the slave interface STP data signal, and the slave interface end signal come from the peer device.
[0064] The receiving module is used to communicate with the peer device based on the Valid-Ready handshake protocol. Specifically: the slave interface valid signal and the slave interface ready signal are used to control the start and end of data transmission. The slave interface valid signal indicates that the data is valid, and the slave interface ready signal indicates that the receiving end is ready to receive data. When the slave interface ready signal is at a high level and the slave interface valid signal is at a high level, it indicates that the receiving module is ready to receive STPv2 protocol data.
[0065] The slave interface STP data signal contains STPv2 protocol data and is used to be transmitted to the parsing module for parsing. This signal can contain information such as execution instructions, system events, and performance data.
[0066] The slave interface end signal is used to indicate whether the transmitted data is the last beat. In multi-beat data transmission, the state of the slave interface end signal is used to represent whether each beat of data is the last beat, so that the receiving module can correctly receive the entire data stream.
[0067] For example, in the debug system of an SoC, the data stream is generally exported in the form of ATB data packets. However, since the ATB data packets do not contain timestamp information, some systems encapsulate the ATB data packets and timestamps into data packets of the STPv2 protocol before exporting. In some embodiments, the parsing module is split into two modules, namely the STP parsing module and the ATB decoding module. When parsing data packets, the STP parsing module and / or the ATB decoding module can be selectively used to parse the data packets according to whether the debug data packets exported by the system carry timestamp information (i.e., whether the data packet format is STPv2 or ATB). It has configurability and can be flexibly adjusted according to scenario requirements. The STPv2 parsing module parses the ATB data packet and timestamp from the STPv2 protocol data. The ATB parsing module further parses the ATB data packet. Next, the STP parsing module, the ATB decoding module, and how to control the corresponding parsing modules according to the STPv2 protocol data of the peer device will be further described. In some embodiments, referring to Figure 2 , the parsing module includes an STP parsing module; the STP parsing module is used to receive an STP_bypass signal, where the STP_bypass signal is used to indicate whether the STP parsing module needs to perform corresponding parsing processing; when parsing processing is required, the STP parsing module is used to parse the data stream in the STPv2 protocol data to obtain a first parsing result and send the first parsing result to a subsequent parsing module or an output module; when parsing processing is not required, the STP parsing module directly sends the STPv2 protocol data to a subsequent parsing module.
[0068] The STP parsing module is used to parse the data stream in the STPv2 protocol data to obtain a first parsing result; the STP parsing module will also selectively enable the STP parsing module according to the STP_bypass signal, where the STP_bypass signal is a static signal and should not be switched during transaction processing. According to system requirements, the STP_bypass signal can be sourced from a system register or connected to a fixed value. In some embodiments, when the level of the STP_bypass signal is high, the STP parsing module does not perform parsing processing; when the level of the STP_bypass signal is low, the STP parsing module performs parsing processing. The STP_bypass signal is used to indicate whether the STP parsing module should perform corresponding parsing processing. In some other embodiments, the level of the STP_bypass signal can also be controlled by whether the STPv2 protocol data carries a timestamp. For example, when the STPv2 protocol data received from the peer end carries a timestamp, the level of the STP_bypass signal is high, and the STP_bypass signal will enable the STP parsing module; when the STPv2 protocol data received from the peer end does not carry a timestamp, the level of the STP_bypass signal is low, and the STP_bypass signal will not enable the STP parsing module. The STP_bypass signal is a mode control signal for the STP parsing module, and the STP_bypass signal is a static signal and does not change with time. For example, when the STP_bypass signal is at a high level, it can indicate that the parsing module does not perform parsing processing and directly passes the STPv2 protocol data to the next-level parsing module.
[0069] Among them, the main task of the STP parsing module is to parse the STPv2 protocol data, that is, to analyze and process the STPv2 protocol data to extract useful information. This may involve identifying different data packets in the STPv2 protocol, parsing its structure, and converting it into an understandable format. The specific parsing process of the STP parsing module will be described below.
[0070] In some embodiments, referring to Figure 2 , the parsing module further includes an ATB decoding module; the ATB decoding module is used to receive the ATB_bypass signal, where the ATB_bypass signal is used to indicate whether the ATB decoding module should perform corresponding parsing processing; when parsing processing is required, the ATB decoding module is used to extract relevant information from the ATB data packet to obtain a second parsing result; and send the second parsing result to the output module.
[0071] Data can be transmitted between the ATB decoding module and the STP parsing module through a handshake protocol.
[0072] Among them, the mode control signal of the ATB decoding module is the ATB_bypass signal. The ATB_bypass signal is a static signal and should not be switched during transaction processing. According to system requirements, this signal can be sourced from a system register or connected to a fixed value. In some embodiments, the level of the ATB_bypass signal can be controlled by whether the STPv2 protocol data carries a timestamp. When the received STPv2 protocol data from the peer does not carry a timestamp, the level of the STP_bypass signal is high, disabling the STP parsing module, and directly sending the ATB data packet in the STPv2 protocol data to the ATB decoding module. At this time, control the ATB_bypass signal to enable the ATB decoding module, and the ATB decoding module parses the ATB data packet accordingly; for example, when the level of the ATB_bypass signal is high, the ATB decoding module does not perform parsing processing and directly transmits the data parsed by the STP parsing module to the output module; when the ATB_bypass signal is at a high level, it may indicate that the parsing module bypasses the parsing of ATB data and directly passes it to the output module; when the level of the ATB_bypass signal is low, the ATB decoding module performs parsing processing to obtain a second parsing result. The second parsing result includes specific information extracted from the ATB data packet, such as events, addresses, data lengths, etc., providing more detailed data for further analysis and debugging.
[0073] The main task of the ATB decoding module is to parse the ATB data packet parsed by the STP parsing module, that is, to extract relevant information from the ATB data stream. ATB is usually used to transmit advanced trace information, such as program counters, register values, etc. The ATB decoding module may identify different types of ATB data packets and extract the valid information therein. The specific decoding process of the ATB decoding module will be described below.
[0074] In some embodiments, referring to Figure 2 , the output module is used to receive the first parsing result or the second parsing result, format and output the first parsing result or the second parsing result for further analysis and processing.
[0075] Communication can also be carried out between the output module and the parsing module, as well as between the output module and an external device, through the Valid-Ready handshake protocol. The valid signal and the ready signal of the main interface on the output module are used to control whether the output module outputs data. When the valid signal of the main interface is at a high level and the ready signal of the main interface is at a high level, it indicates that the output module is ready to output the parsing result. This mechanism helps to coordinate the data transmission between the parsing module and the output module, as well as between the output module and the external device.
[0076] The timestamp size signal is used to indicate the width of the valid timestamp bits. Timestamps are usually used to record the time when an event occurs, and the timestamp size signal specifies the width of the valid timestamp bits to ensure that the correct time information is extracted and parsed. The timestamp signal contains time information about the parsing result, which is used to analyze the order and interval of event occurrences in terms of debugging and performance analysis. The fault signal is used to indicate whether an error occurs during the parsing process. When the fault signal is at a high level, it may indicate that an error has occurred in the parsing module while processing the data, and further inspection and processing are required. The packet header signal can contain the header information of the parsed data packet. This information may help to identify and understand the type and content of the parsing result. Through these signals, the output module can output the parsing result in a formatted form, facilitating subsequent analysis and processing.
[0077] In the foregoing embodiment, an apparatus for parsing STPv2 debugging data is provided. In this embodiment, a method for parsing STPv2 debugging data will be proposed to further illustrate the apparatus for parsing STPv2 debugging data, as Figure 3 shown, the method includes:
[0078] Step 101: The receiving module receives the STPv2 protocol data and transmits the STPv2 protocol data to the parsing module.
[0079] The receiving module needs to conform to specific interface standards for data exchange with external systems or devices. It can include physical interface standards or protocol standards (such as the STPv2 protocol). The receiving module needs to parse and process these standards to correctly receive and interpret the external data stream (in this embodiment, the external data stream is the STPv2 protocol data). To ensure the stable reception and transmission of data, the receiving module can also include a data buffer. The buffer can store the received data and transmit the data to the parsing module at an appropriate time. This helps to handle situations where the data transmission rate is inconsistent or the amount of burst data is large.
[0080] The receiving module can also perform timing control on the processed data to ensure that the data can be transmitted to the parsing module in the correct timing. This involves processing aspects such as the synchronization of clock signals, the alignment of data, and the maintenance of timing stability. To ensure the accuracy of the received data, the receiving module may perform data verification, such as CRC verification, etc., to ensure that the received data is not damaged or incorrect. Error detection and handling logic can also be set in the receiving module to handle possible data transmission errors or abnormal situations. The specific structural composition of the receiving module will not be elaborated here.
[0081] Step 102: The parsing module parses the STPv2 protocol data and the ATB data packets therein, and obtains a parsing result.
[0082] Among them, the parsing module includes an STP parsing module and an ATB decoding module.
[0083] The parsing processes of the STP parsing module and the ATB decoding module are as Figure 4 shown.
[0084] Step 1021: When the received STP_bypass signal is valid, the STP parsing module parses the data stream in the STPv2 protocol data to obtain a first parsing result.
[0085] The STP parsing module receives the STPv2 protocol data; the STP parsing module identifies the execution instruction in the STPv2 protocol data through the preset number of bits of the highest bit, and then performs subsequent parsing processes according to the execution instruction to obtain the corresponding first parsing result.
[0086] Among them, the preset number of bits can be 4bit, that is, the data bit width input to the STP parsing module takes 4bit as the minimum unit. The STP parsing module only recognizes synchronization packets, 64-bit data packets with timestamps, 64-bit data packets without timestamps, fault packets, and empty packets. Among them:
[0087] 1. Synchronization packet:
[0088] The system will output a synchronization packet at the beginning, with the format of FFFFFFFFFFFFFFFFFFFFF0F003000000. This synchronization packet is used to prompt the external receiver when to start receiving data and how to process the subsequent data. In this module, after recognizing this data packet, it enters the preparation state and does not store and forward the information carried.
[0089] 2. 64-bit data packet with timestamp:
[0090] If 4'b1011 is recognized in the preparation state, it means that the subsequent 64-bit data is valid and has a timestamp. Store the subsequent 64 bits of data in this cycle and output it to the ATB parsing module together with the subsequent timestamp information. The subsequent 4-bit data after the 64 bits is the size of the timestamp (TimeStamp_size). Based on its value, obtain how many subsequent cycles are timestamp data, so as to obtain the value of the timestamp. After obtaining the complete timestamp information, send the 64-bit data obtained in the previous step to the ATB parsing module, and at the same time send the timestamp information to the output module. Then return to the preparation state and wait to process new data.
[0091] 3. 64-bit data packet without timestamp:
[0092] If 4'b0111 is received in the preparation state, directly store the subsequent 64 bits as a 64-bit data packet and output it to the ATB parsing module, and then return to the preparation state.
[0093] 4. Fault packet:
[0094] If 4'b0010 is received in the preparation state, it means that a Master fault has occurred, such as an overflow during noc bus trace. At this time, send the subsequent 8 bits of data to the ATB parsing module. And send the error indication signal to the output module.
[0095] 5. Empty packet:
[0096] If 4'b0000 is received, it represents an empty packet and no processing is performed. The system does not support other format data packets of the STPv2 protocol. If received, they are all regarded as empty packets.
[0097] As Figure 5 shown, when the execution instruction indicates being valid and having a timestamp, then the 4 bits after the first ATB cell are used as TimeStamp_size, and based on TimeStamp_size, the subsequent multiple half-bytes are used as the timestamp. After extracting all ATB cells, take all ATB cells as the first parsing result and send the first parsing result to the ATB decoding module; when the execution instruction indicates being valid and without a timestamp, directly extract all ATB cells, take all ATB cells as the first parsing result, and send the first parsing result to the ATB decoding module; when the execution instruction indicates a fault, discard the ATB cell and directly send data to the output module.
[0098] The STP parsing module uses the highest 4 bits of the data for identification. These 4 bits are used to determine the type of execution instruction contained in the received data. According to the STPv2 protocol, an execution instruction is set at a specific position in the STPv2 protocol data, and the execution instruction is parsed according to the protocol.
[0099] If the execution instruction indicates that the data is valid and contains a timestamp, the STP parsing module will identify the size of the timestamp (i.e., indicated by the 4 bits after the first ATB cell). This size tells the module how many half - bytes the timestamp occupies. The STP parsing module extracts the timestamp accordingly and, after completing the extraction of all ATB cells, transfers the data to the ATB decoding module.
[0100] If the execution instruction indicates that the data is valid but does not contain a timestamp, then the module directly extracts the ATB cells and sends them to the ATB decoding module. If the execution instruction indicates that there is a fault in the data, then the corresponding ATB cells are discarded and the data is directly sent to the output module. The parsing process of the STP parsing module shows that the system can flexibly process data according to the attributes of the received data (such as whether it contains a timestamp, whether there is a fault, etc.). This mechanism may be used to ensure the correct parsing and efficient processing of data, especially in application scenarios with large data traffic or complex data formats.
[0101] Step 1022: When the received ATB_bypass signal is valid, the ATB decoding module extracts relevant information from the ATB data packet in the first parsing result to obtain a second parsing result.
[0102] The ATB decoding module decodes the ATB data packets sent by the STP parsing module. It receives 64-bit data per clock cycle, which is called an ATB cell. Based on the specific format of the system-exported data, the highest bit of each ATB cell is used to determine the boundary of the data packet, marking which ATB cells jointly constitute a data packet (packet). Being 0 means the current ATB cell is not the last cell of the data packet; being 1 means the current ATB cell is the last cell of the data packet. Each ATB cell is further decomposed into 7 parts, namely blocks. Each block contains 9 bits. The highest bit (the 9th bit) of each block is the valid bit. The first two bits of the first block are the type of the packet, 0: trace data packet; 1: statistical data packet; 2, 3: reserved. The subsequent 6 bits are the probeid, indicating which probe in the system sent the data, corresponding to a certain position in the bus (a certain node on a certain path, etc.). The subsequent blocks are the packet headers. 1. For the statistical data packet, the packet header is fixed 2-bit data, indicating how many subsequent blocks are the values of the actual statistical counters to be transmitted. The statistical counters can be the number of busy cycles inside the bus, etc. 2. For the trace data packet, the packet header is the packet header of the internal bus transaction, including the flow direction of the transaction inside the bus, the operation of the transaction, and the length of the data, etc. The size of each of its fields is fixed after being determined by the hardware.
[0103] Among them, as Figure 6 shown, the ATB decoding module divides the data transmitted from the STP parsing module into multiple packets through the highest bit of each ATB cell. Each packet includes multiple ATB cells; divides each ATB cell into m blocks, each block has a bit width of n bits, and the highest bit is the valid bit of the block; extracts the data in each block to obtain the second parsing result, the second parsing result includes the flow direction of the transaction inside the bus, the operation of the transaction, and the length of the data, and sends the second parsing result to the output module.
[0104] Among them, the values of m and n are related to the data bit width of the ATB cell. In this embodiment, the data bit width is 64 bits, the value of m is 7, and the value of n is 9. The ATB decoding module will first check the highest bit of each ATB cell. This bit is used to determine the boundary of the data packet, that is, it marks which ATB cells together constitute a data packet (packet). Based on the specific attributes of the data or the requirements of the transmission protocol, each data packet is set to contain multiple ATB cells. Each ATB cell is further decomposed into 7 parts, namely blocks. Each block contains 9 bits. The highest bit (the 9th bit) of each block is the valid bit. This bit indicates whether the block contains valid data. This is a common data marking method for quickly identifying relevant parts of the data.
[0105] Then, the ATB decoding module extracts the data within each block. It may involve decoding or parsing the 8-bit data of each block. The parsing process includes converting the data into a recognizable format or extracting specific information such as operation instructions, data length, etc. The results of the parsing include some key information such as the flow direction of the transaction within the bus, the operation type of the transaction, and the length of the data. Among them, the specific decoding process is not described in detail in this embodiment. The parsed data will be sent to the output module. The output module is responsible for further data processing, storage, or forwarding.
[0106] In step 102, as Figure 7 shown, first the receiving module receives the STPv2 protocol data. After receiving it, the STPv2 protocol data is sent to the STP parsing module. The STP parsing module parses out the corresponding ATB data packet and execution instruction, and judges whether the STP parsing module performs data parsing. When the STP_bypass signal on the STP parsing module is enabled according to actual requirements to enable the STP parsing module, the STP parsing module starts parsing according to the execution instruction; when the STP_bypass signal on the STP parsing module is not enabled according to actual requirements to disable the STP parsing module, the STP parsing module sends the corresponding ATB data packet to the ATB decoding module.
[0107] When controlling the level of the ATB_bypass signal according to whether the STPv2 protocol data transmitted from the peer device includes a timestamp, when the ATB_bypass signal enables the ATB decoding module, the ATB decoding module parses the ATB data packet and sends the second parsing result obtained after parsing to the output module. When the ATB_bypass signal does not enable the ATB decoding module, the ATB decoding module does not parse the ATB data packet and directly sends the first parsing result obtained after parsing by the STP parsing module to the output module.
[0108] Step 103: The output module formats and outputs the parsing result for further analysis and processing.
[0109] The output module formats and outputs the first parsing result or the second parsing result accordingly. The output module can display the parsing result in the form of a graph, a report, or other formats for more in-depth analysis and processing. The output module can also be integrated with other tools and systems to support more comprehensive analysis and debugging.
[0110] For the specific structure of the device for parsing STPv2 debugging data, refer to the foregoing embodiments and will not be elaborated herein.
[0111] In the foregoing embodiments, a device for parsing STPv2 debugging data is provided. In this embodiment, an example will be presented for further illustration.
[0112] The Network On Chip (NOC) bus is a complex system. Enabling the observation function of the NOC module can be used to send the internal information of the bus to the bus interface during the operation of the chip. This information is transmitted to other modules or outside the chip in the format of ATB data packets. If the acquired information needs to carry a timestamp, it is in the STPv2 format. The device for parsing STPv2 debugging data proposed in the foregoing embodiments can be implemented as follows:
[0113] According to requirements, by controlling the STP_bypass signal on the STP parsing module and the ATB_bypass signal on the ATB decoding module, one or both of the modules are selected to be enabled, and a large number of NOC bus data packets are parsed in real time and efficiently, including counting the number of idle or busy state cycles of a certain node, counting the average transmission delay, and exporting internal transactions in real time, and sending them to the lower-level module or software, so as to adjust the bus configuration to improve the bus efficiency or perform system debugging to detect faults, etc.
[0114] Among them, a process taking improving the bus efficiency as an example is as follows:
[0115] 1. Configure the NOC bus to enable the observation function.
[0116] By configuring the NOC bus to enable the data observation function, activate the monitoring points or logging functions on the bus to capture and record the data transmitted through the bus.
[0117] 2. According to the data packet format of the NOC bus, configure the decoding modes of the STP parsing module and the ATB decoding module in the foregoing embodiments to match.
[0118] According to the data packet format of the NOC bus, the decoding modes of the STP parsing module and the ATB decoding module need to be configured accordingly to ensure that they can correctly parse the data received from the NOC bus, and it is necessary to ensure that the decoding logics of the STP parsing module and the ATB decoding module match the data packet format of the NOC bus.
[0119] 3. During the operation of the chip, the device for parsing STPv2 debug data parses the NOC bus data in real time. During the operation of the chip, the device for parsing STPv2 debug data will monitor and parse the data transmitted through the NOC bus in real time, and the system can immediately capture and process all data packets transmitted through the bus.
[0120] 4. When it is analyzed that a certain node is too busy, report an interrupt.
[0121] When the system analyzes that a certain node is too busy or has too high a load, it will trigger and report an interrupt, which is achieved by monitoring data traffic, transaction frequency or other performance indicators. The purpose of reporting the interrupt is to remind the system administrator or the automatic control system that it is necessary to take actions to relieve the load of the node.
[0122] 5. Software configures the NOC to adjust the priorities of each initiator transaction.
[0123] By software configuration to adjust the transaction priorities of different initiators on the NOC bus, the system can dynamically adjust the processing order of data packets according to requirements or the current network status, optimizing network traffic and performance.
[0124] The implementation of this process is crucial for ensuring the efficient and stable operation of the NOC bus. Through real-time monitoring and flexible adjustment, data traffic can be effectively managed, network congestion can be prevented, the efficiency of the NOC bus is improved, and at the same time, the priorities of critical tasks and data transmissions are properly handled. This is particularly important in complex chip designs and high-performance computing environments.
[0125] It can be understood that for the specific structure of the device for parsing STPv2 debug data, refer to the foregoing description, and details are not repeated here.
[0126] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. An apparatus for parsing STPv2 debug data, characterized in that It includes: a receiving module, a parsing module, and an output module, where: the receiving module is used to receive STPv2 protocol data and transmit the STPv2 protocol data to the parsing module; the parsing module is used to parse the STPv2 protocol data and the ATB data packets therein and obtain a parsing result; the output module is used to format and output the parsing result for further analysis and processing.
2. The device for parsing STPv2 debugging data according to claim 1, wherein The receiving module is further used to receive a slave interface valid signal from a peer device and send a slave interface ready signal to the peer device based on the slave interface valid signal; wherein, after receiving the slave interface ready signal, the peer device sends a slave interface STP data signal and a slave interface end signal to the receiving module; the receiving module is further used to receive the slave interface STP data signal; the receiving module is further used to receive the slave interface end signal to determine that the last beat of data has been received through the slave interface end signal, so as to transmit the slave interface STP data signal to the parsing module for parsing.
3. The apparatus for parsing STPv2 debugging data according to claim 1, wherein The parsing module includes an STP parsing module; the STP parsing module is used to receive an STP_bypass signal, where the STP_bypass signal is used to indicate whether the STP parsing module needs to perform corresponding parsing processing; when parsing processing is required, the STP parsing module is used to parse the data stream in the STPv2 protocol data to obtain a first parsing result and send the first parsing result to a subsequent parsing module or the output module; when parsing processing is not required, the STP parsing module directly sends the STPv2 protocol data to a subsequent parsing module.
4. The apparatus for parsing STPv2 debugging data according to claim 3, wherein The parsing module further includes an ATB decoding module; the ATB decoding module is used to receive an ATB_bypass signal, where the ATB_bypass signal is used to indicate whether the ATB decoding module needs to perform corresponding parsing processing; when parsing processing is required, the ATB decoding module is used to extract relevant information from the ATB data packet to obtain a second parsing result; and send the second parsing result to the output module.
5. The apparatus for parsing STPv2 debugging data according to claim 4, wherein The output module is further used to receive the first parsing result or the second parsing result, and format and output the first parsing result or the second parsing result for further analysis and processing.
6. A method for parsing STPv2 debugging data, characterized in that, The method is used to implement the device for parsing STPv2 debugging data as described in any one of claims 1 to 5, and includes: the receiving module receives the STPv2 protocol data and transmits the STPv2 protocol data to the parsing module; the parsing module parses the STPv2 protocol data and the ATB data packets therein and obtains a parsing result; the output module formats and outputs the parsing result for further analysis and processing.
7. The method for parsing STPv2 debugging data according to claim 6, wherein The parsing module includes an STP parsing module and an ATB decoding module, and the parsing module parses the STPv2 protocol data and the ATB data packets therein and obtains a parsing result, including: When the received STP_bypass signal is valid, the STP parsing module parses the data stream in the STPv2 protocol data to obtain a first parsing result; When the received ATB_bypass signal is valid, the ATB decoding module extracts relevant information in the ATB data packet from the first parsing result to obtain a second parsing result.
8. The method for parsing STPv2 debugging data according to claim 7, wherein The STP parsing module parses the data stream in the STPv2 protocol data to obtain a first parsing result, including: The STP parsing module receives the STPv2 protocol data; The STP parsing module identifies the execution instruction in the STPv2 protocol data through data of a preset number of bits at the highest bit, and then performs subsequent parsing processes according to the execution instruction to obtain a corresponding first parsing result.
9. The method for parsing STPv2 debugging data according to claim 8, wherein The STP parsing module identifies the execution instruction in the STPv2 protocol data through data of a preset number of bits at the highest bit, and then performs subsequent parsing processes according to the execution instruction to obtain a corresponding first parsing result, including: When the execution instruction indicates valid and has a timestamp, 4 bits after the first ATB cell are used as TimeStamp_size, and subsequent multiple half-bytes are used as timestamps according to TimeStamp_size. After all ATB cells are extracted, all ATB cells are used as the first parsing result, and the first parsing result is sent to the ATB decoding module; When the execution instruction indicates valid and has no timestamp, all ATB cells are directly extracted, all ATB cells are used as the first parsing result, and the first parsing result is sent to the ATB decoding module; When the execution instruction indicates a fault, the ATB cell is discarded, and data is directly delivered to the output module.
10. The method for parsing STPv2 debugging data according to claim 7, wherein The ATB decoding module extracts relevant information in the ATB data packet from the first parsing result to obtain a second parsing result, including: The ATB decoding module divides the data transmitted from the STP parsing module into multiple packets through the highest bit of each ATB cell, and each packet includes multiple ATB cells; Each ATB cell is divided into m blocks, the bit width of each block is nbits, and the highest bit is the valid bit of the block; By extracting the data in each block, the second parsing result is obtained. The second parsing result includes the flow direction of the in-bus transaction, the operation of the transaction, and the length of the data, and the second parsing result is sent to the output module.