CPC G06F 8/35 (2013.01) [G06F 8/24 (2013.01); G06F 8/457 (2013.01); G06F 9/54 (2013.01)] | 8 Claims |
1. A method of simulating, by a processor, a plurality of codes that form a program configured to control a control target, the method comprising causing the processor to execute the following:
first setting processing for setting a first process of executing a software in a loop simulation of an operation of a code group excluding a specific code among the plurality of codes;
second setting processing for setting a second process of executing a model in a loop simulation of an operation of a specific model obtained by modeling the specific code;
first simulation processing for executing, in the first process, a first simulation of a code preceding the specific code in the code group;
second simulation processing for executing, in the second process, a second simulation of the specific model through use of an execution result of the first simulation by inter-process communication between the first process and the second process;
third simulation processing for executing, in the first process, a third simulation of a code succeeding the specific code through use of an execution result of the second simulation by the inter-process communication between the first process and the second process;
setting, by the processor, in the first setting processing, a first semaphore for managing exclusive control of the second process in the first process, and setting a shared storage area accessible to the second process so that the shared storage area is accessible to the first process;
setting, by the processor, in the second setting processing, a second semaphore for managing exclusive control of the first process in the second process, and setting the shared storage area so that the shared storage area is accessible to the second process;
storing, by the processor, in the first simulation processing, the execution result of the first simulation in the shared storage area, and releasing the first semaphore for the second process;
acquiring, by the processor, in the second simulation processing, the execution result of the first simulation, which is stored in the shared storage area, when the first semaphore is released, executing the simulation of the specific model in the second process, storing the execution result of the second simulation in the shared storage area, and releasing the second semaphore for the first process; and
acquiring, by the processor, in the third simulation processing, the execution result of the second simulation, which is stored in the shared storage area, when the second semaphore is released, and executing the third simulation of the code succeeding the specific code in the first process;
wherein exclusive control of the shared storage area is managed by the first and second semaphores.
|