Supports unlocked lockstep core circuits
By designing a lock-step core circuit that supports unlocking in a multi-core system, allowing the core to run independently in independent core mode and perform lock-step checks in lock-step core mode, the problem of idle verification core cache and insufficient system security is solved. Improved system security and performance.
Patent Information
- Application Number
- CN202410800194.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-20
AI Technical Summary
In the lock-step core mode of existing multi-core systems, the cache of the verification core is in an idle state, resulting in a waste of resources and insufficient system security. It cannot be unlocked as independent cores to obtain more powerful computing power when needed.
A lock-step core circuit that supports unlocking is designed. The core mode is switched through the unlock control signal, allowing the main core and the verification core to read instructions and data from their respective caches in independent core mode, and in lock-step core mode. Carry out lock-step inspection to ensure that the second core participates in the lock-step inspection to improve system security.
In the independent core mode, the security and performance of the system are improved, and the difficulty of clock constraints is reduced. At the same time, the security of the system is ensured in the lock-step core mode, and the problem of idle verification core cache is avoided.
Smart Images

Figure CN118363667B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of integrated circuits, and in particular to a lockstep core circuit supporting unlocking. Background Art
[0002] In embedded systems with high system safety requirements, such as the CPU (central processing unit) of automotive MCU, it is usually composed of one or more pairs of cores that execute the same instructions and data. Generally, one of the paired cores can be called the main core and the other can be called the check core. A system with such a pair of cores can be called a multi-core system. In a multi-core system, two cores execute the same instructions and data, and the outputs of the two cores are compared in real time. If the comparison results are inconsistent or mismatched, an error alarm signal is output and corresponding safety measures are taken. The main core and the check core can be called lock-step cores. With the development of demand, researchers have found that multi-core systems do not always require lock-step cores. In some application scenarios, the core of the MCU needs to be a lock-step core for functional safety, and in some application scenarios, in order to obtain more powerful computing power, the lock-step core needs to be unlocked as two non-lock-step cores, which can also be called independent cores. Therefore, lock-step core circuits that support unlocking came into being.
[0003] However, the existing solution has a flaw in that although both the main core and the check core are configured with caches to store their own instructions and data, when the cores are locked, both the main core and the check core read instructions and data from the main core's cache for lock-step checking. Specifically, the main core's cache is directly sent to the main core, and the main core's cache is sent to the check core via the delay unit and the selector. In this way, the check core's cache is idle, which is a waste of resources on the one hand, and on the other hand, the check core's cache does not participate in the system's lock-step check at this time, and the system security is still insufficient. Summary of the invention
[0004] The purpose of the present application is to provide a lock-step core circuit supporting unlocking, with high system security.
[0005] To achieve the above objectives, this application provides the following technical solutions:
[0006] The present application provides a lock-step core circuit supporting unlocking, the lock-step core circuit supporting unlocking comprising an input-output module, a first core, a second core, a first cache, a second cache, a first delay unit, a first selector, a second delay unit, and a first comparator, the output of the input-output module is sent to the first core, the output of the input-output module is also sent to the first input end of the first selector via the first delay unit, the output of the first core is sent to the input-output module, the output of the first core is also sent to the first input end of the first comparator via the second delay unit, the output of the input-output module is also sent to the second input end of the first selector, the output of the first selector is sent to the second core, the output of the second core is sent to the input-output module, the output of the second core is also sent to the second input end of the first comparator, the selection end of the first selector and the enable end of the first comparator both receive an unlocking control signal; the unlocking control signal has two digital value, when the unlock control signal is a first value, the first selector selects the output of the input-output module to be delayed via the first delay unit and sent to the second core by the first selector, the first comparator is in a working state, the output of the first core is delayed via the second delay unit and compared with the output of the second core, and a first lock-step check result is output, and the first core and the second core together constitute a lock-step core mode; when the unlock control signal is a second value, the first selector selects the output of the input-output module to be directly sent to the second core via the first selector, the first comparator is in a non-working state, and no comparison is made, and the first core and the second core are in independent core modes respectively; the first core is connected to the first cache, and the second core is connected to the second cache, and in the lock-step core mode and the independent core mode, the first core only accesses instructions and data with the first cache, and the second core only accesses instructions and data with the second cache.
[0007] In one embodiment, the lock-step core circuit supporting unlocking further includes an error injection control unit, a first logic unit, and a second logic unit; the output of the first cache is sent to the first input end of the first logic unit, the output of the error injection control unit is sent to the second input end of the first logic unit, and the output of the first logic unit is sent to the first core; the output of the second cache is sent to the first input end of the second logic unit, the output of the error injection control unit is also sent to the second input end of the second logic unit, and the output of the second logic unit is sent to the second core.
[0008] In one embodiment, the injection control unit includes a first injection channel, a second injection channel, a third delay unit, and a second selector; the output of the first injection channel is sent to the second input end of the first logic unit, and the output of the first injection channel is also sent to the first input end of the second selector via the third delay unit, the output of the second injection channel is sent to the second input end of the second selector, and the output of the second selector is sent to the second input end of the second logic unit; the selection end of the second selector also receives the unlocking control signal, when the unlocking control signal is a first value, the second selector selects the output of the first injection channel to be delayed via the third delay unit and sent to the second input end of the second logic unit, when the unlocking control signal is a second value, the second selector selects the output of the second injection channel to be sent to the second input end of the second logic unit.
[0009] In one implementation, both the first logic unit and the second logic unit perform an XOR operation.
[0010] In one embodiment, the lock-step core circuit supporting unlocking further includes a fourth delay unit and a second comparator. The instructions and data stored by the first core in the first cache are also sent to the first input end of the second comparator via the fourth delay unit, and the instructions and data stored by the second core in the second cache are also sent to the second input end of the second comparator; the enable end of the second comparator also receives the unlock control signal. When the unlock control signal is a first value, the second comparator is in a working state, and the instructions and data stored by the first core in the first cache are delayed via the fourth delay unit and compared with the instructions and data stored by the second core in the second cache, and a second lock-step check result is output. When the unlock control signal is a second value, the second comparator is in a non-working state and no comparison is made.
[0011] In one implementation, the input-output module includes a bus, a memory, and a peripheral device.
[0012] Compared with the prior art, the technical solution of the present application has the following beneficial effects:
[0013] The lockstep core circuit supporting unlocking described in the present application, in independent core mode, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache; in lockstep core mode, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache, and the two are compared for lockstep check. Therefore, the second cache configured for the second core in the present application does not process the idle state in the lockstep core mode, but participates in the lockstep check, thereby improving system security. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0015] Figure 1 A schematic diagram of a lockstep core circuit supporting unlocking provided in the first embodiment of the present application;
[0016] Figure 2 for Figure 1 A schematic diagram of the connection between the injection error control unit and the first core and the second core, and the internal structure of the injection error control unit is shown. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. It should be noted that the description order of the following embodiments is not used as a limitation on the preferred order of the embodiments of the present application. In the following embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0018] See also Figure 1As shown, the first embodiment of the present application provides a lock-step core circuit supporting unlocking, and the lock-step core circuit supporting unlocking includes an input-output module, a first core, a second core, a first cache, a second cache, a first delay unit, a first selector, a second delay unit, and a first comparator. The output of the input-output module is sent to the first core, and the output of the input-output module is also sent to the first input end of the first selector via the first delay unit. The output of the first core is sent to the input-output module, and the output of the first core is also sent to the first input end of the first comparator via the second delay unit. The output of the input-output module is also sent to the second input end of the first selector, the output of the first selector is sent to the second core, the output of the second core is sent to the input-output module, and the output of the second core is also sent to the second input end of the first comparator. The selection end of the first selector and the enable end of the first comparator both receive an unlocking control signal; the unlocking control signal The invention has two values. When the unlock control signal is a first value, the first selector selects the output of the input-output module to be delayed via the first delay unit and sent to the second core by the first selector. The first comparator is in a working state. The output of the first core is delayed via the second delay unit and compared with the output of the second core to output a first lock-step check result. The first core and the second core together constitute a lock-step core mode. When the unlock control signal is a second value, the first selector selects the output of the input-output module to be directly sent to the second core via the first selector. The first comparator is in a non-working state and no comparison is made. The first core and the second core are in independent core modes respectively. The first core is connected to the first cache, and the second core is connected to the second cache. In the lock-step core mode and the independent core mode, the first core only performs instruction and data access with the first cache, and the second core only performs instruction and data access with the second cache.
[0019] The input-output module includes various types of buses, memories, and peripherals, and the first core and the second core can address them and access data and instructions. In the lock-step core mode, when the core reads instructions and data from the input-output module, the output of the input-output module is sent to the first core, and at the same time, the output of the input-output module (the content is the same as the content sent to the first core) is delayed by the first delay unit and sent to the second core after being selected by the first selector; after the first core executes the instruction, it sends the execution result to the input-output module again, and sends the execution result to the first end of the first comparator after delaying the execution result through the second delay unit (because the execution of the second core is later than that of the first core, the execution result of the second core is also later than that of the first core, so the execution result of the first core needs to be delayed to synchronize with the execution result of the second core), and after the second core executes the instruction, it sends the execution result to the input-output module again, and sends the execution result to the second end of the first comparator; at this time, the first comparator is enabled and in working state, compares the execution result of the first core (after delay synchronization) with the execution result of the second core, and outputs the lock-step check result. If the lock-step check results are the same, it means that the first core and the second core are both working normally; if the lock-step check results are different, it means that at least one of the first core and the second core is working abnormally, also known as loss of lock (because the first core and the second core are originally executing the same instructions, the execution results should be the same), and the system will give corresponding control measures, such as interruption, reset or triggering some other behaviors. In the independent core mode, when the core reads instructions and data from the input and output module, the output of the input and output module is sent to the first core, and the output of the input and output module is sent to the second core through the first selector (the content is different from the content sent to the first core, there is no delay, no synchronization, and each is independent); after the first core executes the instruction, it sends the execution result to the input and output module, and after the second core executes the instruction, it sends the execution result to the input and output module (each is independent and has no correlation with each other). At this time, the first comparator is in a non-working state, no comparison is made, and no lock-step check result is output. Note that although it seems that the first core also sends the execution result to the first end of the first comparator after delaying it through the second delay unit, and the second core also sends the execution result to the second end of the first comparator, because the first comparator is in a non-working state, it does not actually perform a lock-step check and does not output the lock-step check result. This is exactly what the independent core mode means.
[0020] Further, in the lock-step core mode, when the core reads instructions and data from the cache, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache (because the execution of the second core is later than that of the first core, it is not necessary to delay the first core reading instructions and data from the first cache); after executing the instruction, the first core sends the execution result to the input-output module, and sends the execution result to the first end of the first comparator after delaying it through the two delay units (because the execution of the second core is later than that of the first core, the execution result of the second core is also later than the execution result of the first core, so it is necessary to delay the execution result of the first core to synchronize with the execution result of the second core); after executing the instruction, the second core sends the execution result to the input-output module, and sends the execution result to the second end of the first comparator; at this time, the first comparator is enabled and in a working state, compares the execution result of the first core (after delayed synchronization) with the execution result of the second core, and outputs a lock-step check result. If the lock-step check results are the same, it means that the first core and the second core are both working normally; if the lock-step check results are different, it means that at least one of the first core and the second core is working abnormally, also known as loss of lock (because in the lock-step core mode, the contents stored in the first cache and the second cache should be the same, and the corresponding first core and the second core are also executing the same instructions, so the execution results should be the same), and the system will give corresponding control measures, such as interruption, reset or triggering some other behaviors. In the independent core mode, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache (the content is different from the content read by the first core from the first cache, and it is not synchronized, and each is independent); after the first core executes the instruction, it sends the execution result to the input and output module, and after the second core executes the instruction, it sends the execution result to the input and output module (each is independent and has no mutual correlation). At this time, the first comparator is in a non-working state, no comparison is made, and no lock-step check result is output. Note that although it seems that the first core also sends the execution result to the first end of the first comparator after delaying it through the second delay unit, and the second core also sends the execution result to the second end of the first comparator, because the first comparator is in a non-working state, it does not actually perform a lock-step check and does not output the lock-step check result. This is exactly what the independent core mode means.
[0021] Therefore, in the lockstep core circuit supporting unlocking described in the present application, in the independent core mode, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache; in the lockstep core mode, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache, and the two are compared to perform a lockstep check. Therefore, the second cache configured for the second core in the present application does not process the idle state in the lockstep core mode, but participates in the lockstep check, thereby improving the system security. Moreover, when the core reads instructions and data from the cache, it does not pass through the delay unit in the middle, which reduces the difficulty of the clock constraint of the entire chip system (because the time constraint of the cache signal itself is generally strict, and in the existing solution, the cache of the main core must be sent to the verification core via the delay unit and the selector, and the time constraint is even more stringent).
[0022] Please continue reading Figure 1 As shown, in one embodiment, the lock-step core circuit supporting unlocking further includes an error injection control unit, a first logic unit, and a second logic unit; the output of the first cache is sent to the first input end of the first logic unit, the output of the error injection control unit is sent to the second input end of the first logic unit, and the output of the first logic unit is sent to the first core; the output of the second cache is sent to the first input end of the second logic unit, the output of the error injection control unit is also sent to the second input end of the second logic unit, and the output of the second logic unit is sent to the second core.
[0023] In this case, an error injection check mechanism is also provided in the system. When the core reads instructions and data from the cache, some error signals are artificially injected into the read instructions and data, and then a check is made to see whether the error signal can be identified. If it can be identified, it means that the system is working normally. If it cannot be identified, it means that the system is not working properly, thereby improving the security of the system. In a specific embodiment, the error signal can be all 0 or all 1; and the first logic unit and the second logic unit both perform an XOR operation. Accordingly, the system can be combined with other operations to check whether the error signal can be identified.
[0024] Please refer to Figure 2As shown, in one embodiment, the injection control unit includes a first injection channel, a second injection channel, a third delay unit, and a second selector; the output of the first injection channel is sent to the second input end of the first logic unit, and the output of the first injection channel is also sent to the first input end of the second selector via the third delay unit, the output of the second injection channel is sent to the second input end of the second selector, and the output of the second selector is sent to the second input end of the second logic unit; the selection end of the second selector also receives the unlocking control signal, when the unlocking control signal is a first value, the second selector selects the output of the first injection channel to be delayed via the third delay unit and sent to the second input end of the second logic unit, when the unlocking control signal is a second value, the second selector selects the output of the second injection channel to be sent to the second input end of the second logic unit.
[0025] In simple terms, in independent core mode, the error injection signal of the first error injection channel is sent to the first core, and the error injection signal of the second error injection channel is sent to the second core via the selection of the second selector. Because in independent core mode, the work of each core is independent of each other, so each uses its own error injection channel. In lock-step core mode, the error injection signal of the first error injection channel is sent to the first core, and the error injection signal of the first error injection channel is also delayed by the third delay unit and then sent to the second core via the selection of the second selector. Because when checking the lock-step, it is necessary to ensure that the inputs of the two cores are the same, so at this time, the error injection signal is no longer sent from the second error injection channel to the second core, but the error injection signal of the first error injection channel is sent to the first core and the second core respectively, and because the second core works later than the first core, the error injection signal of the first error injection channel sent to the second core is also delayed by the third delay unit. Figure 2 Only a first error injection channel and a second error injection channel are schematically shown. In fact, there can be more error injection channels in the system for error injection checking of other modules in the system. Of course, more "error injection channels" can also be configured and selected to serve as the first error injection channel and the second error injection channel of this application to provide error injection signals.
[0026] Please return to read Figure 1As shown, in one embodiment, the lock-step core circuit supporting unlocking further includes a fourth delay unit and a second comparator. The first core stores instructions and data in the first cache and sends them to the first input end of the second comparator via the fourth delay unit. The second core stores instructions and data in the second cache and sends them to the second input end of the second comparator. The enable end of the second comparator also receives the unlock control signal. When the unlock control signal is a first value, the second comparator is in a working state, and the instructions and data stored in the first cache by the first core are delayed by the fourth delay unit and compared with the instructions and data stored in the second cache by the second core, and a second lock-step check result is output. When the unlock control signal is a second value, the second comparator is in a non-working state and no comparison is made.
[0027] In this way, it is possible to check and find out whether there is an abnormality in the system earlier. Because, as mentioned above, in the lock-step core mode, whether the core reads instructions and data from the input and output module or reads instructions and data from the cache, a lock-step check is performed after the core executes the instruction. However, no lock-step check is performed in the process of the core storing instructions and data in the cache. In this embodiment, the fourth delay unit and the second comparator cooperate to delay the instructions and data stored by the first core in the first cache through the fourth delay unit, and then compare the instructions and data stored by the second core in the second cache through the second comparator. In the process of the core storing instructions and data in the cache, a lock-step check can also be performed, and it can be checked and found out whether there is an abnormality in the system earlier. Of course, even if there is no lock-step check by the fourth delay unit and the second comparator, and it is assumed that an abnormality occurs in the process of the core storing instructions and data in the cache, so that the instructions and data stored in the cache have errors, there is no need to worry too much. Because when the core reads instructions and data from the cache later, a lock-step check will also be performed to find the abnormality (as mentioned above). In this embodiment, the fourth delay unit and the second comparator are added, and the lock-step check can be performed earlier to find out whether there is an abnormality in the system. In addition, in the independent core mode, the second comparator is also in a non-non-operating state, and does not perform comparison, and thus does not output a lockstep check result.
[0028] Finally, it is explained that in one embodiment, the working states of the first comparator, the second comparator, the first selector, and the second selector are all controlled by the unlock control signal. For example, when the unlock control signal is low, the first comparator and the second comparator are in working state, and accordingly, at this time, the first selector and the second selector both select their respective first input terminals to be connected to the output terminal; when the unlock control signal is high, the first comparator and the second comparator are in non-working state, and accordingly, at this time, the first selector and the second selector both select their respective second input terminals to be connected to the output terminal.
[0029] Compared with the prior art, the technical solution of the present application has the following beneficial effects:
[0030] The lockstep core circuit supporting unlocking described in the present application, in independent core mode, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache; in lockstep core mode, the first core reads instructions and data from the first cache, and the second core reads instructions and data from the second cache, and the two are compared to perform a lockstep check. Therefore, the second cache configured for the second core in the present application does not process the idle state in the lockstep core mode, but participates in the lockstep check, thereby improving the system security. Moreover, when the core reads instructions and data from the cache, it does not pass through the delay unit and selector in the middle, which reduces the difficulty of the clock constraint of the entire chip system (because the time constraint of the cache signal itself is generally strict, and in the existing solution, the cache of the main core must be sent to the verification core via the delay unit and selector, and the time constraint is even more stringent).
[0031] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims. In addition, the specification uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. The content of this specification should not be understood as a limitation on the present application.
Claims
1. A lockstep core circuit supporting unlocking, characterized in that: The lock-step core circuit supporting unlocking includes an input-output module, a first core, a second core, a first cache, a second cache, a first delay unit, a first selector, a second delay unit, and a first comparator. The output of the input-output module is sent to the first core, and the output of the input-output module is also sent to the first input end of the first selector via the first delay unit. The output of the first core is sent to the input-output module, and the output of the first core is also sent to the first input end of the first comparator via the second delay unit. The output of the input-output module is also sent to the second input end of the first selector, the output of the first selector is sent to the second core, the output of the second core is sent to the input-output module, and the output of the second core is also sent to the second input end of the first comparator. The selection end of the first selector and the enable end of the first comparator both receive an unlocking control signal. The unlocking control signal has two values. When the unlocking control signal is The signal is a first value, the first selector selects the output of the input-output module to be delayed via the first delay unit and sent to the second core by the first selector, the first comparator is in a working state, the output of the first core is delayed via the second delay unit and compared with the output of the second core, and a first lock-step check result is output, and the first core and the second core together constitute a lock-step core mode; when the unlock control signal is a second value, the first selector selects the output of the input-output module to be directly sent to the second core via the first selector, the first comparator is in a non-working state and no comparison is made, and the first core and the second core are in independent core modes respectively; the first core is connected to the first cache, and the second core is connected to the second cache, and in the lock-step core mode and the independent core mode, the first core only accesses instructions and data with the first cache, and the second core only accesses instructions and data with the second cache.
2. The lockstep core circuit supporting unlocking according to claim 1, characterized in that: The lock-step core circuit supporting unlocking also includes an error injection control unit, a first logic unit, and a second logic unit; the output of the first cache is sent to the first input end of the first logic unit, the output of the error injection control unit is sent to the second input end of the first logic unit, and the output of the first logic unit is sent to the first core; the output of the second cache is sent to the first input end of the second logic unit, the output of the error injection control unit is also sent to the second input end of the second logic unit, and the output of the second logic unit is sent to the second core.
3. The lockstep core circuit supporting unlocking according to claim 2, characterized in that: The injection error control unit includes a first injection error channel, a second injection error channel, a third delay unit, and a second selector; the output of the first injection error channel is sent to the second input end of the first logic unit, and the output of the first injection error channel is also sent to the first input end of the second selector via the third delay unit, the output of the second injection error channel is sent to the second input end of the second selector, and the output of the second selector is sent to the second input end of the second logic unit; the selection end of the second selector also receives the unlocking control signal, when the unlocking control signal is a first value, the second selector selects the output of the first injection error channel to be delayed via the third delay unit and sent to the second input end of the second logic unit, when the unlocking control signal is a second value, the second selector selects the output of the second injection error channel to be sent to the second input end of the second logic unit.
4. The lockstep core circuit supporting unlocking according to claim 2, characterized in that: The first logic unit and the second logic unit both perform an XOR operation.
5. The lockstep core circuit supporting unlocking according to claim 1, characterized in that: The lock-step core circuit supporting unlocking also includes a fourth delay unit and a second comparator. The first core stores instructions and data in the first cache and sends them to the first input end of the second comparator via the fourth delay unit. The second core stores instructions and data in the second cache and sends them to the second input end of the second comparator. The enable end of the second comparator also receives the unlock control signal. When the unlock control signal is a first value, the second comparator is in a working state, and compares the instructions and data stored in the first cache by the first core with the instructions and data stored in the second cache by the second core via the fourth delay unit delay, and outputs a second lock-step check result. When the unlock control signal is a second value, the second comparator is in a non-working state and does not make a comparison.
6. The lockstep core circuit supporting unlocking according to claim 1, characterized in that: The input-output module includes a bus, a memory, and peripherals.
