Abnormity processing method for multi-core chip and multi-core chip

By detecting abnormal shutdown marks in multi-core chips and entering self-test mode, and performing memory load tests to eliminate bad cores, the problem of poor stability of multi-core chips is solved and the reliability and yield rate of the chips are improved.

CN118656242APending Publication Date: 2024-09-17AMICRO SEMICONDUCTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410834139.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

During the testing process of multi-core chips, due to the poor stability of the CPU core, it is difficult to screen out bad chips in a short period of time, and existing repair methods cannot effectively handle the abnormal shutdown state or system crash of multi-core chips, resulting in overall system abnormalities.

Method used

Enter self-test mode by detecting abnormal shutdown flags, perform multiple restarts, and perform memory load tests on the processing cores at each restart to eliminate bad cores until all cores are judged to be good, ensuring system stability.

Benefits of technology

Effectively detect and disable bad cores, improve the stability and reliability of multi-core chips, reduce modifications to startup code, and improve the chip's yield rate and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656242A
    Figure CN118656242A
Patent Text Reader

Abstract

The invention discloses an exception handling method for a multi-core chip and the multi-core chip, and the exception handling method comprises the steps: controlling the multi-core chip to enter a self-inspection mode to perform multiple restarting under the condition that an exception shutdown mark is detected to exist in advance; in the self-checking mode, the processing cores with the matched number in the multi-core chip are controlled to conduct memory load testing every time restarting is conducted, each processing core is controlled to judge whether the processing core is a bad core or not based on the memory load testing, and the bad cores are excluded from the processing cores allowed to be started by the multi-core chip. Until all the processing cores in the multi-core chip are judged, the bad cores in the multi-core chip are eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of chip testing, and in particular to an exception handling method for a multi-core chip and a multi-core chip. Background Art

[0002] The main control chips used in household smart robots (such as sweeping robots) generally adopt a multi-core CPU design. After the main control chip wafer is packaged, the chip must be tested to screen out defective chips. In the test phase, poor CPU stability is difficult to be screened out in a short test time (such as 10 seconds). The specific manifestation is that after a CPU core in a multi-core CPU runs at full load for a period of time (such as 1 minute), a CPU core memory access (or other) error will occur probabilistically. As the test time or the number of repeated tests increases, the probability of occurrence will increase.

[0003] The Chinese invention patent application with patent application number CN202311173752.3 discloses a chip startup code repair method and repair system. Specifically, when a chip startup abnormality is detected, based on the abnormal position of the startup code, the startup code and / or the repair code stored in the non-volatile memory are copied to the random access memory to repair the abnormal part of the startup code. However, the modification method and repair system do not check the shutdown abnormal state or system freeze abnormality (which can be understood as a chip stability failure) of the multi-core chip system, resulting in the problem of overall system abnormality caused by part of the CPU core every time the multi-core chip is started through the startup code. Summary of the invention

[0004] This application discloses an exception handling method for a multi-core chip and a multi-core chip, and the specific technical solution is as follows: An exception handling method for a multi-core chip, the exception handling method comprising: in the case of detecting a pre-existing abnormal shutdown mark, controlling the multi-core chip to enter a self-check mode for multiple restarts; in the self-check mode, controlling a matching number of processing cores inside the multi-core chip to perform a memory load test each time the chip is restarted, and controlling each processing core to determine whether it is a bad core based on the memory load test, and excluding the bad cores from the processing cores allowed to start by the multi-core chip, until all processing cores in the multi-core chip are determined to exclude the bad cores in the multi-core chip. In summary, in the case of detecting an abnormal shutdown mark, the present application controls the multi-core chip to enter a self-check mode to perform multiple restarts and control a matching number of processing cores in different restarts to perform a memory load test and exclude the bad cores from the processing cores allowed to start by the multi-core chip, until all processing cores in the multi-core chip are determined to exclude the bad cores in the multi-core chip, thereby targeting the poor stability failure of the multi-core chip, checking and disabling the bad cores one by one, and improving the stability of the system device where the multi-core chip is located. Therefore, when some processing cores of the multi-core chip are defective, the defective cores can be checked and disabled through the self-check mode, thereby improving the reliability of the multi-core chip and reducing the modification of the startup code.

[0005] Furthermore, the method of controlling the multi-core chip to restart multiple times and controlling the matching number of processing cores inside the multi-core chip to perform memory load test at each restart includes: at the i-th restart, controlling at most i processing cores inside the multi-core chip to perform memory load test; when i is greater than 1, at most i processing cores inside the multi-core chip, including at least one processing core that has not been previously tested for memory load and / or at most i-1 processing cores of the multi-core chip that have successfully performed memory load test at the i-1 restart; wherein i is a positive integer, i is less than or equal to a preset test number; at most i processing cores inside the multi-core chip are the matching number of processing cores inside the multi-core chip; wherein, when the multi-core chip is set with a preset number of processing cores for test, the number of restarts of the multi-core chip is set to be greater than or equal to the preset test number. Thus, a new processing core is started one by one to perform memory load test.

[0006] Furthermore, at each restart, there is at least one processing core that has not been previously subjected to a memory load test among the processing cores that undergo a memory load test, so that when the number of restarts of the multi-core chip is equal to a preset number of tests, all processing cores in the multi-core chip have undergone a memory load test and based on the memory load test, each processing core is determined to be a bad core.

[0007] Furthermore, in the case of the i-th restart, if there is a processing core in the multi-core chip that fails the memory load test, the failed processing core is marked as a bad core, and then the i+1-th restart is performed by means of reset, until i is equal to the preset test number, and all bad cores are determined from all processing cores in the multi-core chip; in the case of the i-th restart, if all processing cores in the multi-core chip that perform the memory load test are tested successfully, the i+1-th restart is performed by means of reset. Thus, a specific number of processing cores are turned on by one restart in the self-check mode and a round of stability test is completed, and the test is determined to be successful only when all processing cores that perform the memory load test read and write the memory successfully and fetch instructions correctly.

[0008] Furthermore, during the i-th restart, the process of performing memory load testing on at most i processing cores inside the multi-core chip is the i-th round of stability testing for the multi-core chip; in the i-th round of stability testing, if each processing core inside the multi-core chip that performs memory load testing reads and writes memory successfully and fetches instructions correctly, then it is determined that all processing cores inside the multi-core chip that perform memory load testing have been tested successfully, and further it is determined that the i-th round of stability testing on the processing cores is successful; wherein, if it is determined that a single processing core reads and writes memory successfully and fetches instructions correctly, then it is determined that the single processing core has been tested successfully.

[0009] In summary, the interference between different processing cores is reduced, and the problem of probabilistic errors occurring in different restarts or memory load tests of the same processing core is overcome. In addition, multiple rounds of stability tests are required to successively check different bad cores in the multi-core chip.

[0010] Further, when i is less than the preset test number, in the i-th round of stability test, if it is determined that a processing core that performs a memory load test is a bad core, it is determined that the i-th round of stability test on the processing core fails, and the multi-core chip is reset to perform the i+1th round of stability test, and the bad core determined in the i-th round of stability test is configured not to be allowed to perform the i+1th round of stability test; when i is equal to the preset test number, in the i-th round of stability test, if it is determined that a processing core is a bad core, it is determined that the i-th round of stability test on the processing core fails, and then all bad cores in the multi-core chip are determined, and the multi-core chip is reset; when i is equal to the preset test number, in the i-th round of stability test, if each processing core that performs a memory load test in the multi-core chip reads and writes memory successfully and fetches instructions correctly, then all bad cores in the multi-core chip have been determined. To ensure that all processing cores in the multi-core chip that are not marked as bad cores can operate normally.

[0011] Furthermore, the method for the processing core to determine whether it is a bad core based on a memory load test includes: controlling the processing core to write test data to a specific address in the built-in memory, then controlling the processing core to read corresponding data from the specific address in the built-in memory, and then determining whether the corresponding data read by the processing core is the same as the test data, if so, determining that the processing core reads and writes the memory successfully, otherwise determining that the processing core fails the memory load test and determining that the processing core is a bad core; thereby simulating a memory test comparison operation in a scenario where a processing core reads and writes data.

[0012] Or control the processing core to read instructions from the target address, and then determine whether the instructions read by the processing core are the same as the pre-stored target instructions. If so, determine that the processing core fetches the instructions correctly. Otherwise, determine that the processing core fails the memory load test and determines that the processing core is a bad core to prohibit it from being started subsequently.

[0013] Furthermore, whenever the system device where the multi-core chip is located is started, the multi-core chip runs the startup code after power-on and detects whether there is an abnormal shutdown mark in the startup code. If so, it enters the self-check mode, otherwise it continues to run the startup code to enable the multi-core chip to start normally.

[0014] Furthermore, before the system device where the multi-core chip is located is started, if the system device where the multi-core chip is located is abnormally powered off or crashes, the system device where the multi-core chip is located is abnormally shut down, and an abnormal shutdown mark is made in the startup code, so that the multi-core chip enters the self-test mode based on the abnormal shutdown mark after powering on.

[0015] In summary, after detecting the abnormal shutdown mark, the present application enters the self-test mode. In the self-test mode, multiple restarts are used to simulate the repeated execution process of abnormal power-off and shutdown, startup, abnormal power-off and shutdown, and startup of the system equipment where the multi-core chip is located. The test results corresponding to the memory load test disclosed in the aforementioned embodiment can evaluate the performance of the multi-core chip in a long-term unstable read-write environment, thereby detecting the robustness and stability of the system equipment where the multi-core chip is located.

[0016] Furthermore, before the system device where the multi-core chip is located is normally shut down, the abnormal shutdown mark in the startup code is cleared to prevent the multi-core chip from entering the self-check mode after being powered on again.

[0017] A multi-core chip, wherein the multi-core chip executes the exception handling method to exclude all bad cores from the processing cores allowed to be started by the multi-core chip. In the process of executing the exception handling method, the multi-core chip will restart at least the preset test number of times or perform at least the preset test number of rounds of stability test, and control each processing core to perform memory load test in turn to determine all bad cores. When the multi-core chip is started normally later, the aforementioned bad cores will no longer be started to exclude system abnormalities caused by bad cores in the multi-core chip. The multi-core chip completes automatic exception handling, enhances the yield rate of the multi-core chip, and is conducive to maintaining reliability algorithms and chip performance optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flowchart of an exception handling method for a multi-core chip disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The present application is further described in detail below in conjunction with embodiments and drawings, but the implementation methods of the present application are not limited thereto.

[0020] In the current multi-core chip architecture, a processing core (also referred to as a physical core for processing data) may have a memory access error or system runaway after running at full load for a period of time (for example, 1 minute). The probability of occurrence increases with the test time or the frequency of repeated tests. The Chinese invention patent application with patent application number CN202311173752.3 discloses a chip startup code repair method and repair system. When a chip startup anomaly is detected, the startup code and / or the repair code stored in the non-volatile memory are copied to the random access memory based on the abnormal position of the startup code to repair the abnormal part of the startup code. The repair is limited to the abnormal position of the startup code, and the processing core that causes the shutdown abnormal state of the multi-core chip system or the system crash is not screened to check the abnormal hardware in the multi-core chip, resulting in the problem of overall system abnormality caused by part of the CPU core after each multi-core chip is started through the startup code. Therefore, after starting the multi-core chip through the startup code, memory data comparison errors may occur, causing the multi-core chip system to run away. For example, if an individual processing core runs away, it is likely to affect the multi-core chip system. This is because each processing core, in addition to running built-in tasks, also enters privileged mode to participate in the management of the operating system. At this time, a data memory access error will cause the entire multi-core chip system to run away.

[0021] In view of the above technical defects, the present application discloses an exception handling method for a multi-core chip, such as Figure 1 As shown, the exception handling method includes: When a pre-existing abnormal shutdown mark is detected, the multi-core chip is controlled to enter a self-checking mode to perform multiple restarts. In the present application, the multi-core chip first detects the abnormal shutdown mark in the startup code to identify whether an abnormal shutdown phenomenon occurred last time; when the abnormal shutdown mark is detected, it is determined that a system freeze or abnormal power failure occurred last time, and the multi-core chip enters a self-checking mode to screen bad cores in multiple resets (restarts).

[0022] In the self-check mode, each time the multi-core chip is restarted, a matching number of processing cores in the multi-core chip are controlled to perform a memory load test. Each processing core is judged based on the memory load test to see if it is a bad core, and the bad cores are excluded from the processing cores allowed to start by the multi-core chip, until all processing cores in the multi-core chip are judged to exclude the bad cores in the multi-core chip. Among them, the self-check mode is a chip working mode in which a matching number of processing cores in the multi-core chip are all tested for memory load and judged based on the memory load test to see if they are bad cores, so as to determine the bad cores that need to be disabled later; a self-check mode can be equivalent to a round of stability test, and the time consumed is preferably about 1 minute, which will be determined according to the number of processing cores in the multi-core chip.

[0023] In the self-check mode, the matching number will change with the change of the restart times, and may increase with the increase of the restart times to cover more processing cores in the multi-core chip, wherein each processing core is judged based on the memory load test, which is essentially to control each processing core to read and write the relevant memory data to judge whether the processing core is a bad core, so as to detect and mark the processing core that causes the poor stability of the chip such as system crash or system runaway, and the cause of the poor stability of the chip may be that the processing core reads the relevant memory instruction data incorrectly, causing the system to runaway, for example, it runsaway before the memory read-write comparison fails, and the data 0x1 should be read, but the data 0x2 is actually read. Therefore, whenever the processing core is judged to be a bad core, the bad core is disabled; so that when all the processing cores in the multi-core chip complete the memory load test, after the multi-core chip is restarted, all the marked bad cores are not started, and it can be regarded that through multiple restarts and memory load detection, the processing cores in the multi-core chip that may cause poor stability of the chip such as system crash or system runaway have been eliminated, and the abnormal handling of the multi-core chip is completed.

[0024] In summary, when the abnormal shutdown mark is detected, the present application controls the multi-core chip to enter the self-check mode to perform multiple restarts and control the matching number of processing cores in different restarts to perform memory load test detection and exclude the bad cores from the processing cores allowed to start by the multi-core chip, until all processing cores in the multi-core chip are judged to exclude the bad cores in the multi-core chip, so as to check and disable the bad cores one by one for the poor stability failure of the multi-core chip, and improve the stability of the system device where the multi-core chip is located. Therefore, when some processing cores of the multi-core chip are bad, the bad cores are checked and disabled through the self-check mode, the reliability of the multi-core chip is improved, and the modification of the startup code can be reduced.

[0025] The aforementioned shutdown refers to the power-off shutdown of the entire system device where the multi-core chip is located. The overall reset of the multi-core chip can be equivalent to shutting down first and then restarting. The system device where the multi-core chip is located includes a non-volatile memory and the multi-core chip, so that the system device where the multi-core chip is located is used to implement the exception handling method; the multi-core chip is internally provided with a built-in memory, and the system device where the multi-core chip is located also has a peripheral circuit, and the peripheral circuit includes a system bus and a non-volatile memory. Among them, the multi-core chip and the non-volatile memory are connected and interacted through the system bus. The abnormal shutdown mark is stored in the non-volatile memory or the built-in memory of the multi-core chip; the multi-core chip is used to enter the self-check mode when the abnormal shutdown mark is detected, so as to detect the bad core and exclude the bad core from the processing core allowed to be started by the multi-core chip. Therefore, during the operation of the system device where the multi-core chip is located, the bad core is checked by entering the self-check mode to improve the reliability of the system.

[0026] In the self-check mode, the method of controlling the multi-core chip to restart multiple times and controlling a matching number of processing cores inside the multi-core chip to perform a memory load test at each restart includes: at the i-th restart, controlling at most i processing cores inside the multi-core chip to perform a memory load test, wherein some processing cores may be judged as bad cores in the corresponding memory load test after the i-1th restart (i is greater than 1), and they are prohibited from performing the memory load test after the i-th restart.

[0027] When i is greater than 1, the multi-core chip has at most i processing cores, including at least one processing core that has not been previously tested for memory load and / or at most i-1 processing cores that have successfully completed the memory load test when the multi-core chip is restarted for the i-1th time; wherein i is a positive integer, i is less than or equal to the preset test quantity. The at most i processing cores in the multi-core chip are the matching number of processing cores in the multi-core chip, that is, after the i-th restart, the matching number is at most i.

[0028] In the case where a preset number of testing processing cores are set inside a multi-core chip, the number of restarts of the multi-core chip is set to be greater than or equal to the preset testing number, so that even if only one processing core that has not undergone memory load testing is judged at each restart, the judgment of all processing cores in the multi-core chip can be completed after the preset number of restarts, and even some or all of the processing cores in the multi-core chip can be repeatedly judged after a number of restarts greater than the preset test number.

[0029] Preferably, each time the multi-core chip is restarted, the matching number of processing cores are subjected to a memory load test, wherein among the processing cores subjected to the memory load test, there is at least one processing core that has not been subjected to a memory load test before, and there may also be multiple other processing cores that have been subjected to a memory load test and have been successfully tested. Then, during multiple restarts, a new processing core is started one by one to perform a memory load test, so that when the number of restarts of the multi-core chip is equal to the preset test number, all the processing cores in the multi-core chip have been subjected to a memory load test and whether or not it is the bad core is determined for each processing core based on the memory load test.

[0030] It should be noted that after the processing core has been subjected to the memory load test, whether the processing core is a bad core is determined based on the test results involved in the memory load test.

[0031] If the number of processing cores that have been subjected to memory load testing increases with the number of restarts, the same processing core can be judged multiple times after a restart to overcome the problem of probabilistic test success. It should be noted that if it is judged that a single processing core reads and writes memory successfully and fetches instructions correctly, the memory load test of the single processing core is determined to be successful, otherwise the memory load test of the single processing core is determined to have failed.

[0032] As i increases, more processing cores inside the multi-core chip that have not undergone memory load testing will be judged, and after each restart, the order of judging the processing cores for memory load testing, except for the first restart, is from the processing cores that succeeded the last memory load test to the processing cores that have not undergone memory load testing, or from the processing cores that have not undergone memory load testing to the processing cores that succeeded the last memory load test.

[0033] Schematically, the multi-core chip is a chip with four processing cores, and the four processing cores are CPU0, CPU1, CPU2 and CPU3. The multi-core chip enters the self-check mode, and the multi-core chip only starts to judge the processing core CPU0 when it is restarted for the first time. The multi-core chip judges the processing core CPU0 and the processing core CPU1 in sequence through the second restart. The multi-core chip judges the processing core CPU0, the processing core CPU1 and the processing core CPU2 in sequence through the third restart. The multi-core chip judges the processing core CPU0, the processing core CPU1, the processing core CPU2 and the processing core CPU3 in sequence through the fourth restart. It is worth noting that if it is judged that the processing core CPU1 test fails in the third restart, that is, it is determined that the processing core CPU1 causes the system to freeze or the stability test fails, then the processing core CPU1 is marked as a bad core, and then the processing core CPU0, the processing core CPU2 and the processing core CPU3 are judged in sequence during the fourth restart.

[0034] In some embodiments, in the case of the i-th restart, if there is a processing core in the multi-core chip that fails the memory load test, the processing core that failed the test is marked as a bad core to prohibit the processing core that failed the test from being restarted, and then the i+1th restart is performed by reset. It is worth noting that the processing core that failed the test is not started when the multi-core chip performs the i+1th restart. The reset method here can be triggered by the exception handling interrupt function set in the processing core that failed the test. The software can mark the code and then operate the register to directly reset and enter the i+1th restart. Restart multiple times until i is equal to the preset test number, the memory load test of all processing cores in the multi-core chip has been completed, and all bad cores have been judged from all processing cores in the multi-core chip.

[0035] In addition, in the case of the i-th restart, if all processing cores performing memory load tests inside the multi-core chip are tested successfully, then the (i+1)-th restart is performed by resetting, and it can be determined that the multi-core chip is tested successfully after the i-th restart; combined with the implementation method of the aforementioned test failure, the restart is repeated for a preset number of tests until i is equal to the preset number of tests, and all bad cores are determined from all processing cores in the multi-core chip.

[0036] Specifically, during the i-th restart, the process of performing memory load tests on at most i processing cores inside the multi-core chip is the i-th round of stability testing for the multi-core chip, so that the memory load tests performed on multiple processing cores during one restart constitute one round of stability testing. In the i-th round of stability testing, if each processing core inside the multi-core chip that performs memory load testing reads and writes memory successfully and fetches instructions correctly (the read instructions meet the expected requirements), it is determined that all processing cores inside the multi-core chip that perform memory load testing have been tested successfully, and then it is determined that the i-th round of stability testing on the processing cores is successful. Therefore, in the self-check mode, a specific number of processing cores are turned on by restarting once and a round of stability testing is completed, and the test is determined to be successful only when all processing cores that perform memory load testing read and write memory successfully and fetch instructions correctly.

[0037] It should be noted that if it is determined that a single processing core reads and writes memory successfully and fetches instructions correctly, then it is determined that the test of the single processing core is successful. However, each processing core may cause an instruction fetch error when reading instructions because the reading frequency is lower than the actual operating frequency and is marked as a bad core. If one of the bad cores modifies the system sensitive data, other processing cores that have undergone memory load testing and have not been marked as bad cores will have read data errors due to the modification of the system sensitive data; therefore, it is necessary to determine in a round of stability testing that each processing core in the multi-core chip that performs memory load testing reads and writes memory successfully and fetches instructions correctly before determining that the test is successful, thereby reducing interference between different processing cores; and also overcoming the problem of probabilistic errors in the same processing core in different restarts or memory load tests. In addition, multiple rounds of stability testing are required to check different bad cores in the multi-core chip one by one.

[0038] In the self-check mode, during multiple rounds of stability testing, there are: When i is less than the preset test quantity, in the i-th round of stability test, if it is determined that a processing core that performs a memory load test is a bad core, it is determined that the i-th round of stability test on the processing core has failed, and the multi-core chip is reset to perform the i+1-th round of stability test, and the bad core determined in the i-th round of stability test is configured not to be allowed to perform the i+1-th round of stability test, that is, the bad core marked in the i-th round of stability test and the bad core marked in an earlier round of stability test are not started in the i+1-th round of stability test, and the i+1-th round of stability test is started by the processing core that has not yet performed the memory load test.

[0039] Further, when i is equal to a preset number of tests, in the i-th round of stability testing, if a processing core is determined to be a bad core, then it is determined that the i-th round of stability testing on the processing core has failed. At this time, none of the processing cores that have undergone memory load testing in advance are marked as bad cores, and the remaining processing core that has not undergone memory load testing in advance is marked as a bad core, then all bad cores inside the multi-core chip are determined, and the multi-core chip is reset. At this time, the test is completed to configure the multi-core chip not to start the bad core during subsequent normal startup, and then enter the i+1th restart. In the i+1th restart, all processing cores inside the multi-core chip that are not marked as bad cores can operate normally.

[0040] When i is equal to the preset test number, in the i-th round of stability testing, if each processing core inside the multi-core chip that performs memory load testing reads and writes the memory successfully and fetches instructions correctly, then all bad cores inside the multi-core chip have been determined, at least it is determined that all bad cores inside the multi-core chip have been determined in the i-1-th round of stability testing; then the multi-core chip is reset, and the test is completed at this time to configure the multi-core chip not to start the bad cores during subsequent normal startup, and then enter the i+1th restart, in the i+1th restart, all processing cores inside the multi-core chip that are not marked as bad cores can operate normally.

[0041] As an embodiment, the method for the processing core to determine whether it is a bad core based on a memory load test includes: controlling the processing core to write test data to a specific address in the built-in memory, and then controlling the processing core to read corresponding data from the specific address in the built-in memory, and then determining whether the corresponding data read by the processing core is the same as the test data, if so, determining that the processing core reads and writes the memory successfully, otherwise determining that the processing core is a bad core to prohibit subsequent startup; thereby simulating a memory test comparison operation in a scenario where a processing core reads and writes data.

[0042] Or control the processing core to read instructions from the target address, and then determine whether the instructions read by the processing core are the same as the pre-stored target instructions. If yes, determine that the processing core fetches instructions correctly, otherwise determine that the processing core is a bad core to prohibit subsequent startup; in some embodiments, the bad core does not actually run at the expected operating frequency, then the instructions read by the processing core are not the same as the pre-stored target instructions, causing the system where the multi-core chip is located to run away. After the system runs away, the operating system runs into the exception handling process (the exception handling interrupt function executes the software reset), and automatically resets the multi-core chip; it can also be automatically reset by a watchdog; it can also be automatically reset when the system where the multi-core chip is located crashes.

[0043] It should be noted that the multi-core chip includes a built-in memory, and the built-in memory is set with a specific address and / or a target address. The instruction read by the processing core from the target address is the data read out from the target address of the memory associated with the processing core, which may be the data used for the operation of the built-in memory, or may be the instruction transmitted by the bus (the instruction is essentially also data).

[0044] Since there is a probabilistic error in determining whether the processing core reads and writes the memory successfully (some processing cores may have a probability of correct or incorrect memory data comparison), in combination with the aforementioned embodiment, it is necessary to enter the next memory load test through software reset when all processing cores performing memory load tests inside the multi-core chip have passed the test or there is a processing core inside the multi-core chip that fails the memory load test. That is, multiple restarts (i.e., multiple rounds of stability tests) are required in the self-test mode to determine all bad cores inside the multi-core chip.

[0045] As an embodiment, whenever the system device where the multi-core chip is located is started, the multi-core chip runs the startup code after power-on and detects whether there is an abnormal shutdown mark in the startup code. If so, it enters the self-check mode to identify the processing core that causes the abnormal phenomenon related to the abnormal shutdown mark. Otherwise, it continues to run the startup code to enable the multi-core chip to start normally.

[0046] If an abnormal shutdown mark is detected in the startup code, it is determined that there was an abnormal shutdown before the current startup of the system device where the multi-core chip is located, including the last system crash or abnormal power failure; the multi-core chip enters the self-check mode to screen the bad cores in multiple restarts, so as to disable the bad cores through the self-check mode and improve the reliability of the system device where the multi-core chip is located.

[0047] Specifically, before the system device where the multi-core chip is located is started, if the system device where the multi-core chip is located is abnormally powered off or crashes, the system device where the multi-core chip is located is abnormally shut down, and an abnormal shutdown mark is made in the startup code, specifically by adding a flag in the startup code to make an abnormal shutdown mark, or assigning a logical value of 1 to the relevant flag bit in the startup code, so that the multi-core chip enters the self-check mode based on the abnormal shutdown mark after powering on. Among them, when there is a processing core inside the multi-core chip that is a bad core, it causes the system device where the multi-core chip is located to be abnormally powered off or crashed. After detecting the abnormal shutdown mark, this embodiment enters the self-check mode. In the self-check mode, multiple restarts are used to simulate the repeated execution process of abnormal power-off, shutdown, startup, abnormal power-off, shutdown, and startup of the system device where the multi-core chip is located. Based on the test results corresponding to the memory load test disclosed in the aforementioned embodiment, the performance of the multi-core chip in a long-term unstable read-write environment can be evaluated, thereby detecting the robustness and stability of the system device where the multi-core chip is located.

[0048] Preferably, the abnormal shutdown mark is used to identify whether a system crash or abnormal power failure occurred last time. The abnormal shutdown mark can be stored in a non-volatile memory outside the multi-core chip or in a built-in memory of the multi-core chip. The built-in memory can be a register of a specific power domain inside the multi-core chip. It is only necessary to ensure that the abnormal shutdown mark is not lost after the system device where the multi-core chip is located is reset.

[0049] In addition, before the system device where the multi-core chip is located is shut down normally, the abnormal shutdown mark in the startup code is cleared. Specifically, the relevant flag bit in the startup code is assigned a logical value of 0 to clear the guiding effect of the abnormal shutdown mark on the working mode of the multi-core chip, so as to prevent the multi-core chip from entering the self-test mode after powering on again.

[0050] If there is no bad core in the multi-core chip that causes the system abnormality, the abnormal shutdown mark is cleared, and the system device where the multi-core chip is located can be shut down normally.

[0051] It should be noted that the startup code will enable the multi-core chip to work normally after the system device where the multi-core chip is located is abnormally shut down and restarted or the multi-core chip is reset and restarted. The startup code will enable the multi-core chip to work normally after the system device where the multi-core chip is located is powered on or the multi-core chip is powered on.

[0052] The present application discloses a multi-core chip, which executes the exception handling method disclosed in the above embodiment to exclude all bad cores from the processing cores allowed to be started by the multi-core chip. In the process of executing the exception handling method, the multi-core chip will restart at least the preset test number of times or perform at least the preset test number of rounds of stability test, and control each processing core to perform memory load test in turn to determine all bad cores. When the multi-core chip is started normally later, the aforementioned bad cores will no longer be started to exclude system abnormalities caused by bad cores in the multi-core chip. The multi-core chip completes automatic exception handling, enhances the yield rate of the multi-core chip, and is conducive to maintaining reliability algorithms and chip performance optimization.

[0053] In the present application, each processing core set in the multi-core chip extracts the minimum resource set for system startup, and a processing core is a physical core; in addition to running built-in tasks, each processing core will also enter privileged mode to participate in the management of the operating system; each processing core will handle its own interrupt program to facilitate memory load testing in a corresponding round of stability testing; if a data error occurs during the memory load test of one of the processing cores, causing the entire operating system to run away, then one of the processing cores will be marked as a bad core, which is transparent to the user process and facilitates the screening of bad cores.

[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.

Claims

1. Exception handling method for multi-core chips, It is characterized in that The exception handling method comprises: When a pre-existing abnormal shutdown mark is detected, the multi-core chip is controlled to enter a self-check mode to perform multiple restarts; In the self-check mode, each time the multi-core chip is restarted, a matching number of processing cores in the multi-core chip are controlled to perform a memory load test, and each processing core is controlled to determine whether it is a bad core based on the memory load test, and the bad cores are excluded from the processing cores allowed to be started by the multi-core chip, until all processing cores in the multi-core chip are judged to exclude the bad cores in the multi-core chip.

2. According to the exception handling method of claim 1, It is characterized in that The method of controlling the multi-core chip to restart multiple times and controlling a matching number of processing cores in the multi-core chip to perform a memory load test each time the chip restarts includes: At the i-th restart, at most i processing cores in the multi-core chip are controlled to perform a memory load test; when i is greater than 1, at most i processing cores in the multi-core chip include at least one processing core that has not been previously subjected to a memory load test and / or at most i-1 processing cores of the multi-core chip that have successfully performed a memory load test at the i-1th restart; Wherein, i is a positive integer, i is less than or equal to the preset test quantity; the at most i processing cores in the multi-core chip are the matching number of processing cores in the multi-core chip; In the case where a preset number of test processing cores are set inside the multi-core chip, the number of restarts of the multi-core chip is set to be greater than or equal to the preset number of tests.

3. According to the exception handling method of claim 2, It is characterized in that At each restart, there is at least one processing core that has not been previously tested for memory load among the processing cores that undergo memory load testing, so that when the number of restarts of the multi-core chip is equal to the preset test number, all processing cores in the multi-core chip have undergone memory load testing and based on the memory load test, each processing core is determined to be the bad core.

4. According to the exception handling method of claim 3, It is characterized in that In the case of the i-th restart, if there is a processing core in the multi-core chip that fails the memory load test, the failed processing core is marked as a bad core, and then the i+1-th restart is performed by resetting until i equals the preset test number, and all bad cores are determined from all processing cores in the multi-core chip; In the case of the i-th restart, if all the processing cores in the multi-core chip that are performing the memory load test are tested successfully, then the i+1-th restart is performed by resetting.

5. According to the exception handling method of claim 4, It is characterized in that During the i-th restart, the process of performing memory load test on at most i processing cores in the multi-core chip is the i-th round of stability test on the multi-core chip; In the i-th round of stability testing, if each processing core in the multi-core chip that performs the memory load test reads and writes the memory successfully and fetches instructions correctly, it is determined that all processing cores in the multi-core chip that perform the memory load test have been tested successfully, and further determines that the i-th round of stability testing on the processing cores is successful; If it is determined that the single processing core reads and writes the memory successfully and fetches instructions correctly, it is determined that the test of the single processing core is successful.

6. According to the exception handling method of claim 5, It is characterized in that When i is less than the preset test quantity, in the i-th round of stability test, if it is determined that a processing core that performs a memory load test is a bad core, it is determined that the i-th round of stability test performed on the processing core fails, and the multi-core chip is reset to perform the i+1th round of stability test, and the bad core determined in the i-th round of stability test is configured not to be allowed to perform the i+1th round of stability test; When i is equal to the preset test number, in the i-th round of stability test, if a processing core is determined to be a bad core, it is determined that the i-th round of stability test on the processing core has failed, and then all bad cores in the multi-core chip are determined, and the multi-core chip is reset; When i is equal to the preset test number, in the i-th round of stability testing, if each processing core in the multi-core chip that performs memory load testing reads and writes memory successfully and fetches instructions correctly, all bad cores in the multi-core chip have been determined.

7. The exception handling method according to claim 6, It is characterized in that The method for determining whether a processing core is a bad core based on a memory load test comprises: Control the processing core to write test data to a specific address in the built-in memory, then control the processing core to read corresponding data from the specific address in the built-in memory, and then determine whether the corresponding data read by the processing core is the same as the test data, if yes, determine that the processing core reads and writes the memory successfully, otherwise, determine that the processing core fails in the memory load test and determines that the processing core is a bad core; or controlling the processing core to read instructions from a target address, and then determining whether the instructions read by the processing core are the same as the pre-stored target instructions, if yes, determining that the processing core fetches instructions correctly, otherwise determining that the processing core fails the memory load test and determining that the processing core is a bad core; Wherein, the multi-core chip includes a built-in memory, and the built-in memory is set with a specific address and / or a target address.

8. The exception handling method according to claim 1, It is characterized in that Whenever the system device where the multi-core chip is located is started, the multi-core chip runs the startup code after powering on and detects whether there is an abnormal shutdown mark in the startup code. If yes, it enters the self-check mode, otherwise it continues to run the startup code to enable the multi-core chip to start normally.

9. The exception handling method according to claim 8, It is characterized in that Before the system device where the multi-core chip is located is started, there are: If the system device where the multi-core chip is located is abnormally powered off or crashes, the system device where the multi-core chip is located is abnormally shut down, and an abnormal shutdown mark is made in the startup code so that the multi-core chip enters the self-test mode based on the abnormal shutdown mark after powering on.

10. The exception handling method according to claim 9, It is characterized in that Whenever the system device where the multi-core chip is located is shut down normally, the abnormal shutdown mark in the startup code is cleared to prevent the multi-core chip from entering the self-checking mode after being powered on again.

11. Multi-core chips, It is characterized in that The multi-core chip is used to execute the exception handling method described in any one of claims 1 to 10 to exclude all bad cores from the processing cores allowed to be started by the multi-core chip.