WO2017212549A1 - シミュレーション装置およびシミュレーションプログラム - Google Patents

シミュレーション装置およびシミュレーションプログラム Download PDF

Info

Publication number
WO2017212549A1
WO2017212549A1 PCT/JP2016/066932 JP2016066932W WO2017212549A1 WO 2017212549 A1 WO2017212549 A1 WO 2017212549A1 JP 2016066932 W JP2016066932 W JP 2016066932W WO 2017212549 A1 WO2017212549 A1 WO 2017212549A1
Authority
WO
WIPO (PCT)
Prior art keywords
execution
input
output
simulation
instruction
Prior art date
Application number
PCT/JP2016/066932
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 三菱電機株式会社
Priority to PCT/JP2016/066932 priority Critical patent/WO2017212549A1/ja
Priority to JP2016561863A priority patent/JP6076576B1/ja
Priority to TW105123705A priority patent/TW201743149A/zh
Publication of WO2017212549A1 publication Critical patent/WO2017212549A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present invention relates to a technique for performing a simulation.
  • IO is an abbreviation for Input and Output.
  • the instruction set simulation is a technique for simulating the execution of instructions and the operation of a program counter by an ISS (Instruction Set Simulator).
  • the IO simulation is a technique for simulating operations of input / output devices such as a keyboard, a display, and a communication device. When these simulations are executed in the same thread, the simulations are switched in the same thread. When these simulations are executed by different threads, the threads cooperate with each other by thread calling, and these simulations are executed.
  • the error factor often exists near the instruction at the time of the error occurrence. Therefore, it is considered that the error factor can be easily identified if the reverse simulation execution that executes the instructions in reverse order can be performed. Since it is not necessary to re-execute the simulation from the beginning by reverse execution of the simulation, it is possible to reduce the time required for executing the simulation when specifying the error factor. Furthermore, it is no longer necessary to narrow down the cause of error by relying on experience and intuition.
  • Patent Document 1 and Patent Document 2 disclose techniques related to reverse execution of instruction set simulation. However, these patent documents do not disclose or suggest reverse execution of simulation when instruction set simulation and IO simulation are linked. Therefore, even if the techniques described in these patent documents are used, it is impossible to realize reverse simulation execution when instruction set simulation and IO simulation are linked.
  • An object of the present invention is to enable simulation of a target system by linking instruction set simulation and IO simulation.
  • the simulation apparatus of the present invention Execution simulation that functions as an execution simulator that simulates execution of the target program by the target system based on a target program that is a program that includes a plurality of execution instructions and that is executed by a target system having an input / output device And And an input / output simulation unit that functions as an input / output simulator for simulating the operation of the input / output device when execution of the input / output instruction of the plurality of execution instructions is simulated.
  • FIG. 1 is a configuration diagram of a simulation apparatus 100 according to Embodiment 1.
  • FIG. FIG. 3 is a configuration diagram of a storage unit 191 in the first embodiment.
  • FIG. 3 is a configuration diagram of an execution log file 220 according to the first embodiment.
  • FIG. 3 is a configuration diagram of a resource log file 230 according to the first embodiment.
  • FIG. 3 is a configuration diagram of an input / output log file 250 according to the first embodiment.
  • 3 is a flowchart of a simulation method according to the first embodiment.
  • 5 is a flowchart of execution simulation processing [sequential execution] in the first embodiment.
  • 5 is a flowchart of execution log generation processing according to the first embodiment.
  • 7 is a flowchart of input / output simulation processing [sequential execution] in the first embodiment.
  • 5 is a flowchart of input / output log generation processing according to the first embodiment.
  • 5 is a flowchart of resource log generation processing according to the first embodiment.
  • 5 is a flowchart of input / output restoration processing according to the first embodiment.
  • FIG. The figure which shows the specific example of the reverse execution method (S300) in Embodiment 1.
  • FIG. The figure which shows the specific example of the reverse execution method (S300) in Embodiment 1.
  • Embodiment 1 A simulation apparatus 100 that simulates execution of a target program by a target system will be described with reference to FIGS.
  • the target system is a system to be simulated and has an input / output device.
  • the input / output device is a generic term for an input device such as a keyboard or a mouse and an output device such as a display or a communication device.
  • the target program is a program including a plurality of instructions and is executed by the target system.
  • an instruction included in the target program is referred to as an execution instruction.
  • An execution instruction accompanied with input / output is called an input / output instruction.
  • the simulation apparatus 100 is a computer including hardware such as a processor 901, a memory 902, an auxiliary storage device 903, an input device 904, and a display 905. These hardwares are connected to each other via signal lines.
  • the processor 901 is an IC (Integrated Circuit) that performs processing, and controls other hardware.
  • the processor 901 is a CPU, DSP, or GPU.
  • CPU is an abbreviation for Central Processing Unit
  • DSP is an abbreviation for Digital Signal Processor
  • GPU is an abbreviation for Graphics Processing Unit.
  • the memory 902 is a volatile storage device.
  • the memory 902 is also called main memory or main memory.
  • the memory 902 is a RAM (Random Access Memory).
  • the auxiliary storage device 903 is a nonvolatile storage device.
  • the auxiliary storage device 903 is a ROM, HDD, or flash memory. ROM is an abbreviation for Read Only Memory, and HDD is an abbreviation for Hard Disk Drive.
  • Hardware in which the processor 901, the memory 902, and the auxiliary storage device 903 are collected is referred to as a “processing circuit”.
  • the input device 904 is a device that accepts input. Specifically, the input device 904 is a keyboard, a mouse, a numeric keypad, or a touch panel.
  • a display 905 is a display device that displays an image or the like. Specifically, the display 905 is a liquid crystal display. The display 905 is also called a monitor.
  • the simulation apparatus 100 includes a control unit 110, an execution simulation unit 121, an execution log generation unit 122, a resource log generation unit 123, an input / output simulation unit 131, an input / output log generation unit 132, an execution restoration unit 141, and a resource restoration unit 142.
  • a “unit” such as the output restoration unit 143 is provided as a functional component.
  • the function of “part” is realized by software. The function of “part” will be described later.
  • the auxiliary storage device 903 stores a program that realizes the function of “unit”.
  • a program that realizes the function of “unit” is loaded into the memory 902 and executed by the processor 901.
  • the auxiliary storage device 903 stores an OS (Operating System). At least a part of the OS is loaded into the memory 902 and executed by the processor 901. That is, the processor 901 executes a program that realizes the function of “unit” while executing the OS.
  • Data obtained by executing a program that realizes the function of “unit” is stored in a storage device such as the memory 902, the auxiliary storage device 903, a register in the processor 901, or a cache memory in the processor 901.
  • the memory 902 functions as a storage unit 191 that stores data used, generated, input, output, transmitted, or received by the simulation apparatus 100. However, other storage devices may function as the storage unit 191.
  • the input device 904 functions as a reception unit 192 that receives input.
  • the display 905 functions as a display unit 193 that displays an image or the like.
  • the simulation apparatus 100 may include a plurality of processors that replace the processor 901.
  • the plurality of processors share execution of a program that realizes the function of “unit”.
  • a program that realizes the function of “unit” can be stored in a computer-readable manner in a nonvolatile storage medium such as a magnetic disk, an optical disk, or a flash memory.
  • a non-volatile storage medium is a tangible medium that is not temporary. “Part” may be read as “processing” or “process”.
  • the function of “unit” may be realized by firmware.
  • the storage unit 191 stores a target program 200, an execution simulator 210, a resource model 211, an execution log file 220, a resource log file 230, an input / output simulator 240, an input / output log file 250, and the like.
  • the target program 200 is a program that includes a plurality of execution instructions and is executed by the target system.
  • the execution simulator 210 is software that simulates the execution of the target program 200 by the target system.
  • the execution simulator 210 includes state information of the execution simulator 210. Specific state information is a variable used in the execution simulator 210. Specifically, the execution simulator 210 is called an instruction set simulator or a CPU instruction simulator.
  • the resource model 211 is data used as a pseudo resource imitating the resource of the target system.
  • the resource model 211 includes state information indicating a pseudo resource state.
  • the pseudo resources are a pseudo register and a pseudo memory.
  • the pseudo register is a pseudo register imitating a register provided in the target system.
  • the pseudo memory is a pseudo memory imitating the memory provided in the target system.
  • the execution log file 220 is a file including state information of the execution simulator 210 before the execution instruction is simulated.
  • the resource log file 230 is a file including state information of the resource model 211 before execution of the execution instruction is simulated.
  • the input / output simulator 240 is software that simulates the operation of the input / output device of the target system.
  • the input / output simulator 240 includes state information of the input / output simulator 240. Specific state information is a variable used in the input / output simulator 240.
  • the input / output simulator 240 exists for each input / output device to be simulated.
  • the input / output log file 250 is a file including state information of the input / output simulator 240 before the execution of the input / output instruction is simulated.
  • the input / output log file 250 exists for each input / output simulator 240.
  • the configuration of the execution log file 220 will be described based on FIG.
  • the execution log file 220 includes a counter log table 221, a status log table 222, final number data 223, and a final status table 224.
  • the counter log table 221 is a table indicating the execution order of execution instructions in the target program 200.
  • execution number and “program counter” are associated with each other.
  • a set of “execution number” and “program counter” is called a counter log record.
  • Executecution number is a column indicating an execution number.
  • the execution number is a number indicating the execution order of execution instructions in the target program 200.
  • Program counter is a column indicating a program counter.
  • the program counter is information for identifying an execution instruction. Specifically, the program counter is the address of the portion where the execution instruction is located in the storage area where the target program 200 is loaded.
  • program counter means a program counter for the target program 200.
  • the state log table 222 is a table showing the state information of the execution simulator 210 before the execution instruction is executed and the state information of the execution simulator 210 after the execution instruction is executed.
  • execution number “execution number”, “variable”, “before update”, and “after update” are associated with each other.
  • a set of “execution number”, “variable”, “before update”, and “after update” is referred to as a status log record.
  • Executecution number” is a column indicating an execution number.
  • the execution number is a number indicating the execution order of execution instructions in the target program 200.
  • “Variable” is a column indicating a variable name of a variable used in the execution simulator 210.
  • the variable name is an identifier for identifying a variable.
  • Before update is a column indicating the value of the variable before update.
  • Before update means before the execution instruction is executed.
  • After update is a column indicating the value of the updated variable. After the update is after the execution instruction is
  • the final number data 223 is data indicating the final number.
  • the final number is a number indicating the execution order of the final execution instruction.
  • the final execution instruction is an execution instruction executed last in the target program 200.
  • the final state table 224 is a table showing the entire state information of the execution simulator 210 after the final execution instruction is executed.
  • “variable” and “value” are associated with each other.
  • a set of “variable” and “value” is called a final state record.
  • “Variable” is a column indicating a variable name of a variable used in the execution simulator 210.
  • “Value” is a column indicating a variable value of a variable used in the execution simulator 210.
  • the variable value is a value set for the variable.
  • the configuration of the resource log file 230 will be described with reference to FIG.
  • the resource log file 230 includes a status log table 231 and a final status table 232.
  • the state log table 231 is a table showing the state information of the resource model 211 before the execution instruction is executed and the state information of the resource model 211 after the execution instruction is executed.
  • execution number “execution number”, “address”, “before update”, and “after update” are associated with each other.
  • a set of “execution number”, “address”, “before update”, and “after update” is referred to as a status log record.
  • Executecution number” is a column indicating an execution number.
  • “Address” is an address of an updated part in the storage area in which the state information of the resource model 211 is stored.
  • the updated part is an updated part.
  • the address is an identifier for identifying a position in the storage area.
  • Before update is a column indicating the value of the update part before update.
  • After update is a column indicating the value of the updated part after the update.
  • the final state table 232 is a table showing the entire state information of the resource model 211 after the final execution instruction is executed.
  • “address” and “value” are associated with each other.
  • a set of “address” and “value” is called a final state record.
  • “Address” is a column indicating an address in a storage area in which the state information of the resource model 211 is stored.
  • “Value” is a column indicating a set value.
  • the configuration of the input / output log file 250 will be described with reference to FIG.
  • the input / output log file 250 includes an input / output log table 251, a status log table 252, and a final status table 253.
  • the input / output log table 251 is a table showing the state information of the input / output simulator 240 before the input / output instruction is executed and the state information of the input / output simulator 240 after the input / output instruction is executed.
  • “input / output number”, “start number”, and “end number” are associated with each other.
  • a set of “input / output number”, “start number”, and “end number” is called an input / output log record.
  • “Input / output number” is a column indicating an input / output number.
  • the input / output number is a number indicating the execution order of the input / output instructions.
  • the “start number” is an execution number of an execution instruction that is an input / output instruction.
  • “End number” is the execution number of the execution instruction that was being executed when the input / output instruction ended.
  • the state log table 252 is a table showing the state information of the input / output simulator 240 before the input / output instruction is executed and the state information of the input / output simulator 240 after the input / output instruction is executed.
  • “input / output number”, “variable”, “before update”, and “after update” are associated with each other.
  • a set of “input / output number”, “variable”, “before update”, and “after update” is called a status log record.
  • “Input / output number” is a column indicating an input / output number.
  • “Variable” is a column indicating a variable name of a variable used in the input / output simulator 240.
  • “Before update” is a column indicating the value of the variable before update.
  • “After update” is a column indicating the value of the updated variable.
  • the final state table 253 is a table showing the entire state information of the input / output simulator 240 after the final input / output instruction is executed.
  • “variable” and “value” are associated with each other.
  • a set of “variable” and “value” is called a final state record.
  • “Variable” is a column indicating a variable name of a variable used in the input / output simulator 240.
  • “Value” is a column indicating a variable value of a variable used in the input / output simulator 240.
  • the operation of the simulation apparatus 100 corresponds to a simulation method.
  • the procedure of the simulation method corresponds to the procedure of the simulation program.
  • step S ⁇ b> 101 the control unit 110 determines whether to execute the simulation using a forward execution method or a reverse execution method.
  • the sequential execution is an execution method that simulates execution of execution instructions included in the target program 200 in the execution order of a plurality of execution instructions included in the target program 200.
  • Reverse execution is an execution method that simulates execution of execution instructions included in the target program 200 in the reverse order of execution order of a plurality of execution instructions included in the target program 200.
  • the execution method is determined as follows. First, the user operates the input device 904 and inputs the forward execution or reverse execution to the simulation apparatus 100 as an execution method. However, reverse execution cannot be specified before sequential execution is performed, but can be specified after sequential execution is performed. Next, the reception unit 192 receives the input execution method. Then, control unit 110 determines whether the accepted execution method is forward execution or reverse execution.
  • step S200 If it is determined that the execution method is sequential execution, the process proceeds to step S200. If it is determined that the execution method is reverse execution, the process proceeds to step S300.
  • Step S200 is a sequential execution method.
  • the control unit 110 activates the execution simulation unit 121, the execution log generation unit 122, the resource log generation unit 123, the input / output simulation unit 131, and the input / output log generation unit 132.
  • the activated element operates as follows.
  • the execution simulation unit 121 functions as an execution simulator 210 based on the target program 200. Specifically, the execution simulation unit 121 simulates the execution of execution instructions included in the target program 200 in the execution order of a plurality of execution instructions in the target program 200. Details of the operation of the execution simulation unit 121 will be described later.
  • the execution log generation unit 122 generates an execution log file 220. Specifically, the execution log generation unit 122 displays the status information of the execution simulator 210 before the execution of the execution instruction is simulated every time the execution of the execution instruction included in the target program 200 is simulated. Register in file 220. Details of the operation of the execution log generation unit 122 will be described later.
  • the resource log generation unit 123 generates a resource log file 230. Specifically, each time the execution of the execution instruction included in the target program 200 is simulated, the resource log generation unit 123 displays the state information of the resource model 211 before the execution of the execution instruction is simulated in the resource log. Register in file 230. Details of the operation of the resource log generation unit 123 will be described later.
  • the input / output simulation unit 131 functions as the input / output simulator 240 when the execution of the input / output command is simulated. Details of the operation of the input / output simulation unit 131 will be described later.
  • the input / output log generation unit 132 generates an input / output log file 250. Specifically, the input / output log generation unit 132 stores the state information of the input / output simulator 240 before the execution of the input / output instruction is simulated in the input / output log file 250 when the execution of the input / output instruction is simulated. sign up. Details of the operation of the input / output log generation unit 132 will be described later.
  • Step S300 is a reverse execution method.
  • the control unit 110 activates the execution simulation unit 121, the input / output simulation unit 131, the execution restoration unit 141, the resource restoration unit 142, and the input / output restoration unit 143.
  • the activated element operates as follows.
  • the execution simulation unit 121 functions as an execution simulator 210 based on the target program 200. Specifically, the execution simulation unit 121 simulates the execution of execution instructions included in the target program 200 based on the execution log file 220 in the reverse order to the execution order of the plurality of execution instructions in the target program 200.
  • Execution of the execution instruction is simulated as follows. First, the execution restoration unit 141 restores the state information of the execution simulator 210 before the execution instruction is simulated using the execution log file 220. In addition, the resource restoration unit 142 uses the resource log file 230 to restore the state information of the resource model 211 before the execution of the execution instruction is simulated. Then, the execution simulation unit 121 simulates execution of the execution instruction using the restored state information of the execution simulator 210 and the restored state information of the resource model 211.
  • the input / output simulation unit 131 functions as the input / output simulator 240 when execution of the input / output command is simulated.
  • the input / output simulation unit 131 simulates the operation of the input / output device.
  • the operation of the input / output device is simulated as follows.
  • the input / output restoration unit 143 uses the input / output simulator 240 to restore the state information of the input / output simulator 240 before the execution of the input / output instruction is simulated.
  • the input / output simulation unit 131 uses the restored state information of the input / output simulator 240 to simulate the operation of the input / output device.
  • step S102 the control unit 110 determines whether or not the execution method needs to be changed.
  • the change of the execution method means that the reverse execution simulation is performed after the forward execution simulation is performed, and the forward execution simulation is performed after the reverse execution simulation is performed.
  • the necessity of changing the execution method is determined as follows.
  • a user who wishes to change the execution method operates the input device 904 and inputs a change instruction to the simulation device 100.
  • a user who does not wish to change the execution method operates the input device 904 and inputs an end instruction to the simulation device 100.
  • the accepting unit 192 accepts the input change instruction or end instruction.
  • the control unit 110 determines that the execution method needs to be changed.
  • the end instruction is accepted, the control unit 110 determines that the execution method does not need to be changed.
  • step S101 the control unit 110 determines that the execution method is reverse execution. If it is after the reverse execution simulation, in step S101, the control unit 110 determines that the execution method is sequential execution. If it is determined that there is no need to change the execution method, the process ends.
  • the execution simulation process [sequential execution] will be described with reference to FIG.
  • the execution simulation process [sequential execution] is executed in the sequential execution method (S200).
  • the execution simulation unit 121 functions as the execution simulator 210.
  • step S201 the execution simulator 210 initializes a program counter. Specifically, the execution simulator 210 sets the top address of the target program 200 in the program counter.
  • step S ⁇ b> 202 the execution simulator 210 reads an execution instruction corresponding to the program counter from the target program 200.
  • the execution instruction corresponding to the program counter is an execution instruction written in the storage area identified by the address indicated by the program counter.
  • step S203 the execution simulator 210 simulates the execution of the read execution instruction. Then, the display unit 193 displays the simulation result.
  • the resource model 211 is updated according to the execution instruction, and the state information of the execution simulator 210 is updated according to the simulation result.
  • the execution simulator 210 When execution of the input / output instruction is simulated, the execution simulator 210 writes the request information in the input / output request area in the resource model 211.
  • the input / output area is a storage area used for input / output requests.
  • the request information is information indicating the contents of input / output.
  • step S204 the execution simulator 210 determines whether the execution instruction read in step S202 is the final execution instruction.
  • the execution simulation unit 121 notifies the execution log generation unit 122 of the simulation end. Then, the process ends. If the execution instruction read in step S202 is not the final execution instruction, the process proceeds to step S205.
  • step S205 the execution simulator 210 updates the program counter to the next address. After step S205, the process proceeds to step S202.
  • the execution log generation process will be described based on FIG.
  • the execution log generation process is executed in the sequential execution method (S200).
  • Step S211 is executed when the execution log generation unit 122 is activated.
  • the execution log generation unit 122 sets 1 to the execution number.
  • Step S212 is executed when the program counter is initialized (S201 in FIG. 7) and updated (S205 in FIG. 7). Specifically, the execution log generation unit 122 monitors a program counter. And the execution log production
  • Step S213 is executed when execution of the execution instruction is simulated (S203 in FIG. 7).
  • the execution log generation unit 122 determines whether the state of the execution simulator 210 has changed. Specifically, the execution log generation unit 122 monitors the status information of the execution simulator 210 and detects an update of the status information of the execution simulator 210. When the update of the state information of the execution simulator 210 is detected, the execution log generation unit 122 determines that the state of the execution simulator 210 has changed. If it is determined that the state of the execution simulator 210 has changed, the process proceeds to step S214. If it is determined that the state of the execution simulator 210 has not changed, the process proceeds to step S215.
  • step S ⁇ b> 214 the execution log generation unit 122 updates the state log table 222. Specifically, the execution log generation unit 122 generates a state log record and registers the generated state log record in the state log table 222.
  • step S215 the execution log generation unit 122 determines whether the simulation of the target program 200 is completed.
  • the simulation of the target program 200 is to simulate the execution of the target program 200 by the target system. Specifically, when the simulation end is notified from the control unit 110, the execution log generation unit 122 determines that the simulation of the target program 200 has ended. If it is determined that the simulation of the target program 200 has been completed, the process proceeds to step S217. If it is determined that the simulation of the target program 200 has not ended, the process proceeds to step S216.
  • step S216 the execution log generation unit 122 increments the value of the execution number by one. After step S216, the process proceeds to step S212.
  • step S217 the execution log generation unit 122 updates the final number data 223 and the final state table 224. Specifically, the execution log generation unit 122 changes the value of the final number indicated in the final number data 223 to the value of the execution number. Further, the execution log generation unit 122 generates a final state record for each state information of the execution simulator 210, and registers the generated final state record in the final state table 224.
  • the input / output simulation process [sequential execution] will be described with reference to FIG.
  • the input / output simulation process [sequential execution] is executed in the sequential execution method (S200).
  • the input / output simulation unit 131 functions as the input / output simulator 240.
  • Steps S221 to S223 are executed when request information is written in the input / output request area in the resource model 211 (S203 in FIG. 7).
  • step S221 the input / output simulator 240 monitors input / output requests and detects writing of request information in the input / output request area.
  • step S222 the input / output simulator 240 simulates the operation of the input / output device based on the request information written in the input / output request area. Then, the display unit 193 displays the simulation result.
  • the input / output simulator 240 writes the response information in the input / output response area in the resource model 211.
  • the input / output response area is a storage area used for input / output responses.
  • the response information is information for notifying the end of input / output.
  • the input / output log generation processing is executed in the sequential execution method (S200).
  • Step S231 is executed when the input / output log generation unit 132 is activated.
  • the input / output log generation unit 132 sets 1 to the input / output number.
  • Step S232 is executed at the time of writing to the input / output request area in the resource model 211 (S203 in FIG. 7). Specifically, the input / output log generation unit 132 monitors input / output requests. Then, the input / output log generation unit 132 executes Step S232 when detecting writing to the input / output request. In step S232, the input / output log generation unit 132 updates the input / output log table 251. Specifically, the input / output log generation unit 132 generates an input / output log record in which an input / output number and a start number are set, and registers the generated input / output log record in the input / output log table 251.
  • Step S233 is executed when the operation of the input / output device is simulated (S222 in FIG. 9).
  • the input / output log generation unit 132 determines whether the state of the input / output simulator 240 has changed. Specifically, the input / output log generation unit 132 monitors the status information of the input / output simulator 240 and detects an update of the status information of the input / output simulator 240. When the update of the state information of the input / output simulator 240 is detected, the input / output log generation unit 132 determines that the state of the input / output simulator 240 has changed. If it is determined that the state of the input / output simulator 240 has changed, the process proceeds to step S234. If it is determined that the state of the input / output simulator 240 has not changed, the process proceeds to step S235.
  • step S234 the input / output log generation unit 132 updates the state log table 252. Specifically, the input / output log generation unit 132 generates a status log record and registers the generated status log record in the status log table 252.
  • step S235 the input / output log generating unit 132 updates the input / output log table 251. Specifically, the input / output log generation unit 132 sets an end number in the input / output log record registered in the input / output log table 251 in step S232.
  • step S236 the input / output log generation unit 132 determines whether the simulation of the target program 200 has been completed. Specifically, when the simulation end is notified from the control unit 110, the input / output log generation unit 132 determines that the simulation of the target program 200 has ended. If it is determined that the simulation of the target program 200 has been completed, the process proceeds to step S238. If it is determined that the simulation of the target program 200 has not ended, the process proceeds to step S237.
  • step S237 the input / output log generation unit 132 increments the value of the input / output number by one. After step S237, the process proceeds to step S232.
  • step S2308 the input / output log generation unit 132 updates the final state table 253. Specifically, the input / output log generation unit 132 generates a final state record for each state information of the input / output simulator 240 and registers the generated final state record in the final state table 253.
  • the resource log generation process is executed in the sequential execution method (S200).
  • step S241 the resource log generation unit 123 determines whether the state of the resource model 211 has changed. Specifically, the resource log generation unit 123 monitors the state information of the resource model 211 and detects an update of the state information of the resource model 211. When the update of the state information of the resource model 211 is detected, the resource log generation unit 123 determines that the state of the resource model 211 has changed. If it is determined that the state of the resource model 211 has changed, the process proceeds to step S242. If it is determined that the state of the resource model 211 has not changed, the process proceeds to step S243.
  • step S242 the resource log generation unit 123 updates the state log table 231. Specifically, the resource log generation unit 123 generates a status log record and registers the generated status log record in the status log table 231.
  • step S243 the resource log generation unit 123 determines whether the simulation of the target program 200 has been completed. Specifically, when the simulation end is notified from the control unit 110, the resource log generation unit 123 determines that the simulation of the target program 200 has ended. If it is determined that the simulation of the target program 200 has been completed, the process proceeds to step S244. If it is determined that the simulation of the target program 200 has not ended, the process proceeds to step S241.
  • step S244 the resource log generation unit 123 updates the final state table 232. Specifically, the resource log generation unit 123 generates a final state record for each state information of the resource model 211 and registers the generated final state record in the final state table 232.
  • processing by the execution restoration unit 141 is referred to as execution restoration processing
  • processing by the resource restoration unit 142 is referred to as resource restoration processing
  • processing by the input / output restoration unit 143 is referred to as input / output restoration processing.
  • the process performed by the execution simulation unit 121 is referred to as an execution simulation process [reverse execution]
  • the process performed by the input / output simulation unit 131 is referred to as an input / output simulation process [reverse execution].
  • step S ⁇ b> 301 of FIG. 12 the execution restoration unit 141 restores the final state of the execution simulator 210 based on the execution log file 220. Specifically, the execution restoration unit 141 updates the state information of the execution simulator 210 using the final state table 224.
  • the resource restoration unit 142 restores the final state of the resource model 211 based on the resource log file 230. Specifically, the resource restoration unit 142 updates the state information of the resource model 211 using the final state table 232.
  • step S302 the control unit 110 sets the value of the final number as the execution number.
  • the execution restoration unit 141 reads the final number from the final number data 223, and updates the value of the execution number to the value of the final number.
  • step S ⁇ b> 311 the execution restoration unit 141 restores the previous state of the execution simulator 210 based on the execution log file 220.
  • the previous state is a state before execution of the execution instruction corresponding to the execution number is simulated.
  • the execution restoration unit 141 selects a state log record including the same execution number as the execution number updated in step S302 or step S323 from the state log table 222.
  • the execution restoration unit 141 updates the state information of the execution simulator 210 using the value before update included in the selected state log record.
  • the updated state information is a variable identified by a variable name included in the selected state log record. If there is no corresponding state log record, the execution restoration unit 141 does not update the state information of the execution simulator 210.
  • the resource restoration unit 142 restores the previous state of the resource model 211 based on the resource log file 230. Specifically, the resource restoration unit 142 selects a state log record including the same execution number as the execution number updated in step S302 or step S323 from the state log table 231. Then, the resource restoration unit 142 updates the state information of the resource model 211 using the value before update included in the selected state log record. The updated status information is data corresponding to the address included in the selected status log record. The data corresponding to the address is data stored in the storage area identified by the address. If there is no corresponding state log record, the resource restoration unit 142 does not update the state information of the resource model 211.
  • step S312 the control unit 110 determines whether the execution instruction corresponding to the execution number is an input / output instruction based on the input / output log file 250. Specifically, the control unit 110 searches the input / output log table 251 for an input / output log record including a start number having the same value as the execution number. When there is a corresponding input / output log record, the control unit 110 determines that the execution instruction corresponding to the execution number is an input / output instruction. If it is determined that the execution instruction corresponding to the execution number is an input / output instruction, the process proceeds to step S331 in FIG. If it is determined that the execution instruction corresponding to the execution number is not an input / output instruction, the process proceeds to step S313.
  • step S313 the execution simulation unit 121 functions as the execution simulator 210, and the execution simulator 210 simulates an execution instruction corresponding to the execution number.
  • the execution instruction corresponding to the execution number is simulated as follows. First, the control unit 110 selects a counter log record including the same execution number as the execution number updated in step S302 or step S323 from the counter log table 221. Next, the execution simulator 210 updates the value of the program counter for the target program 200 to the value of the program counter included in the selected counter log record. Then, the execution simulator 210 reads an execution instruction corresponding to the updated program counter from the target program 200 and simulates the execution of the read execution instruction. The display unit 193 displays the simulation result.
  • step S ⁇ b> 321 the execution restoration unit 141 restores the previous state of the execution simulator 210 based on the execution log file 220. Further, the resource restoration unit 142 restores the previous state of the resource model 211 based on the resource log file 230.
  • the method for restoring the previous state is the same as in step S311.
  • step S322 the control unit 110 determines whether the execution instruction corresponding to the execution number is the top instruction.
  • the head instruction is the first execution instruction in the target program 200.
  • the control unit 110 determines that the execution instruction corresponding to the execution number is the top instruction. If it is determined that the execution instruction corresponding to the execution number is the first instruction, the process ends. If it is determined that the execution instruction corresponding to the execution number is not the top number, the process proceeds to step S323.
  • step S323 the control unit 110 decreases the value of the execution number by one. After step S323, the process proceeds to step S311.
  • step S331 in FIG. 13 the control unit 110 requests the input / output restoration unit 143 to restore the input / output state.
  • the restoration of the input / output state is to restore the state information of the input / output simulator 240.
  • the control unit 110 calls the input / output restoration unit 143.
  • step S332 the control unit 110 confirms the end of restoration. Specifically, the control unit 110 receives an end notification from the input / output restoration unit 143.
  • step S333 the execution restoration unit 141 functions as the execution simulator 210, and the execution simulator 210 simulates the execution of input / output instructions. Then, the display unit 193 displays the simulation result. Further, the input / output simulation unit 131 functions as an input / output simulator 240, which simulates the operation of the input / output device. Then, the display unit 193 displays the simulation result.
  • the execution simulator 210 and the input / output simulator 240 operate as follows. First, the execution simulator 210 simulates execution of an input / output instruction and writes request information in an input / output request area in the resource model 211. Next, the input / output simulator 240 detects writing of request information in the input / output request area, and simulates the operation of the input / output device based on the request information. Then, the input / output simulator 240 writes the response information in the input / output response area in the resource model 211.
  • step S333 the control unit 110 notifies the end of the simulation to the input / output restoration unit 143, and the process proceeds to step S321 in FIG.
  • the input / output restoration process will be described with reference to FIG.
  • the input / output restoration process is executed in the reverse execution method (S300).
  • Step S341 is executed when the input / output restoration unit 143 is activated.
  • the input / output restoration unit 143 restores the final state of the input / output simulator 240 based on the input / output log file 250.
  • the input / output restoration unit 143 uses the final state table 253 to update the state information of the input / output simulator 240.
  • Steps S342 to S344 are executed when the restoration of the input / output state is requested (S331 in FIG. 13).
  • step S342 the input / output restoration unit 143 detects a restoration request. Specifically, the input / output restoration unit 143 is called from the control unit 110.
  • step S343 the input / output restoration unit 143 restores the previous state of the input / output simulator 240 based on the input / output log file 250.
  • the input / output restoration unit 143 restores the previous state of the input / output simulator 240 as follows. First, the input / output restoration unit 143 selects an input / output log record including a start number having the same value as the execution number from the input / output log table 251. Next, the input / output restoration unit 143 reads the input / output number from the selected input / output log record. Next, the input / output restoration unit 143 selects a status log record including the same input / output number as the read input / output number from the status log table 252. Then, the input / output restoration unit 143 updates the state information of the input / output simulator 240 using the value before update included in the selected state log record. The updated state information is a variable identified by a variable name included in the selected state log record. If there is no corresponding state log record, the input / output restoration unit 143 does not update the state information of the input / output simulator 240.
  • step S344 the input / output restoration unit 143 notifies the control unit 110 of the completion of restoration.
  • Step S345 is executed after the execution of the input / output command is simulated (S333 in FIG. 13). Specifically, the input / output restoration unit 143 executes Step S345 when the simulation end is notified from the control unit 110. In step S345, the input / output restoration unit 143 restores the previous state of the input / output simulator 240 based on the input / output log file 250. The method for restoring the previous state is the same as in step S343.
  • step S346 the input / output restoration unit 143 determines whether the reverse execution of the target program 200 is completed.
  • the reverse execution of the target program 200 is to simulate execution instructions included in the target program 200 in reverse order. Specifically, when the reverse execution end is notified from the control unit 110, the input / output restoration unit 143 determines that the reverse execution of the target program 200 has ended. If it is determined that the reverse execution of the target program 200 has ended, the process ends. If it is determined that the reverse execution of the target program 200 has not ended, the process returns to step S342.
  • the execution simulator 210 simulates execution of execution instructions in order from instruction 1 to instruction 8.
  • the execution log generation unit 122 collects execution logs while the execution instructions from the instruction 1 to the instruction 8 are simulated. As a result, an execution log file 220 as shown in FIG. 3 is obtained.
  • Instruction 2 Instruction 2 are input / output instructions.
  • the execution simulator 210 writes to the input / output request area in the resource model 211.
  • the input / output simulator 240 simulates the operation of the input / output device.
  • IO1 and IO2 are simulated inputs and outputs.
  • the input / output simulator 240 writes to the input / output response area in the resource model 211.
  • the input / output log generation unit 132 collects input / output logs while IO1 and IO2 are simulated.
  • an input / output log file 250 as shown in FIG. 5 is obtained.
  • the resource log generation unit 123 collects resource logs while the execution instructions from the instruction 2 to the instruction 8 are simulated.
  • a resource log file 230 as shown in FIG. 4 is obtained.
  • the execution restoration unit 141 restores the state information of the execution simulator 210 before the execution of the instruction 8 is simulated. Further, the resource restoration unit 142 restores the state information of the resource model 211 before the execution of the instruction 8 is simulated. Then, the execution simulator 210 simulates the execution of the instruction 8.
  • the execution restoration unit 141 restores the state information of the execution simulator 210 before the execution of the instruction 7 is simulated. Further, the resource restoration unit 142 restores the state information of the resource model 211 before the execution of the instruction 7 is simulated. Then, the execution simulator 210 simulates the execution of the instruction 7.
  • the execution restoration unit 141 restores the state information of the execution simulator 210 before the execution of the instruction 6 is simulated. Further, the resource restoration unit 142 restores the state information of the resource model 211 before the execution of the instruction 6 is simulated. Then, the execution simulator 210 simulates the execution of the instruction 6.
  • the input / output restoration unit 143 restores the state information of the input / output simulator 240 before the execution of the instruction 6 is simulated.
  • the input / output simulator 240 simulates IO2.
  • the execution restoration unit 141 restores the state information of the execution simulator 210 before the execution of the instruction 6 is simulated. Further, the resource restoration unit 142 restores the state information of the resource model 211 before the execution of the instruction 6 is simulated. Then, the execution simulator 210 simulates the execution of the instruction 6.
  • Embodiment 1 *** Effects of Embodiment 1 ***
  • the target system can be simulated by linking the instruction set simulation and the IO simulation. Since the reverse execution method (S300) eliminates the need to re-execute the simulation from the beginning, it is possible to reduce the time required to execute the simulation when specifying the error factor. Furthermore, it is no longer necessary to narrow down the cause of error by relying on experience and intuition. Therefore, debugging efficiency is improved.
  • the execution simulator 210 and the input / output simulator 240 may be a simulator realized by hardware.
  • the execution simulator 210 and the input / output simulator 240 may be executed in different threads or may be executed in the same thread.
  • the function of the simulation apparatus 100 may be realized by hardware.
  • FIG. 18 shows a configuration when the function of the simulation apparatus 100 is realized by hardware.
  • the simulation apparatus 100 includes a processing circuit 990.
  • the processing circuit 990 is also called a processing circuit.
  • the processing circuit 990 includes a control unit 110, an execution simulation unit 121, an execution log generation unit 122, a resource log generation unit 123, an input / output simulation unit 131, an input / output log generation unit 132, an execution restoration unit 141, and a resource restoration unit 142.
  • This is a dedicated electronic circuit that realizes the functions of the “unit” such as the output restoration unit 143 and the storage unit 191.
  • the processing circuit 990 is a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, a logic IC, a GA, an ASIC, an FPGA, or a combination thereof.
  • GA is an abbreviation for Gate Array
  • ASIC is an abbreviation for Application Specific Integrated Circuit
  • FPGA is an abbreviation for Field Programmable Gate Array.
  • the simulation apparatus 100 may include a plurality of processing circuits that replace the processing circuit 990.
  • the plurality of processing circuits share the function of “unit”.
  • the functions of the simulation apparatus 100 may be realized by a combination of software and hardware. That is, a part of the function of “unit” may be realized by software, and the rest of the function of “unit” may be realized by hardware.
  • the embodiment is an example of a preferred embodiment and is not intended to limit the technical scope of the present invention.
  • the embodiment may be implemented partially or in combination with other embodiments.
  • the procedure described using the flowchart and the like may be changed as appropriate.
  • 100 simulation device 110 control unit, 121 execution simulation unit, 122 execution log generation unit, 123 resource log generation unit, 131 input / output simulation unit, 132 input / output log generation unit, 141 execution recovery unit, 142 resource recovery unit, 143 Output restoration unit, 191 storage unit, 192 reception unit, 193 display unit, 200 target program, 210 execution simulator, 211 resource model, 220 execution log file, 221 counter log table, 222 status log table, 223 final number data, 224 final Status table, 230 resource log file, 231 status log table, 232 final status table, 240 I / O simulator, 250 I / O log file, 251 I / O log table, 252 Status log table 253 final status table 901 processor, 902 a memory, 903 an auxiliary storage device, 904 input device, 905 display, 990 processing circuits.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

実行模擬部(121)は、複数の実行命令を含んだプログラムであって入出力装置を有するターゲットシステムによって実行されるプログラムであるターゲットプログラムに基づいて、実行シミュレータとして機能する。実行シミュレータは、ターゲットシステムによるターゲットプログラムの実行を模擬する。入出力模擬部(131)は、複数の実行命令のうちの入出力命令の実行が模擬される場合に、入出力シミュレータとして機能する。入出力シミュレータは、入出力装置の動作を模擬する。実行模擬部は、実行ログファイルに基づいて、ターゲットプログラムにおける複数の実行命令の実行順とは逆順に、ターゲットプログラムに含まれる実行命令の実行を模擬する。

Description

シミュレーション装置およびシミュレーションプログラム
 本発明は、シミュレーションを行う技術に関するものである。
 命令セットシミュレーションとIOシミュレーションとを連係して、ターゲットシステムの動作を模擬する技術がある。IOはInputおよびOutputの略称である。
 命令セットシミュレーションは、ISS(Instruction Set Simulator)によって命令の実行とプログラムカウンタの操作とを模擬する技術である。
 IOシミュレーションは、キーボード、ディスプレイおよび通信装置などの入出力装置の動作を模擬する技術である。
 これらのシミュレーションが同一のスレッドで実行される場合、同一のスレッド内でシミュレーションが切り替えられる。これらのシミュレーションが別のスレッドで実行される場合、スレッド呼び出しによってスレッド同士が連携し、これらのシミュレーションが実行される。
 シミュレーションの実行中にエラーが発生した場合、エラー要因を特定するには、シミュレーションを複数回再実行して、変数の値およびシステムの動作を確認する必要がある。そのため、エラー要因の特定に時間がかかってしまう。
 特に、シミュレーションが開始されてからエラーが発生するまでの時間が長いほど、シミュレーションの再実行に要する時間および確認作業に要する時間が増大する。
 さらに、エラー要因を絞り込むために、多くの経験および勘が必要である。そのため、初心者がエラー要因を特定することは困難である。
 エラー要因はエラー発生時の命令の近くに存在する場合が多いため、命令を逆順に実行するシミュレーション逆実行を行うことができれば、エラー要因を特定し易くなると考えられる。
 シミュレーション逆実行により、シミュレーションを最初から実行し直す必要がなくなるため、エラー要因を特定する際にシミュレーションの実行に要する時間を削減できる。さらに、経験および勘に頼ってエラー要因を絞り込む必要がなくなる。
 特許文献1および特許文献2は、命令セットシミュレーションの逆実行に関する技術を開示している。
 しかし、これらの特許文献には、命令セットシミュレーションとIOシミュレーションとを連携した場合のシミュレーション逆実行については、開示も示唆もされていない。
 そのため、これらの特許文献に記載された技術を用いても、命令セットシミュレーションとIOシミュレーションとを連携した場合のシミュレーション逆実行を実現することはできない。
特開平4-352245号公報 特許第2533489号公報
 本発明は、命令セットシミュレーションとIOシミュレーションとを連携してターゲットシステムのシミュレーションを行えるようにすることを目的とする。
 本発明のシミュレーション装置は、
 複数の実行命令を含んだプログラムであって入出力装置を有するターゲットシステムによって実行されるプログラムであるターゲットプログラムに基づいて、前記ターゲットシステムによる前記ターゲットプログラムの実行を模擬する実行シミュレータとして機能する実行模擬部と、
 前記複数の実行命令のうちの入出力命令の実行が模擬される場合に、前記入出力装置の動作を模擬する入出力シミュレータとして機能する入出力模擬部とを備える。
 本発明によれば、命令セットシミュレーションに相当する実行シミュレータとIOシミュレーションに相当する入出力シミュレータとを連携してターゲットシステムのシミュレーションを行うことが可能となる。
実施の形態1におけるシミュレーション装置100の構成図。 実施の形態1における記憶部191の構成図。 実施の形態1における実行ログファイル220の構成図。 実施の形態1におけるリソースログファイル230の構成図。 実施の形態1における入出力ログファイル250の構成図。 実施の形態1におけるシミュレーション方法のフローチャート。 実施の形態1における実行模擬処理[順実行]のフローチャート。 実施の形態1における実行ログ生成処理のフローチャート。 実施の形態1における入出力模擬処理[順実行]のフローチャート。 実施の形態1における入出力ログ生成処理のフローチャート。 実施の形態1におけるリソースログ生成処理のフローチャート。 実施の形態1における逆実行方法(S300)のフローチャート。 実施の形態1における逆実行方法(S300)のフローチャート。 実施の形態1における入出力復元処理のフローチャート。 実施の形態1における順実行方法(S200)の具体例を示す図。 実施の形態1における逆実行方法(S300)の具体例を示す図。 実施の形態1における逆実行方法(S300)の具体例を示す図。 実施の形態におけるシミュレーション装置100のハードウェア構成図。
 実施の形態および図面において、同じ要素または互いに相当する要素には同じ符号を付している。同じ符号が付された要素の説明は適宜に省略または簡略する。
 実施の形態1.
 ターゲットシステムによるターゲットプログラムの実行を模擬するシミュレーション装置100について、図1から図17に基づいて説明する。
 ターゲットシステムは、シミュレーションの対象となるシステムであり、入出力装置を有する。入出力装置は、キーボードまたはマウスなどの入力装置と、ディスプレイまたは通信装置などの出力装置との総称である。
 ターゲットプログラムは、複数の命令を含んだプログラムであって、ターゲットシステムによって実行されるプログラムである。
 実施の形態1では、ターゲットプログラムに含まれる命令を実行命令という。また、入出力を伴う実行命令を入出力命令という。
***構成の説明***
 図1に基づいて、シミュレーション装置100の構成を説明する。
 シミュレーション装置100は、プロセッサ901とメモリ902と補助記憶装置903と入力装置904とディスプレイ905といったハードウェアを備えるコンピュータである。これらのハードウェアは、信号線を介して互いに接続されている。
 プロセッサ901は、プロセッシングを行うIC(Integrated Circuit)であり、他のハードウェアを制御する。具体的には、プロセッサ901は、CPU、DSPまたはGPUである。CPUはCentral Processing Unitの略称であり、DSPはDigital Signal Processorの略称であり、GPUはGraphics Processing Unitの略称である。
 メモリ902は揮発性の記憶装置である。メモリ902は、主記憶装置またはメインメモリとも呼ばれる。具体的には、メモリ902はRAM(Random Access Memory)である。
 補助記憶装置903は不揮発性の記憶装置である。具体的には、補助記憶装置903は、ROM、HDDまたはフラッシュメモリである。ROMはRead Only Memoryの略称であり、HDDはHard Disk Driveの略称である。
 プロセッサ901とメモリ902と補助記憶装置903とをまとめたハードウェアを「プロセッシングサーキットリ」という。
 入力装置904は、入力を受け付ける装置である。具体的には、入力装置904は、キーボード、マウス、テンキーまたはタッチパネルである。
 ディスプレイ905は、画像等を表示する表示装置である。具体的には、ディスプレイ905は液晶ディスプレイである。ディスプレイ905はモニタともいう。
 シミュレーション装置100は、制御部110と実行模擬部121と実行ログ生成部122とリソースログ生成部123と入出力模擬部131と入出力ログ生成部132と実行復元部141とリソース復元部142と入出力復元部143といった「部」を機能構成の要素として備える。「部」の機能はソフトウェアで実現される。「部」の機能については後述する。
 補助記憶装置903には、「部」の機能を実現するプログラムが記憶されている。「部」の機能を実現するプログラムは、メモリ902にロードされて、プロセッサ901によって実行される。
 さらに、補助記憶装置903にはOS(Operating System)が記憶されている。OSの少なくとも一部は、メモリ902にロードされて、プロセッサ901によって実行される。
 つまり、プロセッサ901は、OSを実行しながら、「部」の機能を実現するプログラムを実行する。
 「部」の機能を実現するプログラムを実行して得られるデータは、メモリ902、補助記憶装置903、プロセッサ901内のレジスタまたはプロセッサ901内のキャッシュメモリといった記憶装置に記憶される。
 メモリ902は、シミュレーション装置100で使用、生成、入力、出力、送信または受信されるデータが記憶される記憶部191として機能する。但し、他の記憶装置が記憶部191として機能してもよい。
 入力装置904は入力を受け付ける受付部192として機能する。
 ディスプレイ905は画像等を表示する表示部193として機能する。
 シミュレーション装置100は、プロセッサ901を代替する複数のプロセッサを備えてもよい。複数のプロセッサは、「部」の機能を実現するプログラムの実行を分担する。
 「部」の機能を実現するプログラムは、磁気ディスク、光ディスクまたはフラッシュメモリ等の不揮発性の記憶媒体にコンピュータ読み取り可能に記憶することができる。不揮発性の記憶媒体は、一時的でない有形の媒体である。
 「部」は「処理」または「工程」に読み替えてもよい。「部」の機能はファームウェアで実現してもよい。
 図2に基づいて、記憶部191の構成を説明する。
 記憶部191には、ターゲットプログラム200、実行シミュレータ210、リソースモデル211、実行ログファイル220、リソースログファイル230、入出力シミュレータ240および入出力ログファイル250などが記憶される。
 ターゲットプログラム200は、複数の実行命令を含んだプログラムであってターゲットシステムによって実行されるプログラムである。
 実行シミュレータ210は、ターゲットシステムによるターゲットプログラム200の実行を模擬するソフトウェアである。実行シミュレータ210には、実行シミュレータ210の状態情報が含まれる。具体的な状態情報は、実行シミュレータ210で用いられる変数である。具体的には、実行シミュレータ210は、命令セットシミュレータまたはCPU命令シミュレータと呼ばれるものである。
 リソースモデル211は、ターゲットシステムのリソースを模した擬似的なリソースとして用いられるデータである。リソースモデル211には、擬似的なリソースの状態を示す状態情報が含まれる。具体的には、擬似的なリソースは、擬似レジスタおよび擬似メモリである。疑似レジスタは、ターゲットシステムに備わるレジスタを模した擬似的なレジスタである。疑似メモリは、ターゲットシステムに備わるメモリを模した擬似的なメモリである。
 実行ログファイル220は、実行命令の実行が模擬される前の実行シミュレータ210の状態情報を含んだファイルである。
 リソースログファイル230は、実行命令の実行が模擬される前のリソースモデル211の状態情報を含んだファイルである。
 入出力シミュレータ240は、ターゲットシステムの入出力装置の動作を模擬するソフトウェアである。入出力シミュレータ240には、入出力シミュレータ240の状態情報が含まれる。具体的な状態情報は、入出力シミュレータ240で用いられる変数である。入出力シミュレータ240は、模擬の対象となる入出力装置毎に存在する。
 入出力ログファイル250は、入出力命令の実行が模擬される前の入出力シミュレータ240の状態情報を含んだファイルである。入出力ログファイル250は、入出力シミュレータ240毎に存在する。
 図3に基づいて、実行ログファイル220の構成を説明する。
 実行ログファイル220は、カウンタログテーブル221と状態ログテーブル222と最終番号データ223と最終状態テーブル224とを含む。
 カウンタログテーブル221は、ターゲットプログラム200における実行命令の実行順を示すテーブルである。
 カウンタログテーブル221には、「実行番号」と「プログラムカウンタ」とが互いに対応付けられる。「実行番号」と「プログラムカウンタ」との組をカウンタログレコードという。
 「実行番号」は、実行番号を示す欄である。実行番号は、ターゲットプログラム200における実行命令の実行順を示す番号である。
 「プログラムカウンタ」は、プログラムカウンタを示す欄である。プログラムカウンタは、実行命令を識別する情報である。具体的には、プログラムカウンタは、ターゲットプログラム200がロードされた記憶領域の中で実行命令が位置する部分のアドレスである。実施の形態1の説明において、プログラムカウンタという用語は、ターゲットプログラム200用のプログラムカウンタを意味する。
 状態ログテーブル222は、実行命令が実行される前の実行シミュレータ210の状態情報と実行命令が実行された後の実行シミュレータ210の状態情報とを示すテーブルである。
 状態ログテーブル222には、「実行番号」と「変数」と「更新前」と「更新後」とが互いに対応付けられる。「実行番号」と「変数」と「更新前」と「更新後」との組を状態ログレコードという。
 「実行番号」は、実行番号を示す欄である。実行番号は、ターゲットプログラム200における実行命令の実行順を示す番号である。
 「変数」は、実行シミュレータ210で用いられる変数の変数名を示す欄である。変数名は、変数を識別する識別子である。
 「更新前」は、更新前の変数の値を示す欄である。更新前とは、実行命令が実行される前である。
 「更新後」は、更新後の変数の値を示す欄である。更新後とは、実行命令が実行された後である。
 最終番号データ223は、最終番号を示すデータである。最終番号は、最終の実行命令の実行順を示す番号である。最終の実行命令は、ターゲットプログラム200において最後に実行される実行命令である。
 最終状態テーブル224は、最終の実行命令が実行された後の実行シミュレータ210の状態情報の全体を示すテーブルである。
 最終状態テーブル224には、「変数」と「値」とが互いに対応付けられる。「変数」と「値」との組を最終状態レコードという。
 「変数」は、実行シミュレータ210で用いられる変数の変数名を示す欄である。
 「値」は、実行シミュレータ210で用いられる変数の変数値を示す欄である。変数値は、変数に設定された値である。
 図4に基づいて、リソースログファイル230の構成を説明する。
 リソースログファイル230は、状態ログテーブル231と最終状態テーブル232とを含む。
 状態ログテーブル231は、実行命令が実行される前のリソースモデル211の状態情報と実行命令が実行された後のリソースモデル211の状態情報とを示すテーブルである。
 状態ログテーブル231には、「実行番号」と「アドレス」と「更新前」と「更新後」とが互いに対応付けられる。「実行番号」と「アドレス」と「更新前」と「更新後」との組を状態ログレコードという。
 「実行番号」は、実行番号を示す欄である。
 「アドレス」は、リソースモデル211の状態情報が記憶された記憶領域における更新部分のアドレスである。更新部分は更新された部分である。アドレスは記憶領域内の位置を識別する識別子である。
 「更新前」は、更新前の更新部分の値を示す欄である。
 「更新後」は、更新後の更新部分の値を示す欄である。
 最終状態テーブル232は、最終の実行命令が実行された後のリソースモデル211の状態情報の全体を示すテーブルである。
 最終状態テーブル232には、「アドレス」と「値」とが対応付けられる。「アドレス」と「値」との組を最終状態レコードという。
 「アドレス」は、リソースモデル211の状態情報が記憶された記憶領域におけるアドレスを示す欄である。
 「値」は、設定された値を示す欄である。
 図5に基づいて、入出力ログファイル250の構成を説明する。
 入出力ログファイル250は、入出力ログテーブル251と状態ログテーブル252と最終状態テーブル253とを含む。
 入出力ログテーブル251は、入出力命令が実行される前の入出力シミュレータ240の状態情報と入出力命令が実行された後の入出力シミュレータ240の状態情報とを示すテーブルである。
 入出力ログテーブル251には、「入出力番号」と「開始番号」と「終了番号」とが互いに対応付けられる。「入出力番号」と「開始番号」と「終了番号」との組を入出力ログレコードという。
 「入出力番号」は、入出力番号を示す欄である。入出力番号は、入出力命令の実行順を示す番号である。
 「開始番号」は、入出力命令である実行命令の実行番号である。
 「終了番号」は、入出力命令が終了したときに実行されていた実行命令の実行番号である。
 状態ログテーブル252は、入出力命令が実行される前の入出力シミュレータ240の状態情報と入出力命令が実行された後の入出力シミュレータ240の状態情報とを示すテーブルである。
 状態ログテーブル252には、「入出力番号」と「変数」と「更新前」と「更新後」とが互いに対応付けられる。「入出力番号」と「変数」と「更新前」と「更新後」との組を状態ログレコードという。
 「入出力番号」は、入出力番号を示す欄である。
 「変数」は、入出力シミュレータ240で用いられる変数の変数名を示す欄である。
 「更新前」は、更新前の変数の値を示す欄である。
 「更新後」は、更新後の変数の値を示す欄である。
 最終状態テーブル253は、最終の入出力命令が実行された後の入出力シミュレータ240の状態情報の全体を示すテーブルである。
 最終状態テーブル253には、「変数」と「値」とが互いに対応付けられる。「変数」と「値」との組を最終状態レコードという。
 「変数」は、入出力シミュレータ240で用いられる変数の変数名を示す欄である。
 「値」は、入出力シミュレータ240で用いられる変数の変数値を示す欄である。
***動作の説明***
 シミュレーション装置100の動作はシミュレーション方法に相当する。また、シミュレーション方法の手順はシミュレーションプログラムの手順に相当する。
 図6に基づいて、シミュレーション方法を説明する。
 ステップS101において、制御部110は、順実行と逆実行とのいずれの実行方法でシミュレーションを実行するか判定する。
 順実行は、ターゲットプログラム200に含まれる複数の実行命令の実行順に、ターゲットプログラム200に含まれる実行命令の実行を模擬する実行方法である。
 逆実行は、ターゲットプログラム200に含まれる複数の実行命令の実行順とは逆順に、ターゲットプログラム200に含まれる実行命令の実行を模擬する実行方法である。
 具体的には、実行方法は以下のように判定される。
 まず、利用者は、入力装置904を操作して、順実行または逆実行を実行方法としてシミュレーション装置100に入力する。但し、逆実行は、順実行が行われる前に指定することはできず、順実行が行われた後に指定することが可能となる。
 次に、受付部192は、入力された実行方法を受け付ける。
 そして、制御部110は、受け付けられた実行方法が順実行と逆実行とのいずれであるか判定する。
 実行方法が順実行であると判定された場合、処理はステップS200に進む。
 実行方法が逆実行であると判定された場合、処理はステップS300に進む。
 ステップS200は順実行方法である。
 ステップS200において、制御部110は、実行模擬部121と実行ログ生成部122とリソースログ生成部123と入出力模擬部131と入出力ログ生成部132とを起動する。起動された要素は、以下のように動作する。
 実行模擬部121は、ターゲットプログラム200に基づいて、実行シミュレータ210として機能する。
 具体的には、実行模擬部121は、ターゲットプログラム200における複数の実行命令の実行順に、ターゲットプログラム200に含まれる実行命令の実行を模擬する。
 実行模擬部121の動作の詳細については後述する。
 実行ログ生成部122は、実行ログファイル220を生成する。
 具体的には、実行ログ生成部122は、ターゲットプログラム200に含まれる実行命令の実行が模擬される毎に、実行命令の実行が模擬される前の実行シミュレータ210の状態情報などを、実行ログファイル220に登録する。
 実行ログ生成部122の動作の詳細については後述する。
 リソースログ生成部123は、リソースログファイル230を生成する。
 具体的には、リソースログ生成部123は、ターゲットプログラム200に含まれる実行命令の実行が模擬される毎に、実行命令の実行が模擬される前のリソースモデル211の状態情報などを、リソースログファイル230に登録する。
 リソースログ生成部123の動作の詳細については後述する。
 入出力模擬部131は、入出力命令の実行が模擬される場合に、入出力シミュレータ240として機能する。
 入出力模擬部131の動作の詳細については後述する。
 入出力ログ生成部132は、入出力ログファイル250を生成する。
 具体的には、入出力ログ生成部132は、入出力命令の実行が模擬される場合に、入出力命令の実行が模擬される前の入出力シミュレータ240の状態情報を入出力ログファイル250に登録する。
 入出力ログ生成部132の動作の詳細については後述する。
 ステップS300は逆実行方法である。
 ステップS300において、制御部110は、実行模擬部121と入出力模擬部131と実行復元部141とリソース復元部142と入出力復元部143とを起動する。起動された要素は、以下のように動作する。
 実行模擬部121は、ターゲットプログラム200に基づいて、実行シミュレータ210として機能する。
 具体的には、実行模擬部121は、実行ログファイル220に基づいて、ターゲットプログラム200における複数の実行命令の実行順とは逆順に、ターゲットプログラム200に含まれる実行命令の実行を模擬する。
 実行命令の実行は、以下のように模擬される。
 まず、実行復元部141は、実行ログファイル220を用いて、実行命令の実行が模擬される前の実行シミュレータ210の状態情報を復元する。
 また、リソース復元部142は、リソースログファイル230を用いて、実行命令の実行が模擬される前のリソースモデル211の状態情報を復元する。
 そして、実行模擬部121は、実行シミュレータ210の復元された状態情報とリソースモデル211の復元された状態情報とを用いて、実行命令の実行を模擬する。
 実行復元部141とリソース復元部142と実行模擬部121とのそれぞれの動作の詳細については後述する。
 入出力模擬部131は、入出力命令の実行が模擬される場合に、入出力シミュレータ240として機能する。そして、入出力模擬部131は、入出力装置の動作を模擬する。
 具体的には、入出力装置の動作は、以下のように模擬される。
 まず、入出力復元部143は、入出力シミュレータ240を用いて、入出力命令の実行が模擬される前の入出力シミュレータ240の状態情報を復元する。
 そして、入出力模擬部131は、入出力シミュレータ240の復元された状態情報を用いて、入出力装置の動作を模擬する。
 入出力復元部143と入出力模擬部131とのそれぞれの動作の詳細については後述する。
 ステップS102において、制御部110は、実行方法の変更の要否を判定する。実行方法の変更は、順実行のシミュレーションが行われた後に逆実行のシミュレーションを行うこと、および、逆実行のシミュレーションが行われた後に順実行のシミュレーションを行うことを意味する。
 具体的には、実行方法の変更の要否は以下のように判定される。
 実行方法の変更を希望する利用者は、入力装置904を操作して、変更指示をシミュレーション装置100に入力する。実行方法の変更を希望しない利用者は、入力装置904を操作して、終了指示をシミュレーション装置100に入力する。
 受付部192は、入力された変更指示または終了指示を受け付ける。
 変更指示が受け付けられた場合、制御部110は、実行方法の変更が必要であると判定する。
 終了指示が受け付けられた場合、制御部110は、実行方法の変更が不要であると判定する。
 実行方法の変更が必要であると判定された場合、処理はステップ101に進む。順実行のシミュレーションの後であれば、ステップS101において、制御部110は、実行方法が逆実行であると判定する。逆実行のシミュレーションの後であれば、ステップS101において、制御部110は、実行方法が順実行であると判定する。
 実行方法の変更が不要であると判定された場合、処理は終了する。
 図7に基づいて、実行模擬処理[順実行]を説明する。
 実行模擬処理[順実行]は、順実行方法(S200)において実行される。
 実行模擬処理[順実行]において、実行模擬部121は、実行シミュレータ210として機能する。
 ステップS201において、実行シミュレータ210は、プログラムカウンタを初期化する。
 具体的には、実行シミュレータ210は、ターゲットプログラム200の先頭のアドレスをプログラムカウンタに設定する。
 ステップS202において、実行シミュレータ210は、プログラムカウンタに対応する実行命令をターゲットプログラム200から読み出す。
 プログラムカウンタに対応する実行命令とは、プログラムカウンタが示すアドレスで識別される記憶領域に書き込まれた実行命令である。
 ステップS203において、実行シミュレータ210は、読み出された実行命令の実行を模擬する。そして、表示部193は、模擬結果を表示する。
 実行命令の実行が模擬されることによって、実行命令に応じてリソースモデル211が更新され、模擬結果に応じて実行シミュレータ210の状態情報が更新される。
 入出力命令の実行が模擬される場合、実行シミュレータ210は、リソースモデル211の中の入出力要求領域に要求情報を書き込む。入出力領域は、入出力の要求に用いられる記憶領域である。要求情報は、入出力の内容を示す情報である。
 ステップS204において、実行シミュレータ210は、ステップS202で読み出した実行命令が最終の実行命令であるか判定する。
 ステップS202で読み出した実行命令が最終の実行命令である場合、実行模擬部121は模擬終了を実行ログ生成部122に通知する。そして、処理は終了する。
 ステップS202で読み出した実行命令が最終の実行命令でない場合、処理はステップS205に進む。
 ステップS205において、実行シミュレータ210は、プログラムカウンタを次のアドレスに更新する。
 ステップS205の後、処理はステップS202に進む。
 図8に基づいて、実行ログ生成処理を説明する。
 実行ログ生成処理は、順実行方法(S200)において実行される。
 ステップS211は、実行ログ生成部122の起動時に実行される。
 ステップS211において、実行ログ生成部122は、実行番号に1を設定する。
 ステップS212は、プログラムカウンタの初期化時(図7のS201)および更新時(図7のS205)に実行される。具体的には、実行ログ生成部122は、プログラムカウンタを監視する。そして、実行ログ生成部122は、プログラムカウンタが更新されたときにステップS212を実行する。
 ステップS212において、実行ログ生成部122は、カウンタログテーブル221を更新する。
 具体的には、実行ログ生成部122は、カウンタログレコードを生成し、生成されたカウンタログレコードをカウンタログテーブル221に登録する。
 ステップS213は、実行命令の実行が模擬されたとき(図7のS203)に実行される。
 ステップS213において、実行ログ生成部122は、実行シミュレータ210の状態が変化したか判定する。
 具体的には、実行ログ生成部122は、実行シミュレータ210の状態情報を監視し、実行シミュレータ210の状態情報の更新を検出する。実行シミュレータ210の状態情報の更新が検出された場合、実行ログ生成部122は、実行シミュレータ210の状態が変化したと判定する。
 実行シミュレータ210の状態が変化したと判定された場合、処理はステップS214に進む。
 実行シミュレータ210の状態が変化しなかったと判定された場合、処理はステップS215に進む。
 ステップS214において、実行ログ生成部122は、状態ログテーブル222を更新する。
 具体的には、実行ログ生成部122は、状態ログレコードを生成し、生成された状態ログレコードを状態ログテーブル222に登録する。
 ステップS215において、実行ログ生成部122は、ターゲットプログラム200の模擬が終了したか判定する。ターゲットプログラム200の模擬とは、ターゲットシステムによるターゲットプログラム200の実行を模擬することである。
 具体的には、制御部110から模擬終了が通知された場合に、実行ログ生成部122は、ターゲットプログラム200の模擬が終了したと判定する。
 ターゲットプログラム200の模擬が終了したと判定された場合、処理はステップS217に進む。
 ターゲットプログラム200の模擬が終了していないと判定された場合、処理はステップS216に進む。
 ステップS216において、実行ログ生成部122は、実行番号の値を1増やす。
 ステップS216の後、処理はステップS212に進む。
 ステップS217において、実行ログ生成部122は、最終番号データ223と最終状態テーブル224とを更新する。
 具体的には、実行ログ生成部122は、最終番号データ223に示される最終番号の値を実行番号の値に変更する。さらに、実行ログ生成部122は、実行シミュレータ210の状態情報毎に最終状態レコードを生成し、生成された最終状態レコードを最終状態テーブル224に登録する。
 図9に基づいて、入出力模擬処理[順実行]を説明する。
 入出力模擬処理[順実行]は、順実行方法(S200)において実行される。
 入出力模擬処理[順実行]において、入出力模擬部131は、入出力シミュレータ240として機能する。
 ステップS221からステップS223は、リソースモデル211の中の入出力要求領域に要求情報が書き込まれたとき(図7のS203)に実行される。
 ステップS221において、入出力シミュレータ240は、入出力要求を監視し、入出力要求領域への要求情報の書込みを検出する。
 ステップS222において、入出力シミュレータ240は、入出力要求領域に書き込まれた要求情報に基づいて、入出力装置の動作を模擬する。そして、表示部193は、模擬結果を表示する。
 ステップS223において、入出力シミュレータ240は、リソースモデル211の中の入出力応答領域に応答情報を書き込む。入出力応答領域は、入出力の応答に用いられる記憶領域である。応答情報は、入出力の終了を通知する情報である。
 図10に基づいて、入出力ログ生成処理を説明する。
 入出力ログ生成処理は、順実行方法(S200)において実行される。
 ステップS231は、入出力ログ生成部132の起動時に実行される。
 ステップS231において、入出力ログ生成部132は、入出力番号に1を設定する。
 ステップS232は、リソースモデル211の中の入出力要求領域への書込み時(図7のS203)に実行される。具体的には、入出力ログ生成部132は、入出力要求を監視する。そして、入出力ログ生成部132は、入出力要求への書込みを検出したときにステップS232を実行する。
 ステップS232において、入出力ログ生成部132は、入出力ログテーブル251を更新する。
 具体的には、入出力ログ生成部132は、入出力番号と開始番号とが設定された入出力ログレコードを生成し、生成された入出力ログレコードを入出力ログテーブル251に登録する。
 ステップS233は、入出力装置の動作が模擬されたとき(図9のS222)に実行される。
 ステップS233において、入出力ログ生成部132は、入出力シミュレータ240の状態が変化したか判定する。
 具体的には、入出力ログ生成部132は、入出力シミュレータ240の状態情報を監視し、入出力シミュレータ240の状態情報の更新を検出する。入出力シミュレータ240の状態情報の更新が検出された場合、入出力ログ生成部132は、入出力シミュレータ240の状態が変化したと判定する。
 入出力シミュレータ240の状態が変化したと判定された場合、処理はステップS234に進む。
 入出力シミュレータ240の状態が変化しなかったと判定された場合、処理はステップS235に進む。
 ステップS234において、入出力ログ生成部132は、状態ログテーブル252を更新する。
 具体的には、入出力ログ生成部132は、状態ログレコードを生成し、生成された状態ログレコードを状態ログテーブル252に登録する。
 ステップS235において、入出力ログ生成部132は、入出力ログテーブル251を更新する。
 具体的には、入出力ログ生成部132は、ステップS232で入出力ログテーブル251に登録した入出力ログレコードに終了番号を設定する。
 ステップS236において、入出力ログ生成部132は、ターゲットプログラム200の模擬が終了したか判定する。
 具体的には、制御部110から模擬終了が通知された場合に、入出力ログ生成部132は、ターゲットプログラム200の模擬が終了したと判定する。
 ターゲットプログラム200の模擬が終了したと判定された場合、処理はステップS238に進む。
 ターゲットプログラム200の模擬が終了していないと判定された場合、処理はステップS237に進む。
 ステップS237において、入出力ログ生成部132は、入出力番号の値を1増やす。
 ステップS237の後、処理はステップS232に進む。
 ステップS238において、入出力ログ生成部132は、最終状態テーブル253を更新する。
 具体的には、入出力ログ生成部132は、入出力シミュレータ240の状態情報毎に最終状態レコードを生成し、生成された最終状態レコードを最終状態テーブル253に登録する。
 図11に基づいて、リソースログ生成処理を説明する。
 リソースログ生成処理は、順実行方法(S200)において実行される。
 ステップS241において、リソースログ生成部123は、リソースモデル211の状態が変化したか判定する。
 具体的には、リソースログ生成部123は、リソースモデル211の状態情報を監視し、リソースモデル211の状態情報の更新を検出する。リソースモデル211の状態情報の更新が検出された場合、リソースログ生成部123は、リソースモデル211の状態が変化したと判定する。
 リソースモデル211の状態が変化したと判定された場合、処理はステップS242に進む。
 リソースモデル211の状態が変化しなかったと判定された場合、処理はステップS243に進む。
 ステップS242において、リソースログ生成部123は、状態ログテーブル231を更新する。
 具体的には、リソースログ生成部123は、状態ログレコードを生成し、生成された状態ログレコードを状態ログテーブル231に登録する。
 ステップS243において、リソースログ生成部123は、ターゲットプログラム200の模擬が終了したか判定する。
 具体的には、制御部110から模擬終了が通知された場合に、リソースログ生成部123は、ターゲットプログラム200の模擬が終了したと判定する。
 ターゲットプログラム200の模擬が終了したと判定された場合、処理はステップS244に進む。
 ターゲットプログラム200の模擬が終了していないと判定された場合、処理はステップS241に進む。
 ステップS244において、リソースログ生成部123は、最終状態テーブル232を更新する。
 具体的には、リソースログ生成部123は、リソースモデル211の状態情報毎に最終状態レコードを生成し、生成された最終状態レコードを最終状態テーブル232に登録する。
 図12および図13に基づいて、逆実行方法(S300)の手順を説明する。
 逆実行方法(S300)において、実行復元部141による処理を実行復元処理といい、リソース復元部142による処理をリソース復元処理といい、入出力復元部143による処理を入出力復元処理という。また、実行模擬部121による処理を実行模擬処理[逆実行]といい、入出力模擬部131による処理を入出力模擬処理[逆実行]という。
 図12のステップS301において、実行復元部141は、実行ログファイル220に基づいて、実行シミュレータ210の最終状態を復元する。
 具体的には、実行復元部141は、最終状態テーブル224を用いて、実行シミュレータ210の状態情報を更新する。
 さらに、リソース復元部142は、リソースログファイル230に基づいて、リソースモデル211の最終状態を復元する。
 具体的には、リソース復元部142は、最終状態テーブル232を用いて、リソースモデル211の状態情報を更新する。
 ステップS302において、制御部110は、実行番号に最終番号の値を設定する。
 具体的には、実行復元部141は、最終番号データ223から最終番号を読み出し、実行番号の値を最終番号の値に更新する。
 ステップS311において、実行復元部141は、実行ログファイル220に基づいて、実行シミュレータ210の前状態を復元する。前状態とは、実行番号に対応する実行命令の実行が模擬される前の状態である。
 具体的には、実行復元部141は、状態ログテーブル222から、ステップS302またはステップS323で更新された実行番号と同じ実行番号を含んだ状態ログレコードを選択する。そして、実行復元部141は、選択された状態ログレコードに含まれる更新前の値を用いて、実行シミュレータ210の状態情報を更新する。更新される状態情報は、選択された状態ログレコードに含まれる変数名で識別される変数である。該当する状態ログレコードがない場合、実行復元部141は、実行シミュレータ210の状態情報を更新しない。
 さらに、リソース復元部142は、リソースログファイル230に基づいて、リソースモデル211の前状態を復元する。
 具体的には、リソース復元部142は、状態ログテーブル231から、ステップS302またはステップS323で更新された実行番号と同じ実行番号を含んだ状態ログレコードを選択する。そして、リソース復元部142は、選択された状態ログレコードに含まれる更新前の値を用いて、リソースモデル211の状態情報を更新する。更新される状態情報は、選択された状態ログレコードに含まれるアドレスに対応するデータである。アドレスに対応するデータとは、アドレスで識別される記憶領域に記憶されたデータである。該当する状態ログレコードがない場合、リソース復元部142は、リソースモデル211の状態情報を更新しない。
 ステップS312において、制御部110は、入出力ログファイル250に基づいて、実行番号に対応する実行命令が入出力命令であるか判定する。
 具体的には、制御部110は、入出力ログテーブル251から、実行番号と同じ値の開始番号を含んだ入出力ログレコードを検索する。該当する入出力ログレコードがある場合、制御部110は、実行番号に対応する実行命令が入出力命令であると判定する。
 実行番号に対応する実行命令が入出力命令であると判定された場合、処理は図13のステップS331に進む。
 実行番号に対応する実行命令が入出力命令でないと判定された場合、処理はステップS313に進む。
 ステップS313において、実行模擬部121は実行シミュレータ210として機能し、実行シミュレータ210は実行番号に対応する実行命令を模擬する。
 具体的には、実行番号に対応する実行命令は、以下のように模擬される。
 まず、制御部110は、カウンタログテーブル221から、ステップS302またはステップS323で更新された実行番号と同じ実行番号を含んだカウンタログレコードを選択する。
 次に、実行シミュレータ210は、ターゲットプログラム200用のプログラムカウンタの値を、選択されたカウンタログレコードに含まれるプログラムカウンタの値に更新する。
 そして、実行シミュレータ210は、更新されたプログラムカウンタに対応する実行命令をターゲットプログラム200から読み出し、読み出された実行命令の実行を模擬する。また、表示部193は、模擬結果を表示する。
 ステップS321において、実行復元部141は、実行ログファイル220に基づいて、実行シミュレータ210の前状態を復元する。
 さらに、リソース復元部142は、リソースログファイル230に基づいて、リソースモデル211の前状態を復元する。
 前状態を復元する方法は、ステップS311と同じである。
 ステップS322において、制御部110は、実行番号に対応する実行命令が先頭命令であるか判定する。先頭命令は、ターゲットプログラム200における1番目の実行命令である。実行番号の値が1である場合、制御部110は、実行番号に対応する実行命令が先頭命令であると判定する。
 実行番号に対応する実行命令が先頭命令であると判定された場合、処理は終了する。
 実行番号に対応する実行命令が先頭番号でないと判定された場合、処理はステップS323に進む。
 ステップS323において、制御部110は、実行番号の値を1減らす。
 ステップS323の後、処理はステップS311に進む。
 図13のステップS331において、制御部110は、入出力状態の復元を入出力復元部143に要求する。入出力状態の復元とは、入出力シミュレータ240の状態情報を復元することである。具体的には、制御部110は、入出力復元部143を呼び出す。
 ステップS332において、制御部110は、復元の終了を確認する。
 具体的には、制御部110は、入出力復元部143から終了通知を受ける。
 ステップS333において、実行復元部141は実行シミュレータ210として機能し、実行シミュレータ210は入出力命令の実行を模擬する。そして、表示部193は、模擬結果を表示する。
 さらに、入出力模擬部131は入出力シミュレータ240として機能し、入出力シミュレータ240は入出力装置の動作を模擬する。そして、表示部193は、模擬結果を表示する。
 具体的には、実行シミュレータ210および入出力シミュレータ240は、以下のように動作する。
 まず、実行シミュレータ210は、入出力命令の実行を模擬し、リソースモデル211の中の入出力要求領域に要求情報を書き込む。
 次に、入出力シミュレータ240は、入出力要求領域への要求情報の書込みを検出し、要求情報に基づいて、入出力装置の動作を模擬する。
 そして、入出力シミュレータ240は、リソースモデル211の中の入出力応答領域に応答情報を書き込む。
 ステップS333の後、制御部110は模擬終了を入出力復元部143に通知し、処理は図12のステップS321に進む。
 図14に基づいて、入出力復元処理を説明する。
 入出力復元処理は、逆実行方法(S300)において実行される。
 ステップS341は、入出力復元部143が起動されたときに実行される。
 ステップS341において、入出力復元部143は、入出力ログファイル250に基づいて、入出力シミュレータ240の最終状態を復元する。
 具体的には、入出力復元部143は、最終状態テーブル253を用いて、入出力シミュレータ240の状態情報を更新する。
 ステップS342からステップS344は、入出力状態の復元が要求されたとき(図13のS331)に実行される。
 ステップS342において、入出力復元部143は、復元要求を検出する。
 具体的には、入出力復元部143は、制御部110から呼び出される。
 ステップS343において、入出力復元部143は、入出力ログファイル250に基づいて、入出力シミュレータ240の前状態を復元する。
 具体的には、入出力復元部143は、以下のように入出力シミュレータ240の前状態を復元する。
 まず、入出力復元部143は、入出力ログテーブル251から、実行番号と同じ値の開始番号を含んだ入出力ログレコードを選択する。
 次に、入出力復元部143は、選択された入出力ログレコードから、入出力番号を読み出す。
 次に、入出力復元部143は、状態ログテーブル252から、読み出された入出力番号と同じ入出力番号を含んだ状態ログレコードを選択する。
 そして、入出力復元部143は、選択された状態ログレコードに含まれる更新前の値を用いて、入出力シミュレータ240の状態情報を更新する。更新される状態情報は、選択された状態ログレコードに含まれる変数名で識別される変数である。該当する状態ログレコードがない場合、入出力復元部143は、入出力シミュレータ240の状態情報を更新しない。
 ステップS344において、入出力復元部143は、復元の終了を制御部110に通知する。
 ステップS345は、入出力命令の実行が模擬された後(図13のS333)に実行される。具体的には、入出力復元部143は、制御部110から模擬終了が通知されたときに、ステップS345を実行する。
 ステップS345において、入出力復元部143は、入出力ログファイル250に基づいて、入出力シミュレータ240の前状態を復元する。前状態を復元する方法は、ステップS343と同じである。
 ステップS346において、入出力復元部143は、ターゲットプログラム200の逆実行が終了したか判定する。ターゲットプログラム200の逆実行とは、ターゲットプログラム200に含まれる実行命令を逆順に模擬することである。
 具体的には、制御部110から逆実行終了が通知された場合に、入出力復元部143は、ターゲットプログラム200の逆実行が終了したと判定する。
 ターゲットプログラム200の逆実行が終了したと判定された場合、処理は終了する。
 ターゲットプログラム200の逆実行が終了していないと判定された場合、処理はステップS342に戻る。
 図15に基づいて、順実行方法(S200)の具体例を説明する。
 実行シミュレータ210は、命令1から命令8まで順番に実行命令の実行を模擬する。
 実行ログ生成部122は、命令1から命令8までの実行命令が模擬される間、実行ログを収集する。その結果、図3に示すような実行ログファイル220が得られる。
 命令2、命令5および命令6は入出力命令である。
 命令2、命令5または命令6の実行が模擬される場合、実行シミュレータ210は、リソースモデル211の中の入出力要求領域への書込みを行う。
 入出力要求領域への書込みが行われた場合、入出力シミュレータ240は、入出力装置の動作を模擬する。IO1およびIO2は模擬される入出力である。
 IO1またはIO2が終了した場合、入出力シミュレータ240は、リソースモデル211の中の入出力応答領域への書込みを行う。
 入出力ログ生成部132は、IO1およびIO2が模擬されている間、入出力ログを収集する。その結果、図5に示すような入出力ログファイル250が得られる。
 リソースログ生成部123は、命令2から命令8までの実行命令が模擬される間、リソースログを収集する。その結果、図4に示すようなリソースログファイル230が得られる。
 図16および図17に基づいて、逆実行方法(S300)の具体例を説明する。
 図16において、実行復元部141は、命令8の実行が模擬される前の実行シミュレータ210の状態情報を復元する。また、リソース復元部142は、命令8の実行が模擬される前のリソースモデル211の状態情報を復元する。
 そして、実行シミュレータ210は、命令8の実行を模擬する。
 次に、実行復元部141は、命令7の実行が模擬される前の実行シミュレータ210の状態情報を復元する。また、リソース復元部142は、命令7の実行が模擬される前のリソースモデル211の状態情報を復元する。
 そして、実行シミュレータ210は、命令7の実行を模擬する。
 図17において、実行復元部141は、命令6の実行が模擬される前の実行シミュレータ210の状態情報を復元する。また、リソース復元部142は、命令6の実行が模擬される前のリソースモデル211の状態情報を復元する。
 そして、実行シミュレータ210は、命令6の実行を模擬する。
 また、入出力復元部143は、命令6の実行が模擬される前の入出力シミュレータ240の状態情報を復元する。
 そして、入出力シミュレータ240は、IO2を模擬する。
 次に、実行復元部141は、命令6の実行が模擬される前の実行シミュレータ210の状態情報を復元する。また、リソース復元部142は、命令6の実行が模擬される前のリソースモデル211の状態情報を復元する。
 そして、実行シミュレータ210は、命令6の実行を模擬する。
 その後、同様にして、命令4から命令1まで逆順に実行命令の実行が模擬される。また、命令2が模擬されるときにIO1が模擬される。
***実施の形態1の効果***
 命令セットシミュレーションとIOシミュレーションとを連携してターゲットシステムのシミュレーションを行うことが可能となる。
 逆実行方法(S300)により、シミュレーションを最初から実行し直す必要がなくなるため、エラー要因を特定する際にシミュレーションの実行に要する時間を削減できる。さらに、経験および勘に頼ってエラー要因を絞りこむ必要がなくなる。したがって、デバッグの効率が向上する。
***他の構成***
 実行シミュレータ210および入出力シミュレータ240は、ハードウェアで実現されたシミュレータであってもよい。
 実行シミュレータ210と入出力シミュレータ240とは、別のスレッドで実行されてもよいし、同一のスレッドで実行されてもよい。
***実施の形態の補足***
 実施の形態において、シミュレーション装置100の機能はハードウェアで実現してもよい。
 図18に、シミュレーション装置100の機能がハードウェアで実現される場合の構成を示す。
 シミュレーション装置100は処理回路990を備える。処理回路990はプロセッシングサーキットリともいう。
 処理回路990は、制御部110と実行模擬部121と実行ログ生成部122とリソースログ生成部123と入出力模擬部131と入出力ログ生成部132と実行復元部141とリソース復元部142と入出力復元部143と記憶部191といった「部」の機能を実現する専用の電子回路である。
 具体的には、処理回路990は、単一回路、複合回路、プログラム化したプロセッサ、並列プログラム化したプロセッサ、ロジックIC、GA、ASIC、FPGAまたはこれらの組み合わせである。GAはGate Arrayの略称であり、ASICはApplication Specific Integrated Circuitの略称であり、FPGAはField Programmable Gate Arrayの略称である。
 シミュレーション装置100は、処理回路990を代替する複数の処理回路を備えてもよい。複数の処理回路は、「部」の機能を分担する。
 シミュレーション装置100の機能は、ソフトウェアとハードウェアとの組み合わせで実現してもよい。つまり、「部」の機能の一部をソフトウェアで実現し、「部」の機能の残りをハードウェアで実現してもよい。
 実施の形態は、好ましい形態の例示であり、本発明の技術的範囲を制限することを意図するものではない。実施の形態は、部分的に実施してもよいし、他の形態と組み合わせて実施してもよい。フローチャート等を用いて説明した手順は、適宜に変更してもよい。
 100 シミュレーション装置、110 制御部、121 実行模擬部、122 実行ログ生成部、123 リソースログ生成部、131 入出力模擬部、132 入出力ログ生成部、141 実行復元部、142 リソース復元部、143 入出力復元部、191 記憶部、192 受付部、193 表示部、200 ターゲットプログラム、210 実行シミュレータ、211 リソースモデル、220 実行ログファイル、221 カウンタログテーブル、222 状態ログテーブル、223 最終番号データ、224 最終状態テーブル、230 リソースログファイル、231 状態ログテーブル、232 最終状態テーブル、240 入出力シミュレータ、250 入出力ログファイル、251 入出力ログテーブル、252 状態ログテーブル、253 最終状態テーブル、901 プロセッサ、902 メモリ、903 補助記憶装置、904 入力装置、905 ディスプレイ、990 処理回路。

Claims (10)

  1.  複数の実行命令を含んだプログラムであって入出力装置を有するターゲットシステムによって実行されるプログラムであるターゲットプログラムに基づいて、前記ターゲットシステムによる前記ターゲットプログラムの実行を模擬する実行シミュレータとして機能する実行模擬部と、
     前記複数の実行命令のうちの入出力命令の実行が模擬される場合に、前記入出力装置の動作を模擬する入出力シミュレータとして機能する入出力模擬部と
    を備えるシミュレーション装置。
  2.  前記シミュレーション装置は、実行命令の実行が模擬される前の実行シミュレータの状態情報を含んだ実行ログファイルを記憶する記憶部を備え、
     前記実行模擬部は、前記実行ログファイルに基づいて、前記ターゲットプログラムにおける前記複数の実行命令の実行順とは逆順に、前記ターゲットプログラムに含まれる実行命令の実行を模擬する
    請求項1に記載のシミュレーション装置。
  3.  前記記憶部は、入出力命令の実行が模擬される前の入出力シミュレータの状態情報を含んだ入出力ログファイルを記憶し、
     前記シミュレーション装置は、入出力命令の実行が模擬される場合に、前記入出力ログファイルを用いて、入出力命令の実行が模擬される前の前記入出力シミュレータの状態情報を復元する入出力復元部を備え、
     前記入出力模擬部は、前記入出力シミュレータの復元された状態情報を用いて、前記入出力装置の動作を模擬する
    請求項2に記載のシミュレーション装置。
  4.  前記シミュレーション装置は、前記入出力ログファイルを生成する入出力ログ生成部を備え、
     前記実行模擬部は、前記ターゲットプログラムにおける前記複数の実行命令の実行順に、前記ターゲットプログラムに含まれる実行命令の実行を模擬し、
     前記入出力ログ生成部は、入出力命令の実行が模擬される場合に、入出力命令の実行が模擬される前の前記入出力シミュレータの状態情報を前記入出力ログファイルに登録する
    請求項3に記載のシミュレーション装置。
  5.  前記シミュレーション装置は、実行命令の実行が模擬される場合に、前記実行ログファイルを用いて、実行命令の実行が模擬される前の前記実行シミュレータの状態情報を復元する実行復元部を備え、
     前記実行模擬部は、前記実行シミュレータの復元された状態情報を用いて、実行命令の実行を模擬する
    請求項2から請求項4のいずれか1項に記載のシミュレーション装置。
  6.  前記シミュレーション装置は、前記実行ログファイルを生成する実行ログ生成部を備え、
     前記実行模擬部は、前記ターゲットプログラムにおける前記複数の実行命令の実行順に、前記ターゲットプログラムに含まれる実行命令の実行を模擬し、
     前記実行ログ生成部は、実行命令の実行が模擬される場合に、実行命令の実行が模擬される前の前記実行シミュレータの状態情報を前記実行ログファイルに登録する
    請求項5に記載のシミュレーション装置。
  7.  前記記憶部は、前記ターゲットシステムにおけるリソースモデルと、実行命令の実行が模擬される前の前記リソースモデルの状態情報を含んだリソースログファイルとを記憶し、
     前記シミュレーション装置は、実行命令の実行が模擬される場合に、前記リソースログファイルを用いて、実行命令の実行が模擬される前の前記リソースモデルの状態情報を復元するリソース復元部を備え、
     前記実行模擬部は、前記実行シミュレータの復元された状態情報と前記リソースモデルの復元された状態情報とを用いて実行命令の実行を模擬する
    請求項5または請求項6に記載のシミュレーション装置。
  8.  前記シミュレーション装置は、前記リソースログファイルを生成するリソースログ生成部を備え、
     前記実行模擬部は、前記ターゲットプログラムにおける前記複数の実行命令の実行順に、前記ターゲットプログラムに含まれる実行命令の実行を模擬し、
     前記リソースログ生成部は、実行命令の実行が模擬される場合に、実行命令の実行が模擬される前の前記リソースモデルの状態情報を前記リソースログファイルに登録する
    請求項7に記載のシミュレーション装置。
  9.  複数の実行命令を含んだプログラムであって入出力装置を有するターゲットシステムによって実行されるプログラムであるターゲットプログラムに基づいて、前記ターゲットシステムによる前記ターゲットプログラムの実行を模擬する実行シミュレータとして機能する実行模擬処理と、
     前記複数の実行命令のうちの入出力命令の実行が模擬される場合に、前記入出力装置の動作を模擬する入出力シミュレータとして機能する入出力模擬処理と
    をコンピュータに実行させるためのシミュレーションプログラム。
  10.  前記実行シミュレータは、実行命令の実行が模擬される前の実行シミュレータの状態情報を含んだ実行ログファイルに基づいて、前記ターゲットプログラムにおける前記複数の実行命令の実行順とは逆順に、前記ターゲットプログラムに含まれる実行命令の実行を模擬する
    請求項9に記載のシミュレーションプログラム。
PCT/JP2016/066932 2016-06-07 2016-06-07 シミュレーション装置およびシミュレーションプログラム WO2017212549A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2016/066932 WO2017212549A1 (ja) 2016-06-07 2016-06-07 シミュレーション装置およびシミュレーションプログラム
JP2016561863A JP6076576B1 (ja) 2016-06-07 2016-06-07 シミュレーション装置およびシミュレーションプログラム
TW105123705A TW201743149A (zh) 2016-06-07 2016-07-27 模擬裝置以及模擬程式產品

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2016/066932 WO2017212549A1 (ja) 2016-06-07 2016-06-07 シミュレーション装置およびシミュレーションプログラム

Publications (1)

Publication Number Publication Date
WO2017212549A1 true WO2017212549A1 (ja) 2017-12-14

Family

ID=57981570

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2016/066932 WO2017212549A1 (ja) 2016-06-07 2016-06-07 シミュレーション装置およびシミュレーションプログラム

Country Status (3)

Country Link
JP (1) JP6076576B1 (ja)
TW (1) TW201743149A (ja)
WO (1) WO2017212549A1 (ja)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62274436A (ja) * 1986-05-23 1987-11-28 Hitachi Ltd シミユレ−シヨン方式
JPH04352245A (ja) * 1991-05-30 1992-12-07 Fujitsu Ltd シュミレ−ション方式
JP2007004400A (ja) * 2005-06-22 2007-01-11 Oki Data Corp プログラム・デバッグ方法
US7849450B1 (en) * 2005-01-28 2010-12-07 Intel Corporation Devices, methods and computer program products for reverse execution of a simulation

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07109592B2 (ja) * 1986-02-21 1995-11-22 株式会社日立製作所 Cpu―io並列動作シミュレーション方法
JPH0581075A (ja) * 1991-09-19 1993-04-02 Mitsubishi Electric Corp ソフトウエア開発装置
JP2000020348A (ja) * 1998-07-03 2000-01-21 Toshiba Corp シミュレーション装置及びシミュレーションプログラムを記録したコンピュータ読み取り可能な記録媒体
JP2000242524A (ja) * 1999-02-18 2000-09-08 Sanyo Electric Co Ltd プロセッサのソフトウエアシミュレータ
JP2012226445A (ja) * 2011-04-15 2012-11-15 Canon Inc 情報処理装置及びプログラム

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62274436A (ja) * 1986-05-23 1987-11-28 Hitachi Ltd シミユレ−シヨン方式
JPH04352245A (ja) * 1991-05-30 1992-12-07 Fujitsu Ltd シュミレ−ション方式
US7849450B1 (en) * 2005-01-28 2010-12-07 Intel Corporation Devices, methods and computer program products for reverse execution of a simulation
JP2007004400A (ja) * 2005-06-22 2007-01-11 Oki Data Corp プログラム・デバッグ方法

Also Published As

Publication number Publication date
JPWO2017212549A1 (ja) 2018-06-14
JP6076576B1 (ja) 2017-02-08
TW201743149A (zh) 2017-12-16

Similar Documents

Publication Publication Date Title
JP6051546B2 (ja) 情報処理装置、シミュレーション方法、およびプログラム
JP6119535B2 (ja) トレース方法、処理プログラム、および情報処理装置
US9389978B2 (en) Automated operating system test framework
US9535820B2 (en) Technologies for application validation in persistent memory systems
US20130254747A1 (en) Method and apparatus for testing programs
JP2008282308A (ja) 協調検証装置、協調検証方法、協調検証プログラム
JP6076576B1 (ja) シミュレーション装置およびシミュレーションプログラム
US8938646B2 (en) Mutations on input for test generation
US11720781B2 (en) Parallel execution of gated activation unit operations
JPH04112344A (ja) データベースの疑似更新方式
JP2005510787A5 (ja)
JP5319643B2 (ja) ソフトウェアプロダクトライン開発支援装置およびその方法
JP2008112229A (ja) ソフトウェア製品の更新データ適用方法
KR101567313B1 (ko) 임베디드 시뮬레이션 시스템을 위한 영상처리 장치 및 그 방법
JP2018067057A (ja) 制御プログラムの検証装置及びプログラム
KR102457154B1 (ko) 가속기에서 실행되는 프로그램에 대한 중간표현을 생성하는 방법 및 시스템
US20130262932A1 (en) Stream Generation
JP2006350646A (ja) シミュレーション装置及びシミュレーション方法
KR102053069B1 (ko) 섬네일 이미지의 효율적 갱신 처리가 가능한 프레젠테이션 문서 편집 장치 및 그 동작 방법
WO2019198235A1 (ja) シミュレーション装置およびシミュレーションプログラム
JP4421498B2 (ja) プログラム
JP2015148851A (ja) 画像処理装置
JP2004145670A (ja) テストベンチ生成方法、テストベンチ生成装置、及びコンピュータプログラム
JP2007328775A (ja) シミュレーション装置、シミュレーション方法及びシミュレーションプログラム
CN110674622A (zh) 可视化图表生成方法、系统、存储介质及电子设备

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2016561863

Country of ref document: JP

Kind code of ref document: A

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

Ref document number: 16904584

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: 16904584

Country of ref document: EP

Kind code of ref document: A1