Multitask processing unit

Abstract: The microcomputer shall be offered which has realized more simplified peripheral circuits and more reduced price, besides being provided with the functions of timer, runaway monitor and backup logic. To that effect, the address register and the register are installed which have two areas each in correspondence with two tasks (CPU0 and CPU1) to perform a pipeline processing of the two tasks in parallel and in time division by changing over alternately the two areas of the address register and the register by means of task switching signal. Then, while composing one task (L-task) with a fix-looped program for which a branch instruction is prohibited, the L-task is embedded with a routine to execute a runaway monitor and a timer operation for the other task (A-task). Furthermore, in case where anything abnormal is detected by L-task about the processing of A-task and it is reset, the L-task will execute a backup sequence to obtain a failsafe of the system.

Description: Background of the invention 1. Field of the invention The present invention relates to a multitasking method and a multitask processing unit for performing same which is equipped with the function of time-shared parallel processing of a plurality of programs. 2. Description of the related art Document "I.E.E.E. Transactions on Acoustics, Speech and Signal Processing, New York, NY, US, Vol. 35, No. 9, September 1987, pages 1320 to 1333", on which the preamble of claim 1 is based already discloses a multitasking processing unit having a pipeline architecture. This conventional processing unit includes a program memory for storing the programs of the multiple processes or tasks as well as respective address registers provided in correspondence with each of the programs. Execution means execute the instructions of the respective programs based on the respective address registers selected by a switching signal. Further conventional microcomputers are designed to perform a time shared parallel processing of plural tasks by changing over the multitask processing in consecutive order by means of a register counter or a multiplexer as described, for instance, in the JP-A-58-155406, and JP-A-59-191654. In those conventional compositions, an exclusive hard timer is required to perform time processing by letting the elapsed time known when a task is executed. In addition, it is necessary to provide externally a runaway monitoring logic like a watchdog timer to monitor the runaway of program of each task, which contributes, combined with the above-mentioned matter, to make the peripheral circuits of a microcomputer complicated, leading to the product becoming larger-sized and more expensive. Furthermore, in the conventional compositions, an erroneous jump to the address of other task and the execution of its instruction occurs due to an unexpected cause like noise. In the past, a reset method employed in such a case has been to provide a runaway monitoring logic such as a watchdog timer in the peripheral circuits, which involves time loss before a runaway is detected since it has to be monitored externally, and a risk of the memory data or port data being destroyed in the meantime. Furthermore, the pipeline processing in the conventional microcomputers has the problem of there occurring pipeline disturbances when a branch instruction is executed, causing at least one wasteful cycle, i.e. delayed cycle, thereby delaying the pipeline processing. The cause of this wasteful cycle occurring after a branch instruction in the conventional pipeline processing is that if the branch instruction is fetched, the instruction address to be fetched next is predetermined in order beforehand regardless of the branch address, and the instruction of the branch address can be fetched only after this wasteful instruction is fetched. In the past, it has been possible that the multiple-word instruction system with an unfixed number of instruction words, e.g. instruction system in which there are one-word instruction as well more than two-word instruction, can interpret an instruction wrongly due to mis-perception of the operation code or operand, thereby causing a program runaway or mass destruction of important information in data memory. It is further possible for the program address to branch out to the address in the table immediate data area provided in the program memory, and an execution is started by perceiving the table immediate data as operation code, which also causes a program runaway or mass destruction of important information in data memory. On this account, it has been also necessary, in the past, to install a runaway monitoring logic such as a watchdog timer in the peripheral circuits, which contributes to making the peripheral circuits of a microcomputer complicated, resulting in the product becoming larger-sized and more expensive. Furthermore, the installation of a runaway monitoring logic such as a watchdog timer involves time loss before a runaway is detected since it has to be monitored externally, and a risk of the memory data or port data being destroyed in the meantime. SUMMARY OF THE INVENTION It therefore is an object of the present invention to provide a multitasking method and a multitask processing unit having a monitoring function which can be realized easily and cost-effective. According to the multitask processing unit this object is achieved by the features of claim 1. Concerning the multitasking method the above-mentioned object is achieved by claim 10. The dependent claims describe particular embodiments of the invention. The primary feature of the multitasking method and the multitask processing unit of this invention is that it is equipped with the function to perform a parallel processing by switching plural programs for every several cycles in a certain time division, an instruction cycle condition memory means which, in the case of an instruction being on the way of execution when the program is switched, will retain a midway condition to start execution from the midway condition at the time of the next execution cycle of the program in which said instruction is contained. It will allow a switch of plural programs in a certain cycle division ratio, not depending on the necessary cycle of the instruction, thereby securing the independence between the plural programs in terms of time. In this case, if a branch instruction is prohibited for a specific program in the plural programs and a composition is employed in which a fixed loop execution is performed from the starting address to the specified address, incorporating in the said specific program the routine of at least either of the runaway monitor or the timer function, the specific program can, in the condition in which the program runaway or deadlock is prohibited by the fixed-looping, perform the runaway monitoring or timer operation of the programs of other task, allowing omission of the runaway monitoring logic in the peripheral circuits, hard timer or interrupt logic. It can also realize the facility of design alteration. The secondary feature of the multitasking method and the multitask processing unit of this invention is that it is equipped with the function to perform a parallel processing by switching plural programs for every several cycles in a certain time division, with each instruction of the said plural programs being added with the task identification bit to identify the kind of program, enabling an error check to be performed according to the contents of the said task identification bit after the reading of instruction. It allows to detect quickly a branching to the address of other task by error due to an unexpected cause like noise. In the case of two tasks, a parity bit can be used as task identification bit. The third feature of the multitasking method and the multitask processing unit of this invention is that it will perform a pipeline processing of the plural task programs in parallel by time division, a pipeline processing quick and without delay by using the wasteful cycle after the branch instruction contained in one program for another program. That is, it will perform a pipeline processing in parallel by switching plural programs for every several cycles in a certain time division, and, when a branch instruction is fetched, finish the execution (setting at the branch destination) one cycle before the instruction fetch stage following the program which contains said branch instruction, allowing to fetch the instruction of the branch address at the instruction fetch stage following the program which contains the said branch instruction. It eliminates the occurrence of a wasteful cycle in the pipeline if there is a branch instruction and prevents the pipeline from delaying. The forth feature of the multitasking method and the multitask processing unit of this invention is that, in the case of a unit which incorporates the data area for operation in the memory containing a program, there is installed in each instruction of the program a caution-requiring instruction discrimination bit composed of a small number of bits in said instruction which indicates a character of the instruction whether it is possible for the instruction to lead to a program runaway, while giving to the data in the data area a caution-requiring instruction discrimination bit provided with the value to indicate a non-caution-requiring instruction as the value for the afore-mentioned small number of bits. By this means, if a program address branches out to the address in the data area to be used in operation and an execution is started by perceiving the data as operation code, the execution as caution-requiring instruction is prohibited by the value embedded in the caution-requiring instruction discrimination bit for data, with only the non-caution-requiring instruction being executed, preventing the destruction of data. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram of a computer showing an embodiment of this invention; Fig. 2 is a diagram showing conceptually the storage condition of a program and a table immediate data in the program memory of an embodiment; Fig. 3 is a block diagram showing the composition of the error detection circuit of an embodiment; and Fig. 4 is a time chart to be used for explaining the pipeline processing of an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS Described below is an embodiment of this invention referring to the drawings. The microcomputer in the embodiment is composed, for example, of a one-chip microcomputer, comprising CPU 11, program memory 12 consisting of ROM, data memory 13 consisting of RAM, I/O block 14 (input/output pin), timing generator 39 for generating a task switching signal (clock pulse) to be described later, data bus 15 for transmitting or receiving data, address bus 16 for transmitting or receiving address signal, and control bus 17 and 18 for transmitting or receiving read signal and write signal respectively. For example, the CPU 11 is equipped with two address registers 19, 20 and two registers 21, 22 to perform a pipeline processing of two kinds of tasks (L-task and A-task) in parallel by time division. An alternate switch by the task switching signal from timing generator 39 of those address registers 19, 20 and registers 21, 22 will apparently actuate two CPU's by changing them over alternately. On this occasion, address register 19 and register 21 become the register for CPU0 (for L-task) while address register 20 and register 22 become the register for CPU1 (for A-task). According to the switching of address registers 19 and 20, the value of program counter 23 (address of the instruction to be fetched next) is renewed, the address signals for CPU0 (for L-task) and CPU1 (for A-task) being output alternately from program counter 23 to program memory 12. Installed in CPU 11 are error detection circuit 24 which detects the error by discriminating the kind of task to which the instruction read from program memory 12 belongs and instruction decoder/sequencer 25 which decodes the instruction passing through error detection circuit 24. According to the contents of the instruction decoded by instruction decoder/sequencer 25, an operation is performed by using register 21 and 22 on arithmetic/logic unit (ALU) 26 and read signal or write signal is output to control bus 17 and 18. In program memory 12 are installed program area 27 for CPU0 (for L-task), program area 28 for CPU1 (for A-task) and table immediate data area 29. In this embodiment, the program for L-task stored in program area 27 for CPU0 is composed of the program in which a branch instruction having a risk of leading to a program runaway is prohibited and treated by a fixed loop. By this means, when the program of L-task is executed, the instruction is started in consecutive order from address-0 to address-1 to address-2 to address-3 and so forth, then returning to address-0 after reaching the specified address when the program counter 23 overflows, thereafter repeating the execution of instruction in the order of address as mentioned-above. With L-task, all instructions are fixed for one-word instruction. The reason is that in the case of the instruction system in which the number of words of instruction is not fixed (for example, the instruction system in which there are one-word instruction and two-word instruction), if a two-word instruction is read by mistake for a one-word instruction, it becomes impossible to know what to execute since the next instruction is not a proper one. L-task is suitable for the processing of the sequence control, whose program includes the routine of runaway monitoring for A-task, other task, and the routine of backup sequence for obtaining a failsafe for the system. Furthermore, L-task is equipped with the function as a timer by fixed loop actuation. For instance, it executes an increment or decrement instruction, allowing a fixed time processing equivalent to timer interruption by generating interruption in the processing of A-task when the count value reaches a specific set point. A-task is allowed a branch instruction which is prohibited in L-task, and is suited for complicated analytical and numerical processings. Like L-task, all instructions of A-task are also fixed for one-word instruction. In A-task and L-task, both operation code and operand (address) are allocated in one word. As shown in Fig. 2, each instruction of the program for L-task and A-task stored in program areas 27 and 28 for CPU0 and CPU1 in program memory 12 is provided with a task identification bit 30 to discriminate the kind of task, for example, at MSB (most significant bit). In this embodiment, the task identification bit 30 is parity bit, with L-task for odd parity and A-task for even parity. In this case, not only task discrimination but also instruction code check can be executed. On the other hand, there is installed in CPU 11 an error detection circuit 24 for detecting an error by discriminating the kind of task of the instruction which is read from program memory 12, by means of parity check. The error detection circuit 24 is to detect whether other task is going to be executed by error due to an unexpected cause like noise, and is composed, as shown in Fig. 3, of task discrimination circuit 31, error flag circuit 32, no-operation (NOP) code circuit 33, and both high active type and low active type transfer gates 34 and 35. The above-mentioned task discrimination circuit 31 discriminates by means of parity check the kind of task the instruction read from program memory 12 belongs to (i.e. discriminating as L-task when odd parity and as A-task when even parity), and determine by comparing the results of discrimination with the task switching signal from the timing generator 39 whether or not an error has occurred. If there is an error, an error signal (high level signal) is output to error flag circuit 32 to reset address register 19 or 20 of the task in which the error has occurred. On this occasion, the error signal (high level signal) is also applied to the control terminals of both transfer gates 34 and 35, to turn on high active type transfer gate 34 and to output NOP code signal from NOP code circuit 33 to instruction decoder/sequencer 25, while turning off low active type transfer gate 35 to prevent passage of the instruction to instruction decoder/sequencer 25. On this account, in the case of a branching out to the address of other task by error due to an unexpected cause like noise and the instruction being started to be executed, no-operation condition is obtained instantly, i.e. by one instruction cycle to prevent the destruction of memory data or port data. When there is no error, the output of task discrimination circuit 31 is maintained at low level to turn off high active type transfer gate 34 and to prevent passage of NOP code while turning on low active type transfer gate 35 to allow passage of the instruction to instruction decoder/sequencer 25. In the case of the conventional multi-word instruction compositions, the mis-perception of operation code/operand has caused a program runaway or mass destruction of important information in data memory. Furthermore, it has been possible for program address to branch out to the address in table immediate data area 29 starting the execution by perceiving the table immediate data as operation code thereby resulting in a program runaway or mass destruction of important information in data memory. In contrast to the above-mentioned, all instructions are, in this embodiment, designed for a fixed length of one word, with both operation code and operand allotted in one word. And the address is composed with program memory address completely separated from data memory address. This composition allows to prevent a program runaway beforehand due to the mis-perception of operation code/operand or the execution of instruction of data in data memory. As shown in Fig. 2, the operation code of this embodiment is allotted with the danger instructions such as branch instruction of program, write instruction to data memory or instruction for system control, separated from other instructions, which can be discriminated by specific bits in the operation code. Applicable to them are caution-requiring instruction discrimination bits 36 and 37. When the caution-requiring instruction discrimination bits 36 and 37 are "0", it all indicates the transfer instruction (non-caution-requiring instruction for read line instruction) from data memory 13 to register 21 or 22. In table immediate data area 29, caution-requiring instruction discrimination bit 37 is embedded with "0". For instance, if a program address should branch out to the address in table immediate data area 29 due to such as an address error and the execution be started by perceiving the table immediate data as an operation code, the execution as a caution-requiring instruction is prohibited on account of the value "0" set in caution-requiring instruction discrimination bit 37. That is, the operation transfer instruction from data memory 13 to operation register 21 or 22 is continued and the important information in data memory 13 is retained. Moreover, after the execution of operation transfer instruction to operation register 21 or 22 is finished, the error recovering routine 38 such as initialization processing described at the bottom of table immediate data area 29 is executed. By this means, the processing from error detection to error recovering can be performed in much quicker response than the external monitoring method by such as the conventional watchdog timer. Now an explanation shall be given below, based on Fig. 4, for the pipeline control system employed in this embodiment. For instance, the pipeline in this embodiment consists of three stages of instruction fetch, instruction decoding and instruction execution. It is so designed that all instructions can be processed by the three-stage pipeline without delay. Each stage is executed in one cycle, with one instruction executed in three cycles. However, parallel processing of three instructions by the three-stage pipeline makes it apparently equivalent to executing one instruction in one cycle. The time for one cycle (each stage) is provided by task switching signal (clock pulse) output from the timing generator 39. In this task switching signal, low level time TLo and high level time THi are the same, and, by performing the instruction fetch of CPU0 (L-task) in the high level period and the instruction fetch of CPU1 (A-task) in the low level period of task switching signal, the pipeline processing of both programs for CPU0 (L-task) and CPU1 (A-task) is performed in parallel in the time division ratio of 1:1. On this account, the instruction fetch and the instruction deciding of both tasks are in the reverse CPU relation, i.e. relation in which an instruction of one task is fetched while an instruction of the other task is decoded. Furthermore, for instance, when CPU1 (A-task) has fetched an instruction which requires more than one cycle, this instruction is switched in the way of execution. However, in this case, the instruction decoder/sequencer 25 has memorized the instruction cycle condition and the execution starts in the next CPU1 cycle from the midway condition of instruction and finishes after using the required number of cycle. That is, the switching is performed in time division ratio of 1:1, not depending on the required cycle for instruction. On this account, independence in terms of time is secured for CPU0 (L-task) and CPU1 (A-task), actuating as if there are two CPU's. Moreover, in this embodiment, when the branch instruction is fetched, in order to fetch the instruction of the branch address at the next instruction fetch stage for the task in which said branch instruction is contained, it is so composed that the branch address is to be set at the instruction decoding stage. As shown in Fig. 4, the procedure of the pipeline processing of this embodiment is that the instruction fetch of CPUO (L-task) and the instruction fetch of CPU1 (A-task) are repeated alternately by task switching signal, and, while the instruction of one task is fetched, the instruction of the other task, which is fetched one cycle earlier, is decoded; and while the instruction of one task is decoded, the instruction of the other task, which is decoded one cycle earlier, is executed. By this means, the pipeline processing of the programs of two tasks is performed in parallel in time division ratio of 1:1. As shown in Fig. 4, during the pipeline processing, for example, if the instruction of (X+1) address of CPU1 is a branch instruction (JMP), the branch address (XX address) is set at the instruction decoding stage where the branch instruction of the said (X+1) address is decoded, and, the instruction of the branch address (XX address) is fetched at the next instruction fetch stage for the task (CPU1) which contains said branch instruction. On this account, the pipeline does not develop a wasteful cycle, i.e. delay cycle, if there is a branch instruction, which prevents the pipeline from being delayed. On this occasion, since the setting of a branch address (execution of branch instruction) is performed at the instruction decoding stage, no processing for the branch instruction is to be performed at the instruction execution stage. As explained above, in this embodiment, since L-task is composed of the fix-looped program in which a branch instruction having risk of leading to a program runaway is prohibited, L-task is free from a possibility of leading to a program runaway or deadlock, and repeats a prescribed program. Moreover, since L-task is provided with the function of runaway monitor and timer for A-task, other task, the program runaway monitor, timer operation and timer interruption can be performed by L-task, allowing the runaway monitoring logic, hard timer and interrupt logic to be omitted in the peripheral circuits. Freedom in the design alteration is secured by realizing those functions in programs. Furthermore, in the case where something abnormal is detected by L-task on the processing of A-task and it is reset, since L-task repeats a fix-looped program of no branch instruction, it is possible to execute a backup sequence by means of L-task so as to obtain a failsafe of the system. It eliminates the necessity to compose a backup logic externally, and, together with the above-mentioned matter, contributes to making the peripheral circuits simplified, smaller-sized and less expensive. In this embodiment, though L-task is provided with the function of both the runaway monitor and the timer for A-task, it is good enough if it has at least either one of them. Simplification of the peripheral circuits can be expected even in this case. Furthermore, in this embodiment, though the time division parallel processing is performed for two tasks, it may be done for three or more tasks. In this case, more than one task may be composed of fix-looped program without branch instruction. In this embodiment, each instruction of the program for L-task and A-task is provided with task identification bit 30 to distinguish the kind of task, allowing to determine, when reading each instruction from program memory 12, whether or not there is an error by discriminating the kind of task the instruction belongs to by means of error detection circuit 24. On this account, if a branching out to the address of other task is performed by error due to an unexpected cause like noise, the error can be detected earlier than the instruction is decoded, rendering the instruction to be an invalid instruction like NOP. That is, it is possible to detect an error in much quicker response than the external monitoring logic such as watchdog timer to be installed in the peripheral circuits, enabling the prevention of the destruction of memory data or port data, protecting each task from the other and securing the independence. It goes without saying that the processing when an error is detected is not limited to the invalid instructions like NOP. For instance, the task on which there has occurred an error may be reset. In this embodiment, though task identification bit 30 is a parity bit, the value of task identification bit 30 may be set for L-task being "0" and A-task being "1" so that the kind of task can be judged according as the value of task identification bit 30 is "0" or "1". Moreover, the number of bit of task identification bit 30 may not be limited to one bit, but it may be more than one bit. Also, in the case of the number of task being three or over, a task identification bit may be composed of more than one bit. Needless to say, the location where task identification bit 30 is provided may not be limited to MSB, but it may be at other location. Furthermore, the composition of error detection circuit 24 may be altered in a variety of ways within a range not deviating from the point. In this embodiment, when the pipeline processing is performed for the programs of more than one task in parallel in a certain time division, if the branch instruction which is contained in the program of each task is fetched, the instruction of a branch address is fetched at the next instruction fetch stage of the task in which the branch instruction is contained. On this account, the wasteful cycle after branch instruction can be eliminated, the delay of pipeline prevented, allowing the pipeline processing of more than one task to be performed quickly and without delay. In the embodiment mentioned above, the pipeline processing is performed for two tasks in a certain time division. However, the pipeline processing may be performed for three or more tasks in time division. In case where the pipeline processing is performed for N-piece tasks in time division, if the setting (execution of branch instruction) of branch address is performed during (N-1) cycles after the branch instruction is fetched, the wasteful cycle after branch instruction can be prevented. In this relation, in case where the pipeline processing is performed for two tasks as in this embodiment, it is necessary to set the branch address during the cycle immediately after the branch instruction is fetched, i.e. at the instruction decoding stage. However, in case where the pipeline processing is performed for three tasks, the branch address may be set during two cycles after the branch instruction is fetched. As mentioned above, in the case of three tasks, since the setting of branch address may be performed during two cycles after the branch instruction is fetched, if the address designation system for the branch instruction is the relative address designation system which requires address computation, the branch address can be set before the next instruction fetch stage of the task which contains the branch instruction. Moreover, in this embodiment, though the pipeline is composed of three stages each of instruction fetch, instruction decoding and instruction execution, it may be composed of four stages or more. According to this embodiment, if the program address has branched out to the address in the data area due to such as address error, non-caution-requiring instruction is executed by the value embedded in the caution-requiring instruction discrimination bit for data, and the important information in data memory can be retained. What is more, when the program address has branched out to the address in the data area due to such as address error, a quick error recovering can be performed, the processing from error detection to error recovering being carried out in much more quicker response than the external monitoring method by such as the conventional watchdog timer. In the above embodiment, though error recovering routine 38 like initialization routine is written at the end of table immediate data area 29, an instruction to judge an error by parity check may, of course, be written. Furthermore, the error detection/recovering system of this embodiment can also be adopted for what is deemed as the multi-word instruction system, and caution-requiring instruction discrimination bit may be embedded in data word of multi-word instruction. In this case also, the mis-perception of operation code and operand can be prevented more securely. In addition, the number of bit of caution-requiring instruction discrimination bit 36 and 37 is may not be limited to one bit, but it may be more than one bit. Needless to say, the location where caution-requiring instruction discrimination bits 36 and 37 are privided is not limited to the one shown in this embodiment. Furthermore, the error detection/recovering system of this embodiment is not limited to the time division parallel processing of more than one task, but it can also be applied to a processor executing one task.

Claims: A multitask processing unit comprising: a program memory (12) storing programs of first and second tasks; first and second address registers (19, 20) provided in correspondence with each of said programs of said first and second tasks; means (39) for generating a switching signal to switch alternately said first and second address registers (19, 20) in a certain time division ratio; and means (CPUO, CPU1) for executing an instruction, which fetches the instruction of said program of said first task (L-task) or second task (A-task) based on one of said first or second address register (19, 20) selected by said switching signal from said generating means (39) and executes the fetched instruction; characterized by means (25) for memorizing a midway condition of said instruction when switched by said generating means (39), wherein said program of said first task (L-task) is prohibited from branch instructions, and is composed to be executed fix-looped from its start address to a specific address, with at least one routine of runaway monitor and timer for said second task (A-task) incorporated. The multitask processing unit according to claim 1, characterized in that each instruction of the programs of said first and second tasks includes a task identification bit (30) to indicate the kind of task, and further comprising a task discrimination means (31) for checking a content of said task identification bit (30) before an execution of the instruction by the executing means. The multitask processing unit according to claim 2, characterized in that said task discrimination means (31) checks an execution task based on said switching signal from said generating means (39) and the content of said task identification bit (30). The multitask processing unit according to claim 3, characterized by means (33, 34, 35) for sending prohibition instruction which are sending a no-operation instruction in place of each instruction of said programs to the executing means, when said task discrimination means (31) judges that the content of the task identification bit and the execution task does not conform. The multitask processing unit according to claim 4, characterized in that a parity bit is provided for said task identification bit. The multitask processing unit according to claim 1, characterized in that said executing means (CPUO, CPU1) has first and second registers (21, 22) installed in correspondence with each of the programs of the said first and second tasks. The multitask processing unit according to claim 6, characterized in that said first and second registers (21, 22) are alternately switched based on the switching signal from the generating means (39). The multitask processing unit according to claim 7, characterized in that said executing means (CPU0, CPU1), when fetching a branch instruction, finishes setting the branch address one cycle before the next instruction fetch stage of the program in which said branch instruction is contained. The multitask processing unit according to claim 1, characterized in that said program memory (12) stores a data area (29) to be used for operation, each instruction of the programs of the first and second tasks indicates whether it is a caution-requiring instruction or not by a small number bit (36, 37) in the instruction, and the data area is provided with the value indicating a non-caution-requiring instruction for the value of the small number bit (36, 37). A multitasking method for performing a parallel processing of more than one program by switching for every several cycles in a certain time division, a function of that, in case where the instruction contained in the program is on the way of execution when switched, the program is switched while retaining a midway condition of the instruction, and a function of starting an execution from said midway condition at the next execution cycle of the program in which the said instruction is contained, to thereby allow a switching in a certain cycle division ratio not depending on the required number of cycle of the instruction, wherein a specific program (L-task) of said more than one program being prohibited a branch instruction and performing a fix-loop execution from the start address to the specific address, said specific program (L-task) including at least one routine of the runaway monitor and the timer for another program (A-task). A method according to claim 10, wherein each instruction of said plural programs includes a task identification bit (30) to distinguish the kind of program, whereby each program is protected from other programs and the independence is secured by performing error check after reading the instruction. A method according to claim 11, wherein a parity bit is attached for said task identification bit (30). A method according to any of claims 10 to 12, wherein when a branch instruction (JMP) is fetched, a setting a branch address (XX) is finished at least one cycle before the next instruction fetch stage of the program in which the branch instruction is contained, to thereby fetch the instruction of the branch address (XX) at the next instruction fetch stage without generating a delayed cycle. A method according to any of claims 10 to 13, wherein a memory (12) stores a program, said memory (12) having a data area (29) used for operation, each instruction of the program including a small number bit (36, 37) for indicating whether it is a caution-requiring instruction like a branch instruction (JMP) which has a risk of leading to a program runaway, the data area (29) including a value indicating a non-caution-requiring instruction as said small number bit, thereby prohibiting the execution of the caution-requiring instruction of the data area.

Inventors: HIDEAKI ISHIHARA, KOUICHI MAEDA, ISHIHARA,HIDEAKI, MAEDA,KOUICHI, HIDEAKI,ISHIHARA, KOUICHI,MAEDA
Applicants: DENSO CORP, DENSO CORPORATION
Application year: 1994
Main classification: G06F9
IPC codes: G06F9