Software and hardware code synchronization method, electronic device and medium

By building a set of target software and hardware test cases and establishing a code version mapping relationship, we solved the errors and conflicts in software and hardware code synchronization, improved the synchronization accuracy and efficiency, and promoted the progress of chip development.

CN119987814BActive Publication Date: 2025-09-23METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510154252.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-09-23
Estimated Expiration
2045-02-12

AI Technical Summary

Technical Problem

In the existing technology, the software and hardware codes lack precise verification during the server update process, resulting in code update errors and conflicts, affecting synchronization accuracy and efficiency, and thus slowing down chip development progress.

Method used

Build a target software and hardware test case set, establish a mapping relationship through software code version information, and synchronize with the hardware test case set to ensure the accuracy and efficiency of code updates.

Benefits of technology

The accuracy and efficiency of software and hardware code synchronization are improved, software code synchronization errors are avoided, and chip development efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987814B_ABST
    Figure CN119987814B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of chip technology, and in particular to a method, electronic device, and medium for synchronizing software and hardware codes. The method comprises: S1, constructing a target software test case set and a target hardware test case set; S2, updating software code based on the target software test case set; S3, synchronizing software code version information released each time to a hardware tool; S4, obtaining software code version information and submitting it to a hardware code repository; S5, obtaining the latest version of hardware code in the hardware code repository and generating a mapping relationship; S6, a hardware client obtaining hardware code to be synchronized and determining the corresponding software code version to be synchronized; S7, obtaining software code to be synchronized and sending it to a hardware client; S8, the hardware client updating the hardware code in the hardware code repository based on the target hardware test case set. The present invention avoids software code synchronization errors, thereby improving chip development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and in particular to a software and hardware code synchronization method, electronic equipment and medium. Background Art

[0002] During the chip development process, it is necessary to manage the software code through the software code warehouse on the server, and the hardware code through the hardware code warehouse on the server. The two lines run in parallel, and the update of the hardware code needs to rely on the update of some software code. The update of the software code is based on multiple software clients, and the updates of the software clients are relatively independent. The update of the hardware code is based on multiple hardware clients, and there may be a correlation between the updates of multiple hardware clients. In the existing technology, there is no precise verification of the software code and the hardware code during the server update process. Therefore, it is very likely that erroneous update codes or code conflicts will occur, causing problems in the synchronization of the software code. This will cause a large number of software clients and hardware clients to fall back to problem-free versions for updating, resulting in poor accuracy and low efficiency in the synchronization of software and hardware codes, which seriously affects the progress of chip development and thus reduces the efficiency of chip development. Summary of the Invention

[0003] The purpose of the present invention is to provide a method, electronic device and medium for synchronizing software and hardware codes, which improves the accuracy and efficiency of software and hardware code synchronization, thereby avoiding software code synchronization errors and further improving chip development efficiency.

[0004] According to a first aspect of the present invention, a method for synchronizing software and hardware codes is provided, comprising:

[0005] Step S1: construct a target software test case set and a target hardware test case set, wherein the test cases in the target software test case set can cover the data paths passed by all software clients, and the test cases in the target hardware test case set can cover the data paths passed by all hardware clients;

[0006] Step S2: The software client updates the software code in the software code warehouse based on the target software test case set;

[0007] Step S3: Record the software code version information of each release in a preset software code file, and synchronize the preset software code file to the hardware tool;

[0008] Step S4: The hardware tool reads the preset software code file, obtains the software code version information, and submits it to the hardware code warehouse;

[0009] Step S5: The hardware tool obtains the latest version of the hardware code in the hardware code repository and generates a mapping relationship between the latest version of the hardware code and the software code.

[0010] Step S6: The hardware client obtains the hardware code to be synchronized from the hardware code repository, and determines the corresponding software code version to be synchronized based on the mapping relationship between the hardware code to be synchronized and the software code version;

[0011] Step S7: Obtain the software code to be synchronized corresponding to the software code version to be synchronized from the software code repository and send it to the hardware client;

[0012] Step S8: The hardware client updates the hardware code in the hardware code warehouse based on the acquired hardware code to be synchronized, software code to be synchronized, and target hardware test case set.

[0013] 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 executable by the at least one processor, the instructions being configured to execute the method described in the first aspect of the present invention.

[0014] 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.

[0015] The present invention has significant advantages and beneficial effects compared to the prior art. By utilizing the above technical solution, the software and hardware code synchronization 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:

[0016] The embodiment of the present invention improves the accuracy of software code updates by testing the target software test case set before the software code is released, transmits software code version information through the software code file, and constructs a mapping relationship between software code and hardware code. During the process of software and hardware code synchronization, it is tested again with the target hardware test case set, thereby improving the accuracy and efficiency of software and hardware code synchronization, thereby avoiding software code synchronization errors and further improving chip development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] 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.

[0018] Figure 1 This is a flow chart of the software and hardware code synchronization method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] 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.

[0020] The embodiment of the present invention provides a method for synchronizing software and hardware codes. Figure 1 As shown, including:

[0021] Step S1: Construct a target software test case set and a target hardware test case set. The test cases in the target software test case set can cover the data paths passed by all software clients, and the test cases in the target hardware test case set can cover the data paths passed by all hardware clients.

[0022] Step S2: The software client updates the software code in the software code repository based on the target software test case set.

[0023] It should be noted that the software code to be updated is judged to be error-free based on all software test cases in the target software test case set. If all of them pass, it means that the software code to be updated is likely to be error-free, which can reduce the need for software customers to roll back software.

[0024] Step S3: Record the software code version information of each release in a preset software code file, and synchronize the preset software code file to the hardware tool.

[0025] Step S4: The hardware tool reads the preset software code file, obtains the software code version information, and submits it to the hardware code warehouse.

[0026] The hardware tool may specifically be a Jenkins robot.

[0027] Step S5: The hardware tool obtains the latest version of the hardware code in the hardware code repository, and generates a mapping relationship between the latest version of the hardware code and the software code.

[0028] It is understandable that each time the software code is updated, the mapping relationship between the updated software code and the corresponding hardware code can be obtained through step S5, providing a basis for subsequent synchronization of the software and hardware codes.

[0029] Step S6: The hardware client obtains the hardware code to be synchronized from the hardware code repository, and determines the corresponding software code version to be synchronized based on the mapping relationship between the hardware code to be synchronized and the software code version.

[0030] Step S7: Obtain the software code to be synchronized corresponding to the software code version to be synchronized from the software code repository and send it to the hardware client.

[0031] Step S8: The hardware client updates the hardware code in the hardware code warehouse based on the acquired hardware code to be synchronized, software code to be synchronized, and target hardware test case set.

[0032] It should be noted that judging whether the software and hardware code synchronization is incorrect based on all test cases in the target hardware test case set greatly reduces the number of software clients and hardware clients that need to be rolled back, thereby improving chip development efficiency.

[0033] As an embodiment, step S1 includes:

[0034] Step S11: Get each hardware client C n The submitted candidate hardware test case set n ,A2 n ,...,A i n ,...,A f(n) n}, A i n C n The corresponding candidate hardware test case i, the value range of i is 1 to f(n), f(n) is C n The total number of candidate hardware test cases submitted, C n The corresponding candidate hardware test case is C n Corresponding and C n Hardware test cases that are easily affected by other clients modifying hardware code, each A i n Corresponding to a chip module, the value of n ranges from 1 to N, where N is the total number of hardware clients.

[0035] It's important to note that the size of f(n) may also vary for different values ​​of n, meaning that different hardware clients may submit different numbers of candidate hardware test cases. Candidate hardware test cases are those that are easily affected by hardware code modifications by other hardware clients. By pre-verifying candidate hardware test cases, we can identify issues before code submission, avoiding mass client rollbacks.

[0036] Step S12: traverse all candidate hardware test case sets. If A in If the corresponding chip module already exists in the preset chip module set, skip A i n Otherwise, A i n Add to the target hardware test case set, and add A i n The corresponding chip module is added to the preset chip module set, and the target hardware test case set and the preset chip module set are initially empty.

[0037] It should be noted that the larger the number of candidate hardware test cases in the candidate hardware test case set, the longer the running cycle will be. Therefore, it is necessary to reasonably control the number of candidate hardware test cases on the basis of ensuring comprehensive testing. Each hardware test case will correspond to a chip module on a data path, but the chip modules corresponding to different test cases may overlap. Therefore, the candidate hardware test case set can be screened through step S12.

[0038] Step S13: When all candidate hardware test case sets are traversed, the target hardware test case set is generated.

[0039] It is understandable that when all candidate hardware test case sets are traversed, the hardware test cases in the current target hardware test case set are hardware test case sets that fully cover the data path devices without overlapping corresponding chip modules.

[0040] As an embodiment, step S1 includes:

[0041] Step C11: Get each software client W m The submitted candidate software test case set {B1 m ,B2 m ,...,B j m ,...,B g(m) m}, B j m W m The corresponding j-th candidate software test case, j ranges from 1 to g(m), g(m) is W m The total number of candidate software test cases submitted, W m The corresponding candidate software test case is W m Corresponding and W m Software test cases that are easily affected by other clients modifying the software code, each B j m Corresponding to a software function, the value of m ranges from 1 to M, where M is the total number of software clients.

[0042] It's important to note that the size of f(m) may also vary for different values ​​of m, meaning that different software clients may submit different numbers of candidate software test cases. Candidate software test cases are those that are easily affected by code modifications by other software clients. By pre-verifying candidate software test cases, we can identify issues before code submission, avoiding mass client rollbacks.

[0043] Step C12: traverse all candidate software test case sets. If B j m If the corresponding software function already exists in the preset software function set, skip B j m Otherwise, B j m Add B to the target software test case set and j m The corresponding software is added to the preset software function set, and the target software test case set and the preset software function set are initially empty.

[0044] It should be noted that the larger the number of candidate software test cases in the candidate software test case set, the longer the running cycle will be. Therefore, it is necessary to reasonably control the number of candidate software test cases on the basis of ensuring comprehensive testing. Each software test case will correspond to a software function on a data path, but the software functions corresponding to different test cases may overlap. Therefore, the candidate software test case set can be screened through step C12.

[0045] Step C13: When all candidate software test case sets are traversed, the target software test case set is generated.

[0046] It is understandable that when all candidate software test case sets are traversed, the software test cases in the current target software test case set are software test case sets that fully cover the data path device without overlapping corresponding software functions.

[0047] As an embodiment, step S2 includes:

[0048] Step S21, software client W m Get the latest version of the software code currently stored in the software code warehouse as W m Corresponding software code to be developed P m , the value range of m is 1 to M, where M is the total number of software clients.

[0049] It should be noted that when each software client pulls the software code from the server, it is the latest version of the software code currently stored in the server corresponding to the pulling time.

[0050] Step S22, software client W m Based on P m Perform local development and generate W m Corresponding software code update information Q m .

[0051] It should be noted that the local development requirements corresponding to each software client may be different, so the generated software code update information is usually also different.

[0052] Step S23: m and Q m Merge to generate W m Corresponding software code to be uploaded R m .

[0053] It should be noted that step S23 is performed on the software client W m Local will P m and Q m Merge to generate W m Corresponding software code to be uploaded R m .

[0054] Step S24: Based on R m Run all target software test cases in the target software test case set. If all pass, R m Update to the software code warehouse and generate corresponding software code version information.

[0055] It should be noted that based on R m Run all target software test cases in the target software test case set to determine whether the software code update is wrong and whether the software code update may affect the update of other software clients. If all pass, it means W m The corresponding update code is likely to be error-free and will not affect the updates of other software clients.

[0056] As an embodiment, step S24 includes:

[0057] Step S241: If based on R m If all target software test cases in the target software test case set fail to run, the process returns to step S22; if all target software test cases pass, the process executes step S3; if some target software test cases pass and some fail, the process executes step S242.

[0058] Among them, if based on R mIf all target software test cases in the target software test case set fail to be run, this is usually because there is a problem with the code developed and updated locally by the software client, so it is necessary to go back to step S22 and update again.

[0059] Step S242: Based on R m Debugging, if W m If the corresponding software code update is unreasonable, the process returns to step S22 and executes again; otherwise, the process executes step S243.

[0060] It should be noted that when some target software test cases in the target software test case set pass while others fail, this could be due to a problem with the locally developed and updated code on the software client. Alternatively, it could be due to the locally developed and updated code on the software client causing the test sequences of some target test cases in the target software test case set to need updating. Therefore, further analysis is required.

[0061] Step S243: Based on W m The corresponding software code updates determine the first target software test case in the target software test case set that requires an updated test sequence.

[0062] Step S244: Based on W m The corresponding software code update determines an update sequence corresponding to the first target software test case.

[0063] Step S245: R m The corresponding first target software test case and the update sequence corresponding to the first target software test case are submitted to the software code warehouse for update, and the corresponding software code version information is generated.

[0064] As an example, when a new software function module is added to the software code, the base addresses of other software function modules will change. Therefore, the corresponding test sequences also need to be updated synchronously. It should be noted that only the update sequence corresponding to the first target software test case is generated and submitted synchronously with the updated code. It does not directly update the target software test case set.

[0065] It is understandable that the first target software test case and the update sequence corresponding to the first target software test case are used in conjunction with the corresponding version of the software code, that is, only when the corresponding first target software test case and the update sequence corresponding to the first target software test case exist in the acquired software code version, the update sequence corresponding to the first target software test case needs to be replaced when running the target software test case set. As an embodiment, in step S24, during the process of running all test cases in the target software test case set, if the corresponding first target software test case and the update sequence corresponding to the first target software test case are acquired in step S21, then when running the first target software test case, it is run based on the update sequence corresponding to the first target software test case. As an embodiment, in step S21, if the latest version of the software code currently stored in the software code warehouse includes the corresponding first target software test case, then the first target software test case and the update sequence corresponding to the first target software test case corresponding to the latest version of the software code currently stored are synchronously acquired.

[0066] In step S24, if R m If there is a first target software test case and an update sequence corresponding to the first target software test case, when running to the first target software test case, it is run based on the update sequence corresponding to the first target software test case.

[0067] As an embodiment, step S8 includes:

[0068] Step S81: Hardware client C n Based on the obtained hardware code D to be synchronized n 、Software code to be synchronized L n Perform code synchronization and generate the hardware code H to be updated n .

[0069] It should be noted that, in the embodiment of the present invention, the hardware codes in the default hardware code bin are all correct.

[0070] Step S82: Based on H n Run all target hardware test cases in the target hardware test case set. If all target hardware test cases pass, execute step S85; otherwise, execute step S83.

[0071] Step S83: Based on H n Debugging, if H n Corresponding software code to be synchronized L n If there is a problem, go back to step S2 and execute again.

[0072] 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.

[0073] 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 executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.

[0074] 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.

[0075] The embodiment of the present invention improves the accuracy of software code updates by testing the target software test case set before the software code is released, transmits software code version information through the software code file, and constructs a mapping relationship between software code and hardware code. During the process of software and hardware code synchronization, it is tested again with the target hardware test case set, thereby improving the accuracy and efficiency of software and hardware code synchronization, thereby avoiding software code synchronization errors and further improving chip development efficiency.

[0076] 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 method for synchronizing software and hardware codes, characterized in that: include: Step S1: construct a target software test case set and a target hardware test case set, wherein the test cases in the target software test case set can cover the data paths passed by all software clients, and the test cases in the target hardware test case set can cover the data paths passed by all hardware clients; Step S2: The software client updates the software code in the software code warehouse based on the target software test case set; The step S2 comprises: Step S21, software client W m Get the latest version of the software code currently stored in the software code warehouse as W m Corresponding software code to be developed P m , the value range of m is from 1 to M, where M is the total number of software clients; Step S22, software client W m Based on P m Perform local development and generate W m Corresponding software code update information Q m ; Step S23: m and Q m Merge to generate W m Corresponding software code to be uploaded R m ; Step S24: Based on R m Run all target software test cases in the target software test case set. If all pass, R m Update to the software code warehouse and generate corresponding software code version information; Step S3: Record the software code version information of each release in a preset software code file, and synchronize the preset software code file to the hardware tool; Step S4: The hardware tool reads the preset software code file, obtains the software code version information, and submits it to the hardware code warehouse; Step S5: The hardware tool obtains the latest version of the hardware code in the hardware code repository and generates a mapping relationship between the latest version of the hardware code and the software code. Step S6: The hardware client obtains the hardware code to be synchronized from the hardware code repository, and determines the corresponding software code version to be synchronized based on the mapping relationship between the hardware code to be synchronized and the software code version; Step S7: Obtain the software code to be synchronized corresponding to the software code version to be synchronized from the software code repository and send it to the hardware client; Step S8: The hardware client updates the hardware code in the hardware code warehouse based on the acquired hardware code to be synchronized, software code to be synchronized, and target hardware test case set; The step S8 comprises: Step S81: The hardware client performs code synchronization based on the acquired hardware code to be synchronized and software code to be synchronized, and generates a hardware code to be updated; Step S82: running all target hardware test cases in the target hardware test case set based on the hardware code to be updated. If all target hardware test cases pass, updating the hardware code to be updated to the hardware code warehouse; otherwise, executing step S83; Step S83: Debug based on the hardware code to be updated. If there is a problem with the software code to be synchronized corresponding to the hardware code to be updated, return to step S2 and execute again.

2. The method according to claim 1, characterized in that The step S1 comprises: Step S11: Get each hardware client C n The submitted candidate hardware test case set n ,A2 n ,...,A i n ,...,A f(n) n }, A i n C n The corresponding candidate hardware test case i, the value range of i is 1 to f(n), f(n) is C n The total number of candidate hardware test cases submitted, C n The corresponding candidate hardware test case is C n Corresponding and C n Hardware test cases that are easily affected by other clients modifying hardware code, each A i n For a chip module, the value of n ranges from 1 to N, where N is the total number of hardware clients; Step S12: traverse all candidate hardware test case sets. If A i n If the corresponding chip module already exists in the preset chip module set, skip A i n Otherwise, A i n Add to the target hardware test case set, and add A i n The corresponding chip module is added to the preset chip module set, and the target hardware test case set and the preset chip module set are initially empty; Step S13: When all candidate hardware test case sets are traversed, the target hardware test case set is generated.

3. The method according to claim 1, characterized in that The step S1 comprises: Step C11: Get each software client W m The submitted candidate software test case set {B1 m ,B2 m ,...,B j m ,...,B g(m) m }, B j m W m The corresponding j-th candidate software test case, j ranges from 1 to g(m), g(m) is W m The total number of candidate software test cases submitted, W m The corresponding candidate software test case is W m Corresponding and W m Software test cases that are easily affected by other clients modifying the software code, each B j m Corresponding to a software function, the value of m ranges from 1 to M, where M is the total number of software clients; Step C12: traverse all candidate software test case sets. If B j m If the corresponding software function already exists in the preset software function set, skip B j m Otherwise, B j m Add B to the target software test case set and j m The corresponding software is added to the preset software function set, and the target software test case set and the preset software function set are initially empty; Step C13: When all candidate software test case sets are traversed, the target software test case set is generated.

4. The method according to claim 1, wherein The step S24 includes: Step S241: If based on R m If all target software test cases in the target software test case set fail to be run, the process returns to step S22; if all target software test cases pass, the process proceeds to step S3; if some target software test cases pass and some fail, the process proceeds to step S242; Step S242: Based on R m Debugging, if W m If the corresponding software code update is unreasonable, the process returns to step S22 and executes again; otherwise, the process executes step S243; Step S243: Based on W m The corresponding software code updates determine a first target software test case in the target software test case set that requires an updated test sequence; Step S244: Based on W m The corresponding software code update determines an update sequence corresponding to the first target software test case; Step S245: R m The corresponding first target software test case and the update sequence corresponding to the first target software test case are submitted to the software code warehouse for update, and the corresponding software code version information is generated.

5. The method according to claim 4, characterized in that In step S21, if the latest version of the software code currently stored in the software code warehouse includes the corresponding first target software test case, then the first target software test case corresponding to the latest version of the software code currently stored and the update sequence corresponding to the first target software test case are synchronously obtained; In step S24, if R m If there is a first target software test case and an update sequence corresponding to the first target software test case, when running to the first target software test case, it is run based on the update sequence corresponding to the first target software test case.

6. 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 that can be executed by the at least one processor, and the instructions are configured to execute the method according to any one of claims 1 to 5.

7. 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 5.

Citation Information

Patent Citations

  • System for updating chip software and hardware configuration in chip EDA simulation and application

    CN113312080A

  • File loading method, storage medium and equipment

    CN113377418A