WO2021038923A1 - 制御装置、ユーザプログラムの実行制御方法、およびシステムプログラム - Google Patents

制御装置、ユーザプログラムの実行制御方法、およびシステムプログラム Download PDF

Info

Publication number
WO2021038923A1
WO2021038923A1 PCT/JP2020/007778 JP2020007778W WO2021038923A1 WO 2021038923 A1 WO2021038923 A1 WO 2021038923A1 JP 2020007778 W JP2020007778 W JP 2020007778W WO 2021038923 A1 WO2021038923 A1 WO 2021038923A1
Authority
WO
WIPO (PCT)
Prior art keywords
volatile memory
data
memory
error
instruction
Prior art date
Application number
PCT/JP2020/007778
Other languages
English (en)
French (fr)
Inventor
雅哉 工藤
紀昭 鈴木
中村 満
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Publication of WO2021038923A1 publication Critical patent/WO2021038923A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/048Monitoring; Safety
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present invention relates to a control device that executes a user program to control a controlled object, a method for controlling execution of the user program in the control device, and a system program for realizing the control device.
  • Control devices such as PLC (Programmable Logic Controller) have been introduced at various manufacturing sites.
  • a control device is a kind of computer, and includes a volatile memory such as a RAM (Random Access Memory) and a processor such as a CPU (Central Processing Unit).
  • the volatile memory stores a user program designed according to a manufacturing apparatus or a manufacturing facility.
  • the processor sequentially reads the instructions that make up the user program stored in the volatile memory and executes them sequentially.
  • the data of the user program When executing a user program stored in volatile memory, the data of the user program may be destroyed in 1-bit units due to the influence of radiation, and a soft error may occur in the volatile memory. In this way, the data of the user program may be destroyed and a soft error may occur. Therefore, it is desired that the control device be provided with a function of detecting the soft error and correcting the detected soft error. ..
  • Patent Document 1 Japanese Unexamined Patent Publication No. 2004-220580 (Patent Document 1) includes, in addition to a user program memory in which a user program is stored, a backup memory in which data having the same contents as the user program stored in the user program memory is stored.
  • the unit for the programmable controller is disclosed. This programmable controller unit detects an abnormality by comparing the contents of the backup memory and the user program memory, and when the abnormality is detected, the user program stored in the user program memory is based on the data stored in the backup memory. To repair.
  • Patent Document 1 detects an error by comparing two memories with each other, so that there is a problem that it takes time to obtain a comparison result.
  • An object of the present invention is to reduce the time required for detecting and restoring an error occurring in a memory.
  • a control device for controlling a controlled object.
  • the control device stores an instruction execution unit that sequentially executes instructions included in the user program, a volatile memory for storing the user program, and a backup user program having the same contents as the user program stored in the volatile memory. It includes a backup memory and an access control unit that reads instructions included in a user program from a volatile memory and provides them to an instruction execution unit according to a predetermined execution order.
  • the volatile memory stores data by adding information for error detection, and is based on the data in the specified area and the information for error detection corresponding to the specified area in response to a read request. It is configured to respond whether or not an error has occurred in the specified area to be determined.
  • the access control unit When the access control unit reads an instruction from the volatile memory, the area where the error occurs when the volatile memory responds that an error has occurred in the area where the read instruction was stored. It is configured to reload the data from the backup memory into the volatile memory and read the instructions from the volatile memory again.
  • the presence or absence of an error in the detection of an error in a specified area is determined based on the information for error detection. Therefore, as compared with the case where the error is detected by comparing the memories.
  • the processing time can be shortened.
  • the volatile memory may be configured to respond to the presence or absence of an error by a parity check. According to this configuration, an error in 1-bit units can be detected.
  • the access control unit reads the data stored in the volatile memory in a predetermined order and at a predetermined timing, in addition to the read for the purpose of providing the instruction to the instruction execution unit. , When the volatile memory responds that an error has occurred in the area where the read data was stored, the data including the instructions stored in the backup memory is reloaded from the backup memory to the volatile memory. ..
  • error detection and error restoration are periodically executed even for data related to instructions that are called extremely infrequently.
  • the backup memory may be a memory that non-volatilely stores the user program for backup.
  • the user program stored in the volatile memory is loaded from the backup memory.
  • the memory for power interruption can be used as the backup memory, it is not necessary to prepare the backup memory separately, and the memory capacity can be reduced.
  • the backup memory may be a memory for volatilely storing a user program for backup.
  • the access control unit rewrites the data stored in the volatile memory and the data stored in the backup memory.
  • an execution control method of a user program in a control device for controlling a control target includes a volatile memory for storing the user program and a backup memory for storing the user program for backup having the same contents as the user program stored in the volatile memory.
  • the volatile memory stores data by adding information for error detection, and is based on the data in the specified area and the information for error detection corresponding to the specified area in response to a read request. It is configured to respond whether or not an error has occurred in the specified area to be determined.
  • the execution control method of the user program is a step of reading the instructions included in the user program from the volatile memory according to a predetermined execution order, and an area in which the read instructions are stored when the instructions are read from the volatile memory.
  • the step of reloading the data in the area where the error has occurred from the backup memory to the volatile memory and rereading the instruction from the volatile memory, and the volatile Includes a step to execute an instruction read from the sex memory.
  • the presence or absence of an error in the detection of an error in a specified area is determined based on the information for error detection. Therefore, as compared with the case where the error is detected by comparing the memories.
  • the processing time can be shortened.
  • a system program for realizing a control device for controlling a controlled object includes a volatile memory for storing the user program and a backup memory for storing the user program for backup having the same contents as the user program stored in the volatile memory.
  • the volatile memory stores data by adding information for error detection, and is based on the data in the specified area and the information for error detection corresponding to the specified area in response to a read request. It is configured to respond whether or not an error has occurred in the specified area to be determined.
  • the system program tells the processor of the control device the step of reading the instructions included in the user program from the volatile memory according to a predetermined execution order, and the area where the read instructions are stored when the instructions are read from the volatile memory. When the volatile memory responds that an error has occurred, the data in the area where the error has occurred is reloaded from the backup memory to the volatile memory, and the instruction is read again from the volatile memory. The step of executing the instruction read from the volatile memory is executed.
  • the presence or absence of an error in the detection of an error in a specified area is determined based on the information for error detection. Therefore, as compared with the case where the error is detected by comparing the memories.
  • the processing time can be shortened.
  • the time required for detecting and restoring an error occurring in a memory can be shortened.
  • FIG. 1 is a diagram for schematically explaining an application example of the present disclosure.
  • the control device 100X corresponds to, for example, an industrial controller called a PLC (programmable controller), and controls various manufacturing facilities and machines (not shown).
  • PLC programmable controller
  • necessary information is acquired by using a sensor or the like, and a predetermined control calculation is executed using the acquired information according to the program executed by the control device 100X. , Calculate the control output.
  • the control device 100X includes an instruction execution unit 202X, a volatile memory 106X, a backup memory 110X, and an access control unit 204X.
  • the instruction execution unit 202X sequentially executes the instructions included in the user program 114.
  • the user program 114 is between a program created for the purpose of controlling a control target and another device (for example, a database, another control device, HMI (Human Machine Interface), etc.) capable of communicating with the control device 100. It is a program for realizing an arbitrary application such as a program for sending and receiving data with.
  • the access control unit 204X reads the instructions included in the user program 114 from the main memory 106 and provides them to the instruction execution unit 202X according to a predetermined execution order.
  • the instruction execution unit 202X and the access control unit 204X are functions realized by, for example, the processor of the control device 100 executing a system program for realizing the basic functions of the control device. Note that some or all of the functions of the instruction execution unit 202X and the access control unit 204X are implemented using a dedicated hardware circuit (for example, ASIC (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array)). You may.
  • the function of the instruction execution unit 202X may be implemented by using a dedicated hardware circuit
  • the function of the access control unit 204X may be realized by the processor of the control device 100X executing the system program.
  • the volatile memory 106X volatilely stores the user program 114.
  • the user program 114 stored in the volatile memory 106X is a program for execution and is user data 140.
  • the backup memory 110X stores backup data 160, which is a backup user program 114 having the same contents as the user program 114 stored in the volatile memory 106X.
  • the backup memory 110X may be a volatile memory or a non-volatile memory.
  • the backup data 160 is used to restore the user data 140 when the user data 140 is destroyed. For example, when the user data 140 is destroyed by cosmic ray neutrons or the like, the destroyed data is restored by reloading the backup data 160 into the volatile memory 106X.
  • the volatile memory 106X is a memory equipped with an error detection function. Specifically, when the data 142 is stored, the error detection information (detection information 144X) is added to the data 142 and stored. .. Further, when the volatile memory 106X outputs the data in the designated area in response to the read request, the volatile memory 106X outputs the data in the designated area together with the presence or absence of an error. Whether or not an error has occurred is determined based on the detection information 144X. Whether or not an error occurs is determined, for example, according to a conventionally known parity check.
  • the access control unit 204X When the access control unit 204X responds from the volatile memory 106X that an error has occurred in the area where the read instruction is stored, the data in the area where the error has occurred is volatile from the backup memory 110X. Reload to the sex memory 106X. After reloading, the access control unit 204X reads the instruction from the volatile memory 106X again.
  • the presence or absence of an error in the detection of an error in the specified area is determined based on the information for error detection, so that the processing can be performed as compared with the case where the error is detected by comparing the memories.
  • the time required can be shortened.
  • Volatile memory with a function to detect data errors is generally distributed in the market.
  • the control device 100X uses such a generally distributed volatile memory 106X, and executes a process of re-reading an instruction from the volatile memory 106X when an error occurs in the processor. It is possible to easily realize it by configuring it so as to make it.
  • control device 100X there is a memory having a function of detecting and correcting a data error by hardware, but such a memory is expensive. Since the control device 100X according to the present disclosure can be realized by using a memory having only an error detection function, it can be realized at a low cost.
  • the volatile memory 106X may be a memory having a function of detecting and correcting data errors by hardware.
  • the correction function provided in the memory can be supplemented by configuring the data to be reloaded as a process of the processor.
  • control device 100X since the control device 100X according to the present disclosure reloads the data before executing the instruction, it is possible to prevent the instruction from being executed according to the incorrect data.
  • control device 100X when reloading incorrect data after executing an instruction, it is desirable to back up the input / output data that is updated by executing the instruction according to the incorrect data.
  • the control device 100X since the control device 100X according to the present disclosure reloads erroneous data before executing the instruction, it is not always necessary to back up the input / output data, and the memory can be reduced. Can be done.
  • control device 100X responds with or without an error in response to a data read request. Therefore, it is possible to find an error in the data earlier than in the case where the error is generated or not after the entire user program 114 is executed.
  • the timing for restoring the data may be when a response regarding the presence or absence of an error is made, and after the response is made as to whether or not an error has occurred, a data command relating to the presence or absence of the error is executed. It may be time to do.
  • the data in which the error has occurred may be reloaded from the backup memory 110X, or the data may be reloaded from the backup memory 110X for each instruction read. Further, the data in which the error has occurred may be reloaded by reloading the entire user program 114.
  • FIG. 2 is a diagram schematically showing the configuration of the control device 100.
  • FIG. 2 shows a part of the configuration that performs the central processing of the control device 100.
  • the control device 100 includes a processor 102, a main memory 106, and a flash memory 108.
  • the processor 102, the main memory 106, and the flash memory 108 may be provided in the control device 100 in a form mounted on the one-chip microcomputer, or may be provided in the control device 100 in a form mounted separately. You may be.
  • the processor 102 directly executes the system program 112 stored in the flash memory 108, thereby expanding the user program 114 in the main memory 106 and sequentially executing the user program 114.
  • the processor 102 reads the user program 114, expands it in the main memory 106, and executes it to realize control of the controlled object.
  • the system program 112 may be expanded and executed in the main memory 106, but the control device 100 is realized by directly executing the system program 112 without expanding it in the main memory 106. It is possible to prevent the important programs for this from being transformed by the influence of radiation such as cosmic ray neutrons.
  • the flash memory 108 is a non-volatile memory and holds various programs including the system program 112 and the user program 114, and various parameters used in the various programs.
  • the flash memory 108 functions as a backup memory for storing backup data 160, which is a user program 114 having the same contents as the execution user program 114 expanded in the main memory 106.
  • the system program 112 is firmware and is a program for realizing the control device 100.
  • the user program 114 is a program other than the system program 112, for example, a program created for the purpose of controlling a control target, another device capable of communicating with the control device 100 (for example, a database, another control device). , HMI, etc.) may include a program for sending and receiving data to and from.
  • system program 112 and the user program 114 other than the system program 112 may be configured to be stored in different non-volatile memories.
  • system program 112 that is directly executed without being expanded in the main memory 106 may be stored in the high-speed flash memory, and the data such as the user program 114 that is frequently rewritten may be stored in another non-volatile memory. Good.
  • the main memory 106 is a volatile memory and holds user data 140 for execution when the processor 102 executes the user program 114.
  • control device 100 is an interface for communicating with other devices and an internal bus controller for exchanging data with a functional unit connected through an internal bus. It is equipped with a memory card interface for reading and writing data stored in the memory card.
  • the functional unit connected to the control device 100 may include an I / O (Input Output) unit, a safety I / O unit, a communication unit, a motion controller unit, a temperature control unit, a pulse counter unit, and the like.
  • I / O Input Output
  • safety I / O unit a safety I / O unit
  • communication unit a communication unit
  • motion controller unit a temperature control unit
  • pulse counter unit a pulse counter unit
  • control device 100 may be a safety unit that executes a control calculation for realizing a safety function related to a controlled object.
  • the processor 102 includes an instruction execution unit 202, an access control unit 204, a register 206, and an access interface 220.
  • the instruction execution unit 202 is an arithmetic unit and is composed of one or a plurality of arithmetic circuits.
  • the instruction execution unit 202 executes the instruction read from the main memory 106.
  • the access control unit 204 is a function realized by executing the system program 112, and by controlling the access interface 220, data can be exchanged between the processor 102, the flash memory 108, and the main memory 106. By controlling, the instructions included in the user program 114 are read from the main memory 106 and provided to the instruction execution unit 202 according to a predetermined execution order.
  • the register 206 may include an error address register 208, an error status register 210, and an instruction register 212. Processor 102 may further include other types of registers.
  • the error address register 208 holds an area (address) in which a soft error has occurred in the main memory 106.
  • the error status register 210 holds that a soft error has occurred in the main memory 106.
  • the instruction register 212 holds an instruction executed by the instruction execution unit 202.
  • the processor 102 may include a plurality of instruction registers 212.
  • the access interface 220 is controlled according to the instruction of the access control unit 204, and exchanges data between the main memory 106 and the flash memory 108.
  • the main memory 106 includes an address decoder 602, a memory cell 604, a read / write circuit 606, and a parity check circuit 610.
  • the address decoder 602 is connected to the processor 102 via the address bus 402.
  • the address decoder 602 identifies the address by decoding the signal output on the address bus 402, and activates the cell of the specified address among the memory cells 604.
  • the result decoded by the address decoder 602 is output to the parity check circuit 610.
  • User data 140 which is a user program 114 for execution, is stored in the memory cell 604.
  • Data 142 is stored in the memory cell 604 with the parity bit 144 added as information for error detection.
  • the read / write circuit 606 is connected to the processor 102 via the control bus 404 and the data bus 406.
  • the read / write circuit 606 reads or writes data to the memory cell 604 in response to the control signal from the control bus 404.
  • the read / write circuit 606 has a parity generation circuit 608.
  • the parity generation circuit 608 generates the parity bit 144 from the data 142 transmitted via the data bus 406.
  • the read / write circuit 606 is sent via the data bus 406 by adding the parity bit 144 generated by the parity generation circuit 608 to the cell activated by the address decoder 602. Stores data 142.
  • the read / write circuit 606 When reading data, the read / write circuit 606 reads the data (data 142 and parity bit 144) stored in the cell activated by the address decoder 602 and outputs the data to the data bus 406. Further, the read / write circuit 606 outputs the read data (data 142 and the parity bit 144) to the parity check circuit 610. The read / write circuit 606 may output only the data 142 to the data bus 406.
  • the parity check circuit 610 is connected to the processor 102 via the error bus 408.
  • the parity check circuit 610 checks whether or not an error has occurred in the data output from the read / write circuit 606 by a parity check. For example, when the data 142 at the time of writing is destroyed by cosmic ray neutrons or the like, it is destroyed in 1-bit units. Since it is unlikely that the data 142 to which the parity bit 144 is assigned is destroyed by two or more bits by cosmic ray neutrons, it is possible to detect whether or not the data 142 is destroyed by cosmic ray neutrons by performing a parity check. Since the method of parity check is a conventional technique, detailed description thereof will be omitted.
  • the parity check circuit 610 outputs the presence / absence of a data error and the address output from the address decoder 602 (the address of the cell for which the parity check has been performed) to the error bus 408.
  • the parity check circuit 610 may output the occurrence of the data error and the address to the error bus 408 only when a data error has occurred.
  • the configuration shown in FIG. 2 is an example, and the configuration is not limited to the configuration shown in FIG. 2 as long as it is a volatile memory having a circuit for detecting a data error. Further, the method for detecting a data error is not limited to the parity check, and any method can be applied.
  • the processor 102 and the flash memory 108 are connected via the address bus 410, the control bus 412, and the data bus 414.
  • the processor 102 executes the system program 112 via these buses. Further, the processor 102 appropriately expands the program from the flash memory 108 to the main memory 106 via these buses, and executes the user program 114.
  • FIG. 3 is a flowchart for explaining an example of the processing executed by the processor 102. In the following, the step is simply referred to as "S". The flowchart shown in FIG. 3 is realized by the processor 102 executing the system program 112. The flowchart shown in FIG. 3 is executed when power is supplied to the control device 100.
  • the processor 102 expands the user program 114 into the main memory 106.
  • the data 142 in which the parity bit 144 is added to the memory cell 604 of the main memory 106 is stored.
  • the processor 102 fetches the instruction to be executed from the main memory 106. More specifically, the access interface 220 outputs an address in which data corresponding to the instruction to be executed is stored to the address bus 402 according to the instruction of the access control unit 204, and outputs a signal requesting the control bus 404 to read. Output.
  • the main memory 106 responds to the read request from the processor 102 by outputting the data 142 at the specified address and the result of the parity check for the data 142 at the specified address.
  • the address decoder 602 activates the cell of the address output to the address bus 402, and also outputs the address to the parity check circuit 610.
  • the read / write circuit 606 receives the signal requesting read and outputs the data 142 and the parity bit 144 of the activated cell to the data bus 406 and the parity check circuit 610.
  • the parity check circuit 610 checks for the presence or absence of an error in the data 142 based on the data 142 and the parity bit 144, and outputs the check result and the address of the checked data 142 to the error bus 408.
  • the data 142 sent via the data bus 406 is stored in the instruction register 212.
  • the address of the checked data 142 among the data sent via the error bus 408 is stored in the error address register 208.
  • the check result of the data sent via the error bus 408 is stored in the error status register 210.
  • the processor 102 determines whether or not there is an error. Specifically, the processor 102 determines based on the check result stored in the error status register 210.
  • the processor 102 restores the data in S108. Specifically, the access control unit 204 controls the access interface 220 so that the data of the address stored in the error address register 208 is reloaded from the flash memory 108 to the main memory 106.
  • the access control unit 204 identifies the address in the flash memory 108 in which the data of the address is stored, based on the address stored in the error address register 208.
  • the access interface 220 outputs the specified address to the address bus 410 and a signal requesting reading to the control bus 412 according to the instruction of the access control unit 204.
  • the access interface 220 writes the address where the data 142 to be restored is stored to the address bus 402 and the data output by the flash memory 108 in response to the read request to the data bus 406 according to the instruction of the access control unit 204. Is output to the control bus 404, respectively.
  • the main memory 106 receives a signal requesting writing from the processor 102, and the data 142 and the parity bit 144 sent via the data bus 406 are written to the address specified via the address bus 402. As a result, the erroneous data will be restored.
  • the processor 102 clears the data in the error address register 208 and the error status register 210. After executing the process of S110, the processor 102 executes the processes of S104 and S106 again, and confirms that the parity error has been resolved by restoring the data.
  • the processes of S108 and S110 are repeated until it is determined that there is no error.
  • the processor 102 may stop the execution of the user program 114 and notify the user of the error.
  • the data sent via the error bus 408 is stored in the error address register 208 and the error status register 210. It should be noted that even if it is determined whether or not there is an error based on the data sent via the error bus 408, and if there is an error, the data is stored in the error address register 208 and the error status register 210. Good.
  • the processor 102 executes the fetched instruction in S112. Specifically, the instruction execution unit 202 of the processor 102 executes the instruction indicated by the data 142 stored in the instruction register 212.
  • the processor 102 determines whether or not the user program 114 has been executed for one cycle. When it is determined that the user program 114 has not been executed for one cycle (NO in S114), the processor 102 switches the process to S126.
  • the processor 102 fetches the data 142 as a dummy from the main memory 106.
  • the processor 102 updates the address read by the dummy. Specifically, the processor 102 sequentially updates the address regardless of the execution result of the instruction, and repeats the processes of S118 to S124, so that when the user program 114 is executed for a plurality of cycles, all the addresses in the memory cell 604 are executed. Data 142 is read at least once. That is, the processor 102 updates the address to be read by the dummy so that the data stored in the memory cell 604 is read in a predetermined order.
  • the processor 102 specifies the address in which the instruction to be executed next is stored according to the result of the instruction executed in S112.
  • the processor 102 executes the user program 114 by repeating the processes of S104 to S126.
  • Some of the instructions that make up the user program 114 are executed infrequently. If the processes S116 to S124 are not executed, the data for executing the instruction with low execution frequency will not be checked for a long period of time. Moreover, the parity check can detect only a 1-bit error. Therefore, if it is left unchecked for a long period of time and a destruction of 2 bits or more occurs, the destruction cannot be detected.
  • the data 142 stored in the main memory 106 is read at least once, so that the data for executing the infrequently executed instruction is executed. Can be prevented from being left unchecked for a long period of time.
  • timing for reading the data separately from the execution of the instruction is after the execution of the user program 114 for one cycle (S116), but the timing is not limited to this.
  • the timing for reading the data separately from the execution of the instruction may be, for example, after the execution of the user program 114 for a plurality of cycles, or after the execution of the plurality of instructions.
  • the timing of reading the data separately from the execution of the instruction may be during the execution of the user program 114.
  • the amount of data read in S116 is arbitrary and is not limited.
  • the memory for holding the backup data 160 used for data restoration is the flash memory 108, which is a non-volatile memory. That is, in the above embodiment, the data for holding the power failure stored in the non-volatile memory such as the flash memory 108 is used as the backup data. Therefore, it is not necessary to newly prepare data for backup, and the memory can be reduced.
  • the backup data 160 may be held separately from the data for holding the power failure.
  • the backup data 160 may be stored in a volatile memory such as the main memory 106 separately from the user data 140.
  • the time required for restoration can be shortened.
  • the backup data 160 may be stored in the main memory 106, or may be stored in another volatile memory different from the main memory 106.
  • the processor 102 reads the user program 114 into the memory that holds the backup data 160 when the user program 114 is expanded to the main memory 106.
  • the data of the user program 114 is updated with the execution of the instruction.
  • the data of the user program 114 may change dynamically as the instruction is executed.
  • the backup data 160 is also configured to be updated in the same manner as the data for execution.
  • the number of accesses to the backup data 160 increases. Therefore, when the user program 114 changes dynamically, it is preferable to store the backup data 160 in the volatile memory separately from the data for holding the power failure.
  • FIG. 4 shows a modified example of the processing executed by the processor 102.
  • FIG. 4 common step numbers are assigned to the processes common to those in FIG.
  • the process shown in FIG. 4 is different from the process shown in FIG. 3 in that the processes of S103, S113-1 and S113-2 are newly executed as the processes of S108'and S120'instead of S108 and S120.
  • processing different from the processing shown in FIG. 3 will be mainly described.
  • the processor 102 stores the backup data 160 in the main memory. That is, the processor 102 stores the user data 140 and the same backup data 160 as the user data 140 in the memory cell 604 of the main memory 106.
  • the process of S108' is different from the process of S108 in that the data referred to when reloading is not the data stored in the flash memory 108 but the backup data 160 stored in the main memory 106. (See FIG. 5).
  • the difference between the processing of S120'and the processing of S120 is common to the difference between the processing of S108'and the processing of S108.
  • the processor 102 determines whether or not there is a change in data. If there is a change in the data, it is necessary to rewrite the data. That is, by determining whether or not the data has been changed, it is determined whether or not the data needs to be rewritten. Specifically, the processor 102 determines whether or not the data has been changed as a result of the instruction executed in S112.
  • the processor 102 When there is a change in data (YES in S113-1), that is, when it is necessary to rewrite the data, the processor 102 rewrites the user data 140 and the backup data 160 in S113-2. When there is no change in the data (NO in S113-1), that is, when it is not necessary to rewrite the data, the processor 102 executes the processing after S114 without executing the processing in S113-2.
  • FIG. 5 is a schematic diagram of reading / writing / restoring data when the process shown in FIG. 4 is executed.
  • User data 140 for execution and backup data 160 are stored in the memory cell 604, respectively.
  • data is written to both the user data 140 and the backup data 160 (S113-2 in FIG. 4).
  • the backup data 160 is used to restore the data of the user data 140 (S108', S120' in FIG. 4). Further, when reading the data, it is read from the user data 140 and not from the backup data 160 (S104 in FIG. 4).
  • the backup data 160 will be destroyed, but the probability that both the user data 140 and the backup data 160 will be destroyed is extremely low. Therefore, it is less necessary to consider that the backup data 160 is destroyed.
  • a volatile memory for storing the backup data 160 may be separately provided.
  • only the user data 140 may be checked separately from the execution of the instruction, or the backup data 160 may be checked in addition to the user data 140. ..
  • the processor 102 when the data is restored in S108'and S120', the processor 102 also checks the data of the backup data 160, and if there is an error, notifies the error that the restoration cannot be performed. It may be configured as.
  • FIG. 6 is a diagram showing an example of log data.
  • the processor 102 leaves the date when the error is detected, the address where the data in which the error is stored, the data 142 before restoration, and the data 142 after restoration as log data 180. ..
  • the processor 102 includes the date and time when the error was detected, the data in which the error occurred, and the address where the data is stored. And may be left as log data.
  • the user can analyze the frequency at which the parity check error occurs, the cause of the occurrence, etc. by checking the log data 180.
  • the method for determining the presence or absence of an error is a parity check method. This is because volatile memories with an error detection function on the market often determine the presence or absence of an error by a parity check, so parity is an example of a method for determining the presence or absence of an error. I mentioned the check method.
  • the method for determining whether or not an error has occurred is not limited to this. In consideration of cost, it is preferable to provide the control device 100 with a volatile memory having a parity check function that is generally distributed in the market.
  • the backup data 160 may include data different from the user program 114, such as parameters necessary for executing the user program 114.
  • a control device for controlling a controlled object.
  • An instruction execution unit (202, 202X) that sequentially executes instructions included in a user program, and Volatile memory (106, 106X) for storing the user program and A backup memory (108,110X, 106) for storing a backup user program having the same contents as the user program stored in the volatile memory, and
  • An access control unit (204, 204X) that reads an instruction included in the user program from the volatile memory and provides the instruction to the instruction execution unit according to a predetermined execution order is provided.
  • the volatile memory adds information for error detection (144, 144X) to store data (142), and in response to a read request, data in a designated area and the designated area.
  • the control device is configured to respond (606, 608, 610) whether or not an error has occurred in the specified area, which is determined based on the corresponding error detection information.
  • an error occurs when the volatile memory responds that an error has occurred in the area where the read instruction is stored.
  • the control device is configured to reload the data in the area to be loaded from the backup memory into the volatile memory and read the instruction from the volatile memory again (S104, S106, S108, S108').
  • ⁇ Structure 2> The control device according to configuration 1, wherein the volatile memory is configured to respond with or without occurrence of an error by a parity check (610).
  • the access control unit reads the data stored in the volatile memory in a predetermined order and at a predetermined timing, separately from the reading for the purpose of providing the instruction to the instruction execution unit.
  • the volatile memory responds that an error has occurred in the area where the read data is stored, the data including the instruction stored in the backup memory is transferred from the backup memory to the volatile memory. (S116, S118, S120, S120', S124), the control device according to the configuration 1 or 2.
  • the backup memory is a memory (108) that non-volatilely stores the user program for backup.
  • the control device according to any one of configurations 1 to 3, wherein the user program stored in the volatile memory is loaded from the backup memory (S102).
  • the backup memory is a memory for volatilely storing the user program for backup (106).
  • the access control unit rewrites the data stored in the volatile memory and the data stored in the backup memory ( S113-1, S113-2), the control device according to any one of configurations 1 to 3.
  • ⁇ Structure 6> A method of controlling the execution of a user program in a control device for controlling a controlled object.
  • the control device (100, 100X) is Volatile memory (106, 106X) for storing the user program and A backup memory (108,110X, 106) for storing a backup user program having the same contents as the user program stored in the volatile memory is provided.
  • the volatile memory adds information for error detection (144, 144X) to store data (142), and in response to a read request, data in a designated area and the designated area. It is configured to respond (606, 608, 610) whether or not an error has occurred in the specified area, which is determined based on the corresponding error detection information.
  • a method for controlling execution of a user program comprising a step (S112) of executing an instruction read from the volatile memory.
  • the control device (100, 100X) is Volatile memory (106, 106X) for storing user programs and A backup memory (108,110X, 106) for storing a backup user program having the same contents as the user program stored in the volatile memory is provided.
  • the volatile memory adds information for error detection (144, 144X) to store data (142), and in response to a read request, data in a designated area and the designated area. It is configured to respond (606, 608, 610) whether or not an error has occurred in the specified area, which is determined based on the corresponding error detection information.
  • the system program is sent to the processor (102) of the control device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)
  • Detection And Correction Of Errors (AREA)
  • Retry When Errors Occur (AREA)
  • Stored Programmes (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

メモリに生じる誤りの検出および復元に要する時間を短縮する。揮発性メモリ(106X)は、誤り検出用の検出用情報(144X)を付加してデータ(142)を格納するとともに、読み出し要求に応じて、指定されたアドレスのデータ、および、指定されたアドレスに対応する検出用情報に基づいて決定される指定された領域における誤りの発生有無、を応答するように構成されている。アクセス制御部(204X)は、揮発性メモリ(106X)から命令を読み出した場合に、読み出した命令を格納していた領域に誤りが発生していることが揮発性メモリ(106X)から応答されると、誤りが発生している領域のデータをバックアップメモリ(110X)から揮発性メモリ(106X)にロードしなおし、揮発性メモリ(106X)から命令を再度読み出す。

Description

制御装置、ユーザプログラムの実行制御方法、およびシステムプログラム
 本発明は、制御対象を制御するためにユーザプログラムを実行する制御装置と、当該制御装置におけるユーザプログラムの実行制御方法と、当該制御装置を実現するためのシステムプログラムに関する。
 様々な製造現場において、PLC(Programmable Logic Controller)などの制御装置が導入されている。このような制御装置は、一種のコンピュータであり、RAM(Random Access Memory)などの揮発性メモリと、CPU(Central Processing Unit)などのプロセッサとを備える。揮発性メモリは、製造装置または製造設備などに応じて設計されたユーザプログラムを格納する。プロセッサは、揮発性メモリに格納されたユーザプログラムを構成する命令を順番に読み込み、逐次実行する。
 揮発性メモリに格納されたユーザプログラムを実行する場合に、ユーザプログラムのデータが放射線の影響を受けて1ビット単位で破壊され、揮発性メモリにソフトエラーが発生することがある。このように、ユーザプログラムのデータが破壊されてソフトエラーが発生することがあるため、ソフトエラーの検出、および、検出したソフトエラーを修正する機能を制御装置に対して設けることが望まれている。
 特開2004-220580号公報(特許文献1)は、ユーザプログラムが格納されるユーザプログラムメモリに加えて、ユーザプログラムメモリに格納されたユーザプログラムと同一内容のデータが格納されたバックアップメモリとを備えたプログラマブルコントローラ用ユニットを開示する。このプログラマブルコントローラ用ユニットは、バックアップメモリとユーザプログラムメモリの内容を比較することで異常を検知し、異常を検知した場合にユーザプログラムメモリに格納されたユーザプログラムをバックアップメモリに格納されたデータに基づいて修復する。
特開2004-220580号公報
 特許文献1に開示されたエラーの検知方法は、2つのメモリを互いに比較することでエラーを検知するため、比較結果を得るまでに時間がかかるという課題がある。
 本発明は、メモリに生じる誤りの検出および復元に要する時間を短縮することを目的とする。
 本開示の一例によれば、制御対象を制御するための制御装置が提供される。制御装置は、ユーザプログラムに含まれる命令を順次実行する命令実行部と、ユーザプログラムを格納する揮発性メモリと、揮発性メモリに格納されたユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリと、所定の実行順序に従って、ユーザプログラムに含まれる命令を揮発性メモリから読み出して命令実行部へ提供するアクセス制御部とを含む。揮発性メモリは、誤り検出用の情報を付加してデータを格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、指定された領域に対応する誤り検出用の情報に基づいて決定される指定された領域における誤りの発生有無、を応答するように構成されている。アクセス制御部は、揮発性メモリから命令を読み出した場合に、読み出した命令を格納していた領域に誤りが発生していることが揮発性メモリから応答されると、誤りが発生している領域のデータをバックアップメモリから揮発性メモリにロードしなおし、揮発性メモリから命令を再度読み出すように構成されている。
 本開示によれば、指定された領域の誤りの検出を誤り検出用の情報に基づいて誤りの発生有無が決定されるため、メモリ間を比較して誤りの発生を検知する場合に比べて、処理にかかる時間を短縮することができる。
 上述の開示において、揮発性メモリは、パリティチェックにより誤りの発生有無を応答するように構成されていてもよい。この構成によれば、1ビット単位の誤りを検知することができる。
 上述の開示において、アクセス制御部は、命令実行部に命令を提供することを目的とした読み出しとは別に、揮発性メモリに格納されたデータを予め定められた順番に予め定められたタイミングで読み出し、読み出したデータを格納していた領域に誤りが発生していることが揮発性メモリから応答されると、バックアップメモリに格納されている命令を含むデータをバックアップメモリから揮発性メモリにロードしなおす。
 この開示によれば、命令の実行順序によっては、呼び出される頻度が極めて低い命令にかかるデータに対しても、定期的に誤り検出と誤りの復元とが実行される。
 上述の開示において、バックアップメモリは、バックアップ用のユーザプログラムを不揮発的に格納するメモリであってもよい。この場合に、揮発性メモリに格納されるユーザプログラムは、バックアップメモリからロードされる。
 この開示によれば、電断用のメモリをバックアップメモリに用いることができるため、バックアップメモリを別途用意する必要がなく、メモリ容量を削減することができる。
 上述の開示において、バックアップメモリは、バックアップ用のユーザプログラムを揮発的に格納するメモリであってもよい。アクセス制御部は、命令の実行に伴って揮発性メモリに格納されたデータの書き換えが必要な場合、揮発性メモリに格納されたデータおよびバックアップメモリに格納されたデータを書き換える。
 この開示によれば、揮発性メモリに格納されたデータに加えてバックアップメモリに格納されたデータを書き換えることで、データの書き換えが生じる命令を含むユーザプログラムのソフトエラーにも対応することができる。
 本開示の別の一例によれば、制御対象を制御するための制御装置におけるユーザプログラムの実行制御方法が提供される。制御装置は、ユーザプログラムを格納する揮発性メモリと、揮発性メモリに格納されたユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリとを含む。揮発性メモリは、誤り検出用の情報を付加してデータを格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、指定された領域に対応する誤り検出用の情報に基づいて決定される指定された領域における誤りの発生有無、を応答するように構成されている。ユーザプログラムの実行制御方法は、所定の実行順序に従って、ユーザプログラムに含まれる命令を揮発性メモリから読み出すステップと、揮発性メモリから命令を読み出した場合に、読み出した命令を格納していた領域に誤りが発生していることが揮発性メモリから応答されると、誤りが発生している領域のデータをバックアップメモリから揮発性メモリにロードしなおし、揮発性メモリから命令を再度読み出すステップと、揮発性メモリから読み出した命令を実行するステップとを含む。
 この開示によれば、指定された領域の誤りの検出を誤り検出用の情報に基づいて誤りの発生有無が決定されるため、メモリ間を比較して誤りの発生を検知する場合に比べて、処理にかかる時間を短縮することができる。
 本開示のさらに別の一例によれば、制御対象を制御するための制御装置を実現するためのシステムプログラムが提供される。制御装置は、ユーザプログラムを格納する揮発性メモリと、揮発性メモリに格納されたユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリとを含む。揮発性メモリは、誤り検出用の情報を付加してデータを格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、指定された領域に対応する誤り検出用の情報に基づいて決定される指定された領域における誤りの発生有無、を応答するように構成されている。システムプログラムは制御装置のプロセッサに、所定の実行順序に従って、ユーザプログラムに含まれる命令を揮発性メモリから読み出すステップと、揮発性メモリから命令を読み出した場合に、読み出した命令を格納していた領域に誤りが発生していることが揮発性メモリから応答されると、誤りが発生している領域のデータをバックアップメモリから揮発性メモリにロードしなおし、揮発性メモリから命令を再度読み出すステップと、揮発性メモリから読み出した命令を実行するステップとを実行させる。
 この開示によれば、指定された領域の誤りの検出を誤り検出用の情報に基づいて誤りの発生有無が決定されるため、メモリ間を比較して誤りの発生を検知する場合に比べて、処理にかかる時間を短縮することができる。
 本発明によれば、メモリに生じる誤りの検出および復元に要する時間を短縮することができる。
本開示の適用例を模式的に説明するための図である。 制御装置100の構成を模式的に示した図である。 プロセッサ102が実行する処理の一例を説明するためのフローチャートである。 プロセッサ102が実行する処理の変形例を示す。 図4に示した処理を実行したときのデータの読出/書込/復元の模式図である。 ログデータの一例を示す図である。
 以下、図面を参照しつつ、本発明に従う各実施の形態について説明する。以下の説明では、同一の部品および構成要素には同一の符号を付してある。それらの名称および機能も同じである。したがって、これらについての詳細な説明は繰り返さない。なお、以下で説明される各実施の形態および各変形例は、適宜選択的に組み合わせてもよい。
 §1.適用例
 図1を参照して、本発明が適用される場面の一例について説明する。図1は、本開示の適用例を模式的に説明するための図である。図1を参照して、本開示に係る制御装置100Xは、例えば、PLC(プログラマブルコントローラ)と称される産業用のコントローラに相当し、図示しない各種の製造設備や機械を制御する。制御装置100Xによる制御においては、センサなどを用いて必要な情報を取得し、制御装置100Xで実行されるプログラムに従って、それらの取得された情報を用いて予め定められた制御演算を実行することで、制御出力を算出する。
 制御装置100Xは、命令実行部202Xと、揮発性メモリ106Xと、バックアップメモリ110Xと、アクセス制御部204Xとを含む。
 命令実行部202Xは、ユーザプログラム114に含まれる命令を順次実行する。ユーザプログラム114は、制御対象を制御することを目的として作成されたプログラム、制御装置100と通信可能な他の装置(たとえば、データベース、他の制御装置、HMI(Human Machine Interface)など)との間でデータの送受信を行うためのプログラムなど、任意のアプリケーションを実現するためのプログラムである。
 アクセス制御部204Xは、所定の実行順序に従って、メインメモリ106からユーザプログラム114に含まれる命令を読み出して命令実行部202Xに提供する。
 命令実行部202Xおよびアクセス制御部204Xは、たとえば、制御装置100のプロセッサが、制御装置の基本的な機能を実現するためのシステムプログラムを実行することで実現される機能である。なお、命令実行部202Xおよびアクセス制御部204Xの機能の一部または全部を、専用のハードウェア回路(例えば、ASIC(Application Specific Integrated Circuit)またはFPGA(Field-Programmable Gate Array)など)を用いて実装してもよい。たとえば、命令実行部202Xの機能を専用のハードウェア回路を用いて実装し、アクセス制御部204Xの機能を制御装置100Xのプロセッサがシステムプログラムを実行することで実現してもよい。
 揮発性メモリ106Xは、ユーザプログラム114を揮発的に格納する。揮発性メモリ106Xに格納されたユーザプログラム114は、実行用のプログラムであって、ユーザデータ140である。
 バックアップメモリ110Xは、揮発性メモリ106Xに格納されたユーザプログラム114と同一内容のバックアップ用のユーザプログラム114であるバックアップデータ160を格納する。バックアップメモリ110Xは、揮発性のメモリであっても、不揮発性のメモリであってもよい。
 バックアップデータ160は、ユーザデータ140が破壊された際に当該ユーザデータ140を復元するために利用される。たとえば、ユーザデータ140が宇宙線中性子などにより破壊された場合に、揮発性メモリ106Xにバックアップデータ160をロードしなおすことで、破壊されたデータを復元する。
 揮発性メモリ106Xは、誤り検出機能を搭載したメモリであって、具体的には、データ142を格納する際に、データ142に誤り検出用の情報(検出用情報144X)を付加して格納する。また、揮発性メモリ106Xは、読み出し要求に応じて、指定された領域のデータを出力する場合に、指定された領域に誤りの発生有無を合わせて出力する。誤りの発生有無は、検出用情報144Xに基づいて決定される。誤りの発生有無は、たとえば、従来から知られているパリティチェックに従って決定される。
 アクセス制御部204Xは、読み出した命令を格納していた領域に誤りが発生していることが揮発性メモリ106Xから応答されると、誤りが発生している領域のデータについて、バックアップメモリ110Xから揮発性メモリ106Xにロードしなおす。アクセス制御部204Xは、ロードしなおした後、揮発性メモリ106Xから命令を再度読み出す。
 このように、指定された領域の誤りの検出を誤り検出用の情報に基づいて誤りの発生有無が決定されるため、メモリ間を比較して誤りの発生を検知する場合に比べて、処理にかかる時間を短縮することができる。
 また、データの誤りを検出する機能を備えた揮発性メモリは、市場に一般的に流通している。本開示に係る制御装置100Xは、このような一般的に流通している揮発性メモリ106Xを利用しつつ、誤りが発生している場合に揮発性メモリ106Xから命令を再度読み出す処理をプロセッサに実行させるように構成すればよく、容易に実現することが可能である。
 また、データの誤りをハードウェア的に検知し、かつ訂正する機能を有するメモリが存在するが、このようなメモリは高価である。本開示に係る制御装置100Xは、誤り検出機能のみを備えるメモリを利用することでも実現可能であるため、コストを抑えて実現することが可能である。
 なお、揮発性メモリ106Xは、データの誤りをハードウェア的に検知し、かつ訂正する機能を有するメモリであってもよい。この場合、たとえば、メモリによりデータの訂正ができない場合であっても、プロセッサの処理としてデータをロードしなおすように構成することで、メモリが備える訂正機能を補うことができる。
 また、本開示にかかる制御装置100Xは、命令を実行する前に、データをロードしなおすため、誤ったデータに従って命令が実行されることを防止することができる。
 また、命令を実行した後に、誤ったデータをロードしなおす場合には、誤ったデータに従って命令を実行して更新される入出力データについてもバックアップをとっておくことが望まれる。これに対して、本開示にかかる制御装置100Xは、命令を実行する前に、誤ったデータをロードしなおすため、入出力データのバックアップを必ずしもとっておく必要がなく、メモリの削減をすることができる。
 また、本開示に係る制御装置100Xは、データの読み出し要求に応じて、誤りの発生有無の応答がされる。そのため、ユーザプログラム114全体を実行した後に誤りの発生有無を行うような場合に比べてデータの誤りを早くに発見することができる。
 なお、データを復元するタイミングは、誤りの発生有無の応答がされたときであってもよく、また、誤りの発生有無の応答がされたあと、当該誤りの発生有無にかかるデータの命令を実行するときであってもよい。
 また、誤りが発生している場合、誤りが発生しているデータのみをバックアップメモリ110Xからロードしなおしてもよく、また、読み出した命令単位でデータをバックアップメモリ110Xからロードしなおしてもよく、また、ユーザプログラム114全体をロードしなおすことで誤りが発生しているデータをロードしなおしてもよい。
 なお、誤りが発生している場合にロードをしなおす場合、誤りが発生しているデータのみ、または、読み出した命令にかかるデータを読み出すようにした方が、ユーザプログラム114全体をロードしなおす場合に比べて、復元に要する時間を短縮することができる。
 §2.具体例
 <A.制御装置100の構成>
 図2は、制御装置100の構成を模式的に示した図である。図2においては、制御装置100の中心的な処理を行う構成の一部を示している。
 図2を参照して、制御装置100は、プロセッサ102、メインメモリ106およびフラッシュメモリ108を有する。プロセッサ102、メインメモリ106、およびフラッシュメモリ108は、ワンチップマイコンに搭載された形で制御装置100に設けられていてもよく、また、各々、別々に搭載された形で制御装置100に設けられていてもよい。
 プロセッサ102は、フラッシュメモリ108に格納されたシステムプログラム112を直接実行することで、ユーザプログラム114をメインメモリ106に展開して順次実行する。プロセッサ102は、ユーザプログラム114を読み出して、メインメモリ106に展開して実行することで、制御対象に対する制御を実現する。なお、システムプログラム112をメインメモリ106に展開して実行するような構成であってもよいが、システムプログラム112がメインメモリ106に展開されることなく直接実行されることで、制御装置100を実現するための重要なプログラムが宇宙線中性子などの放射線の影響を受けて化けることを防止することができる。
 フラッシュメモリ108は、不揮発性メモリであって、システムプログラム112およびユーザプログラム114を含む各種プログラムおよび、各種プログラムで利用される各種パラメータを保持する。本実施の形態において、フラッシュメモリ108は、メインメモリ106に展開される実行用のユーザプログラム114と同一内容のユーザプログラム114であるバックアップデータ160を格納するバックアップメモリとして機能する。
 システムプログラム112は、ファームウェアであって、制御装置100を実現するためのプログラムである。ユーザプログラム114は、システムプログラム112以外のプログラムであって、たとえば、制御対象を制御することを目的として作成されたプログラム、制御装置100と通信可能な他の装置(たとえば、データベース、他の制御装置、HMIなど)との間でデータの送受信を行うためのプログラムなどを含み得る。
 なお、システムプログラム112、およびシステムプログラム112以外のユーザプログラム114などのデータを、互いに異なる不揮発性メモリに格納するように構成してもよい。この場合に、メインメモリ106に展開することなく直接実行されるシステムプログラム112は高速のフラッシュメモリに格納し、書き換え頻度の高いユーザプログラム114等のデータについては別の不揮発性メモリに格納してもよい。
 メインメモリ106は、揮発性メモリであって、プロセッサ102がユーザプログラム114を実行するときの実行用のユーザデータ140を保持する。
 なお、図2に記載していないものの、制御装置100は、他の装置と通信するためのインターフェイス、および、内部バスを通じて連結される機能ユニットとの間でデータを遣り取りするための内部バスコントローラ、メモリカードに格納されたデータの読み書きを行うためのメモリカードインターフェイスなどを備える。
 制御装置100と連結される機能ユニットとしては、I/O(Input Output)ユニット、セーフティI/Oユニット、通信ユニット、モーションコントローラユニット、温度調整ユニット、パルスカウンタユニットなどを包含し得る。
 また、制御装置100は、制御対象に関するセーフティ機能を実現するための制御演算を実行するセーフティユニットであってもよい。
 <B.プロセッサおよびメインメモリの機能構成>
 図2を参照して、プロセッサ102およびメインメモリ106の機能構成について説明する。プロセッサ102は、命令実行部202と、アクセス制御部204と、レジスタ206と、アクセスインターフェイス220とを含む。
 命令実行部202は、演算器であって、1または複数の演算回路から構成されている。命令実行部202は、メインメモリ106から読み込んだ命令を実行する。
 アクセス制御部204は、システムプログラム112が実行されることで実現される機能であって、アクセスインターフェイス220を制御することで、プロセッサ102とフラッシュメモリ108とメインメモリ106との間のデータの遣り取りを制御することで、所定の実行順序に従って、ユーザプログラム114に含まれる命令をメインメモリ106から読み出して命令実行部202へ提供する。
 レジスタ206は、エラーアドレスレジスタ208と、エラーステータスレジスタ210と、命令レジスタ212とを含み得る。プロセッサ102は、他の種類のレジスタをさらに備えていてもよい。
 エラーアドレスレジスタ208は、メインメモリ106内においてソフトエラーの発生しているエリア(アドレス)を保持する。
 エラーステータスレジスタ210は、メインメモリ106内においてソフトエラーが発生している状態にあることを保持する。
 命令レジスタ212は、命令実行部202が実行する命令を保持する。プロセッサ102は、命令レジスタ212を複数備えてもよい。
 アクセスインターフェイス220は、アクセス制御部204の指示に従って制御され、メインメモリ106およびフラッシュメモリ108との間でデータの遣り取りを行う。
 メインメモリ106は、アドレスデコーダ602と、メモリセル604と、読出/書込回路606と、パリティチェック回路610とを備える。
 アドレスデコーダ602は、アドレスバス402を介してプロセッサ102に接続されている。アドレスデコーダ602は、アドレスバス402上に出力された信号をデコードすることでアドレスを特定し、メモリセル604のうち特定したアドレスのセルを活性化させる。アドレスデコーダ602によってデコードされた結果は、パリティチェック回路610に出力される。
 メモリセル604には、実行用のユーザプログラム114であるユーザデータ140が格納される。メモリセル604には、誤り検出用の情報としてパリティビット144が付加された状態でデータ142が格納される。
 読出/書込回路606は、コントロールバス404およびデータバス406を介してプロセッサ102に接続されている。読出/書込回路606は、コントロールバス404からの制御信号に応じて、メモリセル604に対し、データの読み出しまたは書き込みを行う。
 読出/書込回路606は、パリティ生成回路608を有する。パリティ生成回路608は、データバス406を介して送信されたデータ142からパリティビット144を生成する。読出/書込回路606は、データの書き込みを行う場合、アドレスデコーダ602によって活性化されたセルに、パリティ生成回路608が生成したパリティビット144を付加して、データバス406を介して送られたデータ142を格納する。
 読出/書込回路606は、データの読み出しを行う場合、アドレスデコーダ602によって活性化されたセルに格納されたデータ(データ142およびパリティビット144)を読み出し、データバス406に出力する。また、読出/書込回路606は、読み出したデータ(データ142およびパリティビット144)をパリティチェック回路610に出力する。なお、読出/書込回路606は、データバス406にデータ142だけを出力するようにしてもよい。
 パリティチェック回路610は、エラーバス408を介してプロセッサ102に接続されている。パリティチェック回路610は、読出/書込回路606から出力されたデータに誤りが発生しているか否かをパリティチェックによりチェックする。たとえば、書き込み時のデータ142が、宇宙線中性子などにより破壊される場合、1ビット単位で破壊される。パリティビット144が付与されたデータ142が宇宙線中性子により2ビット以上破壊される可能性は低いため、パリティチェックをすることで宇宙線中性子により破壊されているか否かを検知することができる。なお、パリティチェックの方法について、従来技術であるため、詳細な説明は省略する。
 パリティチェック回路610は、データ誤りの発生有無と、アドレスデコーダ602から出力されたアドレス(パリティチェックをしたセルのアドレス)とをエラーバス408に出力する。なお、パリティチェック回路610は、データ誤りが発生している場合にのみ、データ誤りの発生と、アドレスとをエラーバス408に出力するようにしてもよい。
 なお、図2に示した構成は一例であって、データ誤りを検出するための回路を有する揮発性メモリであれば、図2に示した構成に限られない。また、データ誤りを検出する方法は、パリティチェックに限られず、任意の方法を適用可能である。
 プロセッサ102とフラッシュメモリ108とは、アドレスバス410、コントロールバス412、およびデータバス414を介して接続されている。プロセッサ102は、これらのバスを介してシステムプログラム112を実行する。また、プロセッサ102は、これらのバスを介して、適宜、フラッシュメモリ108からプログラムをメインメモリ106に展開して、ユーザプログラム114を実行する。
 <プロセッサの処理>
 図3は、プロセッサ102が実行する処理の一例を説明するためのフローチャートである。以下では、ステップは、単に「S」と記載する。図3に示すフローチャートは、プロセッサ102がシステムプログラム112を実行することで実現される。図3に示すフローチャートは、制御装置100に電源が供給されると実行される。
 S102において、プロセッサ102は、ユーザプログラム114をメインメモリ106に展開する。S102の処理により、メインメモリ106のメモリセル604にパリティビット144を付加したデータ142が格納される。
 S104において、プロセッサ102は、実行対象の命令をメインメモリ106からフェッチする。より具体的には、アクセスインターフェイス220は、アクセス制御部204の指示に従って、実行対象の命令に対応するデータが格納されたアドレスをアドレスバス402に出力し、コントロールバス404に読み出しを要求する信号を出力する。
 メインメモリ106は、プロセッサ102からの読み出し要求に対して、指定されたアドレスのデータ142と、当該指定されたアドレスのデータ142に対するパリティチェックの結果とを出力することで応答する。具体的には、アドレスデコーダ602は、アドレスバス402に出力されたアドレスのセルを活性化させ、また、アドレスをパリティチェック回路610に出力する。読出/書込回路606は、読み出しを要求する信号を受けて、活性化されているセルのデータ142およびパリティビット144をデータバス406と、パリティチェック回路610とに出力する。パリティチェック回路610は、データ142およびパリティビット144に基づいて、データ142の誤りの有無をチェックし、チェック結果と、チェックしたデータ142のアドレスとをエラーバス408に出力する。
 データバス406を介して送られたデータ142は、命令レジスタ212に格納される。エラーバス408を介して送られたデータのうちのチェックしたデータ142のアドレスは、エラーアドレスレジスタ208に格納される。エラーバス408を介して送られたデータのうちのチェック結果は、エラーステータスレジスタ210に格納される。
 S106において、プロセッサ102は、エラーがあるか否かを判定する。具体的には、プロセッサ102は、エラーステータスレジスタ210に格納されたチェック結果に基づいて判定する。
 エラーがあると判定された場合(S106においてYES)、S108において、プロセッサ102は、データを復元する。具体的には、アクセス制御部204は、エラーアドレスレジスタ208に格納されているアドレスのデータをフラッシュメモリ108からメインメモリ106に再度ロードするようにアクセスインターフェイス220を制御する。
 たとえば、アクセス制御部204は、エラーアドレスレジスタ208に格納されているアドレスに基づいて、当該アドレスのデータが格納されたフラッシュメモリ108内のアドレスを特定する。アクセスインターフェイス220は、アクセス制御部204の指示に従って、特定されたアドレスをアドレスバス410に、読み出しを要求する信号をコントロールバス412に、それぞれ出力する。
 そして、アクセスインターフェイス220は、アクセス制御部204の指示に従って、復元対象のデータ142が格納されたアドレスをアドレスバス402に、フラッシュメモリ108が読み出し要求に応じて出力したデータをデータバス406に、書き込みを要求する信号をコントロールバス404に、それぞれ出力する。
 メインメモリ106は、プロセッサ102からの書き込みを要求する信号を受けて、アドレスバス402を介して指定されたアドレスに、データバス406を介して送られたデータ142およびパリティビット144が書き込まれる。これにより、誤りのあるデータが、復元されることとなる。
 S110において、プロセッサ102は、エラーアドレスレジスタ208とエラーステータスレジスタ210のデータをクリアする。プロセッサ102は、S110の処理を実行した後、再度S104およびS106の処理を実行し、データが復元されたことでパリティエラーが解消されたことを確認する。
 図3に示す例では、エラーがないと判定されるまで、S108およびS110の処理を繰り返すものとしている。なお、S108およびS110の処理を所定回数繰り返し実行した場合には、プロセッサ102は、ユーザプログラム114の実行を停止して、エラーをユーザに対して通知するようにしてもよい。
 また、本実施の形態において、エラーバス408を介して送られたデータは、エラーアドレスレジスタ208とエラーステータスレジスタ210とに格納されるとした。なお、エラーバス408を介して送られたデータに基づいてエラーがあるか否かを判定し、エラーがある場合に、エラーアドレスレジスタ208とエラーステータスレジスタ210とにデータを格納するようにしてもよい。
 エラーがないと判定された場合(S106においてNO)、S112において、プロセッサ102は、フェッチした命令を実行する。具体的には、プロセッサ102の命令実行部202は、命令レジスタ212に格納されたデータ142が示す命令を実行する。
 S114において、プロセッサ102は、ユーザプログラム114を1サイクル分実行したか否かを判定する。ユーザプログラム114を1サイクル分実行していないと判定された場合(S114においてNO)、プロセッサ102は、S126に処理を切り替える。
 ユーザプログラム114を1サイクル分実行したと判定された場合(S114においてYES)、S116において、プロセッサ102は、データ142をダミーでメインメモリ106からフェッチする。
 S118,120,122の処理は、S106,108,110の処理と共通するため、説明を省略する。
 S118においてエラーがないと判定された場合、または、S120およびS122の処理が実行された後、S124において、プロセッサ102は、ダミーで読み出すアドレスを更新する。具体的には、プロセッサ102は、命令の実行結果に関わらず、アドレスを順次更新し、S118からS124の処理を繰り返すことで、ユーザプログラム114を複数サイクル実行したときに、メモリセル604内の全てのデータ142を少なくとも1度は読み出す。すなわち、プロセッサ102は、メモリセル604に格納されたデータを予め定められた順で読み出されるように、ダミーで読み出すアドレスを更新する。
 S126において、プロセッサ102は、S112において実行した命令の結果に応じて、次に実行する命令が格納されたアドレスを特定する。プロセッサ102は、S104~S126の処理を繰り返すことで、ユーザプログラム114を実行する。
 ユーザプログラム114を構成する命令の中には、実行頻度の低いものも存在する。S116~S124の処理を実行しなかった場合には、実行頻度の低い命令を実行するためのデータについては、長期間に亘ってチェックされないこととなる。また、パリティチェックは、1ビットの誤りしか検出することができない。そのため、長期間に亘ってチェックされることなく放置されて2ビット以上の破壊が生じている場合、当該破壊を検出することができない。
 本実施の形態においては、S116~S124が繰り返し実行されることで、メインメモリ106に格納されたデータ142が少なくとも1度は読み出されることになるため、実行頻度の低い命令を実行するためのデータが長期間に亘ってチェックされることなく放置されてしまうことを防止することができる。
 なお、命令の実行とは別にデータの読み出しをするタイミングは、ユーザプログラム114を1サイクル分実行した後としたが(S116)、これに限られない。命令の実行とは別にデータの読み出しをするタイミングは、たとえば、ユーザプログラム114を複数サイクル分実行した後であってもよく、また、複数の命令を実行した後であってもよい。また、制御装置100に複数のプロセッサが搭載されている場合には、命令の実行とは別にデータの読み出しをするタイミングは、ユーザプログラム114の実行中であってもよい。また、S116において読み出すデータの量は、任意であり、限定されるものではない。
 <変形例>
 (変形例1)
 上記実施の形態においては、データの復元に用いるバックアップデータ160を保持するメモリは、不揮発性メモリであるフラッシュメモリ108とした。すなわち、上記実施の形態においては、フラッシュメモリ108のような不揮発性メモリに格納された電断保持用のデータを、バックアップ用のデータとして用いた。そのため、新たにバックアップ用のデータを用意する必要がなく、メモリを削減することができる。
 なお、バックアップデータ160は、電断保持用のデータとは別に保持されていてもよい。たとえば、バックアップデータ160は、メインメモリ106のような揮発性メモリに、ユーザデータ140とは別に格納されていてもよい。プロセッサ102からのアクセスがフラッシュメモリ108に比べて早い揮発性メモリにバックアップデータ160を格納することで、復元にかかる時間を短縮することができる。バックアップデータ160は、メインメモリ106に格納されてもよく、また、メインメモリ106とは異なる別の揮発性メモリに格納されてもよい。
 なお、バックアップデータ160を保持するメモリを揮発性メモリとする場合、プロセッサ102は、ユーザプログラム114をメインメモリ106に展開する際に、バックアップデータ160を保持するメモリにもユーザプログラム114を読み出す。
 <変形例2>
 上記実施の形態においては、命令の実行に伴ってユーザプログラム114のデータが更新されることについて言及しなかった。なお、ユーザプログラム114によっては、命令の実行に伴って、ユーザプログラム114のデータが動的に変化することもある。このような場合には、バックアップデータ160についても、実行用のデータと同様に更新されるように構成することが好ましい。
 ユーザプログラム114の実行に伴いデータを更新する場合、バックアップデータ160へのアクセス回数が増える。そのため、ユーザプログラム114が動的に変化する場合は、電断保持用のデータとは別に揮発性メモリにバックアップデータ160を格納しておくことが好ましい。
 図4は、プロセッサ102が実行する処理の変形例を示す。図4において、図3と共通する処理には共通のステップ番号を付す。図4に示す処理は、新たにS103、S113-1およびS113-2の処理を、S108およびS120の代わりにS108’およびS120’の処理を実行する点で図3に示す処理と異なる。以下では、図3に示す処理と異なる処理を中心に説明する。
 S103において、プロセッサ102は、バックアップデータ160をメインメモリに格納する。すなわち、プロセッサ102は、メインメモリ106のメモリセル604に、ユーザデータ140と、当該ユーザデータ140と同じバックアップデータ160とを格納する。
 S108’の処理は、S108の処理と比べて、再度ロードするときに参照するデータが、フラッシュメモリ108に格納されたデータではなく、メインメモリ106に格納されているバックアップデータ160である点が異なる(図5参照)。S120’の処理とS120の処理との違いは、S108’の処理とS108の処理との違いと共通する。
 S113-1において、プロセッサ102は、データの変更があるか否かを判定する。データの変更がある場合には、データを書き換える必要がある。すなわち、データの変更があるか否かを判定することで、データを書き換える必要があるか否かが判定される。具体的には、プロセッサ102は、S112において実行した命令の結果、データの変更が生じたか否かを判定する。
 データの変更がある場合(S113-1においてYES)、すなわち、データを書き換える必要がある場合、プロセッサ102は、S113-2において、ユーザデータ140とバックアップデータ160とを書き換える。データの変更がない場合(S113-1においてNO)、すなわち、データを書き換える必要がない場合、プロセッサ102は、S113-2の処理を実行することなく、S114以降の処理を実行する。
 図5は、図4に示した処理を実行したときのデータの読出/書込/復元の模式図である。メモリセル604には、実行用のユーザデータ140と、バックアップデータ160とがそれぞれ格納されている。書き込み時は、ユーザデータ140およびバックアップデータ160の双方にデータが書き込まれる(図4のS113-2)。データを復元する場合は、バックアップデータ160を用いてユーザデータ140のデータを復元する(図4のS108’、S120’)。また、データを読み出す時は、ユーザデータ140から読み出され、バックアップデータ160からは読み出されない(図4のS104)。
 なお、バックアップデータ160が破壊されることも考えられるが、ユーザデータ140とバックアップデータ160とについて、共通のデータが両方とも破壊される確率は極めて低い。そのため、バックアップデータ160が破壊されることを考慮する必要性は低い。
 なお、バックアップデータ160とユーザデータ140とを共通のメインメモリ106に格納する例を示したが、バックアップデータ160を格納するための揮発性メモリを別途設けてもよい。
 また、S116~S124の処理を実行することで、命令の実行とは別にユーザデータ140だけをチェックするようにしてもよく、ユーザデータ140に加えてバックアップデータ160についてもチェックするようにしてもよい。
 また、S108’およびS120’においてデータの復元をする場合に、プロセッサ102は、バックアップデータ160のデータについてもチェックするようにし、エラーがある場合には、復元することができないとしてエラーを通知するように構成してもよい。
 <変形例3>
 上記実施の形態においては、パリティチェックをした結果、エラーとなった場合は、単にデータを復元するに留めたが、プロセッサ102は、エラーの情報をログとして残しても良い。
 図6は、ログデータの一例を示す図である。プロセッサ102は、エラーが発生した場合に、エラーを検出した日と、エラーとなったデータが格納されているアドレスと、復元前のデータ142と、復元後のデータ142とをログデータ180として残す。
 なお、プロセッサ102は、バックアップデータ160を残していないデータに対してエラーが検知された場合においても、当該エラーが検知された日時と、エラーが発生したデータと、当該データが格納されているアドレスとをログデータとして残しても良い。
 このように、ログデータ180を残すことで、ユーザは、ログデータ180を確認することで、パリティチェックエラーが発生している頻度、発生原因などを解析することができる。
 <その他の変形例>
 上記実施の形態において、誤りの発生有無を決定する方法は、パリティチェックによる方法とした。これは、市場に流通している誤り検出機能付きの揮発性メモリは、誤りの発生有無の決定をパリティチェックにより実現していることが多いため、誤りの発生有無を決定する方法の一例としてパリティチェックによる方法を挙げた。なお、誤りの発生有無を決定する方法は、これに限られない。なお、コストの面を考慮すると、市場に一般的に流通しているパリティチェック機能付きの揮発性メモリを制御装置100に設けることが好ましい。
 上記実施の形態において、バックアップデータ160として、ユーザプログラム114のみを格納する例を示した。なお、バックアップデータ160は、ユーザプログラム114を実行する上で必要なパラメータ等のユーザプログラム114とは別のデータを含み得る。
 §3.付記
 以上のように、上記の実施の形態および変形例は以下のような開示を含む。
 <構成1>
 制御対象を制御するための制御装置(100,100X)であって、
 ユーザプログラムに含まれる命令を順次実行する命令実行部(202,202X)と、
 前記ユーザプログラムを格納する揮発性メモリ(106,106X)と、
 前記揮発性メモリに格納された前記ユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリ(108,110X,106)と、
 所定の実行順序に従って、前記ユーザプログラムに含まれる命令を前記揮発性メモリから読み出して前記命令実行部へ提供するアクセス制御部(204,204X)とを備え、
 前記揮発性メモリは、誤り検出用の情報(144,144X)を付加してデータ(142)を格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、当該指定された領域に対応する誤り検出用の情報に基づいて決定される当該指定された領域における誤りの発生有無、を応答するように構成されており(606,608,610)、
 前記アクセス制御部は、前記揮発性メモリから命令を読み出した場合に、当該読み出した命令を格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、誤りが発生している領域のデータを前記バックアップメモリから前記揮発性メモリにロードしなおし、前記揮発性メモリから当該命令を再度読み出すように構成されている(S104,S106,S108,S108’)、制御装置。
 <構成2>
 前記揮発性メモリは、パリティチェックにより誤りの発生有無を応答するように構成されている(610)、構成1に記載の制御装置。
 <構成3>
 前記アクセス制御部は、前記命令実行部に命令を提供することを目的とした読み出しとは別に、前記揮発性メモリに格納されたデータを予め定められた順番に予め定められたタイミングで読み出し、当該読み出したデータを格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、前記バックアップメモリに格納されている当該命令を含むデータを前記バックアップメモリから前記揮発性メモリにロードしなおす(S116,S118,S120,S120’,S124)、構成1または構成2に記載の制御装置。
 <構成4>
 前記バックアップメモリは、前記バックアップ用のユーザプログラムを不揮発的に格納するメモリ(108)であって、
 前記揮発性メモリに格納される前記ユーザプログラムは、前記バックアップメモリからロードされる(S102)、構成1~構成3のうちいずれか1に記載の制御装置。
 <構成5>
 前記バックアップメモリは、前記バックアップ用のユーザプログラムを揮発的に格納するメモリであって(106)、
 前記アクセス制御部は、前記命令の実行に伴って前記揮発性メモリに格納されたデータの書き換えが必要な場合、前記揮発性メモリに格納されたデータおよび前記バックアップメモリに格納されたデータを書き換える(S113-1,S113-2)、構成1~構成3のうちいずれか1に記載の制御装置。
 <構成6>
 制御対象を制御するための制御装置におけるユーザプログラムの実行制御方法であって、
 前記制御装置(100,100X)は、
  前記ユーザプログラムを格納する揮発性メモリ(106,106X)と、
  前記揮発性メモリに格納された前記ユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリ(108,110X,106)とを備え、
 前記揮発性メモリは、誤り検出用の情報(144,144X)を付加してデータ(142)を格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、当該指定された領域に対応する誤り検出用の情報に基づいて決定される当該指定された領域における誤りの発生有無、を応答するように構成されており(606,608,610)、
 所定の実行順序に従って、前記ユーザプログラムに含まれる命令を前記揮発性メモリから読み出すステップ(S104)と、
 前記揮発性メモリから命令を読み出した場合に、当該読み出した命令を格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、誤りが発生している領域のデータを前記バックアップメモリから前記揮発性メモリにロードしなおし、前記揮発性メモリから当該命令を再度読み出すステップ(S104,S106,S108,S108’)と、
 前記揮発性メモリから読み出した命令を実行するステップ(S112)とを備える、ユーザプログラムの実行制御方法。
 <構成7>
 制御対象を制御するための制御装置を実現するためのシステムプログラムであって、
 前記制御装置(100,100X)は、
  ユーザプログラムを格納する揮発性メモリ(106,106X)と、
  前記揮発性メモリに格納された前記ユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリ(108,110X,106)とを備え、
 前記揮発性メモリは、誤り検出用の情報(144,144X)を付加してデータ(142)を格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、当該指定された領域に対応する誤り検出用の情報に基づいて決定される当該指定された領域における誤りの発生有無、を応答するように構成されており(606,608,610)、
 前記システムプログラムは前記制御装置のプロセッサ(102)に、
  所定の実行順序に従って、前記ユーザプログラムに含まれる命令を前記揮発性メモリから読み出すステップ(S104)と、
  前記揮発性メモリから命令を読み出した場合に、当該読み出した命令を格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、誤りが発生している領域のデータを前記バックアップメモリから前記揮発性メモリにロードしなおし、前記揮発性メモリから当該命令を再度読み出すステップ(S104,S106,S108,S108’)と、
  前記揮発性メモリから読み出した命令を実行するステップ(S112)とを実行させる、システムプログラム。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。また、実施の形態および各変形例において説明された発明は、可能な限り、単独でも、組み合わせても、実施することが意図される。
 100,100X 制御装置、102 プロセッサ、106 メインメモリ、106X 揮発性メモリ、108 フラッシュメモリ、110X バックアップメモリ、112 システムプログラム、114 ユーザプログラム、140 ユーザデータ、142 データ、144 パリティビット、144X 検出用情報、160 バックアップデータ、180 ログデータ、202,202X 命令実行部、204,204X アクセス制御部、206 レジスタ、208 エラーアドレスレジスタ、210 エラーステータスレジスタ、212 命令レジスタ、220 アクセスインターフェイス、402,410 アドレスバス、404,412 コントロールバス、406,414 データバス、408 エラーバス、602 アドレスデコーダ、604 メモリセル、606 読出/書込回路、608 パリティ生成回路、610 パリティチェック回路。

Claims (7)

  1.  制御対象を制御するための制御装置であって、
     ユーザプログラムに含まれる命令を順次実行する命令実行部と、
     前記ユーザプログラムを格納する揮発性メモリと、
     前記揮発性メモリに格納された前記ユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリと、
     所定の実行順序に従って、前記ユーザプログラムに含まれる命令を前記揮発性メモリから読み出して前記命令実行部へ提供するアクセス制御部とを備え、
     前記揮発性メモリは、誤り検出用の情報を付加してデータを格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、当該指定された領域に対応する誤り検出用の情報に基づいて決定される当該指定された領域における誤りの発生有無、を応答するように構成されており、
     前記アクセス制御部は、前記揮発性メモリから命令を読み出した場合に、当該読み出した命令を格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、誤りが発生している領域のデータを前記バックアップメモリから前記揮発性メモリにロードしなおし、前記揮発性メモリから当該命令を再度読み出すように構成されている、制御装置。
  2.  前記揮発性メモリは、パリティチェックにより誤りの発生有無を応答するように構成されている、請求項1に記載の制御装置。
  3.  前記アクセス制御部は、前記命令実行部に命令を提供することを目的とした読み出しとは別に、前記揮発性メモリに格納されたデータを予め定められた順番に予め定められたタイミングで読み出し、当該読み出したデータを格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、前記バックアップメモリに格納されている当該命令を含むデータを前記バックアップメモリから前記揮発性メモリにロードしなおす、請求項1または請求項2に記載の制御装置。
  4.  前記バックアップメモリは、前記バックアップ用のユーザプログラムを不揮発的に格納するメモリであって、
     前記揮発性メモリに格納される前記ユーザプログラムは、前記バックアップメモリからロードされる、請求項1~請求項3のうちいずれか1項に記載の制御装置。
  5.  前記バックアップメモリは、前記バックアップ用のユーザプログラムを揮発的に格納するメモリであって、
     前記アクセス制御部は、前記命令の実行に伴って前記揮発性メモリに格納されたデータの書き換えが必要な場合、前記揮発性メモリに格納されたデータおよび前記バックアップメモリに格納されたデータを書き換える、請求項1~請求項3のうちいずれか1項に記載の制御装置。
  6.  制御対象を制御するための制御装置におけるユーザプログラムの実行制御方法であって、
     前記制御装置は、
      前記ユーザプログラムを格納する揮発性メモリと、
      前記揮発性メモリに格納された前記ユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリとを備え、
     前記揮発性メモリは、誤り検出用の情報を付加してデータを格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、当該指定された領域に対応する誤り検出用の情報に基づいて決定される当該指定された領域における誤りの発生有無、を応答するように構成されており、
     所定の実行順序に従って、前記ユーザプログラムに含まれる命令を前記揮発性メモリから読み出すステップと、
     前記揮発性メモリから命令を読み出した場合に、当該読み出した命令を格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、誤りが発生している領域のデータを前記バックアップメモリから前記揮発性メモリにロードしなおし、前記揮発性メモリから当該命令を再度読み出すステップと、
     前記揮発性メモリから読み出した命令を実行するステップとを備える、ユーザプログラムの実行制御方法。
  7.  制御対象を制御するための制御装置を実現するためのシステムプログラムであって、
     前記制御装置は、
      ユーザプログラムを格納する揮発性メモリと、
      前記揮発性メモリに格納された前記ユーザプログラムと同一内容のバックアップ用のユーザプログラムを格納するバックアップメモリとを備え、
     前記揮発性メモリは、誤り検出用の情報を付加してデータを格納するとともに、読み出し要求に応じて、指定された領域のデータ、および、当該指定された領域に対応する誤り検出用の情報に基づいて決定される当該指定された領域における誤りの発生有無、を応答するように構成されており、
     前記システムプログラムは前記制御装置のプロセッサに、
      所定の実行順序に従って、前記ユーザプログラムに含まれる命令を前記揮発性メモリから読み出すステップと、
      前記揮発性メモリから命令を読み出した場合に、当該読み出した命令を格納していた領域に誤りが発生していることが前記揮発性メモリから応答されると、誤りが発生している領域のデータを前記バックアップメモリから前記揮発性メモリにロードしなおし、前記揮発性メモリから当該命令を再度読み出すステップと、
      前記揮発性メモリから読み出した命令を実行するステップとを実行させる、システムプログラム。
PCT/JP2020/007778 2019-08-23 2020-02-26 制御装置、ユーザプログラムの実行制御方法、およびシステムプログラム WO2021038923A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019-152913 2019-08-23
JP2019152913A JP7379932B2 (ja) 2019-08-23 2019-08-23 制御装置、ユーザプログラムの実行制御方法、およびシステムプログラム

Publications (1)

Publication Number Publication Date
WO2021038923A1 true WO2021038923A1 (ja) 2021-03-04

Family

ID=74675878

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/007778 WO2021038923A1 (ja) 2019-08-23 2020-02-26 制御装置、ユーザプログラムの実行制御方法、およびシステムプログラム

Country Status (2)

Country Link
JP (1) JP7379932B2 (ja)
WO (1) WO2021038923A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115714908A (zh) * 2021-08-20 2023-02-24 荣耀终端有限公司 工作模式的切换控制方法、电子设备及可读存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63142449A (ja) * 1986-12-04 1988-06-14 Fujitsu Ltd 制御メモリに対するパトロ−ルチエツク方式
JPH02178862A (ja) * 1988-12-29 1990-07-11 Nec Corp 情報処理装置
JP2003131955A (ja) * 2001-10-19 2003-05-09 Kyocera Corp データバックアップ回路

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5605507B2 (ja) 2011-06-14 2014-10-15 富士通株式会社 メモリ制御装置および制御方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63142449A (ja) * 1986-12-04 1988-06-14 Fujitsu Ltd 制御メモリに対するパトロ−ルチエツク方式
JPH02178862A (ja) * 1988-12-29 1990-07-11 Nec Corp 情報処理装置
JP2003131955A (ja) * 2001-10-19 2003-05-09 Kyocera Corp データバックアップ回路

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115714908A (zh) * 2021-08-20 2023-02-24 荣耀终端有限公司 工作模式的切换控制方法、电子设备及可读存储介质

Also Published As

Publication number Publication date
JP7379932B2 (ja) 2023-11-15
JP2021033623A (ja) 2021-03-01

Similar Documents

Publication Publication Date Title
JP4868216B2 (ja) ファームウェア更新回路およびファームウェア更新方法
EP2770507B1 (en) Memory circuits, method for accessing a memory and method for repairing a memory
JP4834721B2 (ja) メモリ制御装置およびメモリ制御方法
CN107463516B (zh) 控制装置
JP2016167669A (ja) プログラマブル論理回路装置及びそのエラー検出方法
CN114328316A (zh) Dma控制器、soc系统及基于dma控制器的数据搬运方法
JP2008287351A (ja) メモリシステム、メモリコントローラ、制御方法及び制御プログラム
WO2021038923A1 (ja) 制御装置、ユーザプログラムの実行制御方法、およびシステムプログラム
WO2017162049A1 (zh) 驱动模块内存数据监测方法及装置
EP2370899B1 (en) Poison bit error checking code scheme
US11018693B2 (en) System and method for continuously verifying device state integrity
JP2013175118A (ja) 制御装置、及びそのメモリ故障検出方法、その自己診断方法
US8595442B1 (en) Redundantly validating values with a processor and a check circuit
JP2010181990A (ja) データプロセッサ
JP6332134B2 (ja) メモリ診断回路
El-Bayoumi An enhanced algorithm for memory systematic faults detection in multicore architectures suitable for mixed-critical automotive applications
JP5964265B2 (ja) 半導体集積回路装置
EP2352092B1 (en) Processor, information processing apparatus, and method of controlling processor
JP2004038541A (ja) メモリチェックシステムおよびメモリチェック方法、信号処理装置および信号処理装置のメモリチェック方法、ならびに、メモリチェックプログラム
US20240134743A1 (en) Electronic device, electronic system, method for operating an electronic device, and method for operating an electronic system
JP7142731B2 (ja) プログラマブルデバイス
JP4543505B2 (ja) マイクロコンピュータの制御方法及び異常監視装置
JP5645262B2 (ja) 情報処理装置
US20240142518A1 (en) Selecting an Output as a System Output Responsive to an Indication of an Error
JP2017059017A (ja) メモリアクセス部を備える制御装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20858859

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20858859

Country of ref document: EP

Kind code of ref document: A1