Referring now to drawings, a description is made of embodiment modes of the present invention.
The program interface unit 101 corresponds to an interface which reads a program 121 in the simulator 100. The simulation executing unit 103 performs a simulation of the program 121 which is read therein via the program interface unit 101. Also, the simulation executing unit 103 interrupts a simulation in response to an instruction issued from the simulation control unit 107, and outputs information (will be referred to as “simulation status information” hereinafter) related to a simulation status when the simulation is interrupted.
The command interface unit 105 corresponds to an interface used to read a command entered from an input terminal 123 which is manipulated by a user of the simulator 100. The mode recognizing unit 107 recognizes a command read via the command interface unit 105. The simulation control unit 109 controls an execution of a simulation by the simulation executing unit 103 in response to a mode recognized by the mode recognizing unit 107.
The status input/output unit 111 acquires simulation status information outputted from the simulation executing unit 103, and stores the acquired simulation status information into an external storage apparatus 125. Also, the status input/output unit 111 inputs simulation status information acquired from the storage apparatus 125 into the simulation executing unit 103. At this time, the simulation executing unit 103 restores a simulation status which is indicated by the entered simulation status information.
Precisely speaking, in such a case where a command for commanding that a simulation status designated by the user is restored is entered via the command interface unit 105 to the status input/output unit 111, the status input/output unit 111 acquires such a simulation status information in response to the entered command from the storage apparatus 125. When the acquired simulation status information is inputted to the simulation executing unit 103, the simulation executing unit 103 restores a simulation status which is indicated by the entered simultaneous status information. It should also be noted that when a command for commanding that a designated simulation status is restored is inputted, it is preferable that a simulation as to a program in response to the input command is carried out in the simulation executing unit 103.
In the present embodiment mode, plural sets of the below-mentioned commands have been prepared which can be entered from an input terminal. The plural modes of the present embodiment mode are a time mode, a cycle mode, an interrupt mode, a memory access mode, a flag changing mode, and a task switching mode.
In the time mode, output timing of simulation status information has been set in a predetermined time interval (for instance, 1 time per 1 second). In the cycle mode, output timing of simulation status information has been set in a predetermined cycle number interval (for example, 1 time per 100 cycles). In the interrupt mode, output timing of simulation status information has been set in a predetermined interrupt number interval (for instance, 1 time per 10 times). In the memory access mode, output timing of simulation status information has been set in a predetermined memory access interval (for example, 1 time per 100 cycles). In the flag charge mode, output timing of simulation status information has been set in a predetermined flag changing number interval (for example, 1 time per 10 times). In the task switching mode, output timing of simulation status information has been set in a predetermined task switching number interval (for example, 1 time per 10 times).
The simulation control unit 109 contains a plurality of timing control units in correspondence with the respective plural commands.
The simulation control unit 109 executes such a timing control unit corresponding to a mode which is recognized by the mode recognizing unit 107. It should also be understood that a time in the time mode, an interrupt number in the cycle mode, a memory access number in the memory access mode, a flag changing number in the flag changing mode; and a task switching number in the task switching mode correspond to either times on numbers which are set by the user of the simulator 100. Either a time internal or a number which is set by the user is read via the command interface unit 105, and then, is recognized by the mode recognizing unit 107, and thereafter, is set to the relevant timing control unit.
It should also be noted that the interrupt number which is set to the interrupt mode may be defined as a total number directed to all of interrupts, or may be alternatively defined as a total number directed to interrupts designated by the user. Also, the memory access number which is set to the memory access code may be defined as a total access number directed to all address range of a memory (not shown), or may be alternatively defined as a total access number directed to an address range designated by the user. Also, the flag changing number which is set to the flag changing mode may be defined as a total number directed to all of flags, or may be alternatively defined as a total number of tasks designated by the user. Also, the task switching number which is set to the task switching mode may be defined as a total number directed to all of tasks, or may be alternatively defined as a total number of tasks designated by the user.
The simulation executing unit 103 interrupts a simulation at timing defined in accordance with an instruction outputted by a timing control unit corresponding to a mode selected by the user, and outputs simulation status information indicative of a simulation status when this simulation is interrupted.
Next, a description is made of operations of the simulator 100 according to the present embodiment mode.
In the step S105, the simulator 100 judges whether or not a mode is selected by the user. In the step S105, when the mode is selected, the process operation is advanced to a step S107, whereas when the mode is not selected, the process operation is advanced to a step S109. In the step S107, output timing of the mode selected by the user is set to the simulation control unit 109. In the step S109, the simulation executing unit 103 performs a simulation.
While the simulation is carried out by the simulation executing unit 109, the simulation control unit 109 monitors whether or not the present timing is the set output timing (step S111). Then, when the simulation control unit 109 judges that the present timing is the output timing set in the step S111, the process operation is advanced to a step S113, whereas when the simulation control unit 109 judges that the present timing is not the output timing set in the step S111, the process operation is advanced to a step S115. In the step S113, the simulation status information outputted from the simulation executing unit 103 is stored in the storage apparatus 125. In the step S115, the simulator 100 judges whether or not the simulation is accomplished. The process operations defined from the step S111 to the step S115 are executed in a repetition manner until the simulation is accomplished.
In accordance with the simulator 100 of the present embodiment mode, with respect to the timing for reproducing the failure statuses, the plurality of modes different from each other have been prepared, and the simulation status at such a timing corresponding to the selected mode is stored, while this mode is selected from the above-described plural modes by considering the quality of the program. As a consequence, even when the program where switching of the tasks is not present is simulated, and also, such a program which requires a huge simulation time is simulated, a desirable simulation status can be readily restored with a short time. Also, since the user selects the optimum mode, a total output time of the simulation status information is restricted. As a result, it is possible to avoid that the execution speed of the simulation is lowered. Accordingly, a total number of debugging works executed by the simulation can be reduced. As a consequence, the simulation 100 can simulate any types of programs in an effective manner.
Number | Date | Country | Kind |
---|---|---|---|
P. 2006-123523 | Apr 2006 | JP | national |