Method and application of test case configuration based on cosim platform
By parsing and storing chip register and table entry addresses in the database on the Cosim platform, and using name indexing to match Cmodel test cases, the problem of low configuration efficiency is solved, and the test case configuration time is significantly shortened.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU CENTEC COMM CO LTD
- Filing Date
- 2022-10-26
- Publication Date
- 2026-04-14
AI Technical Summary
When configuring test cases for network switching chips on the Cosim platform, as the chip size increases, the configuration efficiency of existing technologies is low, resulting in high time and cost for configuring and converting each test case.
By parsing chip register and table entry addresses and storing them in the Cosim database, Cmodel test cases are matched using register and table entry names as indexes to generate configuration files, avoiding repeated parsing of common information.
It improved the efficiency of test case configuration, reduced the configuration time for each test case from 4 minutes and 30 seconds to just over 8 seconds, and significantly improved configuration conversion efficiency.
Smart Images

Figure CN115617673B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communications, and in particular to a method and application for configuring test cases based on the Cosim platform. Background Technology
[0002] In the verification process of network switching chips, it is difficult to simulate and construct some complex network application scenarios under real network protocol conditions at the module level. Therefore, system-level simulation is used to verify whether the operation of multi-module linkage functional blocks meets expectations. In network switching chips, large functional blocks are generally verified for specific network packets or protocols. At this time, co-simulation with the software reference model can not only construct specific test cases to simulate specific network scenarios, but also integrate the software environment in advance to shorten the overall chip development time.
[0003] In large-scale network switching chips, not only do numerous control registers need configuration, but also many tables, such as forwarding tables for controlling forwarding and tables for matching IP and MAC addresses. Moreover, as customer demands for larger tables increase, the size of these internal tables within the chip continues to expand. Cmodel configures test cases through the CPU interface, configuring registers and tables one by one by address. Therefore, the configuration file grows larger as the number of internal registers and tables increases. For example, a typical test case for a switch chip might have over 60,000 CPU access commands, while the Costim platform requires over 20,000 test cases for simulation.
[0004] Currently, scripting tools parse the configuration files used by Cmodel test cases according to the addresses of registers and tables, converting them into backdoor-style configurations recognizable by the Cosim platform, and then configuring them via the backdoor. First, the addresses of all registers and tables used by the chip are parsed. Then, the configurations provided by Cmodel are matched one by one, and the matched configurations are printed to the configuration file used via the backdoor. For smaller chips, this method is efficient because the Cmodel test case configuration files are also small, with fewer registers and tables. However, as chip scale increases, each test case configuration can contain tens of thousands of lines, making the time cost of converting each test case configuration quite high.
[0005] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide a method and application for configuring test cases based on the Costim platform, thereby solving the problem of low efficiency in configuring test cases based on the Costim platform.
[0007] To achieve the above objectives, embodiments of the present invention provide a method for configuring test cases based on the Costim platform.
[0008] In one or more embodiments of the present invention, the method includes: parsing chip registers and table entry addresses and storing them in a Cosim database; using the names of registers and table entries in the Cosim database as indexes to match the configuration of Cmodel test cases and generate corresponding configuration files.
[0009] In one or more embodiments of the present invention, the names of registers and table entries in the Cosim database are used as indexes to match the configuration of Cmodel test cases and generate corresponding configuration files, including: reading the Cosim database; parsing the configuration of the Cmodel test cases; matching the names of registers and table entries in the configuration in the Cosim database; and generating register configuration and table entry configuration.
[0010] In one or more embodiments of the present invention, the method further includes: configuring the Cmodel test cases via a backdoor configuration method.
[0011] In one or more embodiments of the present invention, the test case configuration includes at least: chip ID, chip address, configuration content, and the names of the registers and table entries.
[0012] In another aspect of the invention, an apparatus for configuring test cases based on the Costim platform is provided, which includes a parsing module and a configuration module.
[0013] The parsing module is used to parse chip register and table entry addresses and store them in the Cosim database.
[0014] The configuration module is used to match the configuration of Cmodel test cases by using the names of registers and table entries in the Costim database as indexes, and generate the corresponding configuration files.
[0015] In one or more embodiments of the present invention, the configuration module is further configured to: read the Cosim database; parse the configuration of the Cmodel test cases; match the names of registers and table entries in the configuration in the Cosim database; and generate register configurations and table entry configurations.
[0016] In one or more embodiments of the present invention, the configuration module is further configured to: configure the Cmodel test cases via a backdoor configuration method.
[0017] In one or more embodiments of the present invention, the test case configuration includes at least: chip ID, chip address, configuration content, and the names of the registers and table entries.
[0018] In another aspect of the invention, an electronic device is provided, comprising: at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of configuring test cases based on the Cosim platform as described above.
[0019] In another aspect of the invention, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method for configuring test cases based on the Costim platform as described above.
[0020] Compared with the prior art, the method and application of test case configuration based on the Cosim platform according to the present invention can separate the original chip register and table entry parsing and implement them separately, avoiding the repeated parsing of these common information in different test cases. By adding the Cosim database to store and match the address of the test case configuration, the efficiency of Cosim test case configuration conversion can be improved. Attached Figure Description
[0021] Figure 1 This is a flowchart of a method for configuring test cases based on the Cosim platform according to an embodiment of the present invention;
[0022] Figure 2 This is a detailed flowchart of a method for configuring test cases based on the Cosim platform according to an embodiment of the present invention;
[0023] Figure 3 This is a structural diagram of a device for configuring test cases based on the Cosim platform according to an embodiment of the present invention;
[0024] Figure 4 This is a hardware structure diagram of a computing device configured with test cases based on the Cosim platform according to an embodiment of the present invention. Detailed Implementation
[0025] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings, but it should be understood that the scope of protection of the present invention is not limited to the specific embodiments.
[0026] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.
[0027] The technical solutions provided by the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0028] Example 1
[0029] like Figures 1 to 2 As shown, an embodiment of the present invention describes a method for configuring test cases based on the Costim platform, which includes the following steps.
[0030] In step S101, the chip register and table entry address are parsed and stored in the Cosim database.
[0031] Simulation results on the Cosim platform show that parsing chip register and table entry addresses takes 55 seconds, and matching the test case configuration with these addresses to generate the configuration takes 4 minutes and 30 seconds. This indicates that parsing chip register and table entry addresses is a repetitive process for all test cases. Therefore, in this embodiment, the process of parsing chip register and table entry addresses is extracted and performed only once, generating an intermediate Cosim database, Cosim.db. This database serves as the input for the process of matching the test case configuration with the chip register and table entry addresses to generate the configuration. Thus, 55 seconds can be saved in configuring each test case, which is a considerable time saving for tens of thousands of test cases.
[0032] In step S102, the names of registers and table entries in the Costim database are used as indexes to match the configuration of Cmodel test cases and generate the corresponding configuration files.
[0033] Since a configuration within a specific address range must belong to a particular register or table entry, register and table entry name identifiers are added to the existing Cmodel test case configuration files, which are configured entirely according to address. The Cosim database generated during the parsing of chip register and table entry addresses uses register and table entry names as indexes for data organization. During the process of matching test case configurations with chip register and table entry addresses to generate configurations, it is no longer necessary to match a single configuration across the entire chip's address space; instead, register and table entry names are directly used for indexing, significantly saving matching time. Testing showed that the original test case configuration matching and generation, which took 4 minutes and 30 seconds, can now be completed in just over 8 seconds, greatly improving efficiency.
[0034] The configuration format for test cases is as follows:
[0035] A B C D 03 85949f40 0000004a #RegisterACtl221[274877906944 / 0x4000000000] 03 85c9ba00 00000000 #TableBCtl246[274877906944 / 0x4000000000] 03 85c9ba04 00000000 #TableBCtl246[274877906944 / 0x4000000000]
[0036] Where A represents the chip ID, B represents the chip address, C represents the configuration content, and D is the name of the configuration register and table entry.
[0037] The data format stored in the Cosim database is as follows:
[0038]
[0039]
[0040] When configuring test cases, the corresponding configuration register and table entry names are RegisterACtl and TableBCtl, respectively, according to the configuration format of the test cases. In the Cosim database, RegisterACtl and TableBCtl can be used as indexes to match RegisterName and MemName, which can quickly generate the required backdoor configuration file.
[0041] The method and application for test case configuration based on the Cosim platform according to embodiments of the present invention can separate the original chip register and table entry parsing and implement them separately, avoiding repeated parsing of these common information in different test cases. By adding the Cosim database for address storage and matching of test case configuration, the efficiency of Cosim test case configuration conversion can be improved.
[0042] like Figure 3 As shown, an apparatus for configuring test cases based on the Cosim platform according to a specific embodiment of the present invention is described.
[0043] In an embodiment of the present invention, the device for configuring test cases based on the Cosim platform includes a parsing module 301 and a configuration module 302.
[0044] The parsing module 301 is used to parse the chip registers and table entry addresses and store them in the Cosim database.
[0045] Configuration module 302 is used to match the configuration of Cmodel test cases by using the names of registers and table entries in the Costim database as indexes, and generate the corresponding configuration files.
[0046] The configuration module 302 is also used for: reading the Costim database; parsing the configuration of Cmodel test cases; matching the names of registers and table entries in the configuration in the Costim database; and generating register configurations and table entry configurations.
[0047] Configuration module 302 is also used to configure Cmodel test cases via a backdoor configuration method.
[0048] In this embodiment, the test case configuration includes at least: chip ID, chip address, configuration content, and the names of registers and table entries.
[0049] Figure 4 A hardware structure diagram of a computing device 40 for configuring test cases based on the Cosim platform, according to an embodiment of this specification, is shown. Figure 4 As shown, the computing device 40 may include at least one processor 401, a memory 402 (e.g., non-volatile memory), a main memory 403, and a communication interface 404, and the at least one processor 401, memory 402, main memory 403, and communication interface 404 are connected together via a bus 405. At least one processor 401 executes at least one computer-readable instruction stored or encoded in the memory 402.
[0050] It should be understood that the computer-executable instructions stored in memory 402, when executed, cause at least one processor 401 to perform the above-described combinations in the various embodiments of this specification. Figure 1-4 The description includes various operations and functions.
[0051] In the embodiments of this specification, computing device 40 may include, but is not limited to: personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile computing device, smartphone, tablet computer, cellular phone, personal digital assistant (PDA), handheld device, messaging device, wearable computing device, consumer electronic device, etc.
[0052] According to one embodiment, a program product, such as a machine-readable medium, is provided. The machine-readable medium may have instructions (i.e., the elements implemented in software as described above), which, when executed by a machine, cause the machine to perform the above-described combinations of the various embodiments of this specification. Figure 1-4 The various operations and functions described. Specifically, a system or apparatus equipped with a readable storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer or processor of the system or apparatus to read and execute the instructions stored in the readable storage medium.
[0053] The method and application for test case configuration based on the Cosim platform according to embodiments of the present invention can separate the original chip register and table entry parsing and implement them separately, avoiding repeated parsing of these common information in different test cases. By adding the Cosim database for address storage and matching of test case configuration, the efficiency of Cosim test case configuration conversion can be improved.
[0054] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present 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, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0055] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0056] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0057] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0058] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A method for configuring test cases based on the Cosim platform, characterized in that, The method includes: Parse the chip registers and table entries, and store them in the Cosim database; The names of registers and table entries in the Cosim database are used as indexes to match the configuration of Cmodel test cases, generating corresponding configuration files, specifically including: Read the Cosim database; Parse the configuration of the Cmodel test cases; The Cosim database is matched according to the names of the registers and entries in the configuration; and Generate register configuration and table entry configuration.
2. The method for configuring test cases based on the Cosim platform as described in claim 1, characterized in that, The method further includes: The Cmodel test cases are configured using a backdoor configuration method.
3. The method for configuring test cases based on the Cosim platform as described in claim 1, characterized in that, The test case configuration includes at least: chip ID, chip address, configuration content, and the names of the registers and table entries.
4. A device for configuring test cases based on the Cosim platform, characterized in that, The device includes: The parsing module is used to parse chip register and table entry addresses and store them in the Cosim database; The configuration module is used to match the configuration of Cmodel test cases by using the names of registers and table entries in the Cosim database as indexes, and generate corresponding configuration files, specifically including: Read the Cosim database; Parse the configuration of the Cmodel test cases; The Cosim database is matched according to the names of the registers and entries in the configuration; and Generate register configuration and table entry configuration.
5. The apparatus for configuring test cases based on the Cosim platform as described in claim 4, characterized in that, The configuration module is also used for: The Cmodel test cases are configured using a backdoor configuration method.
6. The apparatus for configuring test cases based on the Cosim platform as described in claim 4, characterized in that, The test case configuration includes at least: chip ID, chip address, configuration content, and the names of the registers and table entries.
7. An electronic device, characterized in that, include: At least one processor; as well as A memory that stores instructions that, when executed by the at least one processor, cause the at least one processor to perform a method for configuring test cases based on the Cosim platform as described in any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for configuring test cases based on the Cosim platform as described in any one of claims 1 to 3.
Citation Information
Patent Citations
A method and system for automatically testing register
CN109344082A
Chip prototype verification method, device, equipment and medium
CN112560372A