WO2017084523A1 - Method and device for system on chip bus activity detection and computer storage medium - Google Patents

Method and device for system on chip bus activity detection and computer storage medium Download PDF

Info

Publication number
WO2017084523A1
WO2017084523A1 PCT/CN2016/105176 CN2016105176W WO2017084523A1 WO 2017084523 A1 WO2017084523 A1 WO 2017084523A1 CN 2016105176 W CN2016105176 W CN 2016105176W WO 2017084523 A1 WO2017084523 A1 WO 2017084523A1
Authority
WO
WIPO (PCT)
Prior art keywords
bus
data
signal
channel
axi
Prior art date
Application number
PCT/CN2016/105176
Other languages
French (fr)
Chinese (zh)
Inventor
段延亮
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2017084523A1 publication Critical patent/WO2017084523A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults

Definitions

  • the present invention relates to the field of System on Chip (SoC), and in particular, to a SoC bus behavior detection method, apparatus, and computer storage medium.
  • SoC System on Chip
  • the current SoC chip runs faster and faster, and its processor's main frequency has reached 2GHz or above. Therefore, the test machine cannot capture the instantaneous signal, and it is even more impossible to penetrate the chip to capture the bus signal. This requires a monitoring module. Embedded in the chip to capture bus signals in real time.
  • existing monitoring modules such as the SonicsMT and FlexNoC monitoring modules can only capture certain signals of the Advanced EXtensible Interface (AXI) bus. Specifically, the existing monitoring module can only The AXI bus address and commands are fetched, and the AXI bus data cannot be captured. In short, the existing monitoring module has a single function, which cannot meet the diversified requirements for debugging the SoC chip.
  • AXI Advanced EXtensible Interface
  • embodiments of the present invention are expected to provide a SoC bus behavior detecting method, apparatus, and computer storage medium.
  • the embodiment of the invention provides a SoC bus behavior detection method, including:
  • the SoC bus signal including an AXI bus signal
  • the captured AXI bus channel data includes at least one of the following data:
  • the AXI bus write data channel The transmitted data, the data transmitted by the AXI bus read data channel;
  • the bus transmission parameters of each statistics include: the average delay of the bus transmission or the average bandwidth occupied by the corresponding statistical time.
  • the capturing the AXI bus channel data includes: the signal transmitted by the write address channel (AW) in the AXI bus signal satisfies the preset first trigger condition, or the read address channel in the AXI bus signal.
  • the signal transmitted by (Read address channel, AR) satisfies the preset second trigger condition, the AXI bus channel data is captured.
  • the captured AXI bus channel data is data of each channel in which the enable signal of the AXI bus signal is valid.
  • the method further includes: setting a register, wherein the register is configured to store a statistical result of the bus transmission parameter;
  • the stored statistical result is read by sending an interrupt request.
  • the next statistical window is automatically entered until the statistics function is turned off, so as to implement multiple statistics of the transmission parameters during AXI data transmission.
  • T represents the average delay of the bus transmission corresponding to one statistic
  • Total_delay represents the sum of the time spent by each Burst transmission in the corresponding statistical time
  • n represents the number of Burst transmissions occurring in the corresponding statistical time
  • total_byte represents the sum of the amount of data transmitted by each Burst transmission in the corresponding statistical time
  • total_cycle represents the number of clock cycles experienced by the corresponding statistical time
  • the method further includes: receiving timestamp information corresponding to the AXI bus signal.
  • the SoC bus signal further includes: an AXI Coherency Extensions (ACE) bus signal;
  • ACE AXI Coherency Extensions
  • the method further includes: capturing the ACE bus channel data based on the received ACE bus signal.
  • the capturing the ACE bus channel data comprises: capturing the ACE bus channel data when the signal transmitted by the AC channel of the ACE bus signal satisfies a preset third trigger condition.
  • the captured ACE bus channel data is data of each channel in which the enable signal is valid in the ACE bus signal.
  • the method further includes: capturing timestamp information corresponding to the ACE bus signal.
  • the method further includes:
  • the embodiment of the invention further provides a SoC bus behavior detecting device, comprising: a receiving module and a detecting module; wherein
  • a receiving module configured to receive a SoC bus signal, where the SoC bus signal includes an AXI bus signal;
  • the detecting module is configured to perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing the AXI bus data transmission;
  • the captured AXI bus channel data includes at least one The following data: the data transmitted by the AXI bus write data channel, the data transmitted by the AXI bus read data channel;
  • the bus transmission parameters of each statistics include: the average delay of the bus transmission in the corresponding statistical time or possession Average bandwidth.
  • the detection module is configured to transmit AW channel in the AXI bus signal.
  • the signal satisfies the preset first trigger condition, or the AXI bus channel data is captured when the signal transmitted by the AR channel in the AXI bus signal satisfies the preset second trigger condition.
  • the captured AXI bus channel data is data of each channel in which the enable signal of the AXI bus signal is valid.
  • the detecting module further includes a register configured to store a statistical result of the bus transmission parameter
  • the stored statistical result is read by sending an interrupt request.
  • the next statistical window is automatically entered until the statistics function is turned off, so as to implement multiple statistics of the transmission parameters during AXI data transmission.
  • the receiving module is further configured to receive an ACE bus signal
  • the method further includes: capturing the ACE bus channel data based on the received ACE bus signal.
  • the detecting module is configured to capture the ACE bus channel data when the signal transmitted by the AC channel of the ACE bus signal satisfies a preset third trigger condition.
  • the captured ACE bus channel data is data of each channel in which the enable signal is valid in the ACE bus signal.
  • the detecting module is further configured to:
  • the embodiment of the invention further provides a computer storage medium, the computer storage medium comprising a set of instructions, when executed, causing at least one processor to perform the SoC bus behavior detection method described above.
  • the SoC bus behavior detecting method, apparatus and computer storage medium receive a SoC bus signal, and the SoC bus signal includes an AXI bus signal;
  • the AXI bus signal performs at least one of the following operations: grabbing AXI bus channel data, and performing at least one statistics on bus transmission parameters when performing AXI bus data transmission;
  • the captured AXI bus channel data includes at least one of the following data: the AXI The data transmitted by the bus write data channel and the data transmitted by the AXI bus read data channel;
  • the bus transmission parameters of each statistics include: the average delay of the bus transmission or the average bandwidth occupied by the corresponding statistical time.
  • the embodiment of the present invention supports the capture of AXI bus data and the parameter statistics of AXI bus data, and can meet the diversified requirements of SoC bus debugging.
  • FIG. 1 is a flow chart of a first embodiment of a method for detecting a SoC bus behavior according to the present invention
  • FIG. 2 is a schematic diagram of a process of capturing AXI bus channel data in a first embodiment of a SoC bus behavior detection method according to the present invention
  • FIG. 3 is a timing diagram showing statistics of a primary bus transmission parameter in a first embodiment of a SoC bus behavior detection method according to the present invention
  • FIG. 4 is a schematic diagram of a process of statistical bus transmission parameters in a first embodiment of a SoC bus behavior detection method according to the present invention
  • FIG. 5 is a timing diagram of performing continuous statistics in the first embodiment of the SoC bus behavior detecting method according to the present invention.
  • FIG. 6 is a schematic diagram of a process of capturing ACE bus channel data in a first embodiment of a SoC bus behavior detection method according to the present invention
  • FIG. 7 is a schematic diagram of an application scenario of a second embodiment of a SoC bus behavior detection method according to the present invention.
  • FIG. 8 is a flow chart of bus data capture in a second embodiment of a SoC bus behavior detection method according to the present invention.
  • FIG. 9 is a flowchart of statistics of bus transmission parameters in a second embodiment of the SoC bus behavior detecting method according to the present invention.
  • FIG. 10 is a schematic diagram of a first component structure of a SoC bus behavior detecting apparatus according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of a second component structure of a SoC bus behavior detecting apparatus according to an embodiment of the present invention.
  • a SoC bus signal is received, the SoC bus signal includes an AXI bus signal, and at least one of the following operations is performed based on the received AXI bus signal: grabbing AXI bus channel data, and performing AXI bus data
  • the bus transmission parameters are transmitted at least once; the captured AXI bus channel data includes at least one of the following: data transmitted by the AXI bus write data channel, data transmitted by the AXI bus read data channel;
  • the bus transmission parameters include: the average delay of the bus transmission in the corresponding statistical time or the average bandwidth occupied.
  • FIG. 1 is a flowchart of a first embodiment of a SoC bus behavior detection method according to the present invention. As shown in FIG. 1, the method includes:
  • Step 100 Receive a SoC bus signal, where the SoC bus signal includes an AXI bus signal.
  • the AXI bus signal usually includes signals of at least one of the following channels: an AR channel signal, an AW channel signal, a read data channel (R) signal, a write data channel (W) signal, and a write response channel ( Write response channel, B) signal.
  • timestamp information corresponding to the AXI bus signal can also be received, so that the time of the bus handshake and the time of responding to the handshake can be accurately learned.
  • the timing between the signals of the respective channels of the AXI bus signal can be adjusted before receiving the AXI bus signal, for example, using the basic logical unit slice to the AXI.
  • the timing between the individual channel signals of the bus signal is adjusted.
  • the SoC bus signal can also include AXI Coherency (AXI Coherency).
  • time stamp information corresponding to the ACE bus signal can also be received, so that the time of the bus handshake and the time of responding to the handshake can be accurately learned.
  • the timing between the signals of the respective channels of the ACE bus signal can be adjusted before receiving the ACE bus signal, for example, using the basic logical unit slice to the ACE.
  • the timing between the individual channel signals of the bus signal is adjusted.
  • Step 101 Perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing AXI bus data transmission;
  • the captured AXI bus channel data includes at least one of the following: Data: the data transmitted by the AXI bus write data channel, the data transmitted by the AXI bus read data channel;
  • the bus transmission parameters of each statistics include: the average delay of the bus transmission in the corresponding statistical time or the average occupied bandwidth.
  • the capturing the AXI bus channel data includes: receiving the first data capture signal; and when the first data capture signal is valid, the data of each channel of the received AXI bus is captured, and the first data is captured. When the signal is invalid, the data acquisition process of each channel of the received AXI bus is stopped.
  • the validity of the first data capture signal may be preset, for example, the first data capture signal is a high level signal or a low level signal, and when the first data capture signal is a high level signal, indicating A data capture signal is valid; when the first data capture signal is a low level signal, it indicates that the first data capture signal is invalid.
  • the capturing the AXI bus channel data includes: the signal transmitted by the AW channel in the AXI bus signal satisfies a preset first trigger condition, or the signal transmitted by the AR channel in the AXI bus signal satisfies a preset second trigger. Grab the AXI bus channel data when conditions are met; at AXI total The signal transmitted by the AW channel in the line signal does not satisfy the preset first trigger condition, and the AXI bus channel data is not captured when the signal transmitted by the AR channel in the AXI bus signal does not satisfy the preset second trigger condition.
  • the preset first trigger condition may be set according to at least one of the following elements: an AWID signal transmitted by the AW channel, an AWADDR signal transmitted by the AW channel, an AWLEN signal transmitted by the AW channel, an AWSIZE signal transmitted by the AW channel, and AWBURST transmitted by the AW channel.
  • the preset second trigger condition may be set according to at least one of the following elements: an ARID signal transmitted by the AR channel, an ARADDR signal transmitted by the AR channel, an ARLEN signal transmitted by the AR channel, an ARSIZE signal transmitted by the AR channel, and an ARBURST transmitted by the AR channel. signal.
  • the captured AXI bus channel data is the data of each channel in which the enable signal of the AXI bus signal is valid.
  • the validity of the enable signal corresponding to each channel signal in the AXI bus signal can be set in advance.
  • the AXI bus channel data can be flexibly captured, and the data amount of the captured AXI bus channel data can be reduced.
  • the AXI protocol supports Outstanding transport access, that is, can issue multiple unfinished transactions; the AXI protocol can mark each Burst transmission with an ID, so in the first embodiment of the present invention, two register groups id_reg and id_cnt are set, wherein the register set id_reg configured to record the ID number of each Burst transmission order index register set id_cnt Burst configured to record the transmission of the same ID number reaches, here, if the same ID number a plurality of transmission Burst exists, the first i 1 th The index of the order of arrival of the Burst transmission is denoted as i 1 , and i 1 is a natural number.
  • FIG. 2 is a schematic diagram of a process of capturing AXI bus channel data in a first embodiment of a SoC bus behavior detection method according to the present invention.
  • gbal_id_reg indicates that a preset check is performed.
  • the query order of the Burst transmissions in the order is set.
  • the pre-set query order is the arrow order in FIG. 2 (top to bottom);
  • the register group id_reg is composed of a plurality of storage units (slots), each slot is configured to store an ID.
  • the register group id_cnt is also composed of multiple slots, and each slot is configured to store the value of an index.
  • FIG. 1 depicts the capture process of AXI bus channel data from time T0 to time T4, as follows:
  • the first data capture signal is changed from invalid to valid, however, there is also a Burst transmission with ID 0 not completed at this time.
  • a response of a Burst transmission is received.
  • the Burst transmission indicating that the ID of 0 is not completed at time T0 has been completed at time T1.
  • the slot corresponding to the Burst transmission whose ID is 0 which is not completed at time T0 is invalid.
  • the data of the invalid slot is marked as X.
  • the register group id_reg and the register group id_cnt find a valid slot, and search for a slot corresponding to the Burst transmission that satisfies the preset first trigger condition or the second trigger condition, and the slot is selected. Marked as "matched”; the slot corresponding to the Burst transmission that does not satisfy the preset first trigger condition and does not satisfy the preset second trigger condition is marked as "mismatch".
  • the slot labeled "matched” corresponds to the second row of the T2 timetable table
  • the slot labeled "unmatched” corresponds to the third row to the fifth row of the T2 timetable table.
  • the read ID tag (RID) is the same as the ID stored in the slot marked "matched", and the value of the index stored in the corresponding slot marked "matched" is the smallest, then The RID is considered to match the ID stored in the corresponding slot labeled "matched", at which point the read data (RDATA), the read response (RRESP), the RID, and the last read (RLAST) are all fetched and will be fetched. The subsequent data is sent to the FIFO.
  • the Burst transmission corresponding to the slot marked as “mismatched” has been completed, and only the slot in which Burst transmission has been completed at T4 is marked as invalid. Without the data being fetched and sent, the Burst transmission does not satisfy the preset first trigger condition and the second trigger condition.
  • the data transmission is usually performed by using the Burst transmission mechanism when performing AXI bus data transmission, and the Burst transmission mechanism includes but is not limited to incremental bursting and rewinding bursting.
  • the average delay of each statistical bus transmission for AXI bus data transmission can be calculated according to the following formula:
  • T represents the average delay of the bus transmission corresponding to one statistic
  • Total_delay represents the sum of the time spent on each Burst transmission in the corresponding statistical time
  • n represents the number of Burst transmissions occurring in the corresponding statistical time
  • Total_delay T1+T2+...+Tn
  • T1 to Tn respectively indicate the time taken for the first Burst transmission to the nth Burst transmission in the corresponding statistical time.
  • the average bandwidth occupied by the bus transmission for each AXI bus data transmission can be calculated according to the following formula:
  • total_byte is the sum of the amount of data transmitted by each Burst transmission in the corresponding statistical time.
  • the unit is bit, and total_cycle indicates the clock period experienced by the corresponding statistical time.
  • the amount of data transferred by the transmission in bytes.
  • FIG. 3 is a timing diagram of counting a bus transmission parameter in the first embodiment of the SoC bus behavior detecting method of the present invention.
  • ACLK represents a global clock signal
  • AWVALID indicates that a write address is valid
  • AWREADY indicates a write address preparation
  • AWADDR Indicates the write address
  • AWSIZE indicates the maximum number of bytes of a beat data in a write transfer
  • AWLEN indicates how many beat data is written in one write
  • BVALID indicates that the write response is valid
  • BREADY indicates the response preparation
  • BRESP indicates the write response; The meaning of T1 to Tn is explained.
  • the at least one statistics of the bus transmission parameters when performing AXI bus data transmission include: receiving a statistical trigger signal; and when the statistical trigger signal is valid, performing bus transmission parameters for AXI bus data transmission at least once in sequence, When the statistical trigger signal is invalid, stop counting the bus transmission parameters when performing AXI bus data transmission.
  • the validity of the statistical trigger signal may be preset.
  • the statistical trigger signal is a high level signal or a low level signal. When the statistical trigger signal is a high level signal, it indicates that the statistical trigger signal is valid; otherwise, when the statistical trigger is triggered When the signal is low level, it indicates that the statistical trigger signal is invalid.
  • the following two statistical modes can be used to determine the end time point of each statistic.
  • the first statistical mode the starting time point of the first statistics of the bus transmission parameters when performing AXI bus data transmission is the time when the statistical trigger signal changes from invalid to valid, and the termination time point is earlier among the following two time points.
  • Time point The time when the trigger signal is valid from invalid to invalid, and the number of clock cycles experienced by the first statistic exceeds the preset number of clock cycles Fixed_cycle.
  • the start time point of the j-th statistics of the bus transmission parameters when performing AXI bus data transmission is the termination time point of the j-1th statistic or the termination time point of the j-1th statistic.
  • the end time point of the jth statistics of the bus transmission parameters when performing AXI bus data transmission is the earlier time point of the following two time points: the time when the statistical trigger signal is changed from valid to invalid, The number of clock cycles experienced by j statistics exceeds the preset number of clock cycles Fixed_cycle.
  • the second statistical mode the first bus transmission parameters for AXI bus data transmission
  • the starting time point of the secondary statistic is the time when the statistical trigger signal changes from invalid to valid
  • the ending time point is the earlier time point of the following two time points: the time when the statistical trigger signal is changed from valid to invalid, and the first time is performed.
  • the sum of the amount of data transmitted by each Burst transmission is greater than the preset data amount of the fixed byte.
  • the start time point of the j-th statistics of the bus transmission parameters when performing AXI bus data transmission is the termination time point of the j-1th statistic or the termination time point of the j-1th statistic.
  • the end time point of the j-th statistics of the bus transmission parameters when performing AXI bus data transmission is the earlier time point of the following two time points: the time when the statistical trigger signal is changed from valid to invalid, The sum of the amount of data transmitted by each Burst transmission at the jth count is greater than the preset data amount of the fixed byte.
  • the first statistical mode may be referred to as a statistical mode specifying the number of clock cycles
  • the second statistical mode may be referred to as a statistical mode specifying a data amount
  • the AXI protocol can mark each Burst transmission with an ID, by recording the change in the ID on the AXI bus, the delay of each Burst transmission and the total delay they spend can be calculated.
  • three register sets gbal_ID_reg, ID_reg, and ID_cnt are set, wherein the register set gbal_ID_reg is configured to record the ID of each Burst transmission in the entire statistical time, and the register set ID_reg is configured to record each Burst transmission in a time period in which the statistical trigger signal is valid.
  • the ID, register set ID_cnt configured to record the sequence index Burst transmission of the same ID number reaches, here, if there is a plurality of the same ID number Burst transmissions, i 2 the order in which the order of arrival is transmitted Burst index Recorded as i 2 , i 2 is a natural number.
  • FIG. 4 is a schematic diagram of a process of statistical bus transmission parameters in a first embodiment of the SoC bus behavior detection method according to the present invention.
  • the ID numbers stored in the register group gbal_ID_reg are arranged according to a preset query order, and a preset query is performed.
  • the order is the order of the arrows in Figure 4 (by Up to down);
  • the register group gbal_ID_reg is composed of multiple slots, each slot is configured to store an ID number
  • the register group ID_reg is composed of multiple slots
  • each slot is configured to store an ID number
  • the register group ID_cnt is composed of multiple A slot consisting of each slot configured to store the value of an index.
  • the register group ID_reg and the register group ID_cnt have a depth of 5.
  • Figure 4 exemplarily describes the process of counting bus transmission parameters from time T0 to time T4, as follows:
  • the statistical trigger signal is invalid, and the response of two Burst transmissions is not returned. That is, the Burst transmission response with ID 0 in the register group gbal_ID_reg in Figure 4 is not returned; here, the slot with the ID X in the register group gbal_ID_reg is Invalid slot, the invalid slot corresponds to the first line and the third line at time T0 in FIG.
  • the ID order of the Burst transmission without returning the response is not recorded, only the ID of the Burst transmission without returning the response is recorded; when the response of any one of the Burst transmissions is returned, the RID/BID of the corresponding Burst transmission of the return response is The ID in the register group gbal_ID_reg is compared; when the RID/BID of the corresponding Burst transmission of the corresponding response matches the ID in the register group gbal_ID_reg, the corresponding slot is invalid until all the slots in the register group gbal_ID_reg are invalid.
  • the statistical trigger signal becomes invalid, and the new Burst transmission is valid.
  • a valid slot is searched, and the first trigger condition or the first condition that satisfies the preset is searched.
  • the slot corresponding to the Burst transmission of the two trigger conditions marks the slot as "matched”, and the slot labeled "matched" corresponds to the second row of the T1 time table.
  • the slot corresponding to the Burst transmission that does not satisfy the preset first trigger condition and does not satisfy the preset second trigger condition is marked as “unmatched”.
  • the invalid slot corresponds to the third line of the T1 time table in FIG.
  • the new Burst transmission is valid.
  • the new Burst transmission in the register group ID_reg and the register group ID_cnt, find a valid slot, and search for a Burst transmission corresponding to the preset first trigger condition or the second trigger condition.
  • the slot at time T3, marks the slot corresponding to the Burst transmission that does not satisfy the preset first trigger condition and does not satisfy the preset second trigger condition as "no match".
  • the "mismatch" slot it is not necessary to grab the corresponding Burst transmission data; here, the "mismatch" slot corresponds to the first row of the T3 time table in FIG.
  • the response of the Burst transmission with ID 0 is returned. Since the Burst transmission before the statistical trigger signal is valid has been transmitted, at this time, in the register group ID_reg and the register group ID_cnt, the search ID is 0 and the index value is 1.
  • the slot invalidates the slot, and the slot corresponds to the second row of the T4 time table in FIG. 4, stops counting the number of clock cycles, and obtains the time taken to complete the corresponding Burst transmission.
  • a new Burst transmission occurs, the Burst transmission satisfies a preset first trigger condition or a second trigger condition, and the slot corresponding to the Burst transmission is marked as "matched", and the clock is re-clocked for the new Burst transmission.
  • the count of the number of cycles, where the slot labeled "matched" corresponds to the third row of the table at time T4 in FIG.
  • the AXI bus can connect multiple master devices and multiple slave devices; when one master device reads data of one slave device through the AXI bus, or when one master device writes data to a slave device through the AXI bus, According to the address of any pre-configured master device, To calculate the average delay and the average bandwidth occupied by the master device when reading and writing data; similarly, it can count the data read/written data from the device according to the address of any slave device configured in advance. The average delay and the average bandwidth occupied; further, the average delay and the occupied time when the corresponding master device reads and writes the data of the corresponding slave device according to the address of any one of the pre-configured master devices and any one of the slave devices Average bandwidth.
  • a register may be set to store the statistical result, and the statistical result can only be stored once, and after the statistics window (the duration of the valid trigger signal is valid), the statistical result is read by sending an interrupt request. Once the statistics window is finished, it will automatically enter the next statistical window until the statistics function is turned off, thus achieving multiple statistics of the transmission parameters during AXI data transmission.
  • FIG. 5 is a timing diagram of continuous statistics in the first embodiment of the SoC bus behavior detecting method according to the present invention.
  • the window represents the duration of the valid trigger signal
  • the ACLK represents the global clock signal
  • the START represents the statistical trigger signal.
  • START When START is high, it indicates that the statistical trigger signal is valid.
  • START When START is low, it indicates that the statistical trigger signal is invalid; perf indicates the statistical result acquisition timing, and P1 to Pk respectively indicate the k obtained during the duration of the valid statistical trigger signal.
  • Statistics result k is greater than 1; end_flag is a high level signal or a low level signal.
  • end_flag is a low level signal, it indicates that a certain statistic is being performed.
  • end_flag becomes high level and end_flag is pulled up, it indicates A certain statistic is terminated.
  • the SoC bus signal further includes the ACE bus signal in step 100, in this step, the ACE bus channel data needs to be captured based on the received ACE bus signal.
  • the capturing the ACE bus channel data includes: receiving the second data capture signal; When the second data capture signal is valid, the data of each channel of the received ACE bus is captured, and when the second data capture signal is invalid, the data acquisition process of each channel of the received ACE bus is stopped.
  • the validity of the second data capture signal may be preset, for example, the second data capture signal is a high level signal or a low level signal, and when the second data capture signal is a high level signal, indicating The second data capture signal is valid; otherwise, when the second data capture signal is a low level signal, it indicates that the second data capture signal is invalid.
  • the data of the ACE bus channel is captured: when the signal transmitted by the AC channel of the ACE bus signal satisfies the preset third trigger condition, the data of the ACE bus channel is captured; the signal transmitted by the AC channel of the ACE bus signal is not When the preset third trigger condition is met, the ACE bus channel data is not captured.
  • the preset third trigger condition may be set according to at least one of the following elements: an ACADDR signal transmitted by the AC channel, and an ACSNOOP signal transmitted by the AC channel.
  • the captured ACE bus channel data is the data of each channel in which the enable signal of the ACE bus signal is valid.
  • the validity of the enable signal corresponding to each channel signal in the ACE bus signal can be set in advance.
  • the ACE bus channel data can be flexibly captured, and the data amount of the captured ACE bus channel data can be reduced.
  • the ACE bus protocol does not support the use of ID to mark each Burst transmission.
  • the register sets cnt, cnt_cd, max_cnt, max_cnt_cd are set, wherein the register set cnt is configured to record the sequence of AC channel transmission, the register group cnt Including a plurality of slots, each slot is configured to store an index value indicating the sequence of transmission of the AC channel. When the signals transmitted by multiple AC channels arrive one after another, the smaller the index value indicates the corresponding AC channel transmission.
  • the signal arrives first; the register group cnt_cd is configured to record the sequence of CD channel transmissions,
  • the register group cnt includes a plurality of slots, and each slot is configured to store an index value indicating a sequence of transmission of the CD channel.
  • the register group cnt and the register group cnt_cd store index values greater than or equal to one.
  • the register group max_cnt includes at least one slot, and each slot is configured to record second data.
  • the index value of the sequence of the AC channel transmission corresponding to a Burst transmission that is not transmitted before the capture signal is valid;
  • the register group max_cnt_cd includes at least one slot, and each slot is configured to record that the second data capture signal is not transmitted before being valid.
  • a Burst transmits the index value of the sequence of the corresponding CD channel transmission.
  • FIG. 6 exemplarily describes the process of capturing the ACE bus channel data from time T0 to time T4, which is specifically described as follows:
  • the second data capture signal is invalid, and the CRRESP signal or the CDLAST signal is valid.
  • the index value of each slot record in the register group max_cnt and the register group max_cnt_cd is continuously decremented by 1 until the register group max_cnt and The index value of each slot record in the register group max_cnt_cd becomes 0, and all Burst transmissions are completed before the second data capture signal is valid.
  • the second data capture signal is valid. If the ACE bus signal satisfies the preset third trigger condition, the corresponding slot in the register set cnt/register set cnt_cd is marked as "matched", here, labeled " The matched slot corresponds to the second row and the fourth row of the T1 time table in FIG. 6. At this time, the signal transmitted by the AC channel corresponding to the slot labeled "matched" is sent to the FIFO, and the signal transmitted by the AC channel is transmitted. At least one of the following is included: ACVALID signal, ACREADY signal, ACADDR signal, ACSNOP signal, ACPORT signal.
  • the corresponding slot in the register group cnt/register group cnt_cd is marked as "no".
  • Matching here, the slot labeled "mismatch" corresponds to the first row, the third row, and the fifth row of the T1 time table in FIG.
  • the CDLAST signal is valid.
  • the slot with the index value of 1 in the register group cnt_cd is invalid, and the remaining index values recorded in the register group cnt_cd are all decremented by 1.
  • the invalid slot is indexed in FIG.
  • the value X indicates; at time T2, the ACE bus signal satisfies the preset third trigger condition, and the corresponding slot in the register group cnt/register group cnt_cd is marked as "matched", and at this time, it will be marked as "matched”.
  • the signal transmitted by the CD channel corresponding to the slot is sent to the FIFO, and the signal transmitted by the CD channel includes at least one of the following: a CDVALID signal, a CDREADY signal, a CDDATA signal, and a CDLAST signal.
  • the CRRESP signal is valid.
  • the slot with the index value of 1 in the register group cnt is invalid, and the remaining index values recorded in the register group cnt are all decremented by 1.
  • the invalid slot is indexed in FIG.
  • the value X indicates; at time T3, the ACE bus signal satisfies the preset third trigger condition, and the corresponding slot in the register set cnt/register group cnt_cd is marked as "matched", and at this time, it will be marked as "matched”.
  • the signal transmitted by the CR channel corresponding to the slot is sent to the FIFO, and the signal transmitted by the CR channel includes at least one of the following: a CRVALID signal, a CRREADY signal, and a CRRESP signal.
  • the CRRESP signal and the CDLAST signal are valid, the slot with the index value of 1 in the register group cnt is invalid, the slot with the index value of 1 in the register group cnt_cd is invalid, and the rest of the register group cnt_cd and the register group cnt are recorded.
  • the index value is all decremented by one; when the ACE bus signal does not satisfy the preset third trigger condition at time T4, the corresponding slot in the register group cnt/register group cnt_cd is marked as “no match”, and at this time, the grab will not be grabbed.
  • ACE bus channel data when the ACE bus signal does not satisfy the preset third trigger condition at time T4, the corresponding slot in the register group cnt/register group cnt_cd is marked as “no match”, and at this time, the grab will not be grabbed.
  • the first embodiment of the SoC bus behavior detecting method of the present invention can first capture the AXI bus data, and can obtain more accurate information than the existing technical solution that can only capture the AXI bus address and commands. Bus behavior; secondly, the ACE bus signal can be captured, which can be applied to more application scenarios; finally, the statistics of related parameters of the AXI bus transmission can be completed; thus, the first embodiment of the SoC bus behavior detection method of the present invention can Support a variety of functions to meet the diverse needs of SoC bus debugging.
  • FIG. 7 is a schematic diagram of an application scenario of a second embodiment of a SoC bus behavior detection method according to the present invention.
  • the processor 700 represents a master device, and the processor 700 and the slave device 701 pass the AXI bus/ACE bus. Data transmission is performed; the detector 702 is configured to detect the behavior of bus data transmission between the processor and the slave device using the embodiment of the present invention, and the DDR memory 703 is configured to store the bus behavior detection result obtained by the detector.
  • the detector 702 is configured to monitor the AXI bus/ACE bus by connecting the AXI bus/ACE bus from the interface; the detector 702 is connected to the DDR memory 703 through the main interface, and the monitoring of the AXI bus/ACE bus by the detector 702 is non-intrusive monitoring. Therefore, it does not interfere with bus data transfer between the processor and the slave device.
  • FIG. 8 is a flowchart of bus data capture in a second embodiment of the SoC bus behavior detection method according to the present invention. As shown in FIG. 8, the process includes:
  • Step 800 Pre-configure the parameters of the bus data capture; configure the first data capture signal/second data capture signal to be valid, and skip to step 801.
  • the parameters for pre-configuring the bus data capture include: setting a trigger condition, configuring the validity of the enable signal of each channel of the AXI bus/ACE bus, setting the timestamp capture function of the AXI bus/ACE bus signal, and configuring the AXI bus.
  • Each channel of the /ACE bus stores space in the DDR memory, and the AXI bus/ACE bus is configured to store 1G in each DDR memory;
  • pre-configuring various parameters of the SoC bus behavior detection includes: configuring an interrupt mask for at least one channel of the AXI bus/ACE bus, configuring an interrupt clearing and capturing an interrupt signal at the end of the data, and capturing an interrupt at the end of the data
  • the signal is marked as drain_out. When drain_out is pulled high, it indicates that the interrupt signal at the end of the grab data is issued.
  • Step 801 Determine whether at least one channel of the AXI bus/ACE bus issues an interrupt signal, and if yes, skip to step 802; otherwise, skip to step 804.
  • Step 802 It is judged whether the channel that issues the interrupt signal is configured with an interrupt mask, and if yes, returns to step 801; if not, then to step 803.
  • Step 803 Read data corresponding to the channel that issues the interrupt signal in the DDR. After the data is read, the interrupt is cleared, and the process returns to step 801.
  • the reading of the data corresponding to the channel for issuing the interrupt signal in the DDR includes: querying the interrupt number, determining which channel the interrupt signal comes from according to the interrupt number, and then notifying the CPU to configure the corresponding DMA read mode, corresponding to The channel data is read from the DDR and the read data is stored in an external memory such as a USB.
  • Step 804 Determine whether to end the bus data capture. If the bus data capture is not finished, return to step 801; if the bus data capture is ended, configure the first data capture signal/second data capture signal to be invalid, skipping Go to step 805.
  • the timing of ending the bus data capture can be determined by the user himself.
  • Step 805 The detector empties the residual data inside the detector, and sends out the data at the end of the grabbing.
  • the interrupt signal reads out the data corresponding to each channel in which no interrupt mask is set in the DDR. When the data is read, the interrupt is cleared and the flow is terminated.
  • the reading of the data corresponding to each channel in the DDR that is not provided with the interrupt mask includes: notifying the CPU to configure the corresponding DMA read mode based on each channel without the interrupt mask being set, and the data of the corresponding channel is from the DDR. Read out and store the read data into external memory.
  • FIG. 9 is a flowchart of statistics of bus transmission parameters in a second embodiment of the SoC bus behavior detecting method according to the present invention. As shown in FIG. 9, the process includes:
  • Step 900 Pre-configure the statistical parameters of the bus transmission parameters; configure the statistical trigger signal to be valid, and skip to step 901.
  • the statistic parameter for configuring the bus transmission parameter includes: configuring an address of the at least one master device, configured to calculate an average delay of the corresponding master device in the data transmission of the bus and an average bandwidth occupied by the master device; and configuring an address of the at least one slave device, For counting the average delay of the corresponding slave device during bus data transmission and the average bandwidth occupied; pre-configuring the address of at least one master device and the address of at least one slave device for counting the correspondence between the master device and the corresponding slave device The average delay of bus data transmission and the average bandwidth occupied; configuration statistics mode.
  • the configuration of the statistical parameters of the bus transmission parameter may further include: configuring an interrupt mask for the statistical result of at least one channel, configuring an interrupt signal for interrupt clearing and counting at the end of the statistics.
  • Step 901 Determine whether the read request interrupt sent by the CPU is received. If yes, go to step 902. Otherwise, go to step 904.
  • Step 902 Determine whether an interrupt mask is set according to the type of the statistical result to be read, and if yes, return to step 901; if no, skip to step 903.
  • Step 903 Read the statistical result. After the data is read, clear the interrupt and return to the step. 901.
  • Step 904 Determine whether to end the statistical process. If the statistical process is not ended, return to step 901; if the statistical process is ended, the configuration statistical trigger signal is invalid, and the process proceeds to step 905.
  • the timing of ending the statistical process can be determined by the user himself.
  • Step 905 Send an interrupt signal at the end of the statistics, read the statistical result, clear the interrupt, and end the process. At this time, the statistical result can be analyzed.
  • the embodiment of the present invention further provides an SoC bus behavior detecting apparatus.
  • FIG. 10 is a first schematic structural diagram of a SoC bus behavior detecting apparatus according to an embodiment of the present invention. As shown in FIG. 10, the apparatus includes: a receiving module 1000 and a detecting module 1001;
  • the receiving module 1000 is configured to receive a SoC bus signal, where the SoC bus signal includes an AXI bus signal.
  • the detecting module 1001 is configured to perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing the AXI bus data transmission;
  • the captured AXI bus channel data includes At least one of the following data: the data transmitted by the AXI bus write data channel, the data transmitted by the AXI bus read data channel;
  • the bus transmission parameters of each statistics include: the average delay of the bus transmission in the corresponding statistical time or The average bandwidth occupied.
  • the detecting module 1001 is configured to: when the signal transmitted by the AW channel in the AXI bus signal satisfies a preset first trigger condition, or when the signal transmitted by the AR channel in the AXI bus signal satisfies a preset second trigger condition, Grab the AXI bus channel data.
  • the captured AXI bus channel data is valid for the enable signal in the AXI bus signal. Data for each channel.
  • the detecting module 1001 further includes a register configured to store a statistical result of the bus transmission parameter, and the statistical result can only be stored once, and the statistical window (the duration of the valid period of the statistical trigger signal) ends, and the interrupt is sent. Request to read the statistical results, once the statistics window ends, automatically enter the next statistical window, until the statistics function is turned off, thereby achieving multiple statistics of the transmission parameters when transmitting AXI data.
  • the receiving module 1000 is further configured to receive an ACE bus signal.
  • the detection module 1001 is further configured to capture ACE bus channel data based on the received ACE bus signal.
  • the detecting module 1001 is configured to capture the ACE bus channel data when the signal transmitted by the AC channel of the ACE bus signal satisfies a preset third trigger condition.
  • the captured ACE bus channel data is the data of each channel in which the enable signal is valid in the ACE bus signal.
  • the detecting module 1001 may be further configured to monitor the occurrence of a deadlock.
  • a deadlock occurs, the ID and address when the deadlock occurs are captured, and it can be inferred from which host device the deadlock is caused. of.
  • the detection module 1001 can also monitor the access exception address, issue an interrupt when an access exception occurs, and grab the address and ID when the exception occurs, from which it can be inferred from which master device the exception was caused.
  • the receiving module 1000 and the detecting module 1001 can be configured by a central processing unit (CPU), a microprocessor (Micro Processor Unit (MPU), and a digital signal processor (Digital Signal) located in the terminal device.
  • CPU central processing unit
  • MPU Micro Processor Unit
  • DSP Digital Signal processor
  • FPGA Field Programmable Gate Array
  • FIG. 11 is a second schematic structural diagram of a SoC bus behavior detecting apparatus according to an embodiment of the present invention.
  • the apparatus includes: a first timing adjusting unit 1100, a second timing adjusting unit 1101, an AXI bus detecting unit 1102, and an ACE.
  • the configuration unit 1105 is configured to configure a parameter of the bus data capture and a statistical parameter of the bus transmission parameter, and send the parameter of the configured bus data capture to the AXI bus detection unit 1102/ACE bus detection unit 1103, and configure the completed bus.
  • the statistical parameters of the transmission parameters are sent to the statistics unit 1104.
  • the process of configuring the parameters of the bus data capture and the statistical parameters of the bus transmission parameters has been described in detail in the second embodiment of the present invention, and details are not described herein again.
  • the configuration unit 1105 can receive configuration information from the external device and configure related parameters based on the received configuration information; the configuration unit 1105 interacts with the external device through an APB (Advanced High Performance Bus) interface.
  • APB Advanced High Performance Bus
  • the first timing adjustment unit 1100 is configured to receive signals of each channel of the AXI bus, perform timing adjustment on the signals of the received channels, and send signals of each channel of the timing adjustment to the AXI bus detection unit, the first clearing unit, and the first
  • the second clearing unit and the statistical unit here, the first timing adjusting unit 1100 can be implemented by using a basic logical unit slice; in FIG. 1, AW, AR, W, R, and B respectively represent the AXI bus AW channel, the AR channel, the W channel, and the R. Channel and B channel.
  • the second timing adjustment unit 1101 is configured to receive signals of each channel of the ACE bus, perform timing adjustment on the received signals of the respective channels, and send signals of each channel of the timing adjustment to the ACE bus detection unit, the first clearing unit, and the statistics respectively.
  • the second timing adjustment unit 1100 can be implemented by using a basic logical unit slice; in FIG. 1, AC, CR, and CD represent an AXI bus AC channel, a CR channel, and a CD channel, respectively.
  • the first clearing unit 1106 is configured to monitor AXI bus behavior and ACE bus behavior in real time. Receiving the first data capture signal and the second data capture signal, when the first data capture signal is valid, clearing data received by the AXI bus detection unit before the first data capture signal is valid; and capturing the second data in the second data capture When the signal is valid, the data received by the ACE bus detecting unit is cleared before the second data grabbing signal is valid; thus, the bus data received before the corresponding data grabbing signal is valid can be prevented from affecting the bus data grabbing.
  • the second clearing unit 1107 is configured to monitor the behavior of the AXI bus in real time, and receive the statistical trigger signal.
  • the statistical trigger signal When the statistical trigger signal is valid, the data received by the statistical unit before the statistical trigger signal is valid is cleared; thus, the statistical trigger signal can be prevented from being valid before the statistics are valid.
  • the data received by the unit affects the statistical process of subsequent bus transmission parameters.
  • the AXI bus detecting unit 1102 is configured to: when the first data capture signal is valid, capture data of each channel of the received AXI bus, and send data of each channel that is captured to the data transmission unit.
  • the process of capturing data of each channel of the AXI bus has been described in the first embodiment of the present invention, and will not be repeated here.
  • the ACE bus detecting unit 1103 is configured to: when the second data capture signal is valid, capture data of each channel of the received ACE bus, and send data of each channel captured to the data transmission unit.
  • the process of capturing data of each channel of the ACE bus has been explained in the first embodiment of the present invention, and will not be repeated here.
  • the statistic unit 1104 is configured to perform at least one statistics on the bus transmission parameters of the AXI bus data transmission when the statistical trigger signal is valid, and send the obtained statistical result to the outside through the configuration unit.
  • the statistical process of the bus transmission parameters has been explained in the first embodiment of the present invention and will not be repeated here.
  • the data transmission unit 1108 is configured to perform packet processing on the received data, and send the packed data to the third timing adjustment unit.
  • the data transmission unit 1108 includes a first input first output (FIFO) subunit and a data processing subunit; wherein the FIFO subunit is configured to receive from AXI
  • the data of the plurality of channels reaches the corresponding channel threshold at the same time in the FIFO subunit, the data of the corresponding multiple channels is sent to the data processing subunit by using a preset polling order polling.
  • the data processing sub-unit is configured to assemble and receive the received data according to the agreed data structure.
  • the data width of the output data of the SoC bus behavior detecting device is specified to be 64 bits, so that the data width of the data outputted by the data processing subunit needs to be a constant value. That is, the data processing sub-unit combines the received data into fixed-length data and outputs it to the outside; in particular, when the data capture process of each channel of the AXI bus ends, if at least one of the FIFO sub-units The data does not reach the corresponding channel threshold. At this time, redundant data is added to the data of the corresponding channel to reach the corresponding channel threshold, which is beneficial to the data processing process of the data processing subunit.
  • one is an address state machine, configured to generate and split addresses (for example, when transmitting across 4K, a complete data structure needs to be played.
  • the other is the address state machine, configured for data merging and splitting.
  • the data processing subunit needs to merge the two AXI bus channel data. Outward output; when the data width of the channel data of the AXI bus is 32 bits, the data processing subunit splits the channel data of one AXI bus into two sets of data and outputs it outward; thus, the data processing subunit merges through the data. Splitting can greatly improve the efficiency of data transmission.
  • the third timing adjustment unit 1109 is configured to perform timing adjustment on the received data, and send the time-aligned data to an external storage unit; here, the third timing adjustment unit 1109 It can be implemented in the basic logical unit slice.
  • a limited address space is set for each channel of data in the external storage unit, and the address space granularity is 1K.
  • the write operation is performed on the block address space.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • an embodiment of the present invention further provides a computer storage medium, the computer storage medium comprising a set of instructions, when executed, causing at least one processor to execute the SoC bus behavior detection method.
  • the solution provided by the embodiment of the present invention receives a SoC bus signal, where the SoC bus signal includes an AXI bus signal; and performs at least one of the following operations based on the received AXI bus signal: grabbing AXI bus channel data, and performing AXI bus data transmission
  • the bus transmission parameters are analyzed at least once; the captured AXI bus channel data includes at least one of the following: data transmitted by the AXI bus write data channel, data transmitted by the AXI bus read data channel;
  • the transmission parameters include: the average delay of the bus transmission in the corresponding statistical time or the average bandwidth occupied. In this way, the AXI bus data can be captured, and the parameters of the AXI bus data can be counted, thereby meeting the diversified needs of the SoC bus debugging.

Abstract

A system on chip (SoC) bus activity detection method comprising: receiving a SoC bus signal, where the SoC bus signal comprises an Advanced eXtensible Interface (AXI) bus signal (100); performing at least one of the following operations on the basis of the AXI bus signal received: capturing channel data of an AXI bus or compiling statistics at least once with respect to a bus transmission parameter during AXI bus data transmission, where the captured channel data of the AXI bus comprises at least one of the following types of data: data transmitted by a write data channel of the AXI bus or data transmitted by a read data channel of the AXI bus; the bus transmission parameter for which statics are compiled each time comprises: the average delay of bus transmission or the average bandwidth occupied during a corresponding statistics time (101). Also disclosed are a SoC bus activity detection device and a computer storage medium.

Description

一种片上系统总线行为检测方法、装置和计算机存储介质Method, device and computer storage medium for detecting system bus behavior 技术领域Technical field
本发明涉及片上系统(System on Chip,SoC)领域,尤其涉及一种SoC总线行为检测方法、装置和计算机存储介质。The present invention relates to the field of System on Chip (SoC), and in particular, to a SoC bus behavior detection method, apparatus, and computer storage medium.
背景技术Background technique
当前SoC芯片运行速度越来越快,其处理器的主频已经达到2GHz以上,因此单靠测试机台无法捕捉到瞬间信号,更不可能深入到芯片内部捕捉总线信号,这就需要一个监控模块嵌入到芯片内部实时捕捉总线信号。The current SoC chip runs faster and faster, and its processor's main frequency has reached 2GHz or above. Therefore, the test machine cannot capture the instantaneous signal, and it is even more impossible to penetrate the chip to capture the bus signal. This requires a monitoring module. Embedded in the chip to capture bus signals in real time.
然而,现有的监控模块如SonicsMT和FlexNoC监控模块中,只能对高级可扩展接口(Advanced eXtensible Interface,AXI)总线的某些信号进行抓取,具体地说,现有的监控模块只能对AXI总线地址和命令进行抓取,而无法对AXI总线数据进行抓取;总之,现有的监控模块功能较为单一,无法满足对SoC芯片进行调试的多样化需求。However, existing monitoring modules such as the SonicsMT and FlexNoC monitoring modules can only capture certain signals of the Advanced EXtensible Interface (AXI) bus. Specifically, the existing monitoring module can only The AXI bus address and commands are fetched, and the AXI bus data cannot be captured. In short, the existing monitoring module has a single function, which cannot meet the diversified requirements for debugging the SoC chip.
发明内容Summary of the invention
为解决上述技术问题,本发明实施例期望提供一种SoC总线行为检测方法、装置和计算机存储介质。In order to solve the above technical problem, embodiments of the present invention are expected to provide a SoC bus behavior detecting method, apparatus, and computer storage medium.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供了一种SoC总线行为检测方法,包括:The embodiment of the invention provides a SoC bus behavior detection method, including:
接收SoC总线信号,所述SoC总线信号包括AXI总线信号;Receiving a SoC bus signal, the SoC bus signal including an AXI bus signal;
基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道 传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。Perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing AXI bus data transmission; the captured AXI bus channel data includes at least one of the following data: The AXI bus write data channel The transmitted data, the data transmitted by the AXI bus read data channel; the bus transmission parameters of each statistics include: the average delay of the bus transmission or the average bandwidth occupied by the corresponding statistical time.
上述方案中,所述抓取AXI总线通道数据,包括:在AXI总线信号中写地址通道(Write address channel,AW)传输的信号满足预设的第一触发条件,或AXI总线信号中读地址通道(Read address channel,AR)传输的信号满足预设的第二触发条件时,抓取AXI总线通道数据。In the above solution, the capturing the AXI bus channel data includes: the signal transmitted by the write address channel (AW) in the AXI bus signal satisfies the preset first trigger condition, or the read address channel in the AXI bus signal. When the signal transmitted by (Read address channel, AR) satisfies the preset second trigger condition, the AXI bus channel data is captured.
上述方案中,所抓取的AXI总线通道数据为AXI总线信号中使能信号有效的各个通道的数据。In the above solution, the captured AXI bus channel data is data of each channel in which the enable signal of the AXI bus signal is valid.
上述方案中,所述方法还包括:设置寄存器,所述寄存器配置为存储总线传输参数的一次统计结果;In the above solution, the method further includes: setting a register, wherein the register is configured to store a statistical result of the bus transmission parameter;
统计窗口window结束后,通过发中断请求读取存储的统计结果,一次统计window结束后自动进入下一次统计window,直到关闭统计功能,以实现对AXI数据传输时传输参数进的多次统计。After the statistics window is finished, the stored statistical result is read by sending an interrupt request. Once the statistics window is finished, the next statistical window is automatically entered until the statistics function is turned off, so as to implement multiple statistics of the transmission parameters during AXI data transmission.
上述方案中,进行AXI总线数据传输时每次统计的总线传输的平均延时的计算公式为:In the above scheme, the calculation formula of the average delay of the bus transmission for each AXI bus data transmission is:
T=total_delay/nT=total_delay/n
其中,T表示对应一次统计的总线传输的平均延时,Total_delay表示对应的统计时间内各个Burst传输所耗费的时间之和,n表示对应的统计时间内所发生的Burst传输的个数;Where T represents the average delay of the bus transmission corresponding to one statistic, Total_delay represents the sum of the time spent by each Burst transmission in the corresponding statistical time, and n represents the number of Burst transmissions occurring in the corresponding statistical time;
进行AXI总线数据传输时每次统计的总线传输所占有的平均带宽B的计算公式为:The calculation formula of the average bandwidth B occupied by each statistical bus transmission when performing AXI bus data transmission is:
B=total_byte/total_cycleB=total_byte/total_cycle
其中,B表示对应的一次统计的总线传输所占有的平均带宽,total_byte表示对应的统计时间内各个Burst传输所传输的数据量的和,total_cycle表示对应的统计时间所经历的时钟周期数。Where B represents the average bandwidth occupied by the corresponding one-time bus transmission, total_byte represents the sum of the amount of data transmitted by each Burst transmission in the corresponding statistical time, and total_cycle represents the number of clock cycles experienced by the corresponding statistical time.
上述方案中,所述方法还包括:接收A XI总线信号对应的时间戳信息。 In the above solution, the method further includes: receiving timestamp information corresponding to the AXI bus signal.
上述方案中,所述SoC总线信号还包括:AXI一致性扩展(AXI Coherency Extensions,ACE)总线信号;In the above solution, the SoC bus signal further includes: an AXI Coherency Extensions (ACE) bus signal;
在接收SoC总线信号之后,所述方法还包括:基于接收的ACE总线信号抓取ACE总线通道数据。After receiving the SoC bus signal, the method further includes: capturing the ACE bus channel data based on the received ACE bus signal.
上述方案中,所述抓取ACE总线通道数据包括:在ACE总线信号AC通道传输的信号满足预设的第三触发条件时,抓取ACE总线通道数据。In the above solution, the capturing the ACE bus channel data comprises: capturing the ACE bus channel data when the signal transmitted by the AC channel of the ACE bus signal satisfies a preset third trigger condition.
上述方案中,所抓取的ACE总线通道数据为ACE总线信号中使能信号有效的各个通道的数据。In the above solution, the captured ACE bus channel data is data of each channel in which the enable signal is valid in the ACE bus signal.
上述方案中,所述方法还包括:抓取ACE总线信号对应的时间戳信息。In the above solution, the method further includes: capturing timestamp information corresponding to the ACE bus signal.
上述方案中,所述方法还包括:In the above solution, the method further includes:
监控死锁的发生,当死锁发生时,抓取发生死锁时的身份标识(ID)和地址;Monitor the occurrence of a deadlock, and when the deadlock occurs, grab the identity (ID) and address when the deadlock occurs;
和/或,监控访问异常地址,当访问异常发生时发出中断,并且抓取发生异常时的地址和ID。And/or, monitor access to the exception address, issue an interrupt when an access exception occurs, and grab the address and ID when the exception occurred.
本发明实施例还提供了一种SoC总线行为检测装置,包括:接收模块和检测模块;其中,The embodiment of the invention further provides a SoC bus behavior detecting device, comprising: a receiving module and a detecting module; wherein
接收模块,配置为接收SoC总线信号,所述SoC总线信号包括AXI总线信号;a receiving module configured to receive a SoC bus signal, where the SoC bus signal includes an AXI bus signal;
检测模块,配置为基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。The detecting module is configured to perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing the AXI bus data transmission; the captured AXI bus channel data includes at least one The following data: the data transmitted by the AXI bus write data channel, the data transmitted by the AXI bus read data channel; the bus transmission parameters of each statistics include: the average delay of the bus transmission in the corresponding statistical time or possession Average bandwidth.
上述方案中,所述检测模块,配置为在AXI总线信号中AW通道传输 的信号满足预设的第一触发条件,或AXI总线信号中AR通道传输的信号满足预设的第二触发条件时,抓取AXI总线通道数据。In the above solution, the detection module is configured to transmit AW channel in the AXI bus signal. The signal satisfies the preset first trigger condition, or the AXI bus channel data is captured when the signal transmitted by the AR channel in the AXI bus signal satisfies the preset second trigger condition.
上述方案中,所抓取的AXI总线通道数据为AXI总线信号中使能信号有效的各个通道的数据。In the above solution, the captured AXI bus channel data is data of each channel in which the enable signal of the AXI bus signal is valid.
上述方案中,所述检测模块还包括寄存器,所述寄存器配置为存储总线传输参数的一次统计结果;In the above solution, the detecting module further includes a register configured to store a statistical result of the bus transmission parameter;
统计窗口window结束后,通过发中断请求读取存储的统计结果,一次统计window结束后自动进入下一次统计window,直到关闭统计功能,以实现对AXI数据传输时传输参数进的多次统计。After the statistics window is finished, the stored statistical result is read by sending an interrupt request. Once the statistics window is finished, the next statistical window is automatically entered until the statistics function is turned off, so as to implement multiple statistics of the transmission parameters during AXI data transmission.
上述方案中,所述接收模块,还配置为接收ACE总线信号;In the above solution, the receiving module is further configured to receive an ACE bus signal;
在接收SoC总线信号之后,所述方法还包括:基于接收的ACE总线信号抓取ACE总线通道数据。After receiving the SoC bus signal, the method further includes: capturing the ACE bus channel data based on the received ACE bus signal.
上述方案中,所述检测模块,配置为在ACE总线信号AC通道传输的信号满足预设的第三触发条件时,抓取ACE总线通道数据。In the above solution, the detecting module is configured to capture the ACE bus channel data when the signal transmitted by the AC channel of the ACE bus signal satisfies a preset third trigger condition.
上述方案中,所抓取的ACE总线通道数据为ACE总线信号中使能信号有效的各个通道的数据。In the above solution, the captured ACE bus channel data is data of each channel in which the enable signal is valid in the ACE bus signal.
上述方案中,所述检测模块,还配置为:In the above solution, the detecting module is further configured to:
监控死锁的发生,当死锁发生时,抓取发生死锁时的ID和地址;Monitor the occurrence of a deadlock, and when the deadlock occurs, grab the ID and address when the deadlock occurs;
和/或,监控访问异常地址,当访问异常发生时发出中断,并且抓取发生异常时的地址和ID。And/or, monitor access to the exception address, issue an interrupt when an access exception occurs, and grab the address and ID when the exception occurred.
本发明实施例又提供了一种计算机存储介质,所述计算机存储介质包括一组指令,当执行所述指令时,引起至少一个处理器执行上述的SoC总线行为检测方法。The embodiment of the invention further provides a computer storage medium, the computer storage medium comprising a set of instructions, when executed, causing at least one processor to perform the SoC bus behavior detection method described above.
本发明实施例提供的SoC总线行为检测方法、装置和计算机存储介质,接收SoC总线信号,所述SoC总线信号包括AXI总线信号;基于接收的 AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。如此,本发明实施例支持对AXI总线数据的抓取和AXI总线数据的参数统计,能够满足SoC总线调试的多样化需求。The SoC bus behavior detecting method, apparatus and computer storage medium provided by the embodiments of the present invention receive a SoC bus signal, and the SoC bus signal includes an AXI bus signal; The AXI bus signal performs at least one of the following operations: grabbing AXI bus channel data, and performing at least one statistics on bus transmission parameters when performing AXI bus data transmission; the captured AXI bus channel data includes at least one of the following data: the AXI The data transmitted by the bus write data channel and the data transmitted by the AXI bus read data channel; the bus transmission parameters of each statistics include: the average delay of the bus transmission or the average bandwidth occupied by the corresponding statistical time. As such, the embodiment of the present invention supports the capture of AXI bus data and the parameter statistics of AXI bus data, and can meet the diversified requirements of SoC bus debugging.
附图说明DRAWINGS
图1为本发明SoC总线行为检测方法的第一实施例的流程图;1 is a flow chart of a first embodiment of a method for detecting a SoC bus behavior according to the present invention;
图2为本发明SoC总线行为检测方法的第一实施例中抓取AXI总线通道数据的过程的示意图;2 is a schematic diagram of a process of capturing AXI bus channel data in a first embodiment of a SoC bus behavior detection method according to the present invention;
图3为本发明SoC总线行为检测方法的第一实施例中统计一次总线传输参数的时序示意图;3 is a timing diagram showing statistics of a primary bus transmission parameter in a first embodiment of a SoC bus behavior detection method according to the present invention;
图4为本发明SoC总线行为检测方法的第一实施例中统计总线传输参数的过程的示意图;4 is a schematic diagram of a process of statistical bus transmission parameters in a first embodiment of a SoC bus behavior detection method according to the present invention;
图5为本发明SoC总线行为检测方法的第一实施例中进行连续统计的时序示意图;FIG. 5 is a timing diagram of performing continuous statistics in the first embodiment of the SoC bus behavior detecting method according to the present invention; FIG.
图6为本发明SoC总线行为检测方法的第一实施例中抓取ACE总线通道数据的过程的示意图;6 is a schematic diagram of a process of capturing ACE bus channel data in a first embodiment of a SoC bus behavior detection method according to the present invention;
图7为本发明SoC总线行为检测方法的第二实施例的应用场景的示意图;FIG. 7 is a schematic diagram of an application scenario of a second embodiment of a SoC bus behavior detection method according to the present invention; FIG.
图8为本发明SoC总线行为检测方法的第二实施例中总线数据抓取的流程图;8 is a flow chart of bus data capture in a second embodiment of a SoC bus behavior detection method according to the present invention;
图9为本发明SoC总线行为检测方法的第二实施例中总线传输参数的统计的流程图; FIG. 9 is a flowchart of statistics of bus transmission parameters in a second embodiment of the SoC bus behavior detecting method according to the present invention; FIG.
图10为本发明实施例SoC总线行为检测装置的第一组成结构示意图;10 is a schematic diagram of a first component structure of a SoC bus behavior detecting apparatus according to an embodiment of the present invention;
图11为本发明实施例SoC总线行为检测装置的第二组成结构示意图。FIG. 11 is a schematic diagram of a second component structure of a SoC bus behavior detecting apparatus according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings.
在本发明的各种实施例中:接收SoC总线信号,所述SoC总线信号包括AXI总线信号;基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。In various embodiments of the present invention, a SoC bus signal is received, the SoC bus signal includes an AXI bus signal, and at least one of the following operations is performed based on the received AXI bus signal: grabbing AXI bus channel data, and performing AXI bus data The bus transmission parameters are transmitted at least once; the captured AXI bus channel data includes at least one of the following: data transmitted by the AXI bus write data channel, data transmitted by the AXI bus read data channel; The bus transmission parameters include: the average delay of the bus transmission in the corresponding statistical time or the average bandwidth occupied.
图1为本发明SoC总线行为检测方法的第一实施例的流程图,如图1所示,该方法包括:1 is a flowchart of a first embodiment of a SoC bus behavior detection method according to the present invention. As shown in FIG. 1, the method includes:
步骤100:接收SoC总线信号,SoC总线信号包括AXI总线信号。Step 100: Receive a SoC bus signal, where the SoC bus signal includes an AXI bus signal.
这里,AXI总线信号通常包括以下至少一个通道的信号:AR通道信号、AW通道信号、读数据通道(Read data channel,R)信号、写数据通道(Write data channel,W)信号和写响应通道(Write response channel,B)信号。Here, the AXI bus signal usually includes signals of at least one of the following channels: an AR channel signal, an AW channel signal, a read data channel (R) signal, a write data channel (W) signal, and a write response channel ( Write response channel, B) signal.
进一步地,还可以接收AXI总线信号对应的时间戳(timestamp)信息,从而可以准确地获知总线握手的时刻以及响应握手的时刻。Further, timestamp information corresponding to the AXI bus signal can also be received, so that the time of the bus handshake and the time of responding to the handshake can be accurately learned.
本步骤中,为了改善AXI总线信号的各个通道信号之间的时序,可以在接收AXI总线信号之前,对AXI总线信号的各个通道信号之间的时序进行调整,例如,采用基本逻辑单位slice对AXI总线信号的各个通道信号之间的时序进行调整。In this step, in order to improve the timing between the signals of the respective channels of the AXI bus signal, the timing between the signals of the respective channels of the AXI bus signal can be adjusted before receiving the AXI bus signal, for example, using the basic logical unit slice to the AXI. The timing between the individual channel signals of the bus signal is adjusted.
本步骤中,SoC总线信号还可以包括AXI一致性扩展(AXI Coherency  Extensions,ACE)总线信号;这里,ACE总线信号通常包括以下至少一个通道的信号:AC通道(snoop address channel)信号、CR通道(snoop response channel)信号、CD通道(snoop data channel)信号。In this step, the SoC bus signal can also include AXI Coherency (AXI Coherency). Extensions, ACE) bus signals; here, the ACE bus signals usually include signals of at least one of the following channels: an AC channel (snoop address channel) signal, a CR channel (snoop response channel) signal, and a CD channel (snoop data channel) signal.
进一步地,还可以接收ACE总线信号对应的时间戳信息,从而可以准确地获知总线握手的时刻以及响应握手的时刻。Further, time stamp information corresponding to the ACE bus signal can also be received, so that the time of the bus handshake and the time of responding to the handshake can be accurately learned.
本步骤中,为了改善ACE总线信号的各个通道信号之间的时序,可以在接收ACE总线信号之前,对ACE总线信号的各个通道信号之间的时序进行调整,例如,采用基本逻辑单位slice对ACE总线信号的各个通道信号之间的时序进行调整。In this step, in order to improve the timing between the signals of the respective channels of the ACE bus signal, the timing between the signals of the respective channels of the ACE bus signal can be adjusted before receiving the ACE bus signal, for example, using the basic logical unit slice to the ACE. The timing between the individual channel signals of the bus signal is adjusted.
步骤101:基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。Step 101: Perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing AXI bus data transmission; the captured AXI bus channel data includes at least one of the following: Data: the data transmitted by the AXI bus write data channel, the data transmitted by the AXI bus read data channel; the bus transmission parameters of each statistics include: the average delay of the bus transmission in the corresponding statistical time or the average occupied bandwidth.
具体地,所述抓取AXI总线通道数据包括:接收第一数据抓取信号;在第一数据抓取信号有效时,对接收的AXI总线各个通道的数据进行抓取,在第一数据抓取信号无效时,停止对接收的AXI总线各个通道的数据的抓取流程。这里,第一数据抓取信号的有效性可以预先设置,例如,第一数据抓取信号为高电平信号或低电平信号,当第一数据抓取信号为高电平信号时,表明第一数据抓取信号有效;当第一数据抓取信号为低电平信号时,表明第一数据抓取信号无效。Specifically, the capturing the AXI bus channel data includes: receiving the first data capture signal; and when the first data capture signal is valid, the data of each channel of the received AXI bus is captured, and the first data is captured. When the signal is invalid, the data acquisition process of each channel of the received AXI bus is stopped. Here, the validity of the first data capture signal may be preset, for example, the first data capture signal is a high level signal or a low level signal, and when the first data capture signal is a high level signal, indicating A data capture signal is valid; when the first data capture signal is a low level signal, it indicates that the first data capture signal is invalid.
本步骤中,所述抓取AXI总线通道数据包括:在AXI总线信号中AW通道传输的信号满足预设的第一触发条件,或AXI总线信号中AR通道传输的信号满足预设的第二触发条件时,抓取AXI总线通道数据;在AXI总 线信号中AW通道传输的信号不满足预设的第一触发条件,且AXI总线信号中AR通道传输的信号不满足预设的第二触发条件时,不抓取AXI总线通道数据。In this step, the capturing the AXI bus channel data includes: the signal transmitted by the AW channel in the AXI bus signal satisfies a preset first trigger condition, or the signal transmitted by the AR channel in the AXI bus signal satisfies a preset second trigger. Grab the AXI bus channel data when conditions are met; at AXI total The signal transmitted by the AW channel in the line signal does not satisfy the preset first trigger condition, and the AXI bus channel data is not captured when the signal transmitted by the AR channel in the AXI bus signal does not satisfy the preset second trigger condition.
这里,预设的第一触发条件可以根据以下至少一个要素设置:AW通道传输的AWID信号、AW通道传输的AWADDR信号、AW通道传输的AWLEN信号、AW通道传输的AWSIZE信号、AW通道传输的AWBURST信号;预设的第二触发条件可以根据以下至少一个要素设置:AR通道传输的ARID信号、AR通道传输的ARADDR信号、AR通道传输的ARLEN信号、AR通道传输的ARSIZE信号、AR通道传输的ARBURST信号。Here, the preset first trigger condition may be set according to at least one of the following elements: an AWID signal transmitted by the AW channel, an AWADDR signal transmitted by the AW channel, an AWLEN signal transmitted by the AW channel, an AWSIZE signal transmitted by the AW channel, and AWBURST transmitted by the AW channel. The preset second trigger condition may be set according to at least one of the following elements: an ARID signal transmitted by the AR channel, an ARADDR signal transmitted by the AR channel, an ARLEN signal transmitted by the AR channel, an ARSIZE signal transmitted by the AR channel, and an ARBURST transmitted by the AR channel. signal.
本步骤中,所抓取的AXI总线通道数据为AXI总线信号中使能信号有效的各个通道的数据。这里,与AXI总线信号中每个通道信号对应的使能信号的有效性可以预先设置。In this step, the captured AXI bus channel data is the data of each channel in which the enable signal of the AXI bus signal is valid. Here, the validity of the enable signal corresponding to each channel signal in the AXI bus signal can be set in advance.
如此,通过合理地设置第一触发条件、第二触发条件和使能信号的有效性,可以灵活地抓取AXI总线通道数据,降低抓取的AXI总线通道数据的数据量。In this way, by reasonably setting the first trigger condition, the second trigger condition, and the validity of the enable signal, the AXI bus channel data can be flexibly captured, and the data amount of the captured AXI bus channel data can be reduced.
示例性地,下面通过一个具体例子对抓取AXI总线通道数据的过程进行说明。Illustratively, the process of capturing AXI bus channel data is described below by way of a specific example.
AXI协议支持Outstanding传输访问,即能够发出多个未完成的事务;AXI协议可以利用ID标记每个Burst传输,因此在本发明第一实施例中设置两个寄存器组id_reg及id_cnt,其中,寄存器组id_reg配置为记录每个Burst传输的ID号,寄存器组id_cnt配置为记录相同ID号的Burst传输到达的先后顺序的索引,这里,若存在相同的ID号的多个Burst传输,将第i1个到达的Burst传输的先后顺序的索引记为i1,i1为自然数。The AXI protocol supports Outstanding transport access, that is, can issue multiple unfinished transactions; the AXI protocol can mark each Burst transmission with an ID, so in the first embodiment of the present invention, two register groups id_reg and id_cnt are set, wherein the register set id_reg configured to record the ID number of each Burst transmission order index register set id_cnt Burst configured to record the transmission of the same ID number reaches, here, if the same ID number a plurality of transmission Burst exists, the first i 1 th The index of the order of arrival of the Burst transmission is denoted as i 1 , and i 1 is a natural number.
图2为本发明SoC总线行为检测方法的第一实施例中抓取AXI总线通道数据的过程的示意图,如图2所示,gbal_id_reg表示按照预先设置的查 询顺序排列的Burst传输的查询顺序,预先设置的查询顺序为图2中的箭头顺序(由上到下);寄存器组id_reg由多个存储单元(slot)组成,每个slot配置为存储一个ID号,寄存器组id_cnt也由多个slot组成,每个slot配置为存储一个索引的值。2 is a schematic diagram of a process of capturing AXI bus channel data in a first embodiment of a SoC bus behavior detection method according to the present invention. As shown in FIG. 2, gbal_id_reg indicates that a preset check is performed. The query order of the Burst transmissions in the order is set. The pre-set query order is the arrow order in FIG. 2 (top to bottom); the register group id_reg is composed of a plurality of storage units (slots), each slot is configured to store an ID. The register group id_cnt is also composed of multiple slots, and each slot is configured to store the value of an index.
图2描述了从T0时刻到T4时刻AXI总线通道数据的抓取过程,具体说明如下:Figure 2 depicts the capture process of AXI bus channel data from time T0 to time T4, as follows:
在T0时刻,第一数据抓取信号由无效变为有效,然而,此时还存在一个ID为0的Burst传输没有完成。At time T0, the first data capture signal is changed from invalid to valid, however, there is also a Burst transmission with ID 0 not completed at this time.
在T1时刻,接收到一个Burst传输的响应,在接收到的Burst传输的响应与T0时刻未完成的Burst传输匹配时,表示T0时刻未完成的ID为0的Burst传输已经在T1时刻完成,此时,在寄存器组id_reg和寄存器组id_cnt中,将与T0时刻未完成的ID为0的Burst传输相对应的slot无效,图2中,将无效的slot存储的数据标记为X。At time T1, a response of a Burst transmission is received. When the response of the received Burst transmission matches the Burst transmission that is not completed at time T0, the Burst transmission indicating that the ID of 0 is not completed at time T0 has been completed at time T1. At the time of the register group id_reg and the register group id_cnt, the slot corresponding to the Burst transmission whose ID is 0 which is not completed at time T0 is invalid. In FIG. 2, the data of the invalid slot is marked as X.
在T2时刻,针对新的Burst传输,在寄存器组id_reg和寄存器组id_cnt中,查找有效的slot,搜索出满足预设的第一触发条件或第二触发条件的Burst传输对应的slot,将该slot标记为“已匹配”;将不满足预设的第一触发条件且不满足预设的第二触发条件的Burst传输对应的slot标记为“不匹配”。这里,对于“不匹配”的slot,不需要抓取对应的Burst传输数据。图2中,标记为“已匹配”的slot对应T2时刻表格的第二行,标记为“不匹配”的slot对应T2时刻表格的第三行至第五行。At time T2, for the new Burst transmission, in the register group id_reg and the register group id_cnt, find a valid slot, and search for a slot corresponding to the Burst transmission that satisfies the preset first trigger condition or the second trigger condition, and the slot is selected. Marked as "matched"; the slot corresponding to the Burst transmission that does not satisfy the preset first trigger condition and does not satisfy the preset second trigger condition is marked as "mismatch". Here, for a "mismatch" slot, there is no need to grab the corresponding Burst transmission data. In Fig. 2, the slot labeled "matched" corresponds to the second row of the T2 timetable table, and the slot labeled "unmatched" corresponds to the third row to the fifth row of the T2 timetable table.
在T2时刻,对于写数据操作,如果写ID标记(WID)与标记为“已匹配”的slot中存储的ID相同,且对应的标记为“已匹配”的slot存储的索引的值最小,则认为WID与对应的标记为“已匹配”的slot中存储的ID匹配,此时将写数据(WDATA)、写选通(WSTRB)、写最后一个(WLAST)和写ID标记(WID)全部抓取,并将抓取后的数据发送到FIFO中。 At time T2, for the write data operation, if the write ID tag (WID) is the same as the ID stored in the slot labeled "matched", and the value of the index stored in the corresponding slot labeled "matched" is the smallest, then It is considered that the WID matches the ID stored in the corresponding slot marked as "matched", and at this time, the write data (WDATA), the write strobe (WSTRB), the write last (WLAST), and the write ID mark (WID) are all caught. Take and send the captured data to the FIFO.
在T2时刻,对于读数据操作,如果读ID标记(RID)与标记为“已匹配”的slot中存储的ID相同,且对应的标记为“已匹配”的slot存储的索引的值最小,则认为RID与对应的标记为“已匹配”的slot中存储的ID匹配,此时将读数据(RDATA)、读响应(RRESP)、RID及读最后一个(RLAST)全部抓取,并将抓取后的数据发送到FIFO中。At time T2, for the read data operation, if the read ID tag (RID) is the same as the ID stored in the slot marked "matched", and the value of the index stored in the corresponding slot marked "matched" is the smallest, then The RID is considered to match the ID stored in the corresponding slot labeled "matched", at which point the read data (RDATA), the read response (RRESP), the RID, and the last read (RLAST) are all fetched and will be fetched. The subsequent data is sent to the FIFO.
在T3时刻,对于写数据操作,在响应ID(BID)等于0时,如果BID与标记为“已匹配”的slot中存储的ID相同,且对应的标记为“已匹配”的slot存储的索引的值最小,则认为BID与对应的标记为“已匹配”的slot中存储的ID匹配,此时标记为“已匹配”的slot对应的Burst传输已经完成,因此将T3时刻Burst传输已经完成的slot标记为无效,该无效的slot对应图2中T3时刻表格的第二行;然后,在寄存器组id_reg和寄存器组id_cnt中,将其余ID等于0的slot对应的索引值均减1,并将写响应(BRESP)、BID发送到FIFO中。At time T3, for the write data operation, if the response ID (BID) is equal to 0, if the BID is the same as the ID stored in the slot marked "matched", and the corresponding index is marked as "matched". If the value of the BID is the smallest, the BID is considered to match the ID stored in the corresponding slot marked as "matched". At this time, the Burst transmission corresponding to the slot labeled "matched" has been completed, so the Burst transmission at T3 is completed. The slot flag is invalid, and the invalid slot corresponds to the second row of the T3 time table in FIG. 2; then, in the register group id_reg and the register group id_cnt, the index value corresponding to the slot with the remaining ID equal to 0 is decremented by one, and Write response (BRESP), BID is sent to the FIFO.
在T3时刻,对于读数据操作,在RID等于0且RLAST有效的情况下,如果RID与标记为“已匹配”的slot中存储的ID相同,且对应的标记为“已匹配”的slot存储的索引的值最小,则认为标记为“已匹配”的slot对应的Burst传输已经完成,因此将T3时刻Burst传输已经完成的slot标记为无效;然后,在寄存器组id_reg和寄存器组id_cnt中,将其余ID等于0的slot对应的索引值均减1,并将RLAST、RDATA和RRESP发送到FIFO中。At time T3, for a read data operation, if RID is equal to 0 and RLAST is valid, if the RID is the same as the ID stored in the slot labeled "matched", and the corresponding slot marked "matched" is stored If the value of the index is the smallest, it is considered that the Burst transmission corresponding to the slot marked as "matched" has been completed, so the slot in which the Burst transmission has been completed at T3 is marked as invalid; then, in the register group id_reg and the register group id_cnt, the rest The index value corresponding to the slot with ID equal to 0 is decremented by 1, and RLAST, RDATA, and RRESP are sent to the FIFO.
在T4时刻,对于写数据操作,在BID等于0时,如果BID与标记为“不匹配”的slot中存储的ID相同,且对应的标记为“不匹配”的slot存储的索引的值最小,则认为BID与对应的标记为“不匹配”的slot中存储的ID匹配,此时标记为“不匹配”的slot对应的Burst传输已经完成,仅将T4时刻Burst传输已经完成的slot标记为无效,而不进行数据的抓取和发送,这时因为Burst传输并不满足预设的第一触发条件和第二触发条件。 At time T4, for the write data operation, if the BID is equal to 0, if the BID is the same as the ID stored in the slot marked as "mismatching", and the corresponding index of the slot marked as "unmatched" stores the smallest value, The BID is considered to match the ID stored in the corresponding slot marked as “mismatched”. At this time, the Burst transmission corresponding to the slot marked as “mismatched” has been completed, and only the slot in which Burst transmission has been completed at T4 is marked as invalid. Without the data being fetched and sent, the Burst transmission does not satisfy the preset first trigger condition and the second trigger condition.
在T4时刻,对于读数据操作,在RID等于0且RLAST有效的情况下,如果RID与标记为“不匹配”的slot中存储的ID相同,且对应的标记为“不匹配”的slot存储的索引的值最小,则认为标记为“不匹配”的slot对应的Burst传输已经完成,此时仅将T4时刻Burst传输已经完成的slot标记为无效,该标记为无效的slot对应图2中T4时刻表格的第三行;在T4时刻不进行数据的抓取,这是因为Burst传输并不满足预设的第一触发条件和第二触发条件。At time T4, for a read data operation, in the case where RID is equal to 0 and RLAST is valid, if the RID is the same as the ID stored in the slot marked "unmatched", and the corresponding slot marked "mismatching" is stored. If the value of the index is the smallest, it is considered that the Burst transmission corresponding to the slot marked as "unmatched" has been completed. At this time, only the slot whose Burst transmission has been completed at T4 is marked as invalid, and the slot marked as invalid corresponds to the time T4 in FIG. The third line of the table; no data grabbing is performed at time T4 because the Burst transmission does not satisfy the preset first trigger condition and the second trigger condition.
本步骤中,进行AXI总线数据传输时通常使用Burst传输机制进行数据传输,Burst传输机制包括但不限于递增猝发、回卷猝发。In this step, the data transmission is usually performed by using the Burst transmission mechanism when performing AXI bus data transmission, and the Burst transmission mechanism includes but is not limited to incremental bursting and rewinding bursting.
示例性地,进行AXI总线数据传输时每次统计的总线传输的平均延时可以根据以下公式计算:Illustratively, the average delay of each statistical bus transmission for AXI bus data transmission can be calculated according to the following formula:
T=total_delay/nT=total_delay/n
其中,T表示对应一次统计的总线传输的平均延时,Total_delay表示对应的统计时间内各个Burst传输所耗费的时间之和,n表示对应的统计时间内所发生的Burst传输的个数;具体地,Total_delay=T1+T2+…+Tn,T1至Tn分别表示对应的统计时间内第1个Burst传输至第n个Burst传输所耗费的时间。Where T represents the average delay of the bus transmission corresponding to one statistic, Total_delay represents the sum of the time spent on each Burst transmission in the corresponding statistical time, and n represents the number of Burst transmissions occurring in the corresponding statistical time; , Total_delay=T1+T2+...+Tn, T1 to Tn respectively indicate the time taken for the first Burst transmission to the nth Burst transmission in the corresponding statistical time.
进行AXI总线数据传输时每次统计的总线传输所占有的平均带宽可以根据以下公式计算:The average bandwidth occupied by the bus transmission for each AXI bus data transmission can be calculated according to the following formula:
B=total_byte/total_cycleB=total_byte/total_cycle
其中,B表示对应的一次统计的总线传输所占有的平均带宽,total_byte表示对应的统计时间内各个Burst传输所传输的数据量的和,单位为位,total_cycle表示对应的统计时间所经历的时钟周期数,total_cycle为自然数;具体地,total_byte的计算公式为:Total_byte=(L1+L2+…+Ln)*8,其中,L1至Ln分别表示对应的统计时间内第1个Burst传输至第n个Burst传输所传输的数据量,单位为字节。 Where B is the average bandwidth occupied by the corresponding one-time bus transmission, and total_byte is the sum of the amount of data transmitted by each Burst transmission in the corresponding statistical time. The unit is bit, and total_cycle indicates the clock period experienced by the corresponding statistical time. The number, total_cycle is a natural number; specifically, the calculation formula of total_byte is: Total_byte=(L1+L2+...+Ln)*8, where L1 to Ln respectively indicate the first Burst transmission to the nth Burst in the corresponding statistical time. The amount of data transferred by the transmission, in bytes.
图3为本发明SoC总线行为检测方法的第一实施例中统计一次总线传输参数的时序示意图,如图3所示,ACLK表示全局时钟信号,AWVALID表示写地址有效,AWREADY表示写地址准备,AWADDR表示写地址,AWSIZE表示一次写传输中一拍数据的最大字节数,AWLEN指示一次写传输有多少拍数据,BVALID表示写响应有效,BREADY表示响应准备,BRESP表示写响应;图3中示例性的说明了T1至Tn的含义。3 is a timing diagram of counting a bus transmission parameter in the first embodiment of the SoC bus behavior detecting method of the present invention. As shown in FIG. 3, ACLK represents a global clock signal, AWVALID indicates that a write address is valid, and AWREADY indicates a write address preparation, AWADDR. Indicates the write address, AWSIZE indicates the maximum number of bytes of a beat data in a write transfer, AWLEN indicates how many beat data is written in one write, BVALID indicates that the write response is valid, BREADY indicates the response preparation, and BRESP indicates the write response; The meaning of T1 to Tn is explained.
进一步地,所述对进行AXI总线数据传输时的总线传输参数进行至少一次统计包括:接收统计触发信号;在统计触发信号有效时,对进行AXI总线数据传输时总线传输参数依次进行至少一次统计,在统计触发信号无效时,停止对进行AXI总线数据传输时总线传输参数进行统计。这里,统计触发信号的有效性可以预先设置,例如,统计触发信号为高电平信号或低电平信号,当统计触发信号为高电平信号时,表明统计触发信号有效;否则,当统计触发信号为低电平信号时,表明统计触发信号无效。Further, the at least one statistics of the bus transmission parameters when performing AXI bus data transmission include: receiving a statistical trigger signal; and when the statistical trigger signal is valid, performing bus transmission parameters for AXI bus data transmission at least once in sequence, When the statistical trigger signal is invalid, stop counting the bus transmission parameters when performing AXI bus data transmission. Here, the validity of the statistical trigger signal may be preset. For example, the statistical trigger signal is a high level signal or a low level signal. When the statistical trigger signal is a high level signal, it indicates that the statistical trigger signal is valid; otherwise, when the statistical trigger is triggered When the signal is low level, it indicates that the statistical trigger signal is invalid.
具体地,可以采用如下两种统计模式来确定每次统计的终止时间点。Specifically, the following two statistical modes can be used to determine the end time point of each statistic.
第一种统计模式:对进行AXI总线数据传输时的总线传输参数进行第1次统计的开始时间点为统计触发信号由无效变为有效的时刻,终止时间点为以下两个时间点中较早的时间点:统计触发信号由有效变为无效的时刻、第1次统计所经历的时钟周期数超过预设的时钟周期数Fixed_cycle的时刻。The first statistical mode: the starting time point of the first statistics of the bus transmission parameters when performing AXI bus data transmission is the time when the statistical trigger signal changes from invalid to valid, and the termination time point is earlier among the following two time points. Time point: The time when the trigger signal is valid from invalid to invalid, and the number of clock cycles experienced by the first statistic exceeds the preset number of clock cycles Fixed_cycle.
当j大于1时,对进行AXI总线数据传输时总线传输参数进行第j次统计的开始时间点为第j-1次统计的终止时间点或第j-1次统计的终止时间点之后总线握手首次成功的时刻,对进行AXI总线数据传输时总线传输参数进行第j次统计的终止时间点为以下两个时间点中的较早的时间点:统计触发信号由有效变为无效的时刻、第j次统计所经历的时钟周期数超过预设的时钟周期数Fixed_cycle的时刻。When j is greater than 1, the start time point of the j-th statistics of the bus transmission parameters when performing AXI bus data transmission is the termination time point of the j-1th statistic or the termination time point of the j-1th statistic. At the first successful moment, the end time point of the jth statistics of the bus transmission parameters when performing AXI bus data transmission is the earlier time point of the following two time points: the time when the statistical trigger signal is changed from valid to invalid, The number of clock cycles experienced by j statistics exceeds the preset number of clock cycles Fixed_cycle.
第二种统计模式:对进行AXI总线数据传输时总线传输参数进行第1 次统计的开始时间点为统计触发信号由无效变为有效的时刻,终止时间点为以下两个时间点中的较早的时间点:统计触发信号由有效变为无效的时刻、进行第1次统计时各个Burst传输所传输的数据量的和大于预设的数据量Fixed byte的时刻。The second statistical mode: the first bus transmission parameters for AXI bus data transmission The starting time point of the secondary statistic is the time when the statistical trigger signal changes from invalid to valid, and the ending time point is the earlier time point of the following two time points: the time when the statistical trigger signal is changed from valid to invalid, and the first time is performed. The sum of the amount of data transmitted by each Burst transmission is greater than the preset data amount of the fixed byte.
当j大于1时,对进行AXI总线数据传输时总线传输参数进行第j次统计的开始时间点为第j-1次统计的终止时间点或第j-1次统计的终止时间点之后总线握手首次成功的时刻,对进行AXI总线数据传输时总线传输参数进行第j次统计的终止时间点为以下两个时间点中的较早的时间点:统计触发信号由有效变为无效的时刻、进行第j次统计时各个Burst传输所传输的数据量的和大于预设的数据量Fixed byte的时刻。When j is greater than 1, the start time point of the j-th statistics of the bus transmission parameters when performing AXI bus data transmission is the termination time point of the j-1th statistic or the termination time point of the j-1th statistic. At the first successful moment, the end time point of the j-th statistics of the bus transmission parameters when performing AXI bus data transmission is the earlier time point of the following two time points: the time when the statistical trigger signal is changed from valid to invalid, The sum of the amount of data transmitted by each Burst transmission at the jth count is greater than the preset data amount of the fixed byte.
这里,第一种统计模式可以称为规定时钟周期数的统计模式,第二种统计模式可以称为规定数据量的统计模式。Here, the first statistical mode may be referred to as a statistical mode specifying the number of clock cycles, and the second statistical mode may be referred to as a statistical mode specifying a data amount.
示例性地,下面通过一个具体例子对进行AXI总线数据传输时统计总线传输参数的过程进行说明。Illustratively, a process of statistical bus transmission parameters for AXI bus data transmission will be described below by way of a specific example.
由于AXI协议可以利用ID标记每个Burst传输,因此通过记录AXI总线上ID的变化,可以计算每个Burst传输的延时和他们花费的总延时。具体地,设置三个寄存器组gbal_ID_reg、ID_reg和ID_cnt,其中,寄存器组gbal_ID_reg配置为记录整个统计时间内每个Burst传输的ID,寄存器组ID_reg配置为记录统计触发信号有效的时间内每个Burst传输的ID,寄存器组ID_cnt配置为记录相同ID号的Burst传输到达的先后顺序的索引,这里,若存在相同的ID号的多个Burst传输,将第i2个到达的Burst传输的先后顺序的索引记为i2,i2为自然数。Since the AXI protocol can mark each Burst transmission with an ID, by recording the change in the ID on the AXI bus, the delay of each Burst transmission and the total delay they spend can be calculated. Specifically, three register sets gbal_ID_reg, ID_reg, and ID_cnt are set, wherein the register set gbal_ID_reg is configured to record the ID of each Burst transmission in the entire statistical time, and the register set ID_reg is configured to record each Burst transmission in a time period in which the statistical trigger signal is valid. the ID, register set ID_cnt configured to record the sequence index Burst transmission of the same ID number reaches, here, if there is a plurality of the same ID number Burst transmissions, i 2 the order in which the order of arrival is transmitted Burst index Recorded as i 2 , i 2 is a natural number.
图4为本发明SoC总线行为检测方法的第一实施例中统计总线传输参数的过程的示意图,如图4所示,寄存器组gbal_ID_reg存储的ID号按照预先设置的查询顺序排列,预先设置的查询顺序为图4中的箭头顺序(由 上到下);,寄存器组gbal_ID_reg由多个slot组成,每个slot配置为存储一个ID号,寄存器组ID_reg由多个slot组成,每个slot配置为存储一个ID号,寄存器组ID_cnt由多个slot组成,每个slot配置为存储一个索引的值。寄存器组ID_reg和寄存器组ID_cnt的深度为5。图4示例性地描述了从T0时刻到T4时刻统计总线传输参数的过程,具体说明如下:4 is a schematic diagram of a process of statistical bus transmission parameters in a first embodiment of the SoC bus behavior detection method according to the present invention. As shown in FIG. 4, the ID numbers stored in the register group gbal_ID_reg are arranged according to a preset query order, and a preset query is performed. The order is the order of the arrows in Figure 4 (by Up to down);, the register group gbal_ID_reg is composed of multiple slots, each slot is configured to store an ID number, the register group ID_reg is composed of multiple slots, each slot is configured to store an ID number, and the register group ID_cnt is composed of multiple A slot consisting of each slot configured to store the value of an index. The register group ID_reg and the register group ID_cnt have a depth of 5. Figure 4 exemplarily describes the process of counting bus transmission parameters from time T0 to time T4, as follows:
在T0时刻,统计触发信号无效,还有两个Burst传输的响应没有返回,即图4中寄存器组gbal_ID_reg中ID为0的Burst传输响应没有返回;这里,寄存器组gbal_ID_reg中ID为X的slot为无效的slot,该无效的slot对应图4中T0时刻的第一行和第三行。在T0时刻,不记录没有返回响应的Burst传输的ID顺序,只记录没有返回响应的Burst传输的ID;在任意一个Burst传输的响应返回时,将对应的返回响应的Burst传输的RID/BID与寄存器组gbal_ID_reg中ID进行比较;在对应的返回响应的Burst传输的RID/BID与寄存器组gbal_ID_reg中的ID匹配时,将对应的slot无效,直至寄存器组gbal_ID_reg中所有的slot都无效。At time T0, the statistical trigger signal is invalid, and the response of two Burst transmissions is not returned. That is, the Burst transmission response with ID 0 in the register group gbal_ID_reg in Figure 4 is not returned; here, the slot with the ID X in the register group gbal_ID_reg is Invalid slot, the invalid slot corresponds to the first line and the third line at time T0 in FIG. At time T0, the ID order of the Burst transmission without returning the response is not recorded, only the ID of the Burst transmission without returning the response is recorded; when the response of any one of the Burst transmissions is returned, the RID/BID of the corresponding Burst transmission of the return response is The ID in the register group gbal_ID_reg is compared; when the RID/BID of the corresponding Burst transmission of the corresponding response matches the ID in the register group gbal_ID_reg, the corresponding slot is invalid until all the slots in the register group gbal_ID_reg are invalid.
在T1时刻,统计触发信号变为无效,新的Burst传输有效,针对新的Burst传输,在寄存器组ID_reg和寄存器组ID_cnt中,查找有效的slot,搜索出满足预设的第一触发条件或第二触发条件的Burst传输对应的slot,将该slot标记为“已匹配”,标记为“已匹配”的slot对应T1时刻表格的第二行。在T1时刻,将不满足预设的第一触发条件且不满足预设的第二触发条件的Burst传输对应的slot标记为“不匹配”。这里,对于“不匹配”的slot,不需要抓取对应的总线传输数据。At time T1, the statistical trigger signal becomes invalid, and the new Burst transmission is valid. For the new Burst transmission, in the register group ID_reg and the register group ID_cnt, a valid slot is searched, and the first trigger condition or the first condition that satisfies the preset is searched. The slot corresponding to the Burst transmission of the two trigger conditions marks the slot as "matched", and the slot labeled "matched" corresponds to the second row of the T1 time table. At time T1, the slot corresponding to the Burst transmission that does not satisfy the preset first trigger condition and does not satisfy the preset second trigger condition is marked as “unmatched”. Here, for a "mismatch" slot, there is no need to grab the corresponding bus transfer data.
针对标记为“已匹配”的Burst传输,从新的Burst传输有效开始的时刻对时钟周期数进行计数。For Burst transmissions labeled "matched", the number of clock cycles is counted from the moment the new Burst transmission is effectively started.
需要说明的是,在T1时刻,当ID号为0的Burst传输的响应返回时,需要先在寄存器组ID_reg和寄存器组ID_cnt中,将与统计触发信号有效前 寄存器组gbal_ID_reg中ID为0的Burst传输对应的slot无效,以避免统计触发信号有效前Burst传输对统计造成影响,这里,无效的slot对应图4中T1时刻表格的第三行。It should be noted that, at time T1, when the response of the Burst transmission with ID number 0 is returned, it needs to be in the register group ID_reg and the register group ID_cnt before the valid trigger signal is valid. The slot corresponding to the Burst transmission with the ID of 0 in the register group gbal_ID_reg is invalid to avoid the influence of the Burst transmission on the statistics before the statistical trigger signal is valid. Here, the invalid slot corresponds to the third line of the T1 time table in FIG.
在T2时刻,当ID号为0的Burst传输的响应返回时,在寄存器组ID_reg和寄存器组ID_cnt中,将与统计触发信号有效前寄存器组gbal_ID_reg中ID为0的Burst传输对应的slot无效,以避免统计触发信号有效前Burst传输对统计造成影响。从图4中可以看出,此时,统计触发信号有效前所有的Burst传输均已传输完成。At time T2, when the response of the Burst transmission with ID number 0 returns, in the register group ID_reg and the register group ID_cnt, the slot corresponding to the Burst transmission with the ID of 0 in the register group gbal_ID_reg before the statistical trigger signal is valid is invalid. Avoid the statistical impact of the Burst transmission before the statistical trigger signal is valid. As can be seen from Figure 4, at this time, all Burst transmissions have been transmitted before the statistical trigger signal is valid.
在T3时刻,新的Burst传输有效,针对新的Burst传输,在寄存器组ID_reg和寄存器组ID_cnt中,查找有效的slot,搜索出满足预设的第一触发条件或第二触发条件的Burst传输对应的slot,在T3时刻,将不满足预设的第一触发条件且不满足预设的第二触发条件的Burst传输对应的slot标记为“不匹配”。这里,对于“不匹配”的slot,不需要抓取对应的Burst传输数据;这里,“不匹配”的slot对应图4中T3时刻表格的第一行。At time T3, the new Burst transmission is valid. For the new Burst transmission, in the register group ID_reg and the register group ID_cnt, find a valid slot, and search for a Burst transmission corresponding to the preset first trigger condition or the second trigger condition. The slot, at time T3, marks the slot corresponding to the Burst transmission that does not satisfy the preset first trigger condition and does not satisfy the preset second trigger condition as "no match". Here, for the "mismatch" slot, it is not necessary to grab the corresponding Burst transmission data; here, the "mismatch" slot corresponds to the first row of the T3 time table in FIG.
在T4时刻,ID为0的Burst传输的响应返回,由于统计触发信号有效前的Burst传输均已传输完成,此时,在寄存器组ID_reg和寄存器组ID_cnt中,查找ID为0且索引值为1的slot,将该slot无效,该slot对应图4中T4时刻表格的第二行,停止对时钟周期数的计数,得出完成对应的Burst传输所耗费的时间。在T4时刻,新的Burst传输出现,该Burst传输满足预设的第一触发条件或第二触发条件,将该Burst传输对应的slot标记为“已匹配”,重新针对该新的Burst传输进行时钟周期数的计数,这里,该标记为“已匹配”的slot对应图4中T4时刻表格的第三行。At time T4, the response of the Burst transmission with ID 0 is returned. Since the Burst transmission before the statistical trigger signal is valid has been transmitted, at this time, in the register group ID_reg and the register group ID_cnt, the search ID is 0 and the index value is 1. The slot invalidates the slot, and the slot corresponds to the second row of the T4 time table in FIG. 4, stops counting the number of clock cycles, and obtains the time taken to complete the corresponding Burst transmission. At time T4, a new Burst transmission occurs, the Burst transmission satisfies a preset first trigger condition or a second trigger condition, and the slot corresponding to the Burst transmission is marked as "matched", and the clock is re-clocked for the new Burst transmission. The count of the number of cycles, where the slot labeled "matched" corresponds to the third row of the table at time T4 in FIG.
进一步地,AXI总线可以连接多个主设备以及多个从设备;在一个主设备通过AXI总线读取一个从设备的数据,或者,一个主设备通过AXI总线向一个从设备写入数据时,可以根据预先配置的任意一个主设备的地址, 来统计该主设备读写数据时的平均时延和所占有的平均带宽;同理,可以根据预先配置的任意一个从设备的地址,来统计从设备被读取数据/被写入数据时的平均时延和所占用的平均带宽;进一步地,可以根据预先配置的任意一个主设备和任意一个从设备的地址,来统计对应主设备读写对应从设备的数据时的平均时延和所占用的平均带宽。Further, the AXI bus can connect multiple master devices and multiple slave devices; when one master device reads data of one slave device through the AXI bus, or when one master device writes data to a slave device through the AXI bus, According to the address of any pre-configured master device, To calculate the average delay and the average bandwidth occupied by the master device when reading and writing data; similarly, it can count the data read/written data from the device according to the address of any slave device configured in advance. The average delay and the average bandwidth occupied; further, the average delay and the occupied time when the corresponding master device reads and writes the data of the corresponding slave device according to the address of any one of the pre-configured master devices and any one of the slave devices Average bandwidth.
在一实施例中,还可以设置寄存器来存储统计结果,统计结果只能存储一次的统计结果,统计窗口(window)(统计触发信号有效的持续时间)结束后,通过发中断请求读取统计结果,一次统计window结束后即刻自动进入下一次统计window,直到关闭统计功能,从而实现对AXI数据传输时传输参数进的多次统计。In an embodiment, a register may be set to store the statistical result, and the statistical result can only be stored once, and after the statistics window (the duration of the valid trigger signal is valid), the statistical result is read by sending an interrupt request. Once the statistics window is finished, it will automatically enter the next statistical window until the statistics function is turned off, thus achieving multiple statistics of the transmission parameters during AXI data transmission.
可以看出,对进行AXI总线数据传输时总线传输参数进行多次统计时,可以实现统计触发信号有效的持续时间内总线传输参数的连续统计,如此,可以绘制出总线传输参数随时间的变化波形图,有利于更准确的掌握总线行为。It can be seen that when the bus transmission parameters are counted multiple times during the AXI bus data transmission, the continuous statistics of the bus transmission parameters in the duration of the statistical trigger signal can be realized, so that the waveform of the bus transmission parameters with time can be drawn. Figure, which helps to grasp the bus behavior more accurately.
图5为本发明SoC总线行为检测方法的第一实施例中进行连续统计的时序示意图,如图5所示,window表示统计触发信号有效的持续时间,ACLK表示全局时钟信号,START表示统计触发信号,当START为高电平时,表示统计触发信号有效,当START为低电平时,表示统计触发信号无效;perf表示统计结果获取时序,P1至Pk分别表示统计触发信号有效的持续时间内获取的k个统计结果,k大于1;end_flag为高电平信号或低电平信号,当end_flag为低电平信号时,表示正在进行某一次统计,当end_flag变为高电平,end_flag拉起时,表示某一次统计终止。FIG. 5 is a timing diagram of continuous statistics in the first embodiment of the SoC bus behavior detecting method according to the present invention. As shown in FIG. 5, the window represents the duration of the valid trigger signal, the ACLK represents the global clock signal, and the START represents the statistical trigger signal. When START is high, it indicates that the statistical trigger signal is valid. When START is low, it indicates that the statistical trigger signal is invalid; perf indicates the statistical result acquisition timing, and P1 to Pk respectively indicate the k obtained during the duration of the valid statistical trigger signal. Statistics result, k is greater than 1; end_flag is a high level signal or a low level signal. When end_flag is a low level signal, it indicates that a certain statistic is being performed. When end_flag becomes high level and end_flag is pulled up, it indicates A certain statistic is terminated.
进一步地,如果步骤100中SoC总线信号还包括ACE总线信号,则在本步骤中,还需要基于接收的ACE总线信号抓取ACE总线通道数据。Further, if the SoC bus signal further includes the ACE bus signal in step 100, in this step, the ACE bus channel data needs to be captured based on the received ACE bus signal.
具体地,所述抓取ACE总线通道数据包括:接收第二数据抓取信号; 在第二数据抓取信号有效时,对接收的ACE总线各个通道的数据进行抓取,在第二数据抓取信号无效时,停止对接收的ACE总线各个通道的数据的抓取流程。这里,第二数据抓取信号的有效性可以预先设置,例如,第二数据抓取信号为高电平信号或低电平信号,当第二数据抓取信号为高电平信号时,表明第二数据抓取信号有效;否则,当第二数据抓取信号为低电平信号时,表明第二数据抓取信号无效。Specifically, the capturing the ACE bus channel data includes: receiving the second data capture signal; When the second data capture signal is valid, the data of each channel of the received ACE bus is captured, and when the second data capture signal is invalid, the data acquisition process of each channel of the received ACE bus is stopped. Here, the validity of the second data capture signal may be preset, for example, the second data capture signal is a high level signal or a low level signal, and when the second data capture signal is a high level signal, indicating The second data capture signal is valid; otherwise, when the second data capture signal is a low level signal, it indicates that the second data capture signal is invalid.
本步骤中,所述抓取ACE总线通道数据包括:在ACE总线信号AC通道传输的信号满足预设的第三触发条件时,抓取ACE总线通道数据;在ACE总线信号AC通道传输的信号不满足预设的第三触发条件时,不抓取ACE总线通道数据。In this step, the data of the ACE bus channel is captured: when the signal transmitted by the AC channel of the ACE bus signal satisfies the preset third trigger condition, the data of the ACE bus channel is captured; the signal transmitted by the AC channel of the ACE bus signal is not When the preset third trigger condition is met, the ACE bus channel data is not captured.
这里,预设的第三触发条件可以根据以下至少一个要素设置:AC通道传输的ACADDR信号、AC通道传输的ACSNOOP信号。Here, the preset third trigger condition may be set according to at least one of the following elements: an ACADDR signal transmitted by the AC channel, and an ACSNOOP signal transmitted by the AC channel.
本步骤中,所抓取的ACE总线通道数据为ACE总线信号中使能信号有效的各个通道的数据。这里,与ACE总线信号中每个通道信号对应的使能信号的有效性可以预先设置。In this step, the captured ACE bus channel data is the data of each channel in which the enable signal of the ACE bus signal is valid. Here, the validity of the enable signal corresponding to each channel signal in the ACE bus signal can be set in advance.
如此,通过合理地设置第三触发条件和使能信号的有效性,可以灵活地抓取ACE总线通道数据,降低抓取的ACE总线通道数据的数据量。In this way, by reasonably setting the third trigger condition and the validity of the enable signal, the ACE bus channel data can be flexibly captured, and the data amount of the captured ACE bus channel data can be reduced.
示例性地,下面通过一个具体例子对抓取ACE总线通道数据的过程进行说明。Illustratively, the process of capturing ACE bus channel data is described below by way of a specific example.
ACE总线协议不支持利用ID标记每个Burst传输,在本发明第一实施例中设置寄存器组cnt、cnt_cd、max_cnt、max_cnt_cd,其中,寄存器组cnt配置为记录AC通道传输的先后顺序,寄存器组cnt包括多个slot,每个slot配置为存储一个表示AC通道传输的先后顺序的索引值,在有多个AC通道传输的信号先后到达的情况下,索引值越小,则说明对应的AC通道传输的信号越先到达;寄存器组cnt_cd配置为记录CD通道传输的先后顺序,寄 存器组cnt包括多个slot,每个slot配置为存储一个表示CD通道传输的先后顺序的索引值,在有多个CD通道传输的信号先后到达的情况下,索引值越小,则说明对应的CD通道传输的信号越先到达。通常,寄存器组cnt和寄存器组cnt_cd存储的索引值大于等于1的自然数。The ACE bus protocol does not support the use of ID to mark each Burst transmission. In the first embodiment of the present invention, the register sets cnt, cnt_cd, max_cnt, max_cnt_cd are set, wherein the register set cnt is configured to record the sequence of AC channel transmission, the register group cnt Including a plurality of slots, each slot is configured to store an index value indicating the sequence of transmission of the AC channel. When the signals transmitted by multiple AC channels arrive one after another, the smaller the index value indicates the corresponding AC channel transmission. The signal arrives first; the register group cnt_cd is configured to record the sequence of CD channel transmissions, The register group cnt includes a plurality of slots, and each slot is configured to store an index value indicating a sequence of transmission of the CD channel. When the signals transmitted by the plurality of CD channels arrive one after another, the smaller the index value, the corresponding The signal transmitted by the CD channel arrives first. Usually, the register group cnt and the register group cnt_cd store index values greater than or equal to one.
图6为本发明SoC总线行为检测方法的第一实施例中抓取ACE总线通道数据的过程的示意图,如图6所示,寄存器组max_cnt包括至少一个slot,每个slot配置为记录第二数据抓取信号有效前未传输完成的一个Burst传输对应的AC通道传输的先后顺序的索引值;寄存器组max_cnt_cd包括至少一个slot,每个slot配置为记录第二数据抓取信号有效前未传输完成的一个Burst传输对应的CD通道传输的先后顺序的索引值。6 is a schematic diagram of a process of capturing ACE bus channel data in a first embodiment of a SoC bus behavior detection method according to the present invention. As shown in FIG. 6, the register group max_cnt includes at least one slot, and each slot is configured to record second data. The index value of the sequence of the AC channel transmission corresponding to a Burst transmission that is not transmitted before the capture signal is valid; the register group max_cnt_cd includes at least one slot, and each slot is configured to record that the second data capture signal is not transmitted before being valid. A Burst transmits the index value of the sequence of the corresponding CD channel transmission.
图6示例性地描述了从T0时刻到T4时刻ACE总线通道数据的抓取过程,具体说明如下:FIG. 6 exemplarily describes the process of capturing the ACE bus channel data from time T0 to time T4, which is specifically described as follows:
在T0时刻,第二数据抓取信号无效,CRRESP信号或CDLAST信号有效,此时直至寄存器组max_cnt和寄存器组max_cnt_cd中每个slot记录的索引值变为不断进行减1处理,直至寄存器组max_cnt和寄存器组max_cnt_cd中每个slot记录的索引值变为0,此时第二数据抓取信号有效前所有的Burst传输均已完成。At time T0, the second data capture signal is invalid, and the CRRESP signal or the CDLAST signal is valid. At this time, until the index value of each slot record in the register group max_cnt and the register group max_cnt_cd is continuously decremented by 1 until the register group max_cnt and The index value of each slot record in the register group max_cnt_cd becomes 0, and all Burst transmissions are completed before the second data capture signal is valid.
在T1时刻,第二数据抓取信号有效,如果ACE总线信号满足预设的第三触发条件,则将寄存器组cnt/寄存器组cnt_cd中对应的slot标记为“已匹配”,这里,标记为“已匹配”的slot对应图6中T1时刻表格的第二行和第四行,此时,将标记为“已匹配”的slot对应的AC通道传输的信号发送到FIFO中,AC通道传输的信号至少包括以下一种:ACVALID信号、ACREADY信号、ACADDR信号、ACSNOOP信号、ACPORT信号。At time T1, the second data capture signal is valid. If the ACE bus signal satisfies the preset third trigger condition, the corresponding slot in the register set cnt/register set cnt_cd is marked as "matched", here, labeled " The matched slot corresponds to the second row and the fourth row of the T1 time table in FIG. 6. At this time, the signal transmitted by the AC channel corresponding to the slot labeled "matched" is sent to the FIFO, and the signal transmitted by the AC channel is transmitted. At least one of the following is included: ACVALID signal, ACREADY signal, ACADDR signal, ACSNOP signal, ACPORT signal.
在T1时刻,如果AC通道传输的数据/CD通道传输的数据不满足预设的第三触发条件,则将寄存器组cnt/寄存器组cnt_cd中对应的slot标记为“不 匹配”,这里,标记为“不匹配”的slot对应图6中T1时刻表格的第一行、第三行和第五行。At time T1, if the data transmitted by the data channel/CD channel transmitted by the AC channel does not satisfy the preset third trigger condition, the corresponding slot in the register group cnt/register group cnt_cd is marked as "no". Matching, here, the slot labeled "mismatch" corresponds to the first row, the third row, and the fifth row of the T1 time table in FIG.
在T2时刻,CDLAST信号有效,此时将寄存器组cnt_cd中索引值为1的slot无效,并将寄存器组cnt_cd中记录的其余索引值全部减1,这里,该无效的slot在图6中用索引值X表示;在T2时刻,ACE总线信号满足预设的第三触发条件,则将寄存器组cnt/寄存器组cnt_cd中对应的slot标记为“已匹配”,此时,将标记为“已匹配”的slot对应的CD通道传输的信号发送到FIFO中,CD通道传输的信号至少包括以下一种:CDVALID信号、CDREADY信号、CDDATA信号、CDLAST信号。At time T2, the CDLAST signal is valid. At this time, the slot with the index value of 1 in the register group cnt_cd is invalid, and the remaining index values recorded in the register group cnt_cd are all decremented by 1. Here, the invalid slot is indexed in FIG. The value X indicates; at time T2, the ACE bus signal satisfies the preset third trigger condition, and the corresponding slot in the register group cnt/register group cnt_cd is marked as "matched", and at this time, it will be marked as "matched". The signal transmitted by the CD channel corresponding to the slot is sent to the FIFO, and the signal transmitted by the CD channel includes at least one of the following: a CDVALID signal, a CDREADY signal, a CDDATA signal, and a CDLAST signal.
在T3时刻,CRRESP信号有效,此时将寄存器组cnt中索引值为1的slot无效,并将寄存器组cnt中记录的其余索引值全部减1,这里,该无效的slot在图6中用索引值X表示;在T3时刻,ACE总线信号满足预设的第三触发条件,则将寄存器组cnt/寄存器组cnt_cd中对应的slot标记为“已匹配”,此时,将标记为“已匹配”的slot对应的CR通道传输的信号发送到FIFO中,CR通道传输的信号至少包括以下一种:CRVALID信号、CRREADY信号、CRRESP信号。At time T3, the CRRESP signal is valid. At this time, the slot with the index value of 1 in the register group cnt is invalid, and the remaining index values recorded in the register group cnt are all decremented by 1. Here, the invalid slot is indexed in FIG. The value X indicates; at time T3, the ACE bus signal satisfies the preset third trigger condition, and the corresponding slot in the register set cnt/register group cnt_cd is marked as "matched", and at this time, it will be marked as "matched". The signal transmitted by the CR channel corresponding to the slot is sent to the FIFO, and the signal transmitted by the CR channel includes at least one of the following: a CRVALID signal, a CRREADY signal, and a CRRESP signal.
在T4时刻,CRRESP信号和CDLAST信号有效,将寄存器组cnt中索引值为1的slot无效,将寄存器组cnt_cd中索引值为1的slot无效,并将寄存器组cnt_cd和寄存器组cnt中记录的其余索引值全部减1;在T4时刻ACE总线信号不满足预设的第三触发条件,则将寄存器组cnt/寄存器组cnt_cd中对应的slot标记为“不匹配”,此时,不会将抓取ACE总线通道数据。At time T4, the CRRESP signal and the CDLAST signal are valid, the slot with the index value of 1 in the register group cnt is invalid, the slot with the index value of 1 in the register group cnt_cd is invalid, and the rest of the register group cnt_cd and the register group cnt are recorded. The index value is all decremented by one; when the ACE bus signal does not satisfy the preset third trigger condition at time T4, the corresponding slot in the register group cnt/register group cnt_cd is marked as “no match”, and at this time, the grab will not be grabbed. ACE bus channel data.
实际应用时,还可以监控死锁的发生,当死锁发生时,抓取发生死锁时的ID和地址,据此可以推断出死锁是由哪个主设备引起的。还可以监控访问异常地址,当访问异常发生时发出中断,并且抓取发生异常时的地址 和ID,据此可以推断出异常是由哪个主设备引起的。In actual application, it is also possible to monitor the occurrence of a deadlock. When a deadlock occurs, the ID and address at which the deadlock occurs are captured, and it can be inferred from which master device the deadlock is caused. It is also possible to monitor the access exception address, issue an interrupt when an access exception occurs, and grab the address at which the exception occurred. And ID, from which it can be inferred which host device is caused by the exception.
本发明的SoC总线行为检测方法的第一实施例,首先可以对AXI总线数据进行抓取,与现有的只能对AXI总线地址和命令进行抓取的技术方案相比,可以更准确的获知总线行为;其次可以对ACE总线信号进行抓取,能够适用更多的应用场景;最后可以完成对AXI总线传输的相关参数的统计;如此,本发明的SoC总线行为检测方法的第一实施例可以支持多种功能,能够满足SoC总线调试的多样化需求。The first embodiment of the SoC bus behavior detecting method of the present invention can first capture the AXI bus data, and can obtain more accurate information than the existing technical solution that can only capture the AXI bus address and commands. Bus behavior; secondly, the ACE bus signal can be captured, which can be applied to more application scenarios; finally, the statistics of related parameters of the AXI bus transmission can be completed; thus, the first embodiment of the SoC bus behavior detection method of the present invention can Support a variety of functions to meet the diverse needs of SoC bus debugging.
第二实施例Second embodiment
为了能更加说明本发明的目的,在本发明第一实施例的基础上,进行进一步的举例说明。In order to further illustrate the object of the present invention, further exemplification will be made on the basis of the first embodiment of the present invention.
图7为本发明SoC总线行为检测方法的第二实施例的应用场景的示意图,如图7所示,处理器700代表一个主设备,处理器700和从设备701之间通过AXI总线/ACE总线进行数据传输;检测仪702配置为采用本发明实施例对处理器和从设备之间的总线数据传输的行为进行检测,DDR存储器703配置为存储检测仪得出的总线行为检测结果。检测仪702通过从接口连接AXI总线/ACE总线,配置为监控AXI总线/ACE总线;检测仪702通过主接口连接DDR存储器703,检测仪702对AXI总线/ACE总线的监控属于非侵入式监控,因此不会干扰处理器和从设备之间的总线数据传输。FIG. 7 is a schematic diagram of an application scenario of a second embodiment of a SoC bus behavior detection method according to the present invention. As shown in FIG. 7, the processor 700 represents a master device, and the processor 700 and the slave device 701 pass the AXI bus/ACE bus. Data transmission is performed; the detector 702 is configured to detect the behavior of bus data transmission between the processor and the slave device using the embodiment of the present invention, and the DDR memory 703 is configured to store the bus behavior detection result obtained by the detector. The detector 702 is configured to monitor the AXI bus/ACE bus by connecting the AXI bus/ACE bus from the interface; the detector 702 is connected to the DDR memory 703 through the main interface, and the monitoring of the AXI bus/ACE bus by the detector 702 is non-intrusive monitoring. Therefore, it does not interfere with bus data transfer between the processor and the slave device.
具体地,针对上述应用场景,分别对总线数据抓取和总线传输参数的统计的流程进行说明。Specifically, for the above application scenario, the flow of statistics of bus data capture and bus transmission parameters is separately described.
图8为本发明SoC总线行为检测方法的第二实施例中总线数据抓取的流程图,如图8所示,该流程包括:FIG. 8 is a flowchart of bus data capture in a second embodiment of the SoC bus behavior detection method according to the present invention. As shown in FIG. 8, the process includes:
步骤800:预先配置总线数据抓取的参数;配置第一数据抓取信号/第二数据抓取信号有效,跳至步骤801。 Step 800: Pre-configure the parameters of the bus data capture; configure the first data capture signal/second data capture signal to be valid, and skip to step 801.
具体地,预先配置总线数据抓取的参数包括:设置触发条件,配置AXI总线/ACE总线各个通道的使能信号的有效性,设置AXI总线/ACE总线信号的时间戳抓取功能,配置AXI总线/ACE总线各个通道在DDR存储器中存储空间,配置AXI总线/ACE总线每个通道在DDR存储器中存储的粒度为1K;Specifically, the parameters for pre-configuring the bus data capture include: setting a trigger condition, configuring the validity of the enable signal of each channel of the AXI bus/ACE bus, setting the timestamp capture function of the AXI bus/ACE bus signal, and configuring the AXI bus. Each channel of the /ACE bus stores space in the DDR memory, and the AXI bus/ACE bus is configured to store 1G in each DDR memory;
进一步地,预先配置SoC总线行为检测的各种参数还包括:配置针对AXI总线/ACE总线至少一个通道的中断屏蔽,配置中断清除和抓取数据结束时的中断信号,抓取数据结束时的中断信号标记为drain_out,当drain_out拉高为高电平时,表示发出抓取数据结束时的中断信号。Further, pre-configuring various parameters of the SoC bus behavior detection includes: configuring an interrupt mask for at least one channel of the AXI bus/ACE bus, configuring an interrupt clearing and capturing an interrupt signal at the end of the data, and capturing an interrupt at the end of the data The signal is marked as drain_out. When drain_out is pulled high, it indicates that the interrupt signal at the end of the grab data is issued.
当某一个通道配置有中断屏蔽时,忽略对应通道发出的中断信号。When a channel is configured with interrupt mask, the interrupt signal from the corresponding channel is ignored.
步骤801:判断AXI总线/ACE总线的至少一个通道是否发出中断信号,如果是,则跳至步骤802;否则,跳至步骤804。Step 801: Determine whether at least one channel of the AXI bus/ACE bus issues an interrupt signal, and if yes, skip to step 802; otherwise, skip to step 804.
步骤802:判断发出中断信号的通道是否配置有中断屏蔽,如果是,则返回至步骤801;如果否,则跳至步骤803。Step 802: It is judged whether the channel that issues the interrupt signal is configured with an interrupt mask, and if yes, returns to step 801; if not, then to step 803.
步骤803:将DDR中与发出中断信号的通道对应的数据读出,待数据读出后,清除中断,返回至步骤801。Step 803: Read data corresponding to the channel that issues the interrupt signal in the DDR. After the data is read, the interrupt is cleared, and the process returns to step 801.
本步骤中,所述将DDR中与发出中断信号的通道对应的数据读出包括:查询中断号,根据中断号判断中断信号来自哪个通道,之后,通知CPU配置相应的DMA读取方式,将对应通道的数据从DDR读取出来,将读取出的数据存储到外部存储器如USB中。In this step, the reading of the data corresponding to the channel for issuing the interrupt signal in the DDR includes: querying the interrupt number, determining which channel the interrupt signal comes from according to the interrupt number, and then notifying the CPU to configure the corresponding DMA read mode, corresponding to The channel data is read from the DDR and the read data is stored in an external memory such as a USB.
步骤804:判断是否结束总线数据抓取,如果不结束总线数据抓取,则返回至步骤801;如果结束总线数据抓取,则配置第一数据抓取信号/第二数据抓取信号无效,跳至步骤805。Step 804: Determine whether to end the bus data capture. If the bus data capture is not finished, return to step 801; if the bus data capture is ended, configure the first data capture signal/second data capture signal to be invalid, skipping Go to step 805.
这里,结束总线数据抓取的时机可以用户自己确定。Here, the timing of ending the bus data capture can be determined by the user himself.
步骤805:检测仪将自身内部的残余数据排空,发出抓取数据结束时的 中断信号,将DDR中与没有设置中断屏蔽的每个通道对应的数据读出,在数据读取完毕时,清除中断,结束流程。Step 805: The detector empties the residual data inside the detector, and sends out the data at the end of the grabbing. The interrupt signal reads out the data corresponding to each channel in which no interrupt mask is set in the DDR. When the data is read, the interrupt is cleared and the flow is terminated.
具体地,所述将DDR中与没有设置中断屏蔽的每个通道对应的数据读出包括:基于没有设置中断屏蔽的各个通道,通知CPU配置相应的DMA读取方式,将对应通道的数据从DDR读取出来,将读取出的数据存储到外部存储器中。Specifically, the reading of the data corresponding to each channel in the DDR that is not provided with the interrupt mask includes: notifying the CPU to configure the corresponding DMA read mode based on each channel without the interrupt mask being set, and the data of the corresponding channel is from the DDR. Read out and store the read data into external memory.
需要说明的是,如果AXI总线/ACE总线各个通道均设置中断屏蔽,则在检测仪将自身内部的残余数据排空后,直接结束流程。It should be noted that if the interrupt mask is set for each channel of the AXI bus/ACE bus, the process ends directly after the detector empties the residual data inside itself.
图9为本发明SoC总线行为检测方法的第二实施例中总线传输参数的统计的流程图,如图9所示,该流程包括:FIG. 9 is a flowchart of statistics of bus transmission parameters in a second embodiment of the SoC bus behavior detecting method according to the present invention. As shown in FIG. 9, the process includes:
步骤900:预先配置总线传输参数的统计参数;配置统计触发信号有效,跳至步骤901。Step 900: Pre-configure the statistical parameters of the bus transmission parameters; configure the statistical trigger signal to be valid, and skip to step 901.
具体地,配置总线传输参数的统计参数包括:配置至少一个主设备的地址,用于统计对应主设备在总线数据传输时的平均时延和所占有的平均带宽;配置至少一个从设备的地址,用于统计对应从设备在总线数据传输时的平均时延和所占有的平均带宽;预先配置至少一个主设备的地址和至少一个从设备的地址,用于统计对应主设备到对应从设置之间的总线数据传输的平均时延和所占有的平均带宽;配置统计模式。Specifically, the statistic parameter for configuring the bus transmission parameter includes: configuring an address of the at least one master device, configured to calculate an average delay of the corresponding master device in the data transmission of the bus and an average bandwidth occupied by the master device; and configuring an address of the at least one slave device, For counting the average delay of the corresponding slave device during bus data transmission and the average bandwidth occupied; pre-configuring the address of at least one master device and the address of at least one slave device for counting the correspondence between the master device and the corresponding slave device The average delay of bus data transmission and the average bandwidth occupied; configuration statistics mode.
配置总线传输参数的统计参数还可以包括:配置针对至少一个通道的统计结果的中断屏蔽,配置中断清除和统计结束时的中断信号。The configuration of the statistical parameters of the bus transmission parameter may further include: configuring an interrupt mask for the statistical result of at least one channel, configuring an interrupt signal for interrupt clearing and counting at the end of the statistics.
步骤901:判断是否收到CPU发出的读请求中断,如果有,则跳至步骤902,否则,跳至步骤904。Step 901: Determine whether the read request interrupt sent by the CPU is received. If yes, go to step 902. Otherwise, go to step 904.
步骤902:根据需要读取的统计结果的类型,判断是否设置有中断屏蔽,如果是,则返回至步骤901;如果否,则跳至步骤903。Step 902: Determine whether an interrupt mask is set according to the type of the statistical result to be read, and if yes, return to step 901; if no, skip to step 903.
步骤903:将统计结果读出,待数据读出后,清除中断,返回至步骤 901。Step 903: Read the statistical result. After the data is read, clear the interrupt and return to the step. 901.
步骤904:判断是否结束统计过程,如果不结束统计过程,则返回至步骤901;如果结束统计过程,则配置统计触发信号无效,跳至步骤905。Step 904: Determine whether to end the statistical process. If the statistical process is not ended, return to step 901; if the statistical process is ended, the configuration statistical trigger signal is invalid, and the process proceeds to step 905.
这里,结束统计过程的时机可以用户自己确定。Here, the timing of ending the statistical process can be determined by the user himself.
步骤905:发出统计结束时的中断信号,将统计结果读出,清除中断,结束流程,此时,可以针对统计结果进行分析。Step 905: Send an interrupt signal at the end of the statistics, read the statistical result, clear the interrupt, and end the process. At this time, the statistical result can be analyzed.
需要说明的是,如果获取的AXI总线各个通道的统计结果均设置中断屏蔽,则在步骤904之后,直接结束流程。It should be noted that if the statistics of the acquired channels of the AXI bus are all set to interrupt masking, after step 904, the process is directly ended.
第三实施例Third embodiment
针对本发明实施例的方法,本发明实施例还提供了一种SoC总线行为检测装置。For the method of the embodiment of the present invention, the embodiment of the present invention further provides an SoC bus behavior detecting apparatus.
图10为本发明实施例SoC总线行为检测装置的第一组成结构示意图,如图10所示,该装置包括:接收模块1000和检测模块1001;其中,FIG. 10 is a first schematic structural diagram of a SoC bus behavior detecting apparatus according to an embodiment of the present invention. As shown in FIG. 10, the apparatus includes: a receiving module 1000 and a detecting module 1001;
接收模块1000,配置为接收SoC总线信号,所述SoC总线信号包括AXI总线信号。The receiving module 1000 is configured to receive a SoC bus signal, where the SoC bus signal includes an AXI bus signal.
检测模块1001,配置为基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。The detecting module 1001 is configured to perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing the AXI bus data transmission; the captured AXI bus channel data includes At least one of the following data: the data transmitted by the AXI bus write data channel, the data transmitted by the AXI bus read data channel; the bus transmission parameters of each statistics include: the average delay of the bus transmission in the corresponding statistical time or The average bandwidth occupied.
具体地,所述检测模块1001,配置为在AXI总线信号中AW通道传输的信号满足预设的第一触发条件,或AXI总线信号中AR通道传输的信号满足预设的第二触发条件时,抓取AXI总线通道数据。Specifically, the detecting module 1001 is configured to: when the signal transmitted by the AW channel in the AXI bus signal satisfies a preset first trigger condition, or when the signal transmitted by the AR channel in the AXI bus signal satisfies a preset second trigger condition, Grab the AXI bus channel data.
这里,所抓取的AXI总线通道数据为AXI总线信号中使能信号有效的 各个通道的数据。Here, the captured AXI bus channel data is valid for the enable signal in the AXI bus signal. Data for each channel.
进一步地,所述检测模块1001还包括寄存器,配置为存储总线传输参数的一次统计结果,统计结果只能存储一次的统计结果,统计window(统计触发信号有效的持续时间)结束后,通过发中断请求读取统计结果,一次统计window结束后即刻自动进入下一次统计window,直到关闭统计功能,从而实现对AXI数据传输时传输参数进的多次统计。Further, the detecting module 1001 further includes a register configured to store a statistical result of the bus transmission parameter, and the statistical result can only be stored once, and the statistical window (the duration of the valid period of the statistical trigger signal) ends, and the interrupt is sent. Request to read the statistical results, once the statistics window ends, automatically enter the next statistical window, until the statistics function is turned off, thereby achieving multiple statistics of the transmission parameters when transmitting AXI data.
进一步地,所述接收模块1000,还配置为接收ACE总线信号。Further, the receiving module 1000 is further configured to receive an ACE bus signal.
在接收SoC总线信号之后,检测模块1001,还配置为基于接收的ACE总线信号抓取ACE总线通道数据。After receiving the SoC bus signal, the detection module 1001 is further configured to capture ACE bus channel data based on the received ACE bus signal.
具体地,所述检测模块1001,配置为在ACE总线信号AC通道传输的信号满足预设的第三触发条件时,抓取ACE总线通道数据。Specifically, the detecting module 1001 is configured to capture the ACE bus channel data when the signal transmitted by the AC channel of the ACE bus signal satisfies a preset third trigger condition.
这里,所抓取的ACE总线通道数据为ACE总线信号中使能信号有效的各个通道的数据。Here, the captured ACE bus channel data is the data of each channel in which the enable signal is valid in the ACE bus signal.
实际应用时,所述检测模块1001,还可以配置为监控死锁的发生,当死锁发生时,抓取发生死锁时的ID和地址,据此可以推断出死锁是由哪个主设备引起的。所述检测模块1001还可以监控访问异常地址,当访问异常发生时发出中断,并且抓取发生异常时的地址和ID,据此可以推断出异常是由哪个主设备引起的。In actual application, the detecting module 1001 may be further configured to monitor the occurrence of a deadlock. When a deadlock occurs, the ID and address when the deadlock occurs are captured, and it can be inferred from which host device the deadlock is caused. of. The detection module 1001 can also monitor the access exception address, issue an interrupt when an access exception occurs, and grab the address and ID when the exception occurs, from which it can be inferred from which master device the exception was caused.
在实际应用中,所述接收模块1000和检测模块1001均可由位于终端设备中的中央处理器(Central Processing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)、或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。In a practical application, the receiving module 1000 and the detecting module 1001 can be configured by a central processing unit (CPU), a microprocessor (Micro Processor Unit (MPU), and a digital signal processor (Digital Signal) located in the terminal device. Processor, DSP), or Field Programmable Gate Array (FPGA) implementation.
第四实施例Fourth embodiment
为了能更加体现本发明的目的,在本发明第三实施例的基础上,本实施例进行进一步地说明。 In order to further embodies the object of the present invention, the present embodiment will be further described based on the third embodiment of the present invention.
图11为本发明实施例SoC总线行为检测装置的第二组成结构示意图,如图11所示,该装置包括:第一时序调整单元1100、第二时序调整单元1101、AXI总线检测单元1102、ACE总线检测单元1103、统计单元1104、配置单元1105、第一清除单元1106、第二清除单元1107、数据传输单元1108和第三时序调整单元1109;其中,FIG. 11 is a second schematic structural diagram of a SoC bus behavior detecting apparatus according to an embodiment of the present invention. As shown in FIG. 11, the apparatus includes: a first timing adjusting unit 1100, a second timing adjusting unit 1101, an AXI bus detecting unit 1102, and an ACE. a bus detecting unit 1103, a statistic unit 1104, a configuration unit 1105, a first clearing unit 1106, a second clearing unit 1107, a data transfer unit 1108, and a third timing adjustment unit 1109;
配置单元1105,配置为配置总线数据抓取的参数和总线传输参数的统计参数,将配置完成的总线数据抓取的参数发送至AXI总线检测单元1102/ACE总线检测单元1103,将配置完成的总线传输参数的统计参数发送至统计单元1104。这里,配置总线数据抓取的参数和总线传输参数的统计参数的过程已经在本发明第二实施例中作出详细说明,这里不再赘述。The configuration unit 1105 is configured to configure a parameter of the bus data capture and a statistical parameter of the bus transmission parameter, and send the parameter of the configured bus data capture to the AXI bus detection unit 1102/ACE bus detection unit 1103, and configure the completed bus. The statistical parameters of the transmission parameters are sent to the statistics unit 1104. Here, the process of configuring the parameters of the bus data capture and the statistical parameters of the bus transmission parameters has been described in detail in the second embodiment of the present invention, and details are not described herein again.
进一步地,配置单元1105可以接收来自外部设备的配置信息,并基于接收到的配置信息来配置相关参数;配置单元1105与外部设备通过APB(Advanced High performance Bus)接口进行交互。Further, the configuration unit 1105 can receive configuration information from the external device and configure related parameters based on the received configuration information; the configuration unit 1105 interacts with the external device through an APB (Advanced High Performance Bus) interface.
第一时序调整单元1100,配置为接收AXI总线各个通道的信号,对接收的各个通道的信号进行时序调整,将时序调整的各个通道的信号分别发送至AXI总线检测单元、第一清除单元、第二清除单元和统计单元;这里,第一时序调整单元1100可以采用基本逻辑单位slice实现;图1中,AW、AR、W、R、B分别表示AXI总线AW通道、AR通道、W通道、R通道和B通道。The first timing adjustment unit 1100 is configured to receive signals of each channel of the AXI bus, perform timing adjustment on the signals of the received channels, and send signals of each channel of the timing adjustment to the AXI bus detection unit, the first clearing unit, and the first The second clearing unit and the statistical unit; here, the first timing adjusting unit 1100 can be implemented by using a basic logical unit slice; in FIG. 1, AW, AR, W, R, and B respectively represent the AXI bus AW channel, the AR channel, the W channel, and the R. Channel and B channel.
第二时序调整单元1101,配置为接收ACE总线各个通道的信号,对接收的各个通道的信号进行时序调整,将时序调整的各个通道的信号分别发送至ACE总线检测单元、第一清除单元和统计单元;这里,第二时序调整单元1100可以采用基本逻辑单位slice实现;图1中,AC、CR、CD分别表示AXI总线AC通道、CR通道和CD通道。The second timing adjustment unit 1101 is configured to receive signals of each channel of the ACE bus, perform timing adjustment on the received signals of the respective channels, and send signals of each channel of the timing adjustment to the ACE bus detection unit, the first clearing unit, and the statistics respectively. Here, the second timing adjustment unit 1100 can be implemented by using a basic logical unit slice; in FIG. 1, AC, CR, and CD represent an AXI bus AC channel, a CR channel, and a CD channel, respectively.
第一清除单元1106,配置为实时监控AXI总线行为和ACE总线行为, 接收第一数据抓取信号和第二数据抓取信号,在第一数据抓取信号有效时,对第一数据抓取信号有效前AXI总线检测单元接收的数据进行清除;在第二数据抓取信号有效时,对第二数据抓取信号有效前ACE总线检测单元接收的数据进行清除;如此,可以防止对应数据抓取信号有效前接收的总线数据对总线数据抓取造成影响。The first clearing unit 1106 is configured to monitor AXI bus behavior and ACE bus behavior in real time. Receiving the first data capture signal and the second data capture signal, when the first data capture signal is valid, clearing data received by the AXI bus detection unit before the first data capture signal is valid; and capturing the second data in the second data capture When the signal is valid, the data received by the ACE bus detecting unit is cleared before the second data grabbing signal is valid; thus, the bus data received before the corresponding data grabbing signal is valid can be prevented from affecting the bus data grabbing.
第二清除单元1107,配置为实时监控AXI总线行为,接收统计触发信号,在统计触发信号有效时,对统计触发信号有效前统计单元接收的数据进行清除;如此,可以防止统计触发信号有效前统计单元接收的数据对后续的总线传输参数的统计过程造成影响。The second clearing unit 1107 is configured to monitor the behavior of the AXI bus in real time, and receive the statistical trigger signal. When the statistical trigger signal is valid, the data received by the statistical unit before the statistical trigger signal is valid is cleared; thus, the statistical trigger signal can be prevented from being valid before the statistics are valid. The data received by the unit affects the statistical process of subsequent bus transmission parameters.
AXI总线检测单元1102,配置为在第一数据抓取信号有效时,对接收的AXI总线各个通道的数据进行抓取,将抓取的各个通道的数据发送至数据传输单元。这里,对AXI总线各个通道的数据进行抓取的过程已经在本发明第一实施例作出说明,这里不再重复。The AXI bus detecting unit 1102 is configured to: when the first data capture signal is valid, capture data of each channel of the received AXI bus, and send data of each channel that is captured to the data transmission unit. Here, the process of capturing data of each channel of the AXI bus has been described in the first embodiment of the present invention, and will not be repeated here.
ACE总线检测单元1103,配置为在第二数据抓取信号有效时,对接收的ACE总线各个通道的数据进行抓取,将抓取的各个通道的数据发送至数据传输单元。这里,对ACE总线各个通道的数据进行抓取的过程已经在本发明第一实施例作出说明,这里不再重复。The ACE bus detecting unit 1103 is configured to: when the second data capture signal is valid, capture data of each channel of the received ACE bus, and send data of each channel captured to the data transmission unit. Here, the process of capturing data of each channel of the ACE bus has been explained in the first embodiment of the present invention, and will not be repeated here.
统计单元1104,配置为在统计触发信号有效时,对进行AXI总线数据传输时总线传输参数依次进行至少一次统计,将得出的统计结果通过配置单元向外发送。这里,对总线传输参数的统计过程已经在本发明第一实施例作出说明,这里不再重复。The statistic unit 1104 is configured to perform at least one statistics on the bus transmission parameters of the AXI bus data transmission when the statistical trigger signal is valid, and send the obtained statistical result to the outside through the configuration unit. Here, the statistical process of the bus transmission parameters has been explained in the first embodiment of the present invention and will not be repeated here.
数据传输单元1108,配置为对接收的数据进行打包处理,并将打包处理后的数据发送至第三时序调整单元。The data transmission unit 1108 is configured to perform packet processing on the received data, and send the packed data to the third timing adjustment unit.
具体地,数据传输单元1108包括先入先出队列(First Input First Output,FIFO)子单元和数据处理子单元;其中,FIFO子单元配置为接收来自AXI 总线检测单元1102和ACE总线检测单元1103的数据,在接收的至少一个通道的数据达到对应的通道阈值时,启动写操作,将达到通道阈值的数据发送至数据处理子单元;示例性地,当FIFO深度为16时,AW通道、AR通道和AC通道的通道阈值为4,W通道、R通道、B通道、CD通道和CR通道的阈值为8。这里,如果FIFO子单元中,如果多个通道的数据同时达到对应的通道阈值,则采用预设的轮询顺序轮询将对应的多个通道的数据发送至数据处理子单元。Specifically, the data transmission unit 1108 includes a first input first output (FIFO) subunit and a data processing subunit; wherein the FIFO subunit is configured to receive from AXI The data of the bus detecting unit 1102 and the ACE bus detecting unit 1103, when the data of the received at least one channel reaches the corresponding channel threshold, initiates a write operation, and sends data reaching the channel threshold to the data processing subunit; exemplarily, when When the FIFO depth is 16, the channel threshold of the AW channel, the AR channel, and the AC channel is 4, and the thresholds of the W channel, the R channel, the B channel, the CD channel, and the CR channel are 8. Here, if the data of the plurality of channels reaches the corresponding channel threshold at the same time in the FIFO subunit, the data of the corresponding multiple channels is sent to the data processing subunit by using a preset polling order polling.
数据处理子单元,配置为将接收的各个通达的数据按照约定的数据结构组装后输出。这里,为了降低开发难道和验证复杂程度,SoC总线行为检测装置向外输出数据的数据宽度规定为64位,这样,数据处理子单元向外输出的数据的数据宽度需要是恒定值。也就是说,数据处理子单元要将接收的数据组合成为固定长度的数据并向外输出;特别地,当AXI总线各个通道的数据抓取过程结束时,如果FIFO子单元中的至少一个通道的数据没有达到对应的通道阈值,这时,针对对应通道的数据添入冗余数据,使之达到对应的通道阈值,这样有利于数据处理子单元的数据处理过程。The data processing sub-unit is configured to assemble and receive the received data according to the agreed data structure. Here, in order to reduce the development difficulty and the verification complexity, the data width of the output data of the SoC bus behavior detecting device is specified to be 64 bits, so that the data width of the data outputted by the data processing subunit needs to be a constant value. That is, the data processing sub-unit combines the received data into fixed-length data and outputs it to the outside; in particular, when the data capture process of each channel of the AXI bus ends, if at least one of the FIFO sub-units The data does not reach the corresponding channel threshold. At this time, redundant data is added to the data of the corresponding channel to reach the corresponding channel threshold, which is beneficial to the data processing process of the data processing subunit.
为了高效地传输数据,在该数据处理子单元占用中设置了两个状态机,一个是地址状态机,配置为地址的产生和拆分(比如跨4K传输时,需要将一个完整的数据结构打断),另一个是地址状态机,配置为数据的合并和拆分,示例性地,AXI总线通道数据的数据宽度是32位时,数据处理子单元就需要将两个AXI总线通道数据合并后向外输出;在AXI总线的通道数据的数据宽度时32位时,数据处理子单元将一个AXI总线的通道数据拆分为两组数据向外输出;如此,数据处理子单元通过数据的合并和拆分,可以大大提高数据的传输效率。In order to efficiently transfer data, two state machines are set in the data processing sub-unit occupation, one is an address state machine, configured to generate and split addresses (for example, when transmitting across 4K, a complete data structure needs to be played. The other is the address state machine, configured for data merging and splitting. Illustratively, when the data width of the AXI bus channel data is 32 bits, the data processing subunit needs to merge the two AXI bus channel data. Outward output; when the data width of the channel data of the AXI bus is 32 bits, the data processing subunit splits the channel data of one AXI bus into two sets of data and outputs it outward; thus, the data processing subunit merges through the data. Splitting can greatly improve the efficiency of data transmission.
第三时序调整单元1109,配置为对接收的数据进行时序调整,并将经时序调整后的数据发送至外部的存储单元中;这里,第三时序调整单元1109 可以采用基本逻辑单位slice实现。The third timing adjustment unit 1109 is configured to perform timing adjustment on the received data, and send the time-aligned data to an external storage unit; here, the third timing adjustment unit 1109 It can be implemented in the basic logical unit slice.
进一步地,为了解决抓取的数据量大,外部的存储单元无法存取的问题,在外部的存储单元中为每个通道的数据设置一块受限的地址空间,地址空间粒度为1K,在这块地址空间上进行写操作,当抓取的一个通道的数据的数据量达到对应通道的地址空间的一半时,发出中断,通知CPU将抓取的对应通道的数据读取。Further, in order to solve the problem that the amount of data captured is large and the external storage unit cannot be accessed, a limited address space is set for each channel of data in the external storage unit, and the address space granularity is 1K. The write operation is performed on the block address space. When the data amount of the data of one channel captured reaches half of the address space of the corresponding channel, an interrupt is issued, and the CPU is notified to read the data of the corresponding channel that is captured.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机 实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on the computer or other programmable device to produce the computer The implemented processing, such as instructions executed on a computer or other programmable device, provides steps for implementing the functions specified in one or more blocks of the flowchart or in a block or blocks of the flowchart.
基于此,本发明实施例还提供了一种计算机存储介质,所述计算机存储介质包括一组指令,当执行所述指令时,引起至少一个处理器执行上述的SoC总线行为检测方法。Based on this, an embodiment of the present invention further provides a computer storage medium, the computer storage medium comprising a set of instructions, when executed, causing at least one processor to execute the SoC bus behavior detection method.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
具体实施方式detailed description
本发明实施例提供的方案,接收SoC总线信号,所述SoC总线信号包括AXI总线信号;基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。如此,能够对AXI总线数据进行抓取,并能够对AXI总线数据的参数进行统计,从而满足SoC总线调试的多样化需求。 The solution provided by the embodiment of the present invention receives a SoC bus signal, where the SoC bus signal includes an AXI bus signal; and performs at least one of the following operations based on the received AXI bus signal: grabbing AXI bus channel data, and performing AXI bus data transmission The bus transmission parameters are analyzed at least once; the captured AXI bus channel data includes at least one of the following: data transmitted by the AXI bus write data channel, data transmitted by the AXI bus read data channel; The transmission parameters include: the average delay of the bus transmission in the corresponding statistical time or the average bandwidth occupied. In this way, the AXI bus data can be captured, and the parameters of the AXI bus data can be counted, thereby meeting the diversified needs of the SoC bus debugging.

Claims (20)

  1. 一种片上系统SoC总线行为检测方法,所述方法包括:A method for detecting a SoC bus behavior of a system on a chip, the method comprising:
    接收SoC总线信号,所述SoC总线信号包括SoC高级可扩展接口AXI总线信号;Receiving a SoC bus signal, the SoC bus signal including a SoC advanced scalable interface AXI bus signal;
    基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。Perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing AXI bus data transmission; the captured AXI bus channel data includes at least one of the following data: The data transmitted by the AXI bus write data channel and the data transmitted by the AXI bus read data channel; the bus transmission parameters of each statistics include: an average delay of the bus transmission or an average bandwidth occupied by the corresponding statistical time.
  2. 根据权利要求1所述的方法,其中,所述抓取AXI总线通道数据,包括:在AXI总线信号中AW通道传输的信号满足预设的第一触发条件,或AXI总线信号中AR通道传输的信号满足预设的第二触发条件时,抓取AXI总线通道数据。The method of claim 1, wherein the capturing the AXI bus channel data comprises: the signal transmitted by the AW channel in the AXI bus signal satisfies a preset first trigger condition, or the AR channel transmission in the AXI bus signal When the signal meets the preset second trigger condition, the AXI bus channel data is captured.
  3. 根据权利要求1或2所述的方法,其中,所抓取的AXI总线通道数据为AXI总线信号中使能信号有效的各个通道的数据。The method according to claim 1 or 2, wherein the captured AXI bus channel data is data of each channel in which the enable signal is valid in the AXI bus signal.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:设置寄存器,所述寄存器配置为存储总线传输参数的一次统计结果;The method of claim 1 wherein the method further comprises: setting a register configured to store a statistical result of a bus transmission parameter;
    统计窗口window结束后,通过发中断请求读取存储的统计结果,一次统计window结束后自动进入下一次统计window,直到关闭统计功能,以实现对AXI数据传输时传输参数进的多次统计。After the statistics window is finished, the stored statistical result is read by sending an interrupt request. Once the statistics window is finished, the next statistical window is automatically entered until the statistics function is turned off, so as to implement multiple statistics of the transmission parameters during AXI data transmission.
  5. 根据权利要求1或4所述的方法,其中,进行AXI总线数据传输时每次统计的总线传输的平均延时的计算公式为:The method according to claim 1 or 4, wherein the calculation formula of the average delay of each statistical bus transmission when performing AXI bus data transmission is:
    T=total_delay/nT=total_delay/n
    其中,T表示对应一次统计的总线传输的平均延时,Total_delay表示对应的统计时间内各个Burst传输所耗费的时间之和,n表示对应的统计时间 内所发生的Burst传输的个数;Where T represents the average delay of the bus transmission corresponding to one statistic, Total_delay represents the sum of the time spent by each Burst transmission in the corresponding statistical time, and n represents the corresponding statistical time. The number of Burst transmissions occurring within;
    进行AXI总线数据传输时每次统计的总线传输所占有的平均带宽B的计算公式为:The calculation formula of the average bandwidth B occupied by each statistical bus transmission when performing AXI bus data transmission is:
    B=total_byte/total_cycleB=total_byte/total_cycle
    其中,B表示对应的一次统计的总线传输所占有的平均带宽,total_byte表示对应的统计时间内各个Burst传输所传输的数据量的和,total_cycle表示对应的统计时间所经历的时钟周期数。Where B represents the average bandwidth occupied by the corresponding one-time bus transmission, total_byte represents the sum of the amount of data transmitted by each Burst transmission in the corresponding statistical time, and total_cycle represents the number of clock cycles experienced by the corresponding statistical time.
  6. 根据权利要求1、2或4所述的方法,其中,所述方法还包括:接收AXI总线信号对应的时间戳信息。The method of claim 1, 2 or 4, wherein the method further comprises receiving timestamp information corresponding to the AXI bus signal.
  7. 根据权利要求1所述的方法,其中,所述SoC总线信号还包括:AXI一致性扩展ACE总线信号;The method of claim 1 wherein said SoC bus signal further comprises: an AXI coherent extended ACE bus signal;
    在接收SoC总线信号之后,所述方法还包括:基于接收的ACE总线信号抓取ACE总线通道数据。After receiving the SoC bus signal, the method further includes: capturing the ACE bus channel data based on the received ACE bus signal.
  8. 根据权利要求7所述的方法,其中,所述抓取ACE总线通道数据包括:在ACE总线信号AC通道传输的信号满足预设的第三触发条件时,抓取ACE总线通道数据。The method of claim 7, wherein the fetching the ACE bus channel data comprises: grabbing the ACE bus channel data when the signal transmitted by the ACE bus signal AC channel satisfies a preset third trigger condition.
  9. 根据权利要求7或8所述的方法,其中,所抓取的ACE总线通道数据为ACE总线信号中使能信号有效的各个通道的数据。The method according to claim 7 or 8, wherein the captured ACE bus channel data is data of each channel in which the enable signal is valid in the ACE bus signal.
  10. 根据权利要求7或8所述的方法,其中,所述方法还包括:抓取ACE总线信号对应的时间戳信息。The method of claim 7 or 8, wherein the method further comprises: capturing timestamp information corresponding to the ACE bus signal.
  11. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    监控死锁的发生,当死锁发生时,抓取发生死锁时的ID和地址;Monitor the occurrence of a deadlock, and when the deadlock occurs, grab the ID and address when the deadlock occurs;
    和/或,监控访问异常地址,当访问异常发生时发出中断,并且抓取发生异常时的地址和ID。And/or, monitor access to the exception address, issue an interrupt when an access exception occurs, and grab the address and ID when the exception occurred.
  12. 一种SoC总线行为检测装置,所述装置包括:接收模块和检测模块;其中, A SoC bus behavior detecting device, the device comprising: a receiving module and a detecting module; wherein
    接收模块,配置为接收SoC总线信号,所述SoC总线信号包括AXI总线信号;a receiving module configured to receive a SoC bus signal, where the SoC bus signal includes an AXI bus signal;
    检测模块,配置为基于接收的AXI总线信号进行至少以下一种操作:抓取AXI总线通道数据、对进行AXI总线数据传输时总线传输参数进行至少一次统计;所抓取的AXI总线通道数据包括至少以下一种数据:所述AXI总线写数据通道传输的数据、所述AXI总线读数据通道传输的数据;每次统计的总线传输参数包括:对应的统计时间内总线传输的平均延时或所占有的平均带宽。The detecting module is configured to perform at least one of the following operations based on the received AXI bus signal: grab the AXI bus channel data, and perform at least one statistics on the bus transmission parameters when performing the AXI bus data transmission; the captured AXI bus channel data includes at least one The following data: the data transmitted by the AXI bus write data channel, the data transmitted by the AXI bus read data channel; the bus transmission parameters of each statistics include: the average delay of the bus transmission in the corresponding statistical time or possession Average bandwidth.
  13. 根据权利要求12所述的方法,其中,所述检测模块,配置为在AXI总线信号中AW通道传输的信号满足预设的第一触发条件,或AXI总线信号中AR通道传输的信号满足预设的第二触发条件时,抓取AXI总线通道数据。The method according to claim 12, wherein the detecting module is configured to: the signal transmitted by the AW channel in the AXI bus signal satisfies a preset first trigger condition, or the signal transmitted by the AR channel in the AXI bus signal satisfies a preset When the second trigger condition is met, the AXI bus channel data is captured.
  14. 根据权利要求12或13所述的方法,其中,所抓取的AXI总线通道数据为AXI总线信号中使能信号有效的各个通道的数据。The method according to claim 12 or 13, wherein the captured AXI bus channel data is data of each channel in which the enable signal is valid in the AXI bus signal.
  15. 根据权利要求11所述的装置,其中,所述检测模块还包括寄存器,所述寄存器配置为存储总线传输参数的一次统计结果;The apparatus of claim 11 wherein said detection module further comprises a register configured to store a statistical result of a bus transmission parameter;
    统计窗口window结束后,通过发中断请求读取存储的统计结果,一次统计window结束后自动进入下一次统计window,直到关闭统计功能,以实现对AXI数据传输时传输参数进的多次统计。After the statistics window is finished, the stored statistical result is read by sending an interrupt request. Once the statistics window is finished, the next statistical window is automatically entered until the statistics function is turned off, so as to implement multiple statistics of the transmission parameters during AXI data transmission.
  16. 根据权利要求11所述的装置,其中,所述接收模块,还配置为接收ACE总线信号;The apparatus of claim 11, wherein the receiving module is further configured to receive an ACE bus signal;
    所述检测模块,还配置为在接收SoC总线信号之后,基于接收的ACE总线信号抓取ACE总线通道数据。The detection module is further configured to capture ACE bus channel data based on the received ACE bus signal after receiving the SoC bus signal.
  17. 根据权利要求16所述的装置,其中,所述检测模块,配置为在ACE总线信号AC通道传输的信号满足预设的第三触发条件时,抓取ACE 总线通道数据。The apparatus according to claim 16, wherein the detecting module is configured to capture an ACE when a signal transmitted by the AC channel of the ACE bus signal satisfies a preset third trigger condition Bus channel data.
  18. 根据权利要求16或17所述的装置,其中,所抓取的ACE总线通道数据为ACE总线信号中使能信号有效的各个通道的数据。The apparatus according to claim 16 or 17, wherein the captured ACE bus channel data is data of respective channels in which an enable signal is valid in the ACE bus signal.
  19. 根据权利要求12所述的装置,其中,所述检测模块,还配置为:The apparatus according to claim 12, wherein the detecting module is further configured to:
    监控死锁的发生,当死锁发生时,抓取发生死锁时的ID和地址;Monitor the occurrence of a deadlock, and when the deadlock occurs, grab the ID and address when the deadlock occurs;
    和/或,监控访问异常地址,当访问异常发生时发出中断,并且抓取发生异常时的地址和ID。And/or, monitor access to the exception address, issue an interrupt when an access exception occurs, and grab the address and ID when the exception occurred.
  20. 一种计算机存储介质,所述计算机存储介质包括一组指令,当执行所述指令时,引起至少一个处理器执行如权利要求1至11任一项所述的SoC总线行为检测方法。 A computer storage medium comprising a set of instructions that, when executed, cause at least one processor to perform the SoC bus behavior detection method of any one of claims 1 to 11.
PCT/CN2016/105176 2015-11-17 2016-11-09 Method and device for system on chip bus activity detection and computer storage medium WO2017084523A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510793469.XA CN106708671A (en) 2015-11-17 2015-11-17 Method and device for detecting bus behavior of system on chip
CN201510793469.X 2015-11-17

Publications (1)

Publication Number Publication Date
WO2017084523A1 true WO2017084523A1 (en) 2017-05-26

Family

ID=58717379

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/105176 WO2017084523A1 (en) 2015-11-17 2016-11-09 Method and device for system on chip bus activity detection and computer storage medium

Country Status (2)

Country Link
CN (2) CN106708671A (en)
WO (1) WO2017084523A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190400A (en) * 2021-04-19 2021-07-30 思澈科技(上海)有限公司 Bus monitoring module and monitoring method suitable for AHB protocol
CN115357926A (en) * 2022-10-19 2022-11-18 南京芯驰半导体科技有限公司 AXI bus protocol access authority control method and device based on SoC chip

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427629A (en) * 2018-03-12 2018-08-21 杭州朔天科技有限公司 A kind of the SoC chip tracking of information device and performance optimization method of data compression
CN109522194B (en) * 2018-11-14 2022-02-25 北京遥感设备研究所 Automatic pressure test system and method for AXI protocol slave equipment interface
CN110781120B (en) * 2019-10-23 2023-02-28 山东华芯半导体有限公司 Method for realizing cross-4 KB transmission of AXI bus host equipment
CN112486871B (en) * 2020-11-25 2023-06-13 海光信息技术股份有限公司 Routing method and system for on-chip bus
CN117009276A (en) * 2023-06-27 2023-11-07 进迭时空(珠海)科技有限公司 Method, device and system for signal compression transmission based on AXI bus
CN116881065B (en) * 2023-09-07 2023-12-15 湖北芯擎科技有限公司 Bus transmission delay detection module, circuit and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101639816A (en) * 2009-05-21 2010-02-03 北京中星微电子有限公司 Real-time tracking system of bus and corresponding tracking and debugging method
CN101788947A (en) * 2010-02-09 2010-07-28 华为技术有限公司 Method for monitoring system bus, system bus monitor and system on chip
CN103888227A (en) * 2014-04-21 2014-06-25 华北水利水电大学 Data frame receiving and analyzing device and method based on VL

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192192B (en) * 2006-11-21 2010-08-18 华为技术有限公司 Task abnormity diagnosis method and system for real-time operating system
CN101988863B (en) * 2009-07-30 2014-05-21 中国商用飞机有限责任公司 Force dispute test device
US8612648B1 (en) * 2010-07-19 2013-12-17 Xilinx, Inc. Method and apparatus for implementing quality of service in a data bus interface
CN102207913B (en) * 2011-06-09 2019-05-31 中兴通讯股份有限公司 The control method and device of write-protect in embedded system
CN105814547B (en) * 2013-10-27 2019-12-03 超威半导体公司 Input/output memory map unit and north bridge
CN103605625B (en) * 2013-11-29 2016-04-06 山东大学 Based on the control method of the Nor Flash chip of AXI bus
CN104156487B (en) * 2014-08-28 2017-10-03 北京国双科技有限公司 Web data statistical method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101639816A (en) * 2009-05-21 2010-02-03 北京中星微电子有限公司 Real-time tracking system of bus and corresponding tracking and debugging method
CN101788947A (en) * 2010-02-09 2010-07-28 华为技术有限公司 Method for monitoring system bus, system bus monitor and system on chip
CN103888227A (en) * 2014-04-21 2014-06-25 华北水利水电大学 Data frame receiving and analyzing device and method based on VL

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190400A (en) * 2021-04-19 2021-07-30 思澈科技(上海)有限公司 Bus monitoring module and monitoring method suitable for AHB protocol
CN113190400B (en) * 2021-04-19 2022-11-04 思澈科技(上海)有限公司 Bus monitoring module and monitoring method suitable for AHB protocol
CN115357926A (en) * 2022-10-19 2022-11-18 南京芯驰半导体科技有限公司 AXI bus protocol access authority control method and device based on SoC chip

Also Published As

Publication number Publication date
CN106708679A (en) 2017-05-24
CN106708671A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
WO2017084523A1 (en) Method and device for system on chip bus activity detection and computer storage medium
US9952963B2 (en) System on chip and corresponding monitoring method
EP1690184B1 (en) Apparatus and method for time ordering events in a system having multiple time domains
CN110213143B (en) 1553B bus IP core and monitoring system
US11010062B2 (en) Method for providing read data flow control or error reporting using a read data strobe
US20110225337A1 (en) Transaction performance monitoring in a processor bus bridge
KR101045475B1 (en) Real-time debug support for a dma device and method thereof
US8706937B2 (en) Method and system of debugging multicore bus transaction problems
CN103577294B (en) For the method and apparatus followed the tracks of that interconnects
CN103198001B (en) Storage system capable of self-testing peripheral component interface express (PCIE) interface and test method
CN108427629A (en) A kind of the SoC chip tracking of information device and performance optimization method of data compression
CN104917645B (en) A kind of method and apparatus of on-line checking message transmissions time-out
KR101054109B1 (en) Method, apparatus, system, and computer readable medium for calculating message queue time
WO2023123956A1 (en) Io full-lifecycle latency monitoring method and related apparatus
CN116932333B (en) AXI bus real-time performance monitoring method for post-silicon verification
CN111049718B (en) CAN bus simulation monitoring method
CN116074267B (en) Data communication system and SoC chip
CN112749057A (en) Bus monitor for read transactions
CN103186447B (en) Bus read-write detection device
CN105528300B (en) A kind of DDR Memory Controller Hub and its access monitoring method
WO2013144900A1 (en) Method, apparatus and computer program for latency measurement
CN104572515B (en) Tracking module, method, system and on-chip system chip
US9298468B2 (en) Monitoring processing time in a shared pipeline
CN111158339B (en) CAN bus simulation monitoring system
CN109428771B (en) Method and device for detecting performance of high-speed peripheral component interconnection message

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16865700

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16865700

Country of ref document: EP

Kind code of ref document: A1