This application claims benefit of priority from Japanese application number JP 2011-8983 filed Jan. 19, 2011, the entire contents of which are incorporated by reference herein.
Embodiments described herein relate generally to a processor monitoring system for monitoring the operating condition of a program executed by a processor, and to a method of monitoring thereof.
Processor fault detection typically involves monitoring abnormalities of operation using a watchdog timer. However, apart from program bugs, hacking and software errors etc, processor faults may be caused by faults of the various constituent elements of the processor circuitry.
In recent years, in safety devices such as control devices in which a high degree of safety is required, an operation monitoring function is demanded that is capable of verifying correct operation of the device in which the processor is provided.
Accordingly, the method has been disclosed of monitoring the sequence of operation of a program that is being executed by a processor during system operation, and successively examining state transitions by constructing a “state machine” in an operation monitoring device external to the processor, in order to detect stoppage of processor operation or to detect erroneous operation (malfunction). Examples are disclosed in Published Japanese Patent Number 4359632, which is an issued patent in Japan (hereinafter referred to as Patent Reference 1), or Laid-open Japanese Patent Application 2010-9296, which is likewise an issued patent in Japan (hereinafter referred to as Patent Reference 2).
However, the microprocessor operation monitoring system disclosed in Patent Reference 1 incorporates in the operation monitoring circuit a state machine circuit for simulating beforehand the program that is being executed, by using reconstructable hardware such as an FPGA (field programmable gate array): since the new state that the processor ought to take must be calculated, the construction of this operation monitoring circuit becomes complicated.
Also, since the simulating circuit must be altered every time the program is altered, there is the problem that, in a system in which program alteration is anticipated, maintenance becomes complicated and time-consuming.
Also, in the case of the software operation monitoring device disclosed in Patent Reference 2, a construction is adopted in which hardware is used to monitor whether or not the task start-up sequence is normal, using the currently started-up task ID and the ID of the previous task that was started up previously, by allocating an identification information ID containing information specifying the current task and the previously executed task to tasks that are started up, in correspondence with the task address. The information obtained as a result of this monitoring is stored in the form of a time sequence as log information. However, this makes the circuit construction complicated.
Furthermore, the required memory capacity becomes large due to the fact that a construction is adopted whereby abnormalities of the software execution condition are ascertained by the watchdog timer and the stored log information is saved to a recording unit when timeout of the watchdog timer is detected.
There are therefore the problems that, depending on the method of task transition, it is possible that the executed software may be slowed down by the large number of IDs or that a considerable time is required to stop the system once abnormality has been detected.
Thus, in a safety control system using a processor that is required to have safety and reliability, although it is desirable that the circuitry should be constructed so as to detect abnormality of program operation, or incorrect program operation with few errors, in the case of the construction of Patent Reference 2, there are the problems that complex circuitry and large memory capacity become necessary.
According to an aspect of the present technology, a processor operation monitoring system and method for monitoring thereof are provided whereby it is possible to rapidly detect abnormality of the task start-up sequence of the processor, with a straightforward circuit and small memory capacity, without requiring reconstruction of the operation monitoring unit when the program is altered.
A processor operation monitoring system according to the present invention is constructed as follows. Specifically, a processor operation monitoring system comprising: a processor; and an operation monitoring unit that monitors the operation thereof is characterized in that: aforementioned processor comprises a computation unit that executes aforementioned program; a storage unit that stores aforementioned program constituted by a plurality of tasks; and a data transmission circuit that transmits to aforementioned operation monitoring unit a bit signal corresponding to instructions reporting the execution condition of aforementioned program by aforementioned computation unit; and
aforementioned operation monitoring unit comprises a transition operation identification circuit that monitors the transition state of aforementioned program; and a looping processing identification circuit that ascertains the number of times of looping of a looping process and
respective aforementioned tasks comprise:
a start ID instruction that attaches beforehand an ID identifying aforementioned task constituting a transition source to the start address of the task in question;
a termination ID instruction that identifies termination of operation of the task in question at the final address of the task in question and, if the task in question executes loop processing, a loop instruction that reports the maximum value of the number of times of this looping processing
and aforementioned computation unit or aforementioned data transmission circuit respectively generates: aforementioned start ID bit signal corresponding to aforementioned start ID instruction and uses this as a state signal capable of identifying the transition source task from other tasks when this task is started up, in respect of all of the tasks constituting aforementioned program; aforementioned termination ID bit signal corresponding to aforementioned termination ID instruction and uses this as a state signal capable of identifying the fact that another task is not started up when the task in question terminates, in respect of all of the tasks constituting aforementioned program; and a maximum value signal corresponding to aforementioned loop instruction; and transmits these from aforementioned data transmission circuit to aforementioned operation monitoring unit;
aforementioned transition operation identification circuit finds a coincidence signal of a first termination ID bit signal produced when operation was terminated and a second start ID bit signal of aforementioned task that is next to be started up, and the exclusive OR of aforementioned coincidence signal and aforementioned second start ID bit signal, and uses these to evaluate success of the transition operations of the tasks of aforementioned program; and
aforementioned loop processing identification circuit counts, as an increment signal, a coincidence signal of the first start ID bit signal at which operation was started and the first termination ID bit signal, and identifies abnormality of the number of times of loop processing by comparing this count value and aforementioned maximum value, so that abnormality of the transition operations of the tasks can be detected during the execution of the program by the processor.
In order to achieve the above object, a method of monitoring in a processor operation monitoring system according to the present invention comprises the following steps. Specifically, a method of monitoring the operation of a processor comprising a processor and an operation monitoring unit that monitors the operation thereof comprises: a step of, in respect of all of the tasks constituting a program, setting up beforehand a start ID instruction that attaches an ID identifying aforementioned task constituting the transition source at the start address of the task in question; a termination ID instruction that identifies termination of operation of the task in question at the final address of the task in question; and, if the task in question executes loop processing, a loop instruction that reports the maximum value of the number of times of this loop processing;
a step of respectively generating: aforementioned start ID bit signal corresponding to aforementioned start ID instruction and using this as a state signal capable of identifying the transition source task from other tasks when this task is started up, in respect of all of the tasks constituting aforementioned program; aforementioned termination ID bit signal corresponding to aforementioned termination ID instruction and using this as a state signal capable of identifying the fact that another task is not started up when the task in question terminates, in respect of all of the tasks constituting aforementioned program; and a maximum value signal corresponding to aforementioned loop instruction;
a step of finding a coincidence signal of a first termination ID bit signal produced when operation was terminated and a second start ID bit signal of aforementioned task that is next to be started up, and the exclusive OR of aforementioned coincidence signal and aforementioned second start ID bit signal, and using these to evaluate success of the transition operations of the tasks of aforementioned program; and
a step wherein aforementioned loop processing identification circuit counts, as an increment signal, a coincidence signal of the first start ID bit signal at which operation was started and the first termination ID bit signal, and identifies abnormality of the number of times of loop processing by comparing this count value and aforementioned maximum value.
With the present invention, a processor operation monitoring system and method of monitoring thereof can be provided that are capable of easily detecting abnormality of the task start-up sequence of the processor by straightforward circuitry and small memory capacity, without requiring reconstruction of the operation monitoring unit when the program is altered.
Embodiments are described below with reference to the drawings.
Hereinafter, Embodiment 1 will be described with reference to
A processor operation monitoring system 100 comprises a processor 1 and an operation monitoring unit 2 that monitors the operation of the processor 1.
The processor 1 comprises a computation unit 12 that executes a program, a storage unit 11 that stores the program, comprising a plurality of tasks, and a data transmission circuit 13 that transmits to the operation monitoring unit 2 a bit signal corresponding to an instruction whereby the computation unit 12 notifies the execution state of the program.
The operation monitoring unit 2 comprises a transition operation identification circuit 2a that monitors the transition condition of the program and a loop processing identification circuit 2b that identifies abnormality in relation to the number of times of looping of loop processing.
Next, the detailed construction of the various units will be described. First of all, the constituent tasks of the program in question will be described with reference to
As shown in
This bit signal “0001” shows that the transition source of the task A is the task D.
Also, in the case where more than one task constitutes a transition source, for example in the case of task C, we have “1010”, indicating that the transition sources are task A and the current task i.e. task C.
Also, in the case of task C, in which loop processing is performed, as shown in
Specifically, the respective tasks compromise: a start ID instruction that attaches an ID identifying the task constituting the transition source to the start address of the task in question beforehand; a termination ID instruction that identifies the termination of operation of the task in question at the final address of the task in question; and, if the task in question executes loop processing, a loop instruction that notifies the maximum value of the number of times of loop processing. The computation unit 12 or the data transmission circuit 13 respectively generates: as the start ID bit signal corresponding to the start ID instruction, for all the tasks constituting the program, a state signal whereby it is possible to identify a task constituting a transition source when this task is started up and other tasks; as the termination ID bit signal corresponding to the termination ID instruction, a state signal whereby it is possible to identify, for all the tasks constituting the program, the other tasks that are not started up when this task terminates; and a final value signal corresponding to the loop instruction; and transmits these from the data transmission circuit 13 to the operation monitoring unit 2.
Next, the detailed layout of the transition operation identification circuit 2 will be described referring to
The transition operation identification circuit 2 comprises a termination ID register 21 and start ID register 22 that temporarily store the termination ID bit signal and start ID bit signal. In addition, as shown in
Next, the operation of the transition operation identification circuit 2a constructed in this way will be described with reference to
First of all, a preset value “0001” is written as the initial value of the start ID register of task A. Then, with the timing with which the start ID register signal indicating transition from task A to task C is received, the bit signals corresponding to the respective tasks represented by the termination register value “1000” of task A and the start ID register value “1010” of the task C are logically identified by the AND circuit 23a and the EXOR circuit 23b, and the fact that the situation is normal is identified by the fact that the output obtained is “0000”.
However, on transition from task D to task B, the output of the EXOR circuit 23B becomes “0001”, which is identified as abnormality of the task D.
Specifically, although, in this embodiment, there are a plurality of transition sources (start conditions), as shown by the case of the transition from task C to task D, abnormality of the transition operation can be instantaneously identified by the preset bit information after writing to the start ID register.
Next, the layout of loop decision processing 2b will be described with reference to
Logical coincidence of the respective bit signals written in the start ID register and start termination register is treated as an increment signal of the number of times of looping; the output of the AND circuit 23a provided in the identification circuit 23 of the transition operation identification circuit 2a is branched thereat and counted by input to the counter 25. A decision is then made as to whether or not the number of times of looping is abnormal by using the comparison circuit 26 to compare the output of this counter 25 and the maximum value written to the maximum value register 24; if the decision output of the transition operation identification circuit 2a was also abnormal, this is transmitted to the abnormality processing unit 14 from the abnormality signal transmission circuit 27.
Regarding the abnormality processing unit 14, although this was stated to be of a construction mounted on the processor 1, its construction could be independent of both the processor 1 and the operation monitoring unit 2, or it could be attached to either of these.
This abnormality decision output could be used to shut down the processor 1 by a request to the system with which the processor 1 is provided, or could be utilized for diagnosis by logging the abnormality data.
As described above, with Embodiment 1, the transition information of the program is written to the respective tasks and an evaluation is made as to whether or not the transition was successful, based on the bit information of all of the tasks corresponding to the instructions, on execution of these instructions; the transition states of all of the tasks being detailed beforehand as their start ID instruction and termination ID instruction. Consequently, a processor operation monitoring system can be provided whereby abnormality can be evaluated at the timing instant of commencement of the task by a simple circuit construction, using the success of the task transition operation as the minimum information for this purpose.
Next, the processor operation monitoring system of Embodiment 2 will be described with reference to
As shown in
In more detail, in the operation monitoring unit 2A, there is provided a data switching circuit 2a1 that transmits a start ID bit signal, termination ID bit signal and a signal with maximum value, transmission being effected from this data switching circuit 2a1 to the operation monitoring unit 2B.
With Embodiment 2, the operation monitoring unit 2 can be embodied in redundant fashion: alternatively, if the system B is a processor system, a redundant arrangement can be constituted in which mutual diagnosis is performed by providing similar operation monitoring units, with the system B being diagnosed by the system A.
In this case, in the operation monitoring unit 2B, the data switching circuit 2a1 that is provided in the operation monitoring section 2A is provided, and the operation monitoring units are made to be compatible units having the same construction. Thus the system A shown in
While various embodiments of the present invention have been described, these embodiments are presented by way of example only, and are not intended to restrict the scope of the invention. Novel embodiments could be implemented in various other modes and various omissions, replacements and alterations could be effected without departing from the scope of the invention. Such embodiments or modifications are included in the gist of the invention and are included in the range of equivalents to the invention as set out in the patent claims.
Number | Date | Country | Kind |
---|---|---|---|
P2011-008983 | Jan 2011 | JP | national |