Software and hardware code synchronization method, electronic equipment and medium

By building a collection of test cases covering all data paths and testing before software and hardware code updates, the problem of low accuracy and efficiency of software and hardware code synchronization in the existing technology is solved, efficient software and hardware code synchronization is achieved, and chip development efficiency is improved.

CN119987814AActive Publication Date: 2025-05-13METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, software code and hardware code lack precise verification during server update process, resulting in possible incorrect update code or code conflicts, affecting the accuracy and efficiency of software and hardware code synchronization, and seriously affecting the progress of chip development.

Method used

By building a collection of target software test cases and a collection of target hardware test cases, ensure that test cases can cover the data paths of all software and hardware clients. Before the software code is updated, the target software test case collection is tested, and the version information is passed through the software code file to build a mapping relationship between the software code and the hardware code. During the software and hardware code synchronization process, tests of the target hardware test case collection are carried out to ensure the accuracy and efficiency of synchronization.

Benefits of technology

It improves the accuracy and efficiency of software and hardware code synchronization, avoids errors in software code during synchronization, and thus significantly improves chip development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987814A_ABST
    Figure CN119987814A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of chips, in particular to a software and hardware code synchronization method, electronic equipment and a medium, and the method comprises the following steps: S1, constructing a target software test case set and a target hardware test case set; s2, updating a software code based on the target software test case set; s3, synchronizing the software code version information released each time to a hardware tool; s4, acquiring software code version information, and submitting the software code version information to a hardware code bin; s5, acquiring a hardware code version of the current latest version in the hardware code bin, and generating a mapping relation; s6, the hardware client obtains the to-be-synchronized hardware code and determines a corresponding to-be-synchronized software code version; s7, acquiring a software code to be synchronized and sending the software code to the hardware client; and S8, the hardware client updates the hardware code in the hardware code bin based on the target hardware test case set. According to the invention, synchronization errors of software codes are avoided, so that the chip development efficiency is improved.
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 manage 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 codes. The update of the software code is implemented based on multiple software clients, and the update of the software client is relatively independent. The update of the hardware code is implemented based on multiple hardware clients, and there may be a correlation between the updates of multiple hardware clients. In the prior art, 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 process of the software code, which 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 of software and hardware code synchronization, which seriously affects the progress of chip development, thereby reducing chip development efficiency. 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, there is provided a method for synchronizing software and hardware codes, comprising:

[0005] Step S1, constructing 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, recording the software code version information released each time in a preset software code file, and synchronizing 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 version in the hardware code warehouse, and generates a mapping relationship between the latest version of the hardware code version and the software code version;

[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 warehouse 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, there is provided 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, 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, there is provided a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the first aspect of the present invention.

[0015] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the software and hardware code synchronization method, electronic device and medium provided by the present invention can achieve considerable technical advancement and practicality, and have wide industrial utilization value, and at least have the following beneficial effects:

[0016] The embodiment of the present invention improves the accuracy of software code update by testing the target software test case set before the software code is released, transfers software code version information through software code files, builds a mapping relationship between software code and hardware code, and then tests the target hardware test case set during the software and hardware code synchronization process, 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 drawings required for use in the description of the embodiments will be briefly introduced below. 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 A flowchart of a method for synchronizing software and hardware codes provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are 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, 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.

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

[0023] It should be noted that whether the software code to be updated is incorrect is judged based on all software test cases in the target software test case set. If all 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 released each time 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 version in the hardware code warehouse, and generates a mapping relationship between the latest version of the hardware code version and the software code version.

[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, which provides 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 synchronization of software and hardware codes 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, the 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 i-th candidate hardware test case, i ranges from 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 should be noted that when n takes different values, the size of f(n) may also be different, that is, the number of candidate hardware test cases submitted by different hardware clients may be different. Candidate hardware test cases are hardware test cases that are easily affected by other hardware clients modifying the hardware code. By verifying candidate hardware test cases in advance, problems can be discovered before code submission, avoiding the situation of a large number of 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 can be understood 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, the 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 should be noted that when m takes different values, the size of f(m) may also be different, that is, the number of candidate software test cases submitted by different software clients may be different. Candidate software test cases are software test cases that are easily affected by other software clients modifying the software code. By verifying candidate software test cases in advance, problems can be discovered before code submission, avoiding the situation of a large number of 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. 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 can be understood 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 The 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 The 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 The 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, and 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 update of other software clients.

[0056] As an embodiment, step S24 includes:

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

[0058] Among them, if based on R mIf all target software test cases in the target software test case set fail to 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 and some fail, it may be that there is a problem with the code developed and updated locally by the software client, or it may be that the code developed and updated locally by the software client causes the test sequences of some target test cases in the target software test case set to need to be updated. Therefore, further judgment 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 needs to update the 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 embodiment, when a new software function module is added to the software code, the base addresses of other software function modules will change, so 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 trial case is generated and submitted synchronously with the update code, and the target software test case set is not directly updated.

[0065] It can be understood 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, when running the target software test case set, the update sequence corresponding to the first target software test case needs to be replaced. As an embodiment, in 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 obtained in step S21, the first target software test case 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, 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 obtained.

[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 runs 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 acquired hardware code D to be synchronized n 、Software code to be synchronized L n Perform code synchronization to 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 The corresponding software code to be synchronized L n If there is a problem, return to step S2 and execute again.

[0072] It should be noted that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The 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] The 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 update by testing the target software test case set before the software code is released, transfers software code version information through software code files, builds a mapping relationship between software code and hardware code, and then tests the target hardware test case set during the software and hardware code synchronization process, 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 only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification 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 still falls 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, constructing 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; Step S3, recording the software code version information released each time in a preset software code file, and synchronizing 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 version in the hardware code warehouse, and generates a mapping relationship between the latest version of the hardware code version and the software code version; 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 warehouse 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.

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 i-th candidate hardware test case, i ranges from 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; 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 range of m is 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. 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, characterized in that 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 The 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, and if all pass, R m Update to the software code warehouse and generate corresponding software code version information.

5. The method according to claim 4, characterized in that The step S24 comprises: Step S241: If based on R m If all the target software test cases in the target software test case set fail to run, then return to step S22; if all the target software test cases pass, then execute step S3; if some of the target software test cases pass and some fail, then execute step S242; Step S242: Based on R m Debugging, if W m If the corresponding software code update is unreasonable, then return to step S22 and execute again, otherwise, execute step S243; 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 needs to update the 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.

6. The method according to claim 5, characterized in that In the 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, 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 runs based on the update sequence corresponding to the first target software test case.

7. The method according to claim 1, characterized in that The step S8 comprises: Step S81: Hardware client C n Based on the acquired hardware code D to be synchronized n 、Software code to be synchronized L n Perform code synchronization to generate the hardware code H to be updated n ; 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; Step S83: Based on H n Debugging, if H n The corresponding software code to be synchronized L n If there is a problem, return to step S2 and execute again.

8. 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 executable by the at least one processor, wherein the instructions are configured to execute the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the method of any one of the preceding claims 1-7.

Citation Information

Patent Citations

  • Software testing method, device and system, storage medium and electronic equipment

    CN110928770A

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

    CN113312080A

  • File loading method, storage medium and equipment

    CN113377418A

  • Method for synchronizing software code into hardware environment and automatically integrating software code

    CN118916075A

  • Automobile software and hardware version management method, device and equipment and readable storage medium

    CN119379209A