The present invention is directed to a method and a device for switching between at least two operating modes of a processor unit as well as a corresponding processor unit including at least two execution units for running programs.
Such processor units including at least two integrated execution units are also known as dual-core or multi-core architectures. According to the present related art, such dual-core or multi-core architectures are primarily used for two reasons:
In the first instance, they can be used to achieve a performance increase by viewing and treating the two execution units or cores as two arithmetic-logic units on one semiconductor device. In this configuration, the two execution units or cores process different programs or tasks. This makes it possible to achieve a performance increase, for which reason this configuration is described as a performance mode.
In addition to the use as superscalar processors, the second reason for implementing a dual-core or multi-core architecture is to increase safety by having both execution units redundantly run the same program. The results of the two execution units are compared, making it possible to detect an error while comparing for agreement. This configuration is described below as the safety mode.
In general, the two aforementioned configurations are contained exclusively in the dual- or multi-core architecture, i.e., the computer having the at least two execution units is basically operated in only one mode: either the performance mode or the safety mode.
The object of the present invention is to make combined operation of such a dual- or multi-core processor unit possible with respect to at least two operating modes and in so doing achieve an optimal switching strategy between at least two operating modes, i.e., in particular between a safety mode and a performance mode.
A redundant execution of the programs or tasks, in other words also of task programs, program segments, i.e., code blocks, or even individual instructions is desirable for reasons of safety; however, cost factors also make it undesirable to maintain completely redundant hardware for executing non-safety-critical functions. According to the present invention, these conflicting objectives are resolved through optimized switching between at least two operating modes in one processor unit. The present invention is thus directed to a method and a device for switching between at least two operating modes of a processor unit including at least two execution units and a corresponding processor unit. The processor units may have complete cores, i.e., they may be complete CPUs, or however, in a preferred embodiment, only the arithmetic-logic unit is duplicated. If only the arithmetic-logic unit (ALU) is duplicated and the other components of the CPU are safeguarded by other error detection mechanisms, the additional advantage is that the described circuit requires less chip area than a complete dual-core architecture. Nonetheless, the method according to the present invention makes it equally possible to achieve adequate error coverage for a duplicate CPU or a duplicate ALU in safety mode and a significant increase in performance in the performance mode for non-safety-relevant calculations. The present invention is thus directed to a method and a device for switching between at least two operating modes of a processor unit including at least two execution units for running programs, at least one identifier being advantageously assigned to the programs, the identifier making it possible to differentiate between the at least two operating modes, i.e., the safety mode and the performance mode in particular, and switching between the operating modes being performed as a function of the identifier such that the processor unit runs the programs according to the assigned operating mode.
The term programs also includes program segments, i.e., code blocks, which range completely or partially across a plurality of programs across task programs that are contained in the individual programs or are formed by the programs all the way to individual program instructions, an identifier being assigned to each of them.
Such an identifier assignment may be used to switch between the individual operating modes on a functional level, i.e., in particular for controlling operating sequences in a vehicle. Programs or corresponding task programs, program segments, or program instructions that are associated with an operating system of the processor unit or constitute this operating system may also be advantageously assigned to the corresponding operating mode using such identifiers.
When the programs are run, the conditions or results obtained are advantageously compared for agreement, errors being detected if there is a discrepancy.
It is advantageous in particular that the programs are run synchronously.
Advantageously, the identifier is in the form of at least one bit, such an identifier advantageously being generated by a program instruction, in particular by an instruction provided in the instruction set of the processor unit such as, for example, a write instruction.
This identifier may be assigned to the corresponding program, program segment, execution program or program instruction or however, it may be written in a special memory area that is provided.
As a function of the identifier, it is thus possible to switch optimally between two operating modes, in particular the performance mode and the safety mode, in a dual-core architecture or an architecture having only a duplicate arithmetic-logic unit, i.e., a duplicate ALU.
In
In
The non-safety-relevant or non-safety-critical programs or tasks, or rather program segments or code blocks or instructions may be calculated distributed over both execution units to improve performance, the throughput and thus the performance being increased accordingly. This takes place in performance mode LM.
When the particular operands are coupled into ALU units 1, 2, particular importance must be attached to correct data input. If, e.g., the same faulty operands are coupled into the two ALU units 1, 2, it is not possible to detect an error at the output of ALU units 1, 2. It must therefore be ensured that at least one of ALU units 1 or 2 receives a correct data input value or both ALU units 1, 2 receive different but incorrect data input values. This is ensured by the fact that a checksum, i.e., an ECC code, is, as mentioned above, formed from at least one input value of an ALU unit 1, 2. In a specifically provided comparison unit 5, 6, ECC coding 10a, 11a from these additional data registers 10, 11 is compared with ECC coding 8a, 9a from original source register 8, 9. As an option, the input data from registers 10, 11 may also be compared with that from source registers 8, 9. If a difference arises in the ECC coding, i.e., in the operands, this is interpreted as an error and an error signal is output, displayed if appropriate and corrected if appropriate. This comparison is advantageously made while the operands are processed in ALU units 1, 2 so that this input-side error detection and error correction proceeds with almost no loss of performance. If one of comparison units 5, 6 detects an error, the calculation may be repeated within the next cycle. A shaded register may be used to protect the operands of the last calculation constantly so that they are again rapidly available in the event of an error. The provision of such a shaded register may, however, be omitted if the particular operand registers 10, 11 are not written to again until an enable signal based on the absence of an error is received. In the case of an error, comparison units 5, 6 deliver an error signal, as a result of which it is no longer possible to write to operand registers 10, 11 again.
On the output side, each of ALU units 1, 2 generates a result. The result data provided by ALU units 1, 2 or their EEC coding is stored in results registers 12, 13, 12a, 13a. This result data and/or its coding are compared with one another in comparison unit 14. If no error is present, an enable signal 16 is generated. This enable signal 16 is coupled to enable device 15, which is prompted to write the result data to a bus 4. It is then possible to reprocess this result data via bus 4.
Furthermore, enable signal 16 may be used to clear registers 8 through 11 again so that the next operands may be read out of bus 3 and processed in ALU units 1, 2.
The system in
All transient errors, permanent errors, and even runtime errors are detected using the error detection systems in
The following possibilities for error localization are possible:
If a comparison of the result data in comparison unit 14 shows a difference, it is possible to infer the presence of an error within ALU units 1, 2.
If a comparison of the ECC coding in one of comparison units 5, 6 shows a difference, a faulty signal from bus 3 or upstream components may be inferred.
If a comparison of the ECC coding in comparison unit 14 shows a difference, a faulty coding of the result may be inferred.
A switching device UE 17 is used for switching between the aforementioned safety mode in which a redundant run and check takes place and the performance mode in which an increase in performance is achieved through a separate program run. This switching device 17 switches elements 8, 9 and 1, 2 in such a way that in one case, i.e., in safety mode SM, a redundant program run takes place, a synchronous program run in particular, and in the second operating mode, performance mode LM, it is possible to run different programs concurrently. To this end, switches or switching means may be provided that may be located in elements 8, 9 and 1, 2, respectively, or in switching device 17, or in addition they may be contained in the circuit separate from elements 8, 9, 1, 2, or 17.
For the switching, the programs or task programs or program segments, i.e., code blocks or even the instructions, are identified by an identifier that makes it possible to detect if they are safety-relevant, i.e., they must be run in safety mode SM, or may be made accessible to performance mode LM. This may be accomplished by a bit in the instruction or a special instruction may identify the subsequent sequence. This is described in greater detail with reference to the different identification possibilities in
The programs may include application functions, for example, for controlling operating sequences in a vehicle in particular, or the switch is made with respect to programs in which the identification is made on the operating system level, e.g., an assignment of entire operating system tasks.
In a decoding, switching device 17 is able to detect if the following calculation is safety-relevant, i.e., it should or should not be performed in the safety mode. If it should, the data is transferred to the two execution units 1 and 2. If not, i.e., work is continued in the performance mode, an execution unit receives the data, and the next instruction, provided it is also not safety-relevant, is transferred simultaneously to the second execution unit, making it possible to run the programs concurrently with higher throughput.
In the first case, for example, the calculation of the result during synchronous processing is of equal duration on both units. Thus, the results are available simultaneously during synchronous processing in the safety mode. This data is again provided with a coding at the output corresponding to 12 and 13 and the data and/or the coding of this data are, as described in
This switching process according to the present invention is elucidated once more in
An identifier and a corresponding switch are necessary to pass from the first operating mode, i.e., safety mode SM, into the second operating mode, i.e., performance mode LM in this case. This is depicted once more in
In order to reach the second operating mode, the performance mode in this case, from the first operating mode, an identifier according to
The first branch, i.e., block 8 and execution unit 1 in block 230 and the second branch including block 9 and execution unit 2 in block 231 are thus again in the performance mode, as a result of which the switch according to the present invention is completed.
Thus, corresponding to the objective, an optimized switch between two operating modes of a processor unit including two integrated execution units is depicted according to the present invention, it being possible for the identifier to be introduced or localized in a program or data line segment 500 in a variety of ways according to
As an example, programs P1 from line Z1 through line Z6, P2 from line Z7 through Z15, and P3 from line Z16 through Z19 are shown in
In a special embodiment, at least one program instruction may be provided, in this case PB1, PB2 or even PB3, which first generates an identifier indicating whether the processing is to take place in the first or second operating mode. The identifier may be written in a specific memory area SSB, depicted here as KB in ZS2. This area SSB may be located in a register in a memory integrated in the CPU but also in a memory external to it. A special instruction, e.g., PB3 or even an instruction already present in the instruction set of the processor unit, may be provided as an instruction generating this identifier KB. Thus, for example, an instruction “Generate identifier” may be implemented as a special instruction, or an instruction already present in the processor instruction set, a write instruction in particular, maybe used, as depicted by PB1 and PB2 here, so that in Z9, write instruction WR writes binary value 0 to memory area KB, depicted by WR (KB: 0) and thus all subsequent lines are run in safety mode, for example, as long as the identifier is KB0. The same instruction may then be used by WR (KB: 1) in Z12 at PB2 to enter value 1 in the memory area for identifier KB, so that from this point in time, it is possible to run the subsequent lines, e.g., in performance mode. This means that simple identifier-generating instructions, in particular a simple write instruction WR may be used, for example, to generate a corresponding switch identifier KB in a special memory area that is queried regularly.
A plurality of possibilities according to the present invention for implementing a switch of operating modes based on an identifier in a processor unit including two execution units have thus been described. The aforementioned advantages of the present invention are thus achievable.
Number | Date | Country | Kind |
---|---|---|---|
10349581.9 | Oct 2003 | DE | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/DE04/01859 | 8/20/2004 | WO | 2/15/2007 |