Chip interface data statistics method, electronic device and medium
By setting multiple counters for the chip interface, the problems of low efficiency and poor accuracy of chip interface data statistics in the prior art are solved, and flexible configuration and efficient and accurate bandwidth or request counting are achieved.
Patent Information
- Application Number
- CN202510919529.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-04
AI Technical Summary
In the prior art, chip interface data statistics are inefficient and error-prone, and cannot be flexibly configured, and cannot meet the diverse bandwidth statistics needs. Especially in different application scenarios, it is impossible to accurately count the requested transmission amount per unit time.
Multiple counters are set up for the chip interface to be tested, including a clock cycle counter and multiple counters of different statistical types. These counters are used to count different types of requested data or request counts, and flexible configuration is achieved to obtain the target bandwidth or target transmission number within a unit time.
It realizes flexible configuration of chip interface data statistics, improves statistical efficiency and accuracy, and can flexibly obtain the target bandwidth or the number of target transmission requests per unit time according to different application requirements.
Smart Images

Figure CN120429213B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a chip interface data statistics method, electronic equipment and medium. Background Art
[0002] During the chip design process, chip interface data needs to be collected and used to adjust the chip design. This chip interface data includes chip interface bandwidth, a crucial metric. It's often necessary to obtain the chip interface bandwidth and use it to set the clock frequency and signal bit width of interface signals, or prioritize them. Prioritization is often performed based on the chip interface bandwidth. The existing technology calculates chip interface bandwidth by manually counting the amount of request data transmitted over a period of time, which is inefficient and prone to errors. Furthermore, different application scenarios may require different bandwidth statistics. Existing statistical methods are limited in their singleness and lack flexibility, making them unsuitable for diverse chip interface bandwidth statistics needs. In some application scenarios, the chip interface data that needs to be collected also includes the number of transmission requests per unit time, or even the number of transmission requests per unit time corresponding to different request types. However, the existing technology lacks an accurate and reliable method for counting the number of requests transmitted per unit time. Therefore, achieving flexible configuration of chip interface data statistics and improving the efficiency and accuracy of chip interface data statistics have become pressing technical challenges. Summary of the Invention
[0003] The present invention aims to provide a chip interface data statistics method, electronic equipment and medium, which realizes flexible configuration of chip interface data statistics and improves the statistical efficiency and accuracy of chip interface data.
[0004] According to a first aspect of the present invention, a chip interface data statistics method is provided, comprising:
[0005] Step S1: Set M+1 counters {C0, C1, ..., C m ,...,C M}, where C0 is the clock cycle counter, C m is the mth request data volume counter or the mth request quantity counter, all C m The counter types are the same, but different C m The corresponding statistical type is different. The value range of m is 1 to M. M is the total number of request data volume counters set by the chip interface under test. The start time and end time are set in C0.
[0006] Step S2, starting from the start time corresponding to C0, obtaining each request data from the interface of the chip under test. If the request data is clock data, directly execute step S3; otherwise, determine the statistical type corresponding to each request data and then execute step S3;
[0007] Step S3: Send the clock data request data to C0 for statistics, and send the non-clock data request data to C0 of the corresponding statistical type. m Statistics are carried out in
[0008] Step S4: After the end time corresponding to C0 is reached, C0 and all C m Stop counting;
[0009] Step S5: Select at least one C m Obtain the target request data volume or target request quantity, obtain the target clock number from C0, and determine the target bandwidth of the chip interface or the target transmission request quantity per unit time based on the target request data volume and the target clock number.
[0010] According to a second aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executed by the at least one processor, the instructions being configured to execute the method described in the first aspect of the present invention.
[0011] According to a third aspect of the present invention, a computer-readable storage medium is provided, storing computer-executable instructions, wherein the computer instructions are used to execute the method according to the first aspect of the present invention.
[0012] The present invention has significant advantages and beneficial effects compared to the prior art. By utilizing the above technical solution, the chip interface data statistics method, electronic device, and medium provided by the present invention can achieve considerable technological advancement and practicality, and have wide industrial application value, with at least the following beneficial effects:
[0013] The present invention sets multiple counters for each chip interface under test, specifically including a clock cycle counter and multiple counters of different statistical types. The multiple counters of different statistical types can be specifically configured to count the amount of request data of different statistical types or the number of requests of different statistical types. After counting is completed, the target bandwidth of the chip interface or the target number of transmissions per unit time is obtained based on the data counted in the counters. The present invention realizes flexible configuration of chip interface data statistics, improving the statistical efficiency and accuracy of chip interface data. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0015] Figure 1 This is a flow chart of the chip interface data statistics method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0017] The embodiment of the present invention provides a chip interface data statistics method, such as Figure 1 As shown, including:
[0018] Step S1: Set M+1 counters {C0, C1, ..., C m ,...,C M}, where C0 is the clock cycle counter, C m is the mth request data volume counter or the mth request quantity counter, all C m The counter types are the same, but different C m The corresponding statistical type is different. The value range of m is 1 to M. M is the total number of request data volume counters set by the chip interface under test. The start time and end time are set in C0.
[0019] It should be noted that C m The number and statistical type of the data can be flexibly set according to the specific application requirements. m The same counter type refers to all C m All are set to request data amount counter or all C m All are set as request count counters.
[0020] If the application requirement is to obtain the target bandwidth corresponding to the chip interface under test, then C mSet as a request data volume counter, the target bandwidth can be the bandwidth of the entire chip interface under test, or the bandwidth corresponding to a request length statistical interval, multiple request length statistical intervals, or a combination of multiple request length statistical intervals corresponding to the chip interface under test. If the application requirement is to obtain the target number of transmission requests per unit time corresponding to the chip interface under test, then C m Set as a request quantity counter, the number of target transmission requests per unit time can specifically be the number of target transmission requests per unit time corresponding to the entire chip interface under test, or it can be the number of target transmission requests per unit time corresponding to a request length statistical interval, multiple request length statistical intervals or a combination of multiple request length statistical intervals corresponding to the chip interface under test.
[0021] Step S2: Obtain each request data from the interface of the chip under test starting from the start time corresponding to C0. If the request data is clock data, directly execute step S3; otherwise, determine the statistical type corresponding to each request data and then execute step S3.
[0022] It should be noted that all C m Based on the corresponding start time and end time, the statistical work starts and ends at the same time.
[0023] Step S3: Send the clock data request data to C0 for statistics, and send the non-clock data request data to C0 of the corresponding statistical type. m Statistics are performed in .
[0024] It should be noted that C0 is used to count the number of clock cycles corresponding to the request data of the clock data. m Used to count the request data volume or request quantity of the corresponding statistical type. Step S3 can be specifically implemented by setting a filter to send the request data to the corresponding C0 or C m Statistics are performed in .
[0025] Step S4: After the end time corresponding to C0 is reached, C0 and all C m Stop counting.
[0026] Step S5: Select at least one C m Obtain the target request data volume or target request quantity, obtain the target clock number from C0, and determine the target bandwidth of the chip interface or the target transmission request quantity per unit time based on the target request data volume and the target clock number.
[0027] As an embodiment, C0, C m It is composed of a single counter unit or a plurality of counter units set in series, {C0, C1, ..., C m ,...,C MThe total number of counter units included in the chip interface data statistics architecture is less than or equal to the preset counter unit request number. It should be noted that the chip interface data statistics architecture can be applied to multiple different chip interfaces under test, and the chip interface under test can flexibly configure the counter units according to specific application requirements. The number of counters in the chip interface data statistics architecture is the preset counter unit request number, and each chip interface under test can select the corresponding number of counter units from it according to specific application requirements. By configuring the statistical parameters corresponding to each counter unit, {C0, C1, ..., C m ,...,C M}. Typically, a C m Corresponding to a counter unit, when one counter unit is not enough to meet the statistical requirements of a statistical type, two or more consecutive counter units can be configured in cascade mode to form the corresponding C m .
[0028] As an example, C m The corresponding request length statistics interval is set to [D1 m ,D2 m ), D1 m C m The minimum request length of the corresponding request length statistical interval, D2 m C m The maximum request length of the corresponding request length statistics interval, different C m The corresponding request length statistical intervals do not overlap. It should be noted that C1,...,C m ,...,C M The corresponding request length statistical interval can be a continuous request length statistical interval or a discontinuous request length statistical interval. m The sizes of the corresponding request length statistical intervals may be equal or unequal.
[0029] As an example, C m The corresponding event type is set to read type, write type, or read and write type. It should be noted that some applications require separate statistics for read and write types, while some applications do not care about read and write types. Therefore, you can set the read type, write type, or read and write type by time type.
[0030] It should be noted that each counter unit is equipped with a set of corresponding registers, C m The corresponding cascade configuration information, request length statistics interval configuration information and event type configuration information are all configured through C m It is implemented by the register of the corresponding counter unit.
[0031] As an embodiment, step S2 includes:
[0032] Step S21 : acquiring each request data from the interface of the chip under test starting from the start time corresponding to C0 .
[0033] Step S22: If the requested data is clock data, execute step S3; otherwise, execute step S23.
[0034] Step S23: Parse the request data of the non-clock data to obtain the event type and request length corresponding to each request data of the non-clock data.
[0035] Step S24: Determine a corresponding statistical type based on the event type and request length corresponding to each non-clock data request data.
[0036] It should be noted that each statistical type corresponds to a set of event types and request lengths, request statistical intervals, and event types. Therefore, the corresponding statistical type can be determined based on the event type and request length corresponding to each non-clock data request data.
[0037] As an embodiment, in step S3, sending the clock data request data to C0 for statistics includes:
[0038] Step S31: Obtain the clock request quantity A corresponding to the current clock data 0 , the total number of clocks currently recorded in C0 is B 0 Update to B 0 =B 0 +A 0 , B 0 The initial value is set to 0.
[0039] As an embodiment, in step S3, the request data of non-clock data is sent to the corresponding statistical type C m Statistics are collected in the
[0040] Step S32: If C m is the requested data amount counter, then the C corresponding to the current non-clock data request data m The amount of request data currently recorded in D m Updated to D m =D m +E m , E m The request length corresponding to the current non-clock data request data, D m The initial value is set to 0.
[0041] Step S33: If C m For the request quantity counter, the C corresponding to the current non-clock data request data ism The amount of request data currently recorded in D m Updated to D m =D m +1.
[0042] As an embodiment, step S5 includes:
[0043] Step S51: Determine the target request data volume or target request quantity as the target C m , Objective-C m There are one or more.
[0044] Step S52: Get all target C m The sum of the currently counted request data volume or request quantity is used as the target request data volume or target request quantity.
[0045] Step S53: Obtain the number of clock requests currently counted in C0 as the target clock number.
[0046] Step S54: Divide the target request data volume by the target clock number to obtain the target bandwidth, or divide the target request quantity by the target clock number to obtain the target transmission request quantity per unit time.
[0047] It should be noted that the embodiment of the present invention can flexibly configure the target bandwidth or the target number of transmission requests per unit time under different application requirements. First, in the setting of {C0, C1, ..., C m ,...,C M}, only set the C corresponding to the statistical type that needs attention. m . It is also possible that during the analysis phase, if it is not possible to determine the statistical type that needs to be paid attention to, multiple statistical interval configuration information can be evenly set according to the maximum and minimum values of the number corresponding to the request, and the target bandwidth corresponding to each statistical interval or the target number of transmission requests per unit time can be obtained for analysis. The statistical interval configuration information can also be adjusted according to the analysis results, and multiple rounds of steps S1-S5 can be performed until the subsequent target bandwidth or the distribution of the target number of transmission requests per unit time meets the preset requirements. Secondly, in step S5, a variety of target bandwidth or target transmission request number statistical results per unit time can be obtained according to different application requirements. For example, each C m The corresponding target bandwidth or the number of target transmission requests per unit time can also be obtained by multiple C m The corresponding target bandwidth or the number of target transmission requests per unit time.
[0048] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of the steps can be performed in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. A process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. A process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0049] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executed by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.
[0050] An embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.
[0051] An embodiment of the present invention provides multiple counters for each chip interface under test, specifically including a clock cycle counter and multiple counters of different statistical types. The multiple counters of different statistical types can be configured to count the amount of request data of different statistical types or the number of requests of different statistical types. After the counting is completed, the target bandwidth of the chip interface or the target number of transmissions per unit time is obtained based on the data counted in the counters. This invention enables flexible configuration of chip interface data statistics, improving the statistical efficiency and accuracy of chip interface data.
[0052] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Any technician familiar with the present profession can make slight changes or modifications to equivalent embodiments using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A chip interface data statistics method, characterized in that: include: Step S1: Set M+1 counters {C0, C1, ..., C m ,...,C M }, where C0 is the clock cycle counter, C m is the mth request data volume counter or the mth request quantity counter, all C m The counter types are the same, but different C m The corresponding statistical type is different. The value range of m is 1 to M. M is the total number of request data volume counters set by the chip interface under test. The start time and end time are set in C0. Step S2, starting from the start time corresponding to C0, obtaining each request data from the interface of the chip under test. If the request data is clock data, directly execute step S3; otherwise, determine the statistical type corresponding to each request data and then execute step S3; Step S3: Send the clock data request data to C0 for statistics, and send the non-clock data request data to C0 of the corresponding statistical type. m Statistics are carried out in Step S4: After the end time corresponding to C0 is reached, C0 and all C m Stop counting; Step S5: Select at least one C m Obtain the target request data volume or target request quantity, obtain the target clock number from C0, and determine the target bandwidth of the chip interface or the target transmission request quantity per unit time based on the target request data volume and the target clock number.
2. The method according to claim 1, characterized in that C0, C m It is composed of a single counter unit or a plurality of counter units set in series, {C0, C1, ..., C m ,...,C M The total number of counter units contained in} is less than or equal to the preset number of counter unit requests.
3. The method according to claim 1, characterized in that C m The corresponding request length statistics interval is set to [D1 m ,D2 m ), D1 m C m The minimum request length of the corresponding request length statistical interval, D2 m C m The maximum request length of the corresponding request length statistics interval, different C m The corresponding request length statistical intervals do not overlap.
4. The method according to claim 3, characterized in that C m The corresponding event type is set to read type, write type, or read and write type.
5. The method according to claim 4, characterized in that The step S2 comprises: Step S21, obtaining each request data from the interface of the chip under test starting from the start time corresponding to C0; Step S22: If the requested data is clock data, execute step S3; otherwise, execute step S23; Step S23: Parse the request data of the non-clock data to obtain the event type and request length corresponding to each request data of the non-clock data; Step S24: Determine a corresponding statistical type based on the event type and request length corresponding to each non-clock data request data.
6. The method according to claim 1, wherein In step S3, the clock data request data is sent to C0 for statistics, including: Step S31: Obtain the clock request quantity A corresponding to the current clock data 0 , the total number of clocks currently recorded in C0 is B 0 Update to B 0 =B 0 +A 0 , B 0 The initial value is set to 0.
7. The method according to claim 1, characterized in that In the step S3, the request data of the non-clock data is sent to the corresponding statistical type C m Statistics are collected in the Step S32: If C m is the requested data amount counter, then the C corresponding to the current non-clock data request data m The amount of request data currently recorded in D m Updated to D m =D m +E m , E m The request length corresponding to the current non-clock data request data, D m The initial value of is set to 0; Step S33: If C m For the request quantity counter, the C corresponding to the current non-clock data request data is m The amount of request data currently recorded in D m Updated to D m =D m +1.
8. The method according to claim 1, characterized in that The step S5 comprises: Step S51: Determine the target request data volume or target request quantity as the target C m , Objective-C m There are one or more; Step S52: Get all target C m The sum of the currently counted request data volume or request quantity is used as the target request data volume or target request quantity; Step S53: Obtain the number of clock requests currently counted in C0 as the target clock number; Step S54: Divide the target request data volume by the target clock number to obtain the target bandwidth, or divide the target request quantity by the target clock number to obtain the target transmission request quantity per unit time.
9. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions to be executed by the at least one processor, wherein the instructions are configured to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that The computer-executable instructions are stored, and the computer-executable instructions are used to execute the method according to any one of the preceding claims 1 to 8.
Citation Information
Patent Citations
Multi-port multi-channel message classification statistics device and method
CN118646682A
Chip and chip detection method
CN119224525A