WO2015155839A1 - Simulation system, simulation method and program - Google Patents

Simulation system, simulation method and program Download PDF

Info

Publication number
WO2015155839A1
WO2015155839A1 PCT/JP2014/060214 JP2014060214W WO2015155839A1 WO 2015155839 A1 WO2015155839 A1 WO 2015155839A1 JP 2014060214 W JP2014060214 W JP 2014060214W WO 2015155839 A1 WO2015155839 A1 WO 2015155839A1
Authority
WO
WIPO (PCT)
Prior art keywords
simulator
simulation
module
function
time
Prior art date
Application number
PCT/JP2014/060214
Other languages
French (fr)
Japanese (ja)
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/JP2014/060214 priority Critical patent/WO2015155839A1/en
Publication of WO2015155839A1 publication Critical patent/WO2015155839A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Definitions

  • the present invention relates to a technique for simulating by coordinating a plurality of simulators that internally manage simulation times in a simulation using an electronic computer.
  • Patent Document 1 discloses a synchronization matching unit that recognizes simulators having a connection relationship and synchronizes the simulators in time with respect to simulation as a method of performing simulation by integrating information while exchanging information among a plurality of simulators.
  • a method comprising: In Patent Document 2, a simulator function group prepared for each type, a table for registering a function pointer necessary for synchronous execution in the function group, and a function for controlling the execution of each simulator are prepared. It shows how to configure a mix simulator by linking functions.
  • Patent Document 2 shows a method of calling the processing of each simulator only at a necessary time in order to suppress the frequency of calling the simulator.
  • the “execution time” needs to be transmitted to the simulation execution control unit, and cannot be used in a situation where the “next processing time” cannot be obtained in advance when an existing simulator is used.
  • the present invention has been made in view of such a background, and an object of the present invention is to provide a simulation system, a simulation method, and a program capable of easily cooperating a plurality of simulators.
  • a main invention of the present invention for solving the above-described problem is a simulation system that operates first and second simulators that are software for performing simulation, wherein the first simulator performs processing related to the simulation.
  • the module includes an activation unit that activates the second simulator, and a predetermined function from the second simulator.
  • FIG. 1 It is an example of a block diagram of a simulation system. It is a figure explaining an example of the simulator before modification. It is an example of a basic composition at the time of making a some simulator cooperate. It is a figure explaining the method in which the simulator A cooperates with the simulator B via the module for a link. It is a figure showing an example of detailed operation of simulator B. It is a flowchart which shows the example of the process sequence of the module for a link in case the simulator A links simulator B dynamically. It is a flowchart which shows the example of the process sequence of an API function. A processing procedure for executing an example of simulation that is the simulator A will be described. The example of the relationship at the time of making the simulator A and the simulator B which added the offset to the simulation time cooperate is shown.
  • the simulation system is a system for operating a plurality of simulators in a coordinated manner.
  • “simulator” means a program (software) for performing processing related to simulation.
  • a process for performing a process related to simulation which is realized by an electronic computer executing a simulator, is also referred to as a “simulator”.
  • a simulator When referring to a simulator as a system, it is described as a “simulation system”.
  • the cooperative operation of a plurality of simulators includes synchronizing execution of the plurality of simulators, and in this embodiment, further includes setting and referring to data (variables) between simulators.
  • FIG. 1 is a configuration example of an electronic computer constituting the simulation system according to the present embodiment. It is possible to operate as a simulation system by operating the simulator with an electronic computer as shown in FIG.
  • the electronic computer includes a central processing unit 101, a main storage device 102, and an input / output device 103, which are connected by an internal bus 111 and can exchange data with each other.
  • the external storage device 121, the input device 122, and the display device 123 are connected to the internal bus 111 via the input / output control device 103, and the central processing unit 101, the main storage device 102, and data are connected via the input / output control device 103. Can be exchanged.
  • the central processing unit 101 reads the simulator A 300 and the simulator B 400 stored in the external storage device 121 into the main storage device 102, and the simulator read into the main storage device 102.
  • a simulation is performed by interpreting A300 and the simulator B400 and outputting the calculation result to the display device 123 or writing to the external storage device 121.
  • the simulator A300 and the simulator B400 that can be started as independent simulators are modified and linked to form one integrated program, and the simulator A300 and the simulator B400 are operated in cooperation by executing this integrated program. A simulation is performed.
  • FIGS. 2 and 3 are basic configuration examples of a plurality of simulators according to this embodiment.
  • the simulator A300 and the simulator B400 are cooperatively operated.
  • the simulator A300 and the simulator B400 incorporate a module for performing a specific simulation process corresponding to a predetermined model, and the simulator A300 and the simulator B400 each manage a time corresponding to a simulation execution content at a certain point, that is, a simulation time.
  • module X380 and module Y390 corresponding to a model that can be simulated by simulator A300 are incorporated inside simulator A300 before simulator A300 is modified. Although two modules are incorporated here, a necessary number of modules can actually be incorporated into the simulator A 300 according to the simulation contents.
  • the time management function A361 manages the progress of processing in the modules X380 and Y390 (that is, the simulation time), and controls the execution of the modules X380 and Y390 so that the simulation kernel A370 synchronizes the simulation time of each module. To do. Thereby, each module cooperates.
  • the synchronization control of the module is a well-known technique such as SystemC, and therefore detailed description thereof is omitted.
  • a module I401, a module J402, and a module K403 corresponding to models that can be simulated by the simulator B400 exist inside the simulator B400.
  • three modules are incorporated here, in practice, a necessary number of modules can be incorporated into the simulator B 400 according to the simulation contents.
  • the modules (modules I401, J402, and K403) corresponding to models that can be simulated by the simulator B400 may be in a format that cannot be incorporated into the simulator A300 as it is.
  • the time management function B407 manages the simulation times of the modules I401, J402, and K403, and the simulation kernel 404 controls the execution of the modules I401, J402, and K403, so that each module performs a cooperative operation.
  • a link module 310 is added to the modified simulator A300.
  • the link module 310 is a module for connecting another simulator.
  • the simulator B400 is connected to the simulator A300 via the link module 310.
  • the link module 310 is programmed to start another simulator (simulator B400 in this embodiment) when the module is started, and provides a function (API function 320) that is called from another simulator.
  • the linking module 310 is programmed to request the simulation kernel A 370 to perform module synchronization when the API function 320 is called.
  • the API function 320 is given the simulation time of another simulator as an argument.
  • the link module 310 adjusts its own simulation time to the simulation time given as an argument. This is because the linking module 310 waits for a difference time between its own simulation time (that is, when another simulator calls it) and the simulation time when the other simulator performs processing. This is realized by requesting A370. This can be realized, for example, by calling the wait () function in SystemC.
  • a structure for exchanging information is also passed as an argument to the API function 320 (by reference or by pointer).
  • the information exchange structure is a variable for storing a value (reference signal value) referring to the signal of the simulator A300 and a value (setting signal value) for updating the signal of the simulator A300, or information for accessing these variables. including. Which variable is used and which signal is exchanged is determined in advance.
  • the link module 310 refers to the information exchange structure, obtains the setting signal value from the variable that can be specified by the information exchange structure, and obtains the corresponding signal in the simulator A300. It is programmed to write to a variable that holds a value, and to obtain a reference signal value from a variable that holds the value of the corresponding signal in simulator A300 and write it to a variable that can be specified by a structure for information exchange.
  • the simulator A 300 and the simulator B 400 are linked and combined into one software program for execution. That is, the simulator A300 is handled as a main simulator, and the simulator B400 is handled as a subordinate simulator.
  • the simulator B 400 is statically linked with the simulator A 300 at the time of compilation.
  • the simulator B400 may be converted into a dynamic link library in advance and dynamically linked from the simulator A300.
  • the function name of the entry function (the so-called main () function) of the simulator B400 is changed to another function name.
  • the name of the changed function is referred to as a lib # main () function.
  • the simulation kernel A370 of the simulator A300 handles the linking module 310 in the same manner as the module X380 and the module Y390. That is, in the simulator A300, the simulation kernel A370 schedules the execution of each module so that the simulation times of the module X380, the module Y390, and the link module 310 are synchronized. Since this control is a well-known technique such as SystemC or the like, a detailed description thereof will be omitted, but an example of operation timing will be described later with reference to FIG.
  • API functions provided by the linking module 310 of the simulator A300 are necessary in each module (modules I401, J402, and K403) that operate in the simulator B400 in a place where a value that requires information exchange with the simulator A300 is required. Modify to call 320.
  • the modified simulator A300 when the API function 320 is called by the linking module 310, a synchronization request is issued to the simulation kernel A370, and synchronization processing between modules is performed. Thereby, the modules X380 and Y390 are synchronized, and the link module 310 is also synchronized. Therefore, the module that refers to and updates values that need information exchange with the simulator A300 in the simulator B400 is also synchronized, and each module (modules I401, J402, and K403) is also synchronized by the simulation kernel B404 in the simulator B400. Become.
  • the link module 310 calls the entry function (lib # main () function) and starts the processing of the simulator B400.
  • the simulator B400 is prepared as a dynamic library and dynamically linked, a parameter (API) transmitted to the simulator B400, predetermined initialization processing, that is, loading of the library, resolution of necessary symbols before calling the lib # main () function A process such as writing a pointer to the function 320 or a module identification code into a specific variable of the simulator B 400 is performed.
  • the simulator B400 When the simulator B400 starts the simulation process by calling the lib # main () function, the simulator B400 continues the process until a signal value reference or update process that requires information exchange with the simulator A300 occurs. When a signal value reference or update process occurs, the update value is reflected in the information exchange structure in the exchange value update / acquisition process B430, and then the simulation time and information exchange corresponding to the reference or update process are reflected.
  • the API function 320 of the simulator A300 is called by giving a structure as an argument.
  • the link module 310 When the API function 320 is called, the link module 310 first calculates a difference time between the simulation time of the link module 310 managed by the simulator A300 and the simulation time passed from the simulator B400 in the time synchronization process L321. To do.
  • the link module 310 requests the simulation kernel A370 to advance the simulation time of the simulator A300 by the difference time. This request can be made, for example, by calling the wait () function in SystemC.
  • the simulation kernel A370 requested to advance the simulation time causes the module X300 and the module Y300 to execute processing as necessary, and then returns control to the linking module 310 (running the API function 320).
  • the link module 310 fetches the setting value designated in the information exchange structure into the variable of the setting destination designated in the information exchange structure in the value acquisition / update 330, and then in the simulator A300 Then, the value that has been updated to be passed to the simulator B 400 (the value of the reference destination variable specified in the information exchange structure) is set in the information exchange structure. Thereafter, the process returns to the caller of the simulator B400.
  • the simulator B400 executes the exchange value update / acquisition process B430 to inform the simulator A300 of the final state of the simulator B400, and then the lib # main () function of the simulator A300 Returns to the place where was called.
  • the linking module 310 requests the simulation kernel A370 to end the simulation or waits for the completion of other modules in the simulator A300.
  • a window module (link module 310) for connecting the simulator A300 as a main simulator and the simulator B400 as a slave simulator was prepared.
  • the linking module provides an API function 320.
  • the entry function (so-called main function) of the simulator B400 is replaced with a function name (a function having a name that is not a reserved word) that can be called from the simulator A300, and used as a function for starting the simulator B400.
  • the object codes of the simulator A 300 and the simulator B are combined by link processing.
  • the simulator A 300 and the simulator B 400 can operate cooperatively as one simulation program.
  • the simulator A300 calls a function for starting the simulator B400 when the simulation process of the simulator B400 is first required.
  • the simulator B400 calls the API function 320 of the simulator A300 when it is necessary to pass a value to the simulator A300 or when the value of the simulator A300 needs to be acquired.
  • the simulator A300 advances the processing until the simulation time of each simulation module processed by the simulator A300 becomes after the simulation time of the simulator B400 (the link module 310 is set to wait ()).
  • the simulator B 400 returns from the activation function at the end of the simulation, and returns the processing to the simulator A 300.
  • the synchronization function of each module in the main simulator A300 (simulation execution control processing by the simulation kernel A370) is used, and not only the module incorporated in the simulator A300 but also the value on the simulator A300 side in the simulator B400.
  • Modules that need to be acquired or updated can also be synchronized, and each module incorporated in the simulator B400 by the simulation execution control process by the simulation kernel B404 of the simulator B400 can be synchronized in the same manner. That is, a plurality of simulators can be easily coordinated.
  • communication between programs is not required between simulators, the execution speed of cooperative simulation by a plurality of simulators can be improved.
  • the simulator B400 changes the entry function name and changes the value between the simulators so that the API function 320 of the simulator A300 is called at the reference point. Therefore, when using an existing simulator, it is possible to reduce the number of man-hours for modifying the simulator and efficiently perform the modification.
  • the API function 320 is called from the simulator B 400 to synchronize the module incorporated in the simulator A 300 with the module incorporated in the simulator B 400 and to refer to variables in the simulator A 300. And updates can be made. Therefore, it is possible to easily realize reference and update of signal values between the simulator A 300 and the simulator B 400 via the information exchange structure.
  • the simulator B400 can be prepared as a dynamic link library. Therefore, even when changing the simulation process in the simulator B400 connected to the simulator A300, only the simulator B400 needs to be modified, and the development efficiency can be improved.
  • FIG. 5 shows an example of the operation of the simulator B 400 with respect to the contents shown in FIG. 4, and shows a more detailed operation.
  • the overall processing flow is as already described in the description of FIG.
  • initialization A 302 initializes internal variables and the like, and then starts a simulation execution control process 360.
  • the time management function A361 of the simulation execution control process 360 manages the simulation time and execution status of each module in the simulator A300, and the simulation execution control process 360 has the earliest simulation time for a module that has not been processed. Process to transfer control to. At this time, if the module to which the control is transferred is not started, the first process of the module is called, and if the module has been started (that is, the simulation execution control process 360 is performed by the time synchronization request from the module). If so, return to the module that called the time synchronization request. When there are a plurality of modules having the earliest simulation time, any one of those modules is selected and control is transferred.
  • the simulation execution control process 360 receives a waiting time from the module when receiving a time synchronization request from the module, and updates the simulation time of the module by integrating the waiting time.
  • the simulation time is 0 for all modules in the simulator A300, so that the modules are sequentially activated.
  • the simulation execution control process 360 updates the simulation time of the module X382, and then activates the link module 310.
  • the linking module 310 activates the simulator B400 at the simulator B activation 311 and transfers control to the simulator B400.
  • the simulator B400 performs the actual processing of the simulation after the processing is started, after initialization of the simulator is performed in initialization B405.
  • the simulation actual process is a loop process, and the simulation time is updated by the time update B1 (421) and the time update B2 (422) existing in the loop.
  • the process proceeds and reaches an inter-simulator exchange value update B431 and an inter-simulator exchange value reference B432 in which a value that needs to be exchanged between simulators in a certain module or a value that needs to be exchanged between simulators is generated.
  • the API function 320 of the link module 310 is called.
  • Simulator B400 performs simulator processing by repeating a loop until the simulation end condition is satisfied, for example, the simulation time reaches a certain time.
  • the simulator B400 executes the end process B406 and calls the API function 320 of the simulator A300 to inform the simulator A300 of the final state of the simulator B400.
  • the end process B406 is completed, the process returns to the module end process 341 of the link module 310 of the simulator A300.
  • the link module 310 generates a time synchronization request so as to wait for a difference time between the simulation time passed from the simulator B 400 and the simulation time of the link module 310 in the time synchronization process L321 in the API function 320, and the simulation execution control process Control returns to 360.
  • the simulation execution control process 360 updates the simulation time of the linking module 310, and the simulation time of the linking module 310 becomes the simulation time of the module that called the API function 320 in the simulator B400.
  • the simulation execution control apparatus 360 activates the module Y390.
  • processing proceeds in module Y390 and time synchronization processing Y392 is executed a time synchronization request is generated by module Y390, and control returns to simulation execution control processing 360.
  • the simulation execution control process 360 can return to the time synchronization request source of the module with the earliest simulation time, so that each module can continue the process.
  • the processing procedure of the simulator B 400 shown in FIG. 5 is an example, and is a simulator in which the simulation time update process and the exchange value between the simulators are updated or referred to, and programmed to call the API function 320 at that time. Any simulator can be handled as the simulator B400.
  • FIG. 6 is a flowchart showing an example of a processing procedure of the linking module 310 when the simulator A 300 dynamically links the simulator B 400.
  • the linking module 310 reads the simulator B400 that has been made into a dynamic link library.
  • the linking module 310 acquires a pointer to the entry function of the simulator B 400, a pointer to a variable indicating access information to the API function 320, and a pointer to a parameter registration structure.
  • the link module 310 registers access information to the API function 320 in a variable indicating access information to the API function.
  • a variable indicating access information to the API function 320 is a pointer to the function in the case of the C language, and a pointer to an instance of the link module 310 in the case of the C ++ language (for example, the link module 310 is defined as a class. Is prepared as a member function of the linking module, and the member function is called using a pointer to the instance).
  • the link module 310 writes a parameter to be passed to the simulator B 400 in the information exchange structure.
  • the linking module 310 calls the simulator B400.
  • the linking process of the linking module 310 is performed in the ending process S806.
  • the parameter registration structure has the initial conditions of the simulator B 400 and the like, and is set in the parameter setting S804. However, if there is no parameter to be passed including the initial conditions, the parameter registration structure is unnecessary, and the parameters in the symbol resolution S802 Acquisition of a pointer to the registration structure and processing of parameter setting S804 can be omitted.
  • the linking module 310 should have an API function 320 accessible from C language. It is possible. At this time, in order to exchange values between simulators, it is necessary to access the member variables of the link module 310 during the processing of the API function 320. Therefore, a pointer to the instance of the module 310 for linking when the simulator B 400 is activated is included in the parameters set in the parameter setting S804, and the pointer to the instance is passed as a parameter for calling the API function 320 from the simulator B 400 side.
  • the API function 320 can cope with this by accessing a member variable using a pointer to an instance received as a parameter.
  • FIG. 7 is a flowchart showing an example of the processing procedure of the API function 320.
  • the simulation time difference calculation S811 calculates the difference between the simulation time of the simulator A 300 and the simulation time of the module that called the API function 320 in the simulator B 400 received as a parameter when the API function is called. .
  • simulation time synchronization S812 a time waiting process is performed for the difference time, thereby matching the simulation time of the simulator A300 with the simulation time of the module that called the API function 320 in the simulator B.
  • the time waiting process is performed by requesting the simulation kernel A370. For example, when the simulator A300 is described in SystemC, the wait () function is called by designating the difference time.
  • the pointer to the instance of the linking module 310 and the simulation time of the simulator B400 are transferred from the simulator B400 to the simulator A300 using the structure (information exchange structure) used for information exchange between the simulator A300 and the simulator B400. It doesn't matter.
  • Simulator B signal value acquisition (refer to information exchange structure)
  • the signal value to be received by the simulator A300 from the simulator B400 is included in the information exchange structure passed as a parameter when the simulator B400 calls the API function 320.
  • the member variables holding these signal values are copied to the variables managed by the simulator A300.
  • simulator B 400 calls API function 320 from a variable managed by simulator A 300 regarding the signal value to be sent from simulator A 300 to simulator B 400 Copy these signal values contained in the information exchange structure passed as parameters to the member variables.
  • FIG. 8 shows an example of a procedure executed by each module in the simulator A300 in synchronization.
  • the simulator A300 first executes process 1 (501) by the module X380.
  • the module X380 becomes the simulation time T1.
  • the modules with the shortest simulation time are the link module 310 and the module Y 390 at the simulation time 0, so the processing of any one of these modules is executed next.
  • the processing of the link module 310 is executed.
  • the process 2 (502) of the link module 310 is executed and the process is completed at the simulation time T2, and the link module 310 reaches the simulation time T2. Since the module having the smallest simulation time at this time is the module Y390 at the simulation time 0, processing 3 (503) is executed next at the module Y390, and the processing is completed at the simulation time T3. The module Y390 becomes the simulation time T3. . Since the module having the smallest simulation time at this time is the module X380 at the simulation time T1, processing 4 (504) is executed at the module X380, and the processing is completed at the simulation time T4. The simulator X380 becomes the simulation time T4. Since the module having the smallest simulation time at this time is the link module 310 at the simulation time T2, the link module 310 executes the process 5a (505).
  • the process 5a (505) performs a series of processes together with the process 5b (515). Since the signal value of the other module is referred to at the simulation time T6 that is the completion time of the process 5a (505), the simulation time is The process proceeds to the execution of the module Y390 at the simulation time T3, which is the smallest module, and the process 6 (506) is executed. Process 6 (506) is completed at simulation time T5, and module Y390 is at simulation time T5. At this time, the process moves to the execution of the module X380 at the simulation time T4, which is the module with the smallest simulation time, and the process 7 (507) is executed. After the completion of the process 7 (507), the simulation time of the module X380 becomes the completion time of the process 7 (507).
  • the process Y (508) is executed at the module Y390, the process is completed at the simulation time T7, and the module Y390 becomes the simulation time T7.
  • the process 5b (515) is executed by the link module 310, and the process is completed at the simulation time T8.
  • Simulation time T8 is reached.
  • the process Y (510) is executed by the module Y390, and the simulation time of the module Y390 becomes the completion time of the process 10.
  • the link module 310 executes the process 9 (509) and completes the process 9 (509). At this time, all the processes of the simulator A300 are completed.
  • the timing at which the updated value can be referred from other than the module that performed the process is the time when the next process executed by the module is started.
  • the value updated by the process 1 (501) can be referred to by the link module 310 or the module Y 390 at the start of the process 4 (504).
  • the simulation time of the modules other than the module X380 may be before the time T1.
  • the reference value of the module to be processed next is the processing value. This is because the value before reflecting the processing result of 1 (501) is required. That is, processing 2 (502) and processing 3 (503) need to refer to values before reflecting the processing result of processing 1 (501).
  • the simulation time of modules other than the module X380 is guaranteed to be after the time T1, so the processing result of the process 1 (501) is referred from other modules at this timing. If possible, the result of the process 1 (501) can be correctly referred to in other modules as in the process in the module X380.
  • FIG. 8 assumes a situation where there is no timing at which only a reference is made without updating a value, except for the boundary between the processing 5a (505) and the processing 5b (515). Also, it is possible to refer to the values of other modules at the value update timing.
  • the processing portion of the link module 310 indicates that the simulator B 400 is actually processed via the link module 310.
  • the simulator A300 can reproduce the operation of executing a plurality of modules in a pseudo parallel manner.
  • FIG. 9 shows an example of the relationship between the simulator A300 and the simulator B400 in which an offset is added to the simulation time.
  • the simulation of the initialization process is performed by the initialization unit simulation 901 during the simulation, and then the simulation of the actual process is performed by the actual process simulation A902.
  • the simulator B 400 does not simulate the initialization process, and the actual process simulation 912 is performed from the beginning. That is, the simulation times of the simulator A 300 and the simulator B 400 are executed while being offset from each other.
  • the simulation in which the offset time is added to the simulation time in this way is, for example, a simulator in which the simulator A300 simulates a microcomputer, and when the software for the microcomputer is executed on the model and the simulator B400 simulates the operation of the machine. It is valid.
  • the simulator A300 after executing software corresponding to hardware initialization and operating system activation, machine control software is operated, and simulation and cooperation processing of the machine operating in the simulator B400 starts.
  • the simulation of the simulator B400 becomes a useless process until the machine control software operates in the simulator A300.
  • the simulator B400 is started, so that the processing of the simulator B400 during the period of executing the initialization-related simulation processing can be suppressed, and the initialization-related simulation processing can be performed.
  • the speed can be increased.
  • FIG. 10 is a flowchart showing an example of a processing procedure of the linking module 310 when the simulator A 300 dynamically links the simulator B 400 when the simulator A 300 and the simulator B 400 to which an offset is added to the simulation time are cooperatively operated.
  • an offset time waiting S807 is inserted between the API function setting S803 and the parameter setting S804.
  • the linking module 310 requests the simulation kernel A370 to advance the simulation time by the offset time. This request causes the simulation time of the simulator A300 to advance by the offset time.
  • a value to be passed from the simulator A300 to the simulator B400 at the simulation time is set as an initial parameter of the simulator B400 so that the simulator B400 can match the state of the simulator A300 with respect to the initial conditions.
  • FIG. 11 is a flowchart showing an example of the processing procedure of the API function 320 when the simulator B 400 and the simulator B 400 are operated in cooperation by adding an offset to the simulation time.
  • the simulation time difference calculation S811 in FIG. 7 is changed to a simulation time offset added difference calculation S819 in FIG.
  • the difference between the simulation times on the simulator A300 side and the simulator B400 side is calculated in consideration of the influence of the offset time. That is, the link module 310 calculates the difference between the simulation time received from the simulator B 400 and the time when the offset time is returned from its own simulation time.
  • the processing of the other parts in FIG. 11 is the same as that described in FIG.
  • an offset can be added to the simulation time of the simulator B400. That is, by specifying the offset, the activation timing of the simulator B400 can be easily changed as necessary.
  • the configuration of the API function 320 shown in the first embodiment is divided into three functions instead of one function.
  • the respective processes of the time synchronization process L321, the value acquisition 331, and the value update 332 can be directly controlled from the simulator B400.
  • the exchange value update processing B440 is performed.
  • the exchange value reference processing B450 can be performed.
  • exchange value update processing B440 first, a function that executes the time synchronization processing L321 by the time synchronization request B1 (441) is called by giving the simulation time of the module that called the API function 320 by the simulator B400 as an argument.
  • a function for executing the value acquisition 331 is called by giving a pointer to the information exchange structure as an argument.
  • the simulation kernel A370 of the simulator A300 performs a process of fetching a necessary value from the information exchange structure from the simulator B400.
  • exchange value reference process B450 first, a function for executing the time synchronization process L321 by the time synchronization request B1 (441) is called by giving the simulation time of the simulator B400 as an argument, and then the value is updated by the exchange value reference B452. Is called with a pointer to the information exchange structure as an argument.
  • the link module 310 in the simulator A300 performs a process of writing a value to be passed to the simulator B400 into the information exchange structure.
  • the process of passing values from the simulator A 300 to the simulator B 400 and the process of passing values from the simulator B 400 to the simulator A 300 can be separated. This is necessary when calling the API function 320 on the simulator A 300 side. Only processing can be performed.
  • the API function 320 may have two configurations: a function that performs time synchronization processing L321 and value acquisition 331, and a function that performs time synchronization processing L321 and value update 332. It is also conceivable to provide both the function shown in the first embodiment and the function shown in the third embodiment as the configuration of the API function 320. Further, by combining this embodiment with the second embodiment, an offset can be added to the simulation time of the simulator B400.
  • a simulator C600 is connected to the simulator A300 in addition to the simulator B400 as a cooperatively operating simulator
  • a link module 350 is prepared, and the simulator B 400 and the simulator C 600 are connected to each.
  • the simulation is performed via the simulator A300.
  • the simulator B400 is handled as the linking module 310
  • the simulator C600 is handled as the linking module 350, and the simulation processing proceeds so that the entire consistency can be obtained as the simulator A300. If this idea is extended, it is possible to connect not only two but also more simulators to the main simulator for cooperative operation.
  • the linking module 310 and the linking module 350 are the same as the module, and it is also conceivable that only the instances are separated. For example, when mounting with SystemC, it is possible to prepare the link module 310 as one class, and to create and correspond to the number of simulators to be connected.
  • a plurality of other simulators (B400, C600) and the simulator A300 can be operated in a coordinated manner.
  • This embodiment can be combined with the second embodiment to add an offset to the simulation time of the simulator B400 and the simulation time of the simulator C600.
  • the simulator B400 and the simulator C600 can also perform cooperative simulation using different simulation times.
  • the API function provided by the simulator A300 can be provided as a plurality of functions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention makes it possible to easily operate a plurality of simulators in coordination with one another. When simulating by operating software for performing a plurality of simulations in coordination with one another, one software serves as a primary simulator, while a software for performing a simulation other than the primary simulator serves as a secondary simulator. The primary simulator prepares functions for providing: the ability to receive the simulation time of the secondary simulator, and synchronize with the simulation time of the secondary simulator; the ability to receive a simulation value required for simulation from the secondary simulator; and the ability to transfer a value required for simulation by the secondary simulator to the secondary simulator. Thus, the primary simulator and the secondary simulator operate in coordination with one another as a result of the secondary simulator being linked to the primary simulator and calling these functions.

Description

シミュレーションシステム、シミュレーション方法及びプログラムSimulation system, simulation method, and program
 本発明は、電子計算機を用いたシミュレーションにおいて、内部でシミュレーション時刻を管理している複数のシミュレータを協調させてシミュレーションする技術に関する。 The present invention relates to a technique for simulating by coordinating a plurality of simulators that internally manage simulation times in a simulation using an electronic computer.
 特許文献1には、複数のシミュレータが情報交換しながら統合してシミュレーションを行う方法として、接続関係を有するシミュレータを認識すると共に、シミュレータ間でシミュレーションの実行上の時間的な同期をとる同期整合部を備える方法が示されている。また、特許文献2には、種類毎に用意したシミュレータ関数群と、関数群の中で同期実行に必要な関数ポインタを登録するテーブルと、各シミュレータの実行制御する関数を用意しておき、これら関数をリンクすることでミックスシミュレータを構成する方法が示されている。 Patent Document 1 discloses a synchronization matching unit that recognizes simulators having a connection relationship and synchronizes the simulators in time with respect to simulation as a method of performing simulation by integrating information while exchanging information among a plurality of simulators. A method comprising: In Patent Document 2, a simulator function group prepared for each type, a table for registering a function pointer necessary for synchronous execution in the function group, and a function for controlling the execution of each simulator are prepared. It shows how to configure a mix simulator by linking functions.
特開2004-38785号公報JP 2004-38785 A 特開平5-258002号公報JP-A-5-258002
 しかしながら、特許文献1で示された方法のように複数のシミュレータを協調させてシミュレーションを行う場合、それぞれのシミュレータ間を接続する通信路を用意し、適宜シミュレーション時刻の同期を取りながら値を交換する必要があり、特に値の交換頻度が高い場合、通信に伴うオーバヘッドが大きくなり、シミュレーション速度が低下してしまう。また、既存のシミュレータを協調シミュレーションに対応させるべく改変しようとした場合、交換する信号の種類や値などを考慮しながら通信プロトコルを決定した上で通信用のソフトウェアを組み込む必要があり工数を要する。 However, when a simulation is performed by coordinating a plurality of simulators as in the method disclosed in Patent Document 1, a communication path that connects the simulators is prepared, and values are exchanged while appropriately synchronizing the simulation times. In particular, when the value exchange frequency is high, the overhead associated with communication increases and the simulation speed decreases. Further, when an attempt is made to modify an existing simulator so as to correspond to the cooperative simulation, it is necessary to incorporate communication software after determining the communication protocol in consideration of the type and value of the signal to be exchanged.
 また、特許文献2で示されている方法では、シミュレーション実行制御部が、シミュレーション1単位時刻分の処理単位で各シミュレータを呼び出す必要があり、各シミュレータを呼び出す頻度が非常に高く処理オーバヘッドが大きくなってしまう。また既存のシミュレータを改変して利用する場合には、シミュレーション1単位時刻の処理が明確に分離されていないと対応が難しい。特許文献2には、シミュレータを呼び出す頻度を抑制するために、必要な時刻のみ各シミュレータの処理を呼び出す手法も示されているが、この手法を利用するには各シミュレータが予め「次の処理を行う時刻」をシミュレーション実行制御部に伝える必要があり、既存のシミュレータを活用する場合等で「次の処理を行う時刻」を予め得ることが出来ない状況では利用できない。 Further, in the method disclosed in Patent Document 2, it is necessary for the simulation execution control unit to call each simulator in a processing unit corresponding to one simulation unit time, so that the frequency of calling each simulator is very high and processing overhead increases. End up. Further, when modifying an existing simulator and using it, it is difficult to deal with it unless the processing of one simulation unit time is clearly separated. Patent Document 2 also shows a method of calling the processing of each simulator only at a necessary time in order to suppress the frequency of calling the simulator. The “execution time” needs to be transmitted to the simulation execution control unit, and cannot be used in a situation where the “next processing time” cannot be obtained in advance when an existing simulator is used.
 本発明は、このような背景を鑑みてなされたものであり、複数のシミュレータを容易に協調動作させることのできる、シミュレーションシステム、シミュレーション方法及びプログラムを提供することを目的とする。 The present invention has been made in view of such a background, and an object of the present invention is to provide a simulation system, a simulation method, and a program capable of easily cooperating a plurality of simulators.
 上記課題を解決するための本発明の主たる発明は、シミュレーションを行うソフトウェアである第1及び第2のシミュレータを動作させるシミュレーションシステムであって、前記第1のシミュレータは、前記シミュレーションに係る処理を行う複数のモジュールと、前記モジュールを同期させて実行させる実行制御処理部と、を備え、前記モジュールには、前記第2のシミュレータを起動する起動部と、前記第2のシミュレータからの所定の関数の呼び出しに応じて前記実行処理制御部に前記モジュールの実行を同期させる関数実行部と、を備えるリンク用モジュールが含まれ、前記第2のシミュレータは、前記第1のシミュレータと同期する必要がある場合に前記関数を呼び出すように構成されていることとする。 A main invention of the present invention for solving the above-described problem is a simulation system that operates first and second simulators that are software for performing simulation, wherein the first simulator performs processing related to the simulation. A plurality of modules; and an execution control processing unit that executes the modules in synchronization with each other. The module includes an activation unit that activates the second simulator, and a predetermined function from the second simulator. A link module including a function execution unit that synchronizes the execution of the module with the execution process control unit in response to a call, and the second simulator needs to be synchronized with the first simulator Are configured to call the function.
 その他本願が開示する課題やその解決方法については、発明の実施形態の欄及び図面により明らかにされる。 Other problems and solutions disclosed in the present application will be clarified in the column of the embodiment of the invention and the drawings.
 複数のシミュレータを容易に協調動作させることができる。 ∙ Multiple simulators can be easily operated in a coordinated manner.
シミュレーションシステムの構成図の例である。It is an example of a block diagram of a simulation system. 改変前のシミュレータの一例を説明する図である。It is a figure explaining an example of the simulator before modification. 複数のシミュレータを協調動作させる際の基本構成例である。It is an example of a basic composition at the time of making a some simulator cooperate. シミュレータAがリンク用モジュールを介してシミュレータBと協調動作する方法を説明する図であるIt is a figure explaining the method in which the simulator A cooperates with the simulator B via the module for a link. シミュレータBの詳細動作の一例を示す図である。It is a figure showing an example of detailed operation of simulator B. シミュレータAがシミュレータBを動的リンクする場合の、リンク用モジュールの処理手順の例を示すフローチャートである。It is a flowchart which shows the example of the process sequence of the module for a link in case the simulator A links simulator B dynamically. API関数の処理手順の例を示すフローチャートである。It is a flowchart which shows the example of the process sequence of an API function. シミュレータAである一例のシミュレーションを実行する際の処理手順を示す。A processing procedure for executing an example of simulation that is the simulator A will be described. シミュレータAとシミュレーション時刻にオフセットを付加したシミュレータBを協調動作させる際の関係の例を示す。The example of the relationship at the time of making the simulator A and the simulator B which added the offset to the simulation time cooperate is shown. シミュレータAとシミュレーション時刻にオフセットを付加したシミュレータBを協調動作させる際に、シミュレータAがシミュレータBを動的リンクする場合の、リンク用モジュールの処理手順の例を示すフローチャートである。It is a flowchart which shows the example of the process procedure of the module for a link in case the simulator A dynamically links the simulator B, when making the simulator A and the simulator B which added the offset to the simulation time cooperate. シミュレータAとシミュレーション時刻にオフセットを付加したシミュレータBを協調動作させる際の、API関数の処理手順の例を示すフローチャートである。It is a flowchart which shows the example of the process sequence of an API function at the time of making the simulator A and the simulator B which added the offset to the simulation time cooperate. シミュレータAのAPI関数の構成を変更した例である。It is an example which changed the composition of the API function of simulator A. シミュレータAに、協調動作するシミュレータとしてシミュレータBとシミュレータCとを付加した例である。This is an example in which a simulator B and a simulator C are added to the simulator A as simulators that cooperate.
 以下、本発明の一実施形態に係るシミュレーションシステムを、図面を用いて説明する。 Hereinafter, a simulation system according to an embodiment of the present invention will be described with reference to the drawings.
 本実施形態に係るシミュレーションシステムは、複数のシミュレータを協調動作させるシステムである。ここで「シミュレータ」はシミュレーションに係る処理を行うためのプログラム(ソフトウェア)を意味する。また、本実施形態では電子計算機がシミュレータを実行することにより実現される、シミュレーションに係る処理を行うプロセスのことも「シミュレータ」と記す。システムとしてのシミュレータを指す場合は「シミュレーションシステム」と記す。複数のシミュレータの協調動作には、複数のシミュレータの実行を同期させることが含まれ、本実施形態ではさらにシミュレータ間でデータ(変数)の設定及び参照をすることが含まれる。 The simulation system according to the present embodiment is a system for operating a plurality of simulators in a coordinated manner. Here, “simulator” means a program (software) for performing processing related to simulation. In the present embodiment, a process for performing a process related to simulation, which is realized by an electronic computer executing a simulator, is also referred to as a “simulator”. When referring to a simulator as a system, it is described as a “simulation system”. The cooperative operation of a plurality of simulators includes synchronizing execution of the plurality of simulators, and in this embodiment, further includes setting and referring to data (variables) between simulators.
 図1は本実施形態に係るシミュレーションシステムを構成する電子計算機の構成例である。シミュレータを図1で示すような電子計算機で動作させることでシミュレーションシステムとして動作させることが可能である。 FIG. 1 is a configuration example of an electronic computer constituting the simulation system according to the present embodiment. It is possible to operate as a simulation system by operating the simulator with an electronic computer as shown in FIG.
 電子計算機は、中央演算装置101、主記憶装置102及び入出力装置103を備え、これらは内部バス111により接続されており、相互にデータをやりとりすることが出来る。外部記憶装置121、入力装置122及び表示装置123は入出力制御装置103を介して内部バス111に接続されており、入出力制御装置103を介することで中央演算装置101、主記憶装置102とデータのやりとりが可能である。 The electronic computer includes a central processing unit 101, a main storage device 102, and an input / output device 103, which are connected by an internal bus 111 and can exchange data with each other. The external storage device 121, the input device 122, and the display device 123 are connected to the internal bus 111 via the input / output control device 103, and the central processing unit 101, the main storage device 102, and data are connected via the input / output control device 103. Can be exchanged.
 電子計算機では、入力装置122より入力された指示に従い、中央演算装置101が外部記憶装置121に保存されているシミュレータA300及びシミュレータB400を主記憶装置102に読み込み、主記憶装置102に読み込まれたシミュレータA300及びシミュレータB400を解釈して演算を行い、演算結果を表示装置123に出力したり外部記憶装置121に書き込んだりすることによりシミュレーションを行う。 In the electronic computer, in accordance with an instruction input from the input device 122, the central processing unit 101 reads the simulator A 300 and the simulator B 400 stored in the external storage device 121 into the main storage device 102, and the simulator read into the main storage device 102. A simulation is performed by interpreting A300 and the simulator B400 and outputting the calculation result to the display device 123 or writing to the external storage device 121.
 本実施形態では、独立したシミュレータとして起動可能なシミュレータA300及びシミュレータB400をそれぞれ改変したうえでリンクして1つの統合プログラムとし、この統合プログラムを実行することによりシミュレータA300及びシミュレータB400を協調動作させてシミュレーションを行うようにしている。 In this embodiment, the simulator A300 and the simulator B400 that can be started as independent simulators are modified and linked to form one integrated program, and the simulator A300 and the simulator B400 are operated in cooperation by executing this integrated program. A simulation is performed.
 図2及び図3は本実施形態に係る複数のシミュレータの基本構成例である。本実施形態では一例としてシミュレータA300とシミュレータB400とを協調動作させることを想定する。シミュレータA300及びシミュレータB400には、所定のモデルに対応する具体的なシミュレーション処理を行うモジュールが組み込まれ、シミュレータA300及びシミュレータB400はそれぞれ、ある時点のシミュレーション実行内容に対応する時刻、即ちシミュレーション時刻を管理する時刻管理機能A361及び時刻管理機能B407と、シミュレーション時刻に応じてモジュールの実行を制御するシミュレーションカーネルA370及びシミュレーションカーネルB404と、を持つ。 2 and 3 are basic configuration examples of a plurality of simulators according to this embodiment. In this embodiment, it is assumed as an example that the simulator A300 and the simulator B400 are cooperatively operated. The simulator A300 and the simulator B400 incorporate a module for performing a specific simulation process corresponding to a predetermined model, and the simulator A300 and the simulator B400 each manage a time corresponding to a simulation execution content at a certain point, that is, a simulation time. A time management function A361 and a time management function B407, and a simulation kernel A370 and a simulation kernel B404 that control module execution according to the simulation time.
 図2に示すように、シミュレータA300の改変前において、シミュレータA300の内部には、シミュレータA300によりシミュレーション可能なモデルに対応するモジュールX380、及びモジュールY390が組み込まれている。ここでは2個のモジュールを組み込んだが、実際にはシミュレーション内容に応じて必要な個数のモジュールをシミュレータA300に組み込むことができる。シミュレータA300において、時刻管理機能A361はモジュールX380及びY390における処理の進み具合(即ちシミュレーション時刻)を管理し、シミュレーションカーネルA370が各モジュールのシミュレーション時刻を同期させるように、モジュールX380及びY390の実行を制御する。これにより各モジュールは協調動作する。尚、モジュールの同期制御はSystemC等で公知な技術であるため詳述は省略する。 As shown in FIG. 2, module X380 and module Y390 corresponding to a model that can be simulated by simulator A300 are incorporated inside simulator A300 before simulator A300 is modified. Although two modules are incorporated here, a necessary number of modules can actually be incorporated into the simulator A 300 according to the simulation contents. In the simulator A300, the time management function A361 manages the progress of processing in the modules X380 and Y390 (that is, the simulation time), and controls the execution of the modules X380 and Y390 so that the simulation kernel A370 synchronizes the simulation time of each module. To do. Thereby, each module cooperates. Note that the synchronization control of the module is a well-known technique such as SystemC, and therefore detailed description thereof is omitted.
 また、シミュレータB400の改変前において、シミュレータB400の内部には、シミュレータB400でシミュレーション可能なモデルに対応するモジュールI401、モジュールJ402、モジュールK403が存在する。ここではモジュールを3個組み込んだが、実際にはシミュレーション内容に応じて必要な個数のモジュールをシミュレータB400に組み込むことができる。尚、シミュレータB400でシミュレーション可能なモデルに対応するモジュール(モジュールI401、J402及びK403)は、そのままではシミュレータA300に組み入れることはできない形式であってよい。 Also, before the modification of the simulator B400, a module I401, a module J402, and a module K403 corresponding to models that can be simulated by the simulator B400 exist inside the simulator B400. Although three modules are incorporated here, in practice, a necessary number of modules can be incorporated into the simulator B 400 according to the simulation contents. The modules (modules I401, J402, and K403) corresponding to models that can be simulated by the simulator B400 may be in a format that cannot be incorporated into the simulator A300 as it is.
 シミュレータB400においても、時刻管理機能B407がモジュールI401、J402及びK403のシミュレーション時刻を管理し、シミュレーションカーネル404がモジュールI401、J402及びK403の実行を制御することにより、各モジュールは協調動作する。 Also in the simulator B400, the time management function B407 manages the simulation times of the modules I401, J402, and K403, and the simulation kernel 404 controls the execution of the modules I401, J402, and K403, so that each module performs a cooperative operation.
 図3に示すように、改変後のシミュレータA300にはリンク用モジュール310が追加される。リンク用モジュール310は別のシミュレータを接続するためのモジュールである。本実施例では、リンク用モジュール310を介してシミュレータB400がシミュレータA300に接続される。 As shown in FIG. 3, a link module 310 is added to the modified simulator A300. The link module 310 is a module for connecting another simulator. In this embodiment, the simulator B400 is connected to the simulator A300 via the link module 310.
 リンク用モジュール310は、モジュールの起動時に他のシミュレータ(本実施形態ではシミュレータB400)を起動するようにプログラムされるとともに、他のシミュレータから呼び出される関数(API関数320)を提供する。リンク用モジュール310は、API関数320が呼び出されるとシミュレーションカーネルA370に対してモジュールの同期を行うように要求するようにプログラムされる。API関数320には引数として他のシミュレータのシミュレーション時刻が与えられる。リンク用モジュール310は、引数として与えられたシミュレーション時刻に自身のシミュレーション時刻を合わせる。これは、リンク用モジュール310が、自身のシミュレーション時刻(即ち他のシミュレータが呼び出した時点)と、他のシミュレータが処理を行った時点であるシミュレーション時刻との差分の時間だけ待機するようにシミュレーションカーネルA370に要求することにより実現される。これは例えばSystemCではwait()関数を呼び出すことで実現できる。 The link module 310 is programmed to start another simulator (simulator B400 in this embodiment) when the module is started, and provides a function (API function 320) that is called from another simulator. The linking module 310 is programmed to request the simulation kernel A 370 to perform module synchronization when the API function 320 is called. The API function 320 is given the simulation time of another simulator as an argument. The link module 310 adjusts its own simulation time to the simulation time given as an argument. This is because the linking module 310 waits for a difference time between its own simulation time (that is, when another simulator calls it) and the simulation time when the other simulator performs processing. This is realized by requesting A370. This can be realized, for example, by calling the wait () function in SystemC.
 API関数320には情報交換用の構造体も引数として渡される(参照渡し又はポインタ渡し)。情報交換用の構造体は、シミュレータA300の信号を参照した値(参照信号値)及びシミュレータA300の信号を更新する値(設定信号値)を格納する変数、或いはそれらの変数へアクセスするための情報を含む。どの変数を用いてどの信号のやりとりを行うかは予め決めておく。リンク用モジュール310は、API関数320が呼び出されると、情報交換用の構造体の参照し、情報交換用の構造体で特定できる変数から設定信号値を取得し、シミュレータA300内で対応する信号の値を保持する変数に書き込むとともに、参照信号値をシミュレータA300内で対応する信号の値を保持する変数から取得して、情報交換用の構造体で特定できる変数に書き込むようプログラムされる。 A structure for exchanging information is also passed as an argument to the API function 320 (by reference or by pointer). The information exchange structure is a variable for storing a value (reference signal value) referring to the signal of the simulator A300 and a value (setting signal value) for updating the signal of the simulator A300, or information for accessing these variables. including. Which variable is used and which signal is exchanged is determined in advance. When the API function 320 is called, the link module 310 refers to the information exchange structure, obtains the setting signal value from the variable that can be specified by the information exchange structure, and obtains the corresponding signal in the simulator A300. It is programmed to write to a variable that holds a value, and to obtain a reference signal value from a variable that holds the value of the corresponding signal in simulator A300 and write it to a variable that can be specified by a structure for information exchange.
 上述したように、本実施形態では、シミュレータA300とシミュレータB400とをリンクして一つのソフトウェアプログラムに結合して実行する。即ち、シミュレータA300を主となるシミュレータとして取り扱い、シミュレータB400を従となるシミュレータとして取り扱う。一つのソフトウェアプログラムとして動作させるために、シミュレータB400はコンパイル時にシミュレータA300と静的リンクする。あるいはシミュレータB400を予め動的リンクライブラリ化しておきシミュレータA300から動的リンクするようにしてもよい。 As described above, in this embodiment, the simulator A 300 and the simulator B 400 are linked and combined into one software program for execution. That is, the simulator A300 is handled as a main simulator, and the simulator B400 is handled as a subordinate simulator. In order to operate as one software program, the simulator B 400 is statically linked with the simulator A 300 at the time of compilation. Alternatively, the simulator B400 may be converted into a dynamic link library in advance and dynamically linked from the simulator A300.
 シミュレータB400については、シミュレータA300とシミュレータB400とをリンクするために、シミュレータB400のエントリ関数(いわゆるmain()関数)の関数名を、別の関数名に変更する。この変更した関数の名前を本実施形態ではlib#main()関数と記す。また、シミュレータB400がシミュレーション処理終了時にシミュレータA300と無関係にプログラムを終了させないよう、少なくともシミュレータB400のシミュレーション正常終了時はlib#main()関数の呼び出し元へ復帰するようにする。 Regarding the simulator B400, in order to link the simulator A300 and the simulator B400, the function name of the entry function (the so-called main () function) of the simulator B400 is changed to another function name. In this embodiment, the name of the changed function is referred to as a lib # main () function. Also, so that the simulator B 400 does not end the program regardless of the simulator A 300 when the simulation processing ends, at least when the simulation of the simulator B 400 ends normally, the program returns to the caller of the lib # main () function.
 シミュレータA300のシミュレーションカーネルA370はリンク用モジュール310もモジュールX380及びモジュールY390と同様に取り扱う。すなわち、シミュレータA300では、モジュールX380、モジュールY390及びリンク用モジュール310のシミュレーション時刻が同期されるように、シミュレーションカーネルA370が各モジュールの実行をスケジューリングする。この制御はSystemC等で公知な技術であるため詳述は省略するが、動作タイミングの例を、図8を用いて後述する。 The simulation kernel A370 of the simulator A300 handles the linking module 310 in the same manner as the module X380 and the module Y390. That is, in the simulator A300, the simulation kernel A370 schedules the execution of each module so that the simulation times of the module X380, the module Y390, and the link module 310 are synchronized. Since this control is a well-known technique such as SystemC or the like, a detailed description thereof will be omitted, but an example of operation timing will be described later with reference to FIG.
 また、シミュレータB400内で動作する各モジュール(モジュールI401、J402及びK403)でシミュレータA300と情報交換が必要な値の参照や更新が必要な箇所では、シミュレータA300のリンク用モジュール310が提供するAPI関数320を呼び出すように改変する。 Further, API functions provided by the linking module 310 of the simulator A300 are necessary in each module (modules I401, J402, and K403) that operate in the simulator B400 in a place where a value that requires information exchange with the simulator A300 is required. Modify to call 320.
 上述のとおり、改変後のシミュレータA300では、リンク用モジュール310によって、API関数320が呼び出されるとシミュレーションカーネルA370に同期要求を出し、モジュール間の同期処理が行われる。これにより、モジュールX380及びY390が同期されるとともに、リンク用モジュール310も同期される。したがって、シミュレータB400内のシミュレータA300と情報交換が必要な値の参照や更新を行うモジュールも同期され、シミュレータB400内ではシミュレーションカーネルB404により各モジュール(モジュールI401、J402及びK403)も同期されることになる。 As described above, in the modified simulator A300, when the API function 320 is called by the linking module 310, a synchronization request is issued to the simulation kernel A370, and synchronization processing between modules is performed. Thereby, the modules X380 and Y390 are synchronized, and the link module 310 is also synchronized. Therefore, the module that refers to and updates values that need information exchange with the simulator A300 in the simulator B400 is also synchronized, and each module (modules I401, J402, and K403) is also synchronized by the simulation kernel B404 in the simulator B400. Become.
 図4を用いてシミュレータA300がリンク用モジュール310を介してシミュレータB400と協調動作する流れを説明する。 A flow in which the simulator A 300 operates in cooperation with the simulator B 400 via the link module 310 will be described with reference to FIG.
 リンク用モジュール310はシミュレーションカーネルA370により制御が移されると、エントリ関数(lib#main()関数)を呼び出し、シミュレータB400の処理を開始する。シミュレータB400を動的ライブラリとして用意し動的リンクする場合には、所定の初期化処理、即ちlib#main()関数呼出前にライブラリのロード、必要なシンボルの解決、シミュレータB400へ伝えるパラメータ(API関数320へのポインタやモジュール識別用のコード等)をシミュレータB400の特定変数に書き込む等の処理を行う。 When the control is transferred by the simulation kernel A370, the link module 310 calls the entry function (lib # main () function) and starts the processing of the simulator B400. When the simulator B400 is prepared as a dynamic library and dynamically linked, a parameter (API) transmitted to the simulator B400, predetermined initialization processing, that is, loading of the library, resolution of necessary symbols before calling the lib # main () function A process such as writing a pointer to the function 320 or a module identification code into a specific variable of the simulator B 400 is performed.
 シミュレータB400は、lib#main()関数の呼び出しによりシミュレーションの処理を開始すると、シミュレータA300と情報交換が必要な信号値の参照または更新処理が発生するまで処理を継続する。信号値の参照または更新処理が発生した場合、交換値の更新・取得処理B430で情報交換用の構造体に更新内容を反映した後、その参照または更新処理に対応するシミュレーション時刻と情報交換用の構造体とを引数として与えてシミュレータA300のAPI関数320を呼び出す。 When the simulator B400 starts the simulation process by calling the lib # main () function, the simulator B400 continues the process until a signal value reference or update process that requires information exchange with the simulator A300 occurs. When a signal value reference or update process occurs, the update value is reflected in the information exchange structure in the exchange value update / acquisition process B430, and then the simulation time and information exchange corresponding to the reference or update process are reflected. The API function 320 of the simulator A300 is called by giving a structure as an argument.
 API関数320が呼び出されると、リンク用モジュール310は、まず時刻同期処理L321にてシミュレータA300で管理しているリンク用モジュール310のシミュレーション時刻とシミュレータB400から渡されたシミュレーション時刻との差分時間を計算する。リンク用モジュール310は、シミュレータA300のシミュレーション時刻を差分時間分進めるようシミュレーションカーネルA370に依頼する。この依頼は例えばSystemCではwait()関数を呼び出すことで行うことが出来る。シミュレーション時刻を進めるよう依頼されたシミュレーションカーネルA370は、必要に応じてモジュールX300及びモジュールY300に処理を実行させた後に、(API関数320を実行中の)リンク用モジュール310へ制御を戻す。 When the API function 320 is called, the link module 310 first calculates a difference time between the simulation time of the link module 310 managed by the simulator A300 and the simulation time passed from the simulator B400 in the time synchronization process L321. To do. The link module 310 requests the simulation kernel A370 to advance the simulation time of the simulator A300 by the difference time. This request can be made, for example, by calling the wait () function in SystemC. The simulation kernel A370 requested to advance the simulation time causes the module X300 and the module Y300 to execute processing as necessary, and then returns control to the linking module 310 (running the API function 320).
 リンク用モジュール310は次に値の取得・更新330で情報交換用の構造体に指定された設定先の変数に情報交換用の構造体に指定された設定値を取り込み、次にシミュレータA300内にて値が更新されたものでシミュレータB400に渡す値(情報交換用の構造体で指定された参照先の変数の値)を、情報交換用の構造体に設定する。その後、シミュレータB400の呼び出し元に復帰する。 Next, the link module 310 fetches the setting value designated in the information exchange structure into the variable of the setting destination designated in the information exchange structure in the value acquisition / update 330, and then in the simulator A300 Then, the value that has been updated to be passed to the simulator B 400 (the value of the reference destination variable specified in the information exchange structure) is set in the information exchange structure. Thereafter, the process returns to the caller of the simulator B400.
 シミュレータB400は全てのシミュレーション実行処理が完了した場合には、交換値の更新・取得処理B430を実行することでシミュレータB400の最終状態をシミュレータA300に伝えた後に、シミュレータA300のlib#main()関数を呼び出した箇所へ復帰する。復帰後、リンク用モジュール310はシミュレーションカーネルA370にシミュレーションの終了を要求する、あるいはシミュレータA300内の他のモジュールの完了を待つ処理を行う。 When all the simulation execution processes have been completed, the simulator B400 executes the exchange value update / acquisition process B430 to inform the simulator A300 of the final state of the simulator B400, and then the lib # main () function of the simulator A300 Returns to the place where was called. After returning, the linking module 310 requests the simulation kernel A370 to end the simulation or waits for the completion of other modules in the simulator A300.
 以上説明したように、本実施形態のシミュレーションシステムでは、独立して動作可能であったシミュレータA300とシミュレータB400とを1つのシミュレーションプログラムとして協調動作させるべく、次のような改変を行った。すなわち、シミュレータA300を主シミュレータとし、シミュレータB400を従のシミュレータとして接続する窓口のモジュール(リンク用モジュール310)を用意した。リンク用モジュールはAPI関数320を提供するようにした。シミュレータB400のエントリ関数(いわゆるmain関数)をシミュレータA300から呼出可能な関数名(予約語でない名称の関数)に置き換えてシミュレータB400の起動用関数とした。そのうえで、シミュレータA300とシミュレータBとのオブジェクトコードをリンク処理により結合した。これにより1つのシミュレーションプログラムとしてシミュレータA300とシミュレータB400とが協調動作するようになった。また、リンクされた1つのシミュレーションプログラムの実行時に、シミュレータA300は、シミュレータB400のシミュレーション処理が最初に必要となった際に、シミュレータB400の起動用関数を呼び出すようになった。さらに、シミュレータB400は、シミュレータA300へ値を渡す必要があるときやシミュレータA300の値を取得する必要があるときにはシミュレータA300のAPI関数320を呼び出すようになった。シミュレータA300は、API関数320がシミュレータB400から呼び出されたときには、シミュレータA300で処理を行う各シミュレーションモジュールのシミュレーション時刻がシミュレータB400のシミュレーション時刻以降になるまで処理を進め(リンク用モジュール310をwait()関数により待機させ)、情報交換用の構造体を介してシミュレータB400からの値の取り込み及びシミュレータB400へ渡す値の更新を行ったうえで、シミュレータB400へ処理を戻すようになった。シミュレータB400はシミュレーション終了時に起動用関数から復帰し、シミュレータA300に処理を戻すようになった。 As described above, in the simulation system according to the present embodiment, the following modifications are made to allow the simulator A300 and the simulator B400, which can be operated independently, to operate cooperatively as one simulation program. That is, a window module (link module 310) for connecting the simulator A300 as a main simulator and the simulator B400 as a slave simulator was prepared. The linking module provides an API function 320. The entry function (so-called main function) of the simulator B400 is replaced with a function name (a function having a name that is not a reserved word) that can be called from the simulator A300, and used as a function for starting the simulator B400. After that, the object codes of the simulator A 300 and the simulator B are combined by link processing. As a result, the simulator A 300 and the simulator B 400 can operate cooperatively as one simulation program. Further, when one linked simulation program is executed, the simulator A300 calls a function for starting the simulator B400 when the simulation process of the simulator B400 is first required. Furthermore, the simulator B400 calls the API function 320 of the simulator A300 when it is necessary to pass a value to the simulator A300 or when the value of the simulator A300 needs to be acquired. When the API function 320 is called from the simulator B400, the simulator A300 advances the processing until the simulation time of each simulation module processed by the simulator A300 becomes after the simulation time of the simulator B400 (the link module 310 is set to wait ()). It waits with a function), fetches a value from the simulator B400 and updates a value to be passed to the simulator B400 via the information exchange structure, and then returns the process to the simulator B400. The simulator B 400 returns from the activation function at the end of the simulation, and returns the processing to the simulator A 300.
 このような改変により、主たるシミュレータA300における各モジュールの同期機能(シミュレーションカーネルA370によるシミュレーション実行制御処理)を利用して、シミュレータA300に組み込まれたモジュールのみならず、シミュレータB400内でシミュレータA300側の値の取得や更新が必要なモジュールも同じく同期させることができ、さらにシミュレータB400のシミュレーションカーネルB404によるシミュレーション実行制御処理によりシミュレータB400に組み込まれた各モジュールをも同じく同期させるようにすることができる。即ち、複数のシミュレータを容易に協調動作させることができる。また、シミュレータ間でプログラム間の通信が不要となる為、複数シミュレータによる協調シミュレーションの実行速度を向上させることができる。さらに、シミュレータA300用にリンク用モジュール310を作成すれば、シミュレータB400はエントリ関数名を変更し、シミュレータ間での値の更新・参照箇所でシミュレータA300のAPI関数320の呼出を行うようにする改変だけで済むため、特に既存のシミュレータを利用する上でシミュレータの改変工数を減らし効率的に改変を行うことができる。 By such a modification, the synchronization function of each module in the main simulator A300 (simulation execution control processing by the simulation kernel A370) is used, and not only the module incorporated in the simulator A300 but also the value on the simulator A300 side in the simulator B400. Modules that need to be acquired or updated can also be synchronized, and each module incorporated in the simulator B400 by the simulation execution control process by the simulation kernel B404 of the simulator B400 can be synchronized in the same manner. That is, a plurality of simulators can be easily coordinated. In addition, since communication between programs is not required between simulators, the execution speed of cooperative simulation by a plurality of simulators can be improved. Furthermore, if the linking module 310 is created for the simulator A300, the simulator B400 changes the entry function name and changes the value between the simulators so that the API function 320 of the simulator A300 is called at the reference point. Therefore, when using an existing simulator, it is possible to reduce the number of man-hours for modifying the simulator and efficiently perform the modification.
 また、本実施形態のシミュレーションシステムでは、シミュレータB400からAPI関数320を呼び出すことにより、シミュレータA300に組み込まれたモジュールと、シミュレータB400に組み込まれたモジュールとの同期を行うとともに、シミュレータA300における変数の参照及び更新を行うことができる。したがって、情報交換用の構造体を介してシミュレータA300及びシミュレータB400の間で信号値の参照及び更新を容易に実現することができる。 In the simulation system according to the present embodiment, the API function 320 is called from the simulator B 400 to synchronize the module incorporated in the simulator A 300 with the module incorporated in the simulator B 400 and to refer to variables in the simulator A 300. And updates can be made. Therefore, it is possible to easily realize reference and update of signal values between the simulator A 300 and the simulator B 400 via the information exchange structure.
 また、本実施形態のシミュレーションシステムでは、シミュレータB400を動的リンクライブラリとして用意することができる。したがって、シミュレータA300に接続させるシミュレータB400におけるシミュレーションの処理を変更する場合などにおいても、シミュレータB400のみを改変すればよく、開発効率を向上することができる。 Further, in the simulation system of the present embodiment, the simulator B400 can be prepared as a dynamic link library. Therefore, even when changing the simulation process in the simulator B400 connected to the simulator A300, only the simulator B400 needs to be modified, and the development efficiency can be improved.
 図5では図4で示した内容について、シミュレータB400の動作の一例をとり上げ、より詳細な動作を示している。全体的な処理の流れは図4の説明にて既に述べた通りである。シミュレータA300は、主シミュレータとして処理を開始すると、初期化A302にて内部変数などの初期化を行い、その後シミュレーション実行制御処理360を開始する。 FIG. 5 shows an example of the operation of the simulator B 400 with respect to the contents shown in FIG. 4, and shows a more detailed operation. The overall processing flow is as already described in the description of FIG. When the simulator A 300 starts processing as the main simulator, initialization A 302 initializes internal variables and the like, and then starts a simulation execution control process 360.
 シミュレーション実行制御処理360の時刻管理機能A361は、シミュレータA300内の各モジュールのシミュレーション時刻と実行状況を管理しており、シミュレーション実行制御処理360は、処理完了していないモジュールに関してシミュレーション時刻が最も早いモジュールに制御を移す処理を行う。この際、制御を移す先のモジュールが未起動状態であればそのモジュールの最初の処理を呼び出し、起動済みであれば(すなわちモジュールからの時刻同期要求によりシミュレーション実行制御処理360を行っている状態)であれば、時刻同期要求の呼び出し元のモジュールに復帰する。シミュレーション時刻が最も早いモジュールが複数ある場合は、それらのモジュールの任意の一つを選択し制御を移す。 The time management function A361 of the simulation execution control process 360 manages the simulation time and execution status of each module in the simulator A300, and the simulation execution control process 360 has the earliest simulation time for a module that has not been processed. Process to transfer control to. At this time, if the module to which the control is transferred is not started, the first process of the module is called, and if the module has been started (that is, the simulation execution control process 360 is performed by the time synchronization request from the module). If so, return to the module that called the time synchronization request. When there are a plurality of modules having the earliest simulation time, any one of those modules is selected and control is transferred.
 シミュレーション実行制御処理360はモジュールからの時刻同期要求を受け付ける際にモジュールから待ち時間を受け取り、その待ち時間を積算することでそのモジュールのシミュレーション時刻を更新する。 The simulation execution control process 360 receives a waiting time from the module when receiving a time synchronization request from the module, and updates the simulation time of the module by integrating the waiting time.
 シミュレーション実行制御処理360の開始直後は、シミュレータA300内のどのモジュールもシミュレーション時刻は0であるため、各モジュールを順次起動することになる。例えば図5に示すように、最初にモジュールX380を起動し、モジュールX380で処理が進み時刻同期処理X382が実行されるとそこで時刻同期要求が発生し、シミュレーション実行制御処理360に制御が戻る。シミュレーション実行制御処理360はモジュールX382のシミュレーション時刻を更新し、次にリンク用モジュール310を起動する。リンク用モジュール310はシミュレータB起動311でシミュレータB400を起動し、シミュレータB400へ制御を移す。 Immediately after the start of the simulation execution control process 360, the simulation time is 0 for all modules in the simulator A300, so that the modules are sequentially activated. For example, as shown in FIG. 5, when the module X380 is first activated and the process proceeds in the module X380 and the time synchronization process X382 is executed, a time synchronization request is generated and the control returns to the simulation execution control process 360. The simulation execution control process 360 updates the simulation time of the module X382, and then activates the link module 310. The linking module 310 activates the simulator B400 at the simulator B activation 311 and transfers control to the simulator B400.
 シミュレータB400は処理開始後、初期化B405でシミュレータ内部の初期化を行った後、シミュレーションの実処理を行う。シミュレーション実処理はループ処理となっており、ループ中に存在する時刻更新B1(421)、時刻更新B2(422)でシミュレーション時刻の更新を行う。シミュレータB400では処理が進み、あるモジュール内においてシミュレータ間で交換が必要な値の更新やシミュレータ間で交換が必要な値の参照が発生するシミュレータ間交換値更新B431及びシミュレータ間交換値参照B432に達すると、リンク用モジュール310のAPI関数320を呼び出す。 The simulator B400 performs the actual processing of the simulation after the processing is started, after initialization of the simulator is performed in initialization B405. The simulation actual process is a loop process, and the simulation time is updated by the time update B1 (421) and the time update B2 (422) existing in the loop. In the simulator B400, the process proceeds and reaches an inter-simulator exchange value update B431 and an inter-simulator exchange value reference B432 in which a value that needs to be exchanged between simulators in a certain module or a value that needs to be exchanged between simulators is generated. Then, the API function 320 of the link module 310 is called.
 シミュレータB400はシミュレーション時刻がある時刻に達する等、シミュレーション終了条件を満たすまでループを繰り返すことでシミュレータ処理を行う。シミュレータB400は終了条件を満たした段階で、終了処理B406を実行し、シミュレータB400の最終的な状態をシミュレータA300に伝えるためシミュレータA300のAPI関数320を呼び出す。終了処理B406を完了した場合にはシミュレータA300のリンク用モジュール310のモジュール終了処理341に復帰する。 Simulator B400 performs simulator processing by repeating a loop until the simulation end condition is satisfied, for example, the simulation time reaches a certain time. When the end condition is satisfied, the simulator B400 executes the end process B406 and calls the API function 320 of the simulator A300 to inform the simulator A300 of the final state of the simulator B400. When the end process B406 is completed, the process returns to the module end process 341 of the link module 310 of the simulator A300.
 リンク用モジュール310では、API関数320内の時刻同期処理L321でシミュレータB400から渡されたシミュレーション時刻とリンク用モジュール310のシミュレーション時刻との差分時間待つように時刻同期要求を発生させ、シミュレーション実行制御処理360に制御が戻る。シミュレーション実行制御処理360はリンク用モジュール310のシミュレーション時刻を更新し、これによりリンク用モジュール310のシミュレーション時刻はシミュレータB400でAPI関数320を呼び出したモジュールのシミュレーション時刻となる。シミュレーション実行制御装置360は、次にモジュールY390を起動する。モジュールY390で処理が進み時刻同期処理Y392が実行されると、そこでモジュールY390により時刻同期要求が発生し、シミュレーション実行制御処理360に制御が戻る。 The link module 310 generates a time synchronization request so as to wait for a difference time between the simulation time passed from the simulator B 400 and the simulation time of the link module 310 in the time synchronization process L321 in the API function 320, and the simulation execution control process Control returns to 360. The simulation execution control process 360 updates the simulation time of the linking module 310, and the simulation time of the linking module 310 becomes the simulation time of the module that called the API function 320 in the simulator B400. Next, the simulation execution control apparatus 360 activates the module Y390. When processing proceeds in module Y390 and time synchronization processing Y392 is executed, a time synchronization request is generated by module Y390, and control returns to simulation execution control processing 360.
 このようにして、シミュレータA300内の全てのモジュールの起動が行われる。 In this way, all modules in the simulator A300 are activated.
 シミュレータA300の全てのモジュールが起動された後、シミュレーション実行制御処理360はシミュレーション時刻が最も早い時刻のモジュールの時刻同期要求元に復帰することで、各モジュールは処理を継続することができる。 After all modules of the simulator A 300 are activated, the simulation execution control process 360 can return to the time synchronization request source of the module with the earliest simulation time, so that each module can continue the process.
 図5で示すシミュレータB400の処理手順は一例であり、シミュレーション時刻の更新処理とシミュレータ間での交換値の更新あるいは参照が行われるシミュレータであり、その際にAPI関数320を呼び出すようにプログラムされていればどのようなシミュレータでもシミュレータB400として取り扱うことが可能である。 The processing procedure of the simulator B 400 shown in FIG. 5 is an example, and is a simulator in which the simulation time update process and the exchange value between the simulators are updated or referred to, and programmed to call the API function 320 at that time. Any simulator can be handled as the simulator B400.
 図6はシミュレータB400をシミュレータA300が動的リンクする際の、リンク用モジュール310の処理手順の例を示すフローチャートである。 FIG. 6 is a flowchart showing an example of a processing procedure of the linking module 310 when the simulator A 300 dynamically links the simulator B 400.
 まずシミュレータB400読み込みS801で、リンク用モジュール310は、動的リンクライブラリ化したシミュレータB400を読み込む。次にシンボル解決S802で、リンク用モジュール310は、シミュレータB400のエントリ関数へのポインタ、API関数320へのアクセス情報を示す変数へのポインタ、及びパラメータ登録用構造体へのポインタを取得する。API関数設定S803で、リンク用モジュール310はAPI関数へのアクセス情報を示す変数にAPI関数320へのアクセス情報を登録する。API関数320へのアクセス情報を示す変数はC言語の場合は関数へのポインタ、C++言語の場合はリンク用モジュール310のインスタンスへのポインタ(例えばリンク用モジュール310をクラスとして定義し、API関数320をリンク用モジュールのメンバ関数として用意し、インスタンスへのポインタを用いてメンバ関数を呼び出す)などとすることができる。 First, in module B400 reading S801, the linking module 310 reads the simulator B400 that has been made into a dynamic link library. Next, in symbol resolution S802, the linking module 310 acquires a pointer to the entry function of the simulator B 400, a pointer to a variable indicating access information to the API function 320, and a pointer to a parameter registration structure. In API function setting S803, the link module 310 registers access information to the API function 320 in a variable indicating access information to the API function. A variable indicating access information to the API function 320 is a pointer to the function in the case of the C language, and a pointer to an instance of the link module 310 in the case of the C ++ language (for example, the link module 310 is defined as a class. Is prepared as a member function of the linking module, and the member function is called using a pointer to the instance).
 パラメータ設定S804で、リンク用モジュール310は情報交換用構造体にシミュレータB400へ渡すべきパラメータを書き込む。シミュレータB処理S805で、リンク用モジュール310はシミュレータB400を呼び出す。シミュレータB400の処理が終了すると、終了処理S806でリンク用モジュール310リンク用モジュール310の終了処理を行う。 In parameter setting S804, the link module 310 writes a parameter to be passed to the simulator B 400 in the information exchange structure. In the simulator B process S805, the linking module 310 calls the simulator B400. When the process of the simulator B400 is completed, the linking process of the linking module 310 is performed in the ending process S806.
 図6において、シミュレータB読み込みS801からシミュレータB処理S805でシミュレータB400を呼び出すまでの処理は図5のシミュレータB起動311に対応し、終了処理S806は図5のモジュール終了処理341に対応する。 In FIG. 6, the process from the simulator B reading S801 to calling the simulator B 400 in the simulator B process S805 corresponds to the simulator B activation 311 in FIG. 5, and the end process S806 corresponds to the module end process 341 in FIG.
 パラメータ登録用構造体は、シミュレータB400の初期条件などを持ち、パラメータ設定S804で設定するが、初期条件を含め渡すべきパラメータがなければパラメータ登録用構造体は不要であり、シンボル解決S802でのパラメータ登録用構造体へのポインタ取得や、パラメータ設定S804の処理は省略可能である。 The parameter registration structure has the initial conditions of the simulator B 400 and the like, and is set in the parameter setting S804. However, if there is no parameter to be passed including the initial conditions, the parameter registration structure is unnecessary, and the parameters in the symbol resolution S802 Acquisition of a pointer to the registration structure and processing of parameter setting S804 can be omitted.
 尚、シミュレータA300がSystemC(プログラミング言語としてはC++)で記述されており、シミュレータB400がC言語で記述されている場合でも、リンク用モジュール310はC言語からアクセス可能なAPI関数320を用意すれば対応可能である。この際、シミュレータ間の値の交換のために、API関数320の処理中にリンク用モジュール310のメンバ変数にアクセスする必要が生じる。そこで、パラメータ設定S804で設定するパラメータにシミュレータB400を起動した際のリンク用モジュール310のインスタンスへのポインタを含め、シミュレータB400側からAPI関数320を呼び出す際のパラメータとしてそのインスタンスへのポインタを渡し、API関数320ではパラメータとして受け取ったインスタンスへのポインタを用いてメンバ変数へアクセスすることで対応することができる。 Even if the simulator A300 is described in SystemC (C ++ as a programming language) and the simulator B400 is described in C language, the linking module 310 should have an API function 320 accessible from C language. It is possible. At this time, in order to exchange values between simulators, it is necessary to access the member variables of the link module 310 during the processing of the API function 320. Therefore, a pointer to the instance of the module 310 for linking when the simulator B 400 is activated is included in the parameters set in the parameter setting S804, and the pointer to the instance is passed as a parameter for calling the API function 320 from the simulator B 400 side. The API function 320 can cope with this by accessing a member variable using a pointer to an instance received as a parameter.
 図7はAPI関数320の処理手順の例を示すフローチャートである。シミュレータB400側よりAPI関数320が呼び出されると、シミュレーション時刻差分計算S811でシミュレータA300のシミュレーション時刻とAPI関数呼び出し時にパラメータとして受け取ったシミュレータB400でAPI関数320を呼び出したモジュールのシミュレーション時刻の差分を計算する。次にシミュレーション時刻同期S812で差分時間分だけ時間待ち処理を行うことでシミュレータA300のシミュレーション時刻をシミュレータBでAPI関数320を呼び出したモジュールのシミュレーション時刻に合わせる。時間待ち処理はシミュレーションカーネルA370に要求することで行う。例えばシミュレータA300がSystemCで記述されている場合、差分時間を指定してwait()関数を呼び出す。 FIG. 7 is a flowchart showing an example of the processing procedure of the API function 320. When the API function 320 is called from the simulator B 400 side, the simulation time difference calculation S811 calculates the difference between the simulation time of the simulator A 300 and the simulation time of the module that called the API function 320 in the simulator B 400 received as a parameter when the API function is called. . Next, in simulation time synchronization S812, a time waiting process is performed for the difference time, thereby matching the simulation time of the simulator A300 with the simulation time of the module that called the API function 320 in the simulator B. The time waiting process is performed by requesting the simulation kernel A370. For example, when the simulator A300 is described in SystemC, the wait () function is called by designating the difference time.
 尚、リンク用モジュール310のインスタンスへのポインタやシミュレータB400のシミュレーション時刻は、シミュレータA300とシミュレータB400の情報交換に用いる構造体(情報交換用の構造体)を用いてシミュレータB400からシミュレータA300に渡しても構わない。 The pointer to the instance of the linking module 310 and the simulation time of the simulator B400 are transferred from the simulator B400 to the simulator A300 using the structure (information exchange structure) used for information exchange between the simulator A300 and the simulator B400. It doesn't matter.
 シミュレータB信号値取得(情報交換用の構造体参照)S813ではシミュレータB400からシミュレータA300が受け取るべき信号値に関し、シミュレータB400がAPI関数320を呼び出した際にパラメータとして渡す情報交換用の構造体に含まれそれら信号値を保持するメンバ変数よりシミュレータA300で管理している変数へコピーする。 Simulator B signal value acquisition (refer to information exchange structure) In S813, the signal value to be received by the simulator A300 from the simulator B400 is included in the information exchange structure passed as a parameter when the simulator B400 calls the API function 320. The member variables holding these signal values are copied to the variables managed by the simulator A300.
 シミュレータBへの信号値更新(情報交換用の構造体更新)S814ではシミュレータA300からシミュレータB400へ送るべき信号値に関し、シミュレータA300で管理している変数からシミュレータB400がAPI関数320を呼び出した際にパラメータとして渡す情報交換用の構造体に含まれるそれら信号値を保持するメンバ変数へコピーする。 In signal update to simulator B (update structure for information exchange) S814, when simulator B 400 calls API function 320 from a variable managed by simulator A 300 regarding the signal value to be sent from simulator A 300 to simulator B 400 Copy these signal values contained in the information exchange structure passed as parameters to the member variables.
 図8はシミュレータA300において各モジュールが同期して実行する手順の例である。シミュレータA300はまずモジュールX380で処理1(501)を実行する。処理1(501)が完了すると、モジュールX380はシミュレーション時刻T1となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻0のリンク用モジュール310とモジュールY390であるので、次にこのいずれかのモジュールの処理を実行する。図8の例では、リンク用モジュール310の処理を実行している。 FIG. 8 shows an example of a procedure executed by each module in the simulator A300 in synchronization. The simulator A300 first executes process 1 (501) by the module X380. When the process 1 (501) is completed, the module X380 becomes the simulation time T1. At this time, the modules with the shortest simulation time are the link module 310 and the module Y 390 at the simulation time 0, so the processing of any one of these modules is executed next. In the example of FIG. 8, the processing of the link module 310 is executed.
 リンク用モジュール310の処理2(502)を実行し、シミュレーション時刻T2で処理完了し、リンク用モジュール310はシミュレーション時刻T2となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻0のモジュールY390であるので、次にモジュールY390で処理3(503)を実行し、シミュレーション時刻T3で処理完了し、モジュールY390はシミュレーション時刻T3となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻T1のモジュールX380のであるので、モジュールX380で処理4(504)を実行し、シミュレーション時刻T4で処理完了し、シミュレータX380はシミュレーション時刻T4となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻T2のリンク用モジュール310であるため、リンク用モジュール310で処理5a(505)を実行する。 The process 2 (502) of the link module 310 is executed and the process is completed at the simulation time T2, and the link module 310 reaches the simulation time T2. Since the module having the smallest simulation time at this time is the module Y390 at the simulation time 0, processing 3 (503) is executed next at the module Y390, and the processing is completed at the simulation time T3. The module Y390 becomes the simulation time T3. . Since the module having the smallest simulation time at this time is the module X380 at the simulation time T1, processing 4 (504) is executed at the module X380, and the processing is completed at the simulation time T4. The simulator X380 becomes the simulation time T4. Since the module having the smallest simulation time at this time is the link module 310 at the simulation time T2, the link module 310 executes the process 5a (505).
 処理5a(505)は処理5b(515)と合わせて一連の処理を行うが、処理5a(505)の完了時点であるシミュレーション時刻T6で他モジュールの信号値を参照するため、この時点でシミュレーション時刻が最も小さいモジュールであるシミュレーション時刻T3のモジュールY390の実行に移り、処理6(506)を実行する。処理6(506)はシミュレーション時刻T5で完了し、モジュールY390はシミュレーション時刻T5となる。この時点でシミュレーション時刻が最も小さいモジュールであるシミュレーション時刻T4のモジュールX380の実行に移り、処理7(507)を実行する。処理7(507)の完了後、モジュールX380のシミュレーション時刻は処理7(507)の完了時刻となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻T5のモジュールY390となるため、モジュールY390で処理8(508)を実行し、シミュレーション時刻T7で処理完了し、モジュールY390はシミュレーション時刻T7となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻T6のリンク用モジュール310であるので、リンク用モジュール310で処理5b(515)を実行し、シミュレーション時刻T8で処理を完了し、リンク用モジュール310はシミュレーション時刻T8となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻T7のモジュールY390であるので、モジュールY390で処理10(510)を実行し、モジュールY390のシミュレーション時刻は処理10の完了時刻となる。この時点でシミュレーション時刻が最も小さいモジュールはシミュレーション時刻T8のリンク用モジュール310であるので、リンク用モジュール310で処理9(509)を実行し、処理9(509)の処理を完了する。この時点でシミュレータA300の処理は全て完了する。 The process 5a (505) performs a series of processes together with the process 5b (515). Since the signal value of the other module is referred to at the simulation time T6 that is the completion time of the process 5a (505), the simulation time is The process proceeds to the execution of the module Y390 at the simulation time T3, which is the smallest module, and the process 6 (506) is executed. Process 6 (506) is completed at simulation time T5, and module Y390 is at simulation time T5. At this time, the process moves to the execution of the module X380 at the simulation time T4, which is the module with the smallest simulation time, and the process 7 (507) is executed. After the completion of the process 7 (507), the simulation time of the module X380 becomes the completion time of the process 7 (507). Since the module having the smallest simulation time at this time is the module Y390 at the simulation time T5, the process Y (508) is executed at the module Y390, the process is completed at the simulation time T7, and the module Y390 becomes the simulation time T7. Since the module with the smallest simulation time at this time is the link module 310 at the simulation time T6, the process 5b (515) is executed by the link module 310, and the process is completed at the simulation time T8. Simulation time T8 is reached. Since the module having the smallest simulation time at this time is the module Y390 at the simulation time T7, the process Y (510) is executed by the module Y390, and the simulation time of the module Y390 becomes the completion time of the process 10. Since the module with the smallest simulation time at this time is the link module 310 at the simulation time T8, the link module 310 executes the process 9 (509) and completes the process 9 (509). At this time, all the processes of the simulator A300 are completed.
 それぞれの処理により値の更新が発生する場合、処理を行ったモジュール以外から更新後の値を参照できるタイミングは、同モジュールで実行する次の処理を開始する時点とする。例えば、処理1(501)により更新された値をリンク用モジュール310やモジュールY390で参照可能となるのは処理4(504)の開始時となる。これは処理1(501)が完了した時点では、モジュールX380以外のモジュールのシミュレーション時刻は時刻T1以前である可能性があり、シミュレーション処理に都合、次に処理すべきモジュールの参照値としては、処理1(501)の処理結果を反映する前の値が必要となるからである。すなわち処理2(502)や処理3(503)は処理1(501)の処理結果を反映する前の値を参照する必要がある。また処理4(504)を開始するタイミングでは、モジュールX380以外のモジュールのシミュレーション時刻は時刻T1以降であることが保証されるので、このタイミングで処理1(501)の処理結果を他のモジュールから参照可能な状態とすれば、処理1(501)の結果を、モジュールX380内での処理と同様に、他のモジュールでも正しく参照することができる。 When the value is updated by each process, the timing at which the updated value can be referred from other than the module that performed the process is the time when the next process executed by the module is started. For example, the value updated by the process 1 (501) can be referred to by the link module 310 or the module Y 390 at the start of the process 4 (504). This is because when the processing 1 (501) is completed, the simulation time of the modules other than the module X380 may be before the time T1. For convenience of the simulation processing, the reference value of the module to be processed next is the processing value. This is because the value before reflecting the processing result of 1 (501) is required. That is, processing 2 (502) and processing 3 (503) need to refer to values before reflecting the processing result of processing 1 (501). Further, at the timing of starting the process 4 (504), the simulation time of modules other than the module X380 is guaranteed to be after the time T1, so the processing result of the process 1 (501) is referred from other modules at this timing. If possible, the result of the process 1 (501) can be correctly referred to in other modules as in the process in the module X380.
 図8では処理5a(505)と処理5b(515)の境界以外では、値の更新なく参照だけ行われるタイミングはない状況を想定している。また、値の更新タイミングで他のモジュールの値を参照するのは差し支えない。 FIG. 8 assumes a situation where there is no timing at which only a reference is made without updating a value, except for the boundary between the processing 5a (505) and the processing 5b (515). Also, it is possible to refer to the values of other modules at the value update timing.
 図8でリンク用モジュール310の処理部分は、実際にはリンク用モジュール310を介してシミュレータB400の処理を行うことを示している。 In FIG. 8, the processing portion of the link module 310 indicates that the simulator B 400 is actually processed via the link module 310.
 以上のように処理を進めることで、シミュレータA300は複数のモジュールを擬似的に並列実行したような動作を再現可能である。 By proceeding with the processing as described above, the simulator A300 can reproduce the operation of executing a plurality of modules in a pseudo parallel manner.
 尚、図8を用いて説明したように、あるモジュールがシミュレーション時刻をある時刻となるよう要求する、すなわち図4のシミュレーションカーネルA370にシミュレーション時刻がある時刻となるよう要求することは、実際には要求元以外のモジュールが指定した時刻以降になるまでシミュレーション処理を進めることを意味する。 As described with reference to FIG. 8, it is actually necessary for a certain module to request the simulation time to be a certain time, that is, to request that the simulation kernel A 370 in FIG. This means that the simulation process is continued until the module other than the request source is after the specified time.
 本実施例では、シミュレータA300とシミュレータB400が協調動作する際に、シミュレータB400のシミュレーション時刻にオフセットを付加可能な例を説明する。 In the present embodiment, an example in which an offset can be added to the simulation time of the simulator B400 when the simulator A300 and the simulator B400 perform a cooperative operation will be described.
 図9はシミュレータA300とシミュレーション時刻にオフセットを付加したシミュレータB400を協調動作させる際の関係を示した例である。 FIG. 9 shows an example of the relationship between the simulator A300 and the simulator B400 in which an offset is added to the simulation time.
 シミュレータA300ではシミュレーション中で初期化処理のシミュレーションを初期化部シミュレーション901で行った後に実際の処理のシミュレーションを実処理シミュレーションA902で行う。シミュレータB400では初期化処理のシミュレーションは行わず、最初から実際の処理のシミュレーションを実処理シミュレーション912で行う。すなわち、シミュレータA300とシミュレータB400のシミュレーション時刻をオフセット時間ずらして実行する。 In the simulator A300, the simulation of the initialization process is performed by the initialization unit simulation 901 during the simulation, and then the simulation of the actual process is performed by the actual process simulation A902. The simulator B 400 does not simulate the initialization process, and the actual process simulation 912 is performed from the beginning. That is, the simulation times of the simulator A 300 and the simulator B 400 are executed while being offset from each other.
 このようにシミュレーション時刻にオフセット時間を付加するシミュレーションは、例えばシミュレータA300がマイコンを模擬するシミュレータであり、モデル上でそのマイコン用のソフトウェアの実行し、シミュレータB400が機械の動作のシミュレーションを行う場合に有効である。このような場合、シミュレータA300ではハードウェアの初期化やオペレーティングシステムの起動に対応するソフトウェアを実行した後に、機械制御用のソフトウェアを動作させ、シミュレータB400で動作する機械のシミュレーションと協調処理が始まる。シミュレータA300とシミュレータB400を同時に開始して協調シミュレーションを実行すると、シミュレータA300で機械制御用のソフトウェアが動作するまで、シミュレータB400のシミュレーションが無駄な処理となる。そこで、シミュレータA300で初期化関連の処理が完了するまで遅らせてシミュレータB400を起動することで、初期化関連のシミュレーション処理を実行する期間のシミュレータB400の処理を抑制でき、初期化関連のシミュレーション処理を高速化することができる。 The simulation in which the offset time is added to the simulation time in this way is, for example, a simulator in which the simulator A300 simulates a microcomputer, and when the software for the microcomputer is executed on the model and the simulator B400 simulates the operation of the machine. It is valid. In such a case, in the simulator A300, after executing software corresponding to hardware initialization and operating system activation, machine control software is operated, and simulation and cooperation processing of the machine operating in the simulator B400 starts. When the simulator A300 and the simulator B400 are started at the same time and the cooperative simulation is executed, the simulation of the simulator B400 becomes a useless process until the machine control software operates in the simulator A300. Therefore, by delaying until the initialization-related processing is completed in the simulator A300, the simulator B400 is started, so that the processing of the simulator B400 during the period of executing the initialization-related simulation processing can be suppressed, and the initialization-related simulation processing can be performed. The speed can be increased.
 図10はシミュレータA300とシミュレーション時刻にオフセットを付加したシミュレータB400を協調動作させる際に、シミュレータA300がシミュレータB400を動的リンクする場合の、リンク用モジュール310の処理手順の例を示すフローチャートである。図6で示した処理に対し、API関数設定S803とパラメータ設定S804の間にオフセット時間待ちS807を挿入してある。 FIG. 10 is a flowchart showing an example of a processing procedure of the linking module 310 when the simulator A 300 dynamically links the simulator B 400 when the simulator A 300 and the simulator B 400 to which an offset is added to the simulation time are cooperatively operated. For the processing shown in FIG. 6, an offset time waiting S807 is inserted between the API function setting S803 and the parameter setting S804.
 オフセット時間待ちS807では、リンク用モジュール310はシミュレーションカーネルA370に対し、オフセット時間分だけシミュレーション時間を進めるよう要求する。この要求により、シミュレータA300のシミュレーション時刻がオフセット時間進むことになる。 In the waiting for offset time S807, the linking module 310 requests the simulation kernel A370 to advance the simulation time by the offset time. This request causes the simulation time of the simulator A300 to advance by the offset time.
 パラメータ設定S804では図6で示した内容に加え、そのシミュレーション時刻でのシミュレータA300からシミュレータB400へ渡す値をシミュレータB400の初期パラメータとして設定し、シミュレータB400が初期条件に関しシミュレータA300の状態と合わせられるようにする。 In the parameter setting S804, in addition to the contents shown in FIG. 6, a value to be passed from the simulator A300 to the simulator B400 at the simulation time is set as an initial parameter of the simulator B400 so that the simulator B400 can match the state of the simulator A300 with respect to the initial conditions. To.
 図10でオフセット時間待ちS807とパラメータ設定S804以外については図6で説明した内容と同じであるため、説明を省略する。 10 except for the offset time waiting S807 and the parameter setting S804 in FIG. 10 is the same as the content described in FIG.
 図11はシミュレータA300とシミュレーション時刻にオフセットを付加してシミュレータB400を協調動作させる際の、API関数320の処理手順の例を示すフローチャートである。図7のシミュレーション時刻差分計算S811を、図11ではシミュレーション時刻オフセット付差分計算S819に変更している。シミュレーション時刻オフセット付差分計算S819ではシミュレータA300側とシミュレータB400側のシミュレーション時刻の差分を求める際、オフセット時間の影響を考慮して計算を行う。即ち、リンク用モジュール310は、シミュレータB400から受け取ったシミュレーション時刻と、自身のシミュレーション時刻からオフセット時間戻した時刻との差分を計算する。図11の他の部分の処理については図7で説明した内容と同じであるため、説明を省略する。 FIG. 11 is a flowchart showing an example of the processing procedure of the API function 320 when the simulator B 400 and the simulator B 400 are operated in cooperation by adding an offset to the simulation time. The simulation time difference calculation S811 in FIG. 7 is changed to a simulation time offset added difference calculation S819 in FIG. In the difference calculation with simulation time offset S819, the difference between the simulation times on the simulator A300 side and the simulator B400 side is calculated in consideration of the influence of the offset time. That is, the link module 310 calculates the difference between the simulation time received from the simulator B 400 and the time when the offset time is returned from its own simulation time. The processing of the other parts in FIG. 11 is the same as that described in FIG.
 以上のように、図10及び図11に示した内容により、シミュレータB400のシミュレーション時刻にオフセットを付加することが可能となる。即ち、オフセットを指定することにより、シミュレータB400の起動タイミングを必要に応じて容易に変更することができる。 As described above, according to the contents shown in FIGS. 10 and 11, an offset can be added to the simulation time of the simulator B400. That is, by specifying the offset, the activation timing of the simulator B400 can be easily changed as necessary.
 本実施例では、図12を用いて、シミュレータA300のAPI関数320の構成を変更した例を説明する。 In this embodiment, an example in which the configuration of the API function 320 of the simulator A300 is changed will be described with reference to FIG.
 実施例3は実施例1で示したAPI関数320の構成を、1個の関数ではなく、3個の関数に分割している。3個の関数に分割することで、時刻同期処理L321、値の取得331、値の更新332それぞれの処理をシミュレータB400から直接制御可能にしている。値の取得331と値の更新332の関数を分けることにより、シミュレータB400でシミュレータA300に送るべき値に更新が発生した際には、交換値の更新処理B440を行い、シミュレータB400でシミュレータA300の値を参照する必要がある際には、交換値の参照処理B450を行うことができる。 In the third embodiment, the configuration of the API function 320 shown in the first embodiment is divided into three functions instead of one function. By dividing into three functions, the respective processes of the time synchronization process L321, the value acquisition 331, and the value update 332 can be directly controlled from the simulator B400. By dividing the functions of the value acquisition 331 and the value update 332, when an update occurs to the value to be sent to the simulator A300 by the simulator B400, the exchange value update processing B440 is performed. When it is necessary to refer to the exchange value, the exchange value reference processing B450 can be performed.
 交換値の更新処理B440では、まず時刻同期要求B1(441)で時刻同期処理L321を実行する関数を、シミュレータB400でAPI関数320を呼び出したモジュールのシミュレーション時刻を引数に与えて呼び出したうえで、交換値更新B442で値の取得331を実行する関数を情報交換用の構造体へのポインタを引数に与えて呼び出す。値の取得331では、シミュレータA300のシミュレーションカーネルA370はシミュレータB400より情報交換用の構造体から必要な値を取り込む処理を行う。 In the exchange value update processing B440, first, a function that executes the time synchronization processing L321 by the time synchronization request B1 (441) is called by giving the simulation time of the module that called the API function 320 by the simulator B400 as an argument. In the exchange value update B442, a function for executing the value acquisition 331 is called by giving a pointer to the information exchange structure as an argument. In the value acquisition 331, the simulation kernel A370 of the simulator A300 performs a process of fetching a necessary value from the information exchange structure from the simulator B400.
 交換値の参照処理B450では、まず時刻同期要求B1(441)で時刻同期処理L321を実行する関数を、シミュレータB400シミュレーション時刻を引数に与えて呼び出したうえで、交換値参照B452で値の更新332を実行する関数を情報交換用の構造体へのポインタを引数に与えて呼び出す。値の更新332では、シミュレータA300内のリンク用モジュール310はシミュレータB400へ渡すべき値を情報交換用の構造体に書き込む処理を行う。 In the exchange value reference process B450, first, a function for executing the time synchronization process L321 by the time synchronization request B1 (441) is called by giving the simulation time of the simulator B400 as an argument, and then the value is updated by the exchange value reference B452. Is called with a pointer to the information exchange structure as an argument. In the value update 332, the link module 310 in the simulator A300 performs a process of writing a value to be passed to the simulator B400 into the information exchange structure.
 API関数を3個の関数に分割することで、シミュレータA300からシミュレータB400に値を渡す処理と、シミュレータB400からシミュレータA300へ値を渡す処理を分離でき、シミュレータA300側でAPI関数320呼び出し時に必要な処理のみを行うことができる。 By dividing the API function into three functions, the process of passing values from the simulator A 300 to the simulator B 400 and the process of passing values from the simulator B 400 to the simulator A 300 can be separated. This is necessary when calling the API function 320 on the simulator A 300 side. Only processing can be performed.
 尚、API関数320の構成として、時刻同期処理L321及び値の取得331を行う関数と、時刻同期処理L321及び値の更新332を行う関数の2個の構成とする方法も考えられる。またAPI関数320の構成として、実施例1に示した関数と実施例3で示した関数の両方を提供することも考えられる。また本実施例は実施例2と組み合わせることにより、シミュレータB400のシミュレーション時刻にオフセットを付加することも可能である。 Note that the API function 320 may have two configurations: a function that performs time synchronization processing L321 and value acquisition 331, and a function that performs time synchronization processing L321 and value update 332. It is also conceivable to provide both the function shown in the first embodiment and the function shown in the third embodiment as the configuration of the API function 320. Further, by combining this embodiment with the second embodiment, an offset can be added to the simulation time of the simulator B400.
 本実施例では、図13を用いて、協調動作するシミュレータとしてシミュレータB400に加えシミュレータC600をシミュレータA300に接続した例を説明する。即ちシミュレータA300にシミュレータB400を接続するリンク用モジュール310に加え、リンク用モジュール350を用意して、それぞれにシミュレータB400とシミュレータC600を接続する。 In this embodiment, an example in which a simulator C600 is connected to the simulator A300 in addition to the simulator B400 as a cooperatively operating simulator will be described with reference to FIG. That is, in addition to the link module 310 for connecting the simulator B 400 to the simulator A 300, a link module 350 is prepared, and the simulator B 400 and the simulator C 600 are connected to each.
 リンク用モジュール310とシミュレータB400を接続する方法、及びリンク用モジュール350とシミュレータC600を接続する方法は、それぞれ実施例1で示したリンク用モジュール310とシミュレータB400を接続する方法と同じであるので、説明を省略する。 Since the method for connecting the linking module 310 and the simulator B400 and the method for connecting the linking module 350 and the simulator C600 are the same as the method for connecting the linking module 310 and the simulator B400 shown in the first embodiment, respectively. Description is omitted.
 シミュレータB400とシミュレータC600でシミュレーション値の交換が必要な場合は、シミュレータA300を介して行う。シミュレータA300としては、シミュレータB400はリンク用モジュール310、シミュレータC600はリンク用モジュール350として取り扱われ、シミュレータA300として全体の整合性が取れるようにシミュレーション処理が進むことになる。この考え方を拡張すれば、2個だけでなく、より多くのシミュレータを主シミュレータに接続して協調動作させることも可能である。 When it is necessary to exchange simulation values between the simulator B400 and the simulator C600, the simulation is performed via the simulator A300. As the simulator A300, the simulator B400 is handled as the linking module 310 and the simulator C600 is handled as the linking module 350, and the simulation processing proceeds so that the entire consistency can be obtained as the simulator A300. If this idea is extended, it is possible to connect not only two but also more simulators to the main simulator for cooperative operation.
 尚、図13でリンク用モジュール310とリンク用モジュール350はモジュールとしては同一でインスタンスのみ分ける実装とすることも考えられる。例えば、SystemCで実装する場合、リンク用モジュール310をひとつのクラスとして用意し、接続するシミュレータの数だけインスタンスを作成して対応することが可能である。 In FIG. 13, the linking module 310 and the linking module 350 are the same as the module, and it is also conceivable that only the instances are separated. For example, when mounting with SystemC, it is possible to prepare the link module 310 as one class, and to create and correspond to the number of simulators to be connected.
 このように2つのリンク用モジュール(310,350)をシミュレータA300に組み入れることにより複数の他のシミュレータ(B400,C600)と、シミュレータA300とを協調動作させることができる。 Thus, by incorporating the two link modules (310, 350) into the simulator A300, a plurality of other simulators (B400, C600) and the simulator A300 can be operated in a coordinated manner.
 本実施例は実施例2と組み合わせることにより、シミュレータB400のシミュレーション時刻やシミュレータC600のシミュレーション時刻にオフセットを付加することにも対応可能である。この際、リンク用モジュール310とリンク用モジュール350で異なるオフセットを用いシミュレーション時刻の同期を行うことで、シミュレータB400とシミュレータC600で異なるシミュレーション時刻を用いた協調シミュレーションも可能である。また実施例3と組み合わせ、シミュレータA300が提供するAPI関数を複数の関数として提供することも可能である。 This embodiment can be combined with the second embodiment to add an offset to the simulation time of the simulator B400 and the simulation time of the simulator C600. At this time, by using different offsets in the link module 310 and the link module 350 to synchronize the simulation times, the simulator B400 and the simulator C600 can also perform cooperative simulation using different simulation times. In combination with the third embodiment, the API function provided by the simulator A300 can be provided as a plurality of functions.
 以上、本実施形態について説明したが、上記実施形態は本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明は、その趣旨を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物も含まれる。 As mentioned above, although this embodiment was described, the said embodiment is for making an understanding of this invention easy, and is not for limiting and interpreting this invention. The present invention can be changed and improved without departing from the gist thereof, and the present invention includes equivalents thereof.
101 中央演算装置
102 主記憶装置
103 入出力制御装置
111 内部バス
121 外部記憶装置
122 入力装置
123 表示装置
300 シミュレータA
301 開始
302 初期化A
303 終了処理A
304 終了
310 リンク用モジュール
311 シミュレータB起動
320 API関数
321 時刻同期処理L
330 値の取得・更新
331 値の取得
332 値の更新
341 モジュール終了処理
360 シミュレーション実行制御処理
361 時刻管理機能A
370 シミュレーションカーネルA
380 モジュールX
381 モジュールX実行
382 時刻同期処理X
390 モジュールY
391 モジュールY実行
392 時刻同期処理Y
400 シミュレータB
401 モジュールI
402 モジュールJ
403 モジュールK
404 シミュレーションカーネルB
405 初期化B
407 時刻管理機能B
406 終了処理B
421 時刻更新B1
422 時刻更新B2
430 交換値の更新・取得処理B
431 シミュレータ間交換値更新B
432 シミュレータ間交換値参照B
440 交換値の更新処理B
441 時刻同期要求B1
442 交換値更新B
450 交換値の参照処理B
451 時刻同期要求B2
452 交換値参照B
501 処理1
502 処理2
503 処理3
504 処理4
505 処理5a
506 処理6
507 処理7
508 処理8
509 処理9
510 処理10
515 処理5b
600 シミュレータC
607 時刻管理機能C
630 交換値の更新・取得処理C
901 初期化部シミュレーション
902 実処理シミュレーションA
912 実処理シミュレーションB
S801 シミュレータB読み込み
S802 シンボル解決
S803 API関数設定
S804 パラメータ設定
S805 シミュレータB処理
S806 終了処理L
S811 シミュレーション時刻差分計算
S812 シミュレーション時刻同期
S813 シミュレータBの信号値取得(構造体参照)
S814 シミュレータBの信号値更新(構造体更新)
101 Central processing unit 102 Main storage device 103 Input / output control device 111 Internal bus 121 External storage device 122 Input device 123 Display device 300 Simulator A
301 Start 302 Initialization A
303 End processing A
304 End 310 Link module 311 Simulator B start 320 API function 321 Time synchronization processing L
330 Value acquisition / update 331 Value acquisition 332 Value update 341 Module end processing 360 Simulation execution control processing 361 Time management function A
370 Simulation kernel A
380 module X
381 Module X execution 382 Time synchronization processing X
390 module Y
391 Module Y execution 392 Time synchronization processing Y
400 Simulator B
401 Module I
402 Module J
403 Module K
404 Simulation kernel B
405 Initialization B
407 Time management function B
406 End processing B
421 Time update B1
422 Time update B2
430 Exchange value update / acquisition processing B
431 Inter-simulator exchange value update B
432 Inter-simulator exchange value reference B
440 Exchange value update process B
441 Time synchronization request B1
442 Exchange value update B
450 Exchange value reference process B
451 Time synchronization request B2
452 Exchange value reference B
501 Processing 1
502 Processing 2
503 treatment 3
504 Processing 4
505 treatment 5a
506 Processing 6
507 treatment 7
508 Processing 8
509 treatment 9
510 treatment 10
515 Process 5b
600 Simulator C
607 Time management function C
630 Exchange value update / acquisition processing C
901 Initialization simulation 902 Actual processing simulation A
912 Actual processing simulation B
S801 Simulator B reading S802 Symbol resolution S803 API function setting S804 Parameter setting S805 Simulator B processing S806 End processing L
S811 Simulation time difference calculation S812 Simulation time synchronization S813 Signal value acquisition of simulator B (see structure)
S814 Simulator B signal value update (structure update)

Claims (12)

  1.  シミュレーションを行うソフトウェアである第1及び第2のシミュレータを動作させるシミュレーションシステムであって、
     前記第1のシミュレータは、前記シミュレーションに係る処理を行う複数のモジュールと、前記モジュールを同期させて実行させる実行制御処理部と、を備え、
     前記モジュールには、前記第2のシミュレータを起動する起動部と、前記第2のシミュレータからの所定の関数の呼び出しに応じて前記実行処理制御部に前記モジュールの実行を同期させる関数実行部と、を備えるリンク用モジュールが含まれ、
     前記第2のシミュレータは、前記第1のシミュレータと同期する必要がある場合に前記関数を呼び出すように構成されていること
     を特徴とするシミュレーションシステム。
    A simulation system for operating first and second simulators, which is software for performing simulation,
    The first simulator includes a plurality of modules that perform processing related to the simulation, and an execution control processing unit that executes the modules in synchronization with each other,
    The module includes an activation unit that activates the second simulator, a function execution unit that synchronizes execution of the module with the execution processing control unit in response to a call of a predetermined function from the second simulator, A linking module comprising
    The simulation system, wherein the second simulator is configured to call the function when it is necessary to synchronize with the first simulator.
  2.  請求項1記載のシミュレーションシステムであって、前記関数実行部は、前記関数の呼び出しに応じて、前記モジュールの実行を同期させるとともに、前記第1のシミュレータが設定した変数の値を参照して前記第2のシミュレータに応答し、前記第2のシミュレータから与えられた値を前記第1のシミュレータが参照可能な変数に設定すること、を特徴とするシミュレーションシステム。 2. The simulation system according to claim 1, wherein the function execution unit synchronizes execution of the module in response to the call of the function, and refers to a value of a variable set by the first simulator. A simulation system characterized by responding to a second simulator and setting a value given from the second simulator as a variable that can be referred to by the first simulator.
  3.  請求項1または2に記載のシミュレーションシステムであって、前記第1のシミュレータが備える前記起動部は、オフセット時間が与えられた場合に、前記オフセット時間だけ前記第2のシミュレータの起動を遅らせることを特徴とするシミュレーションシステム。 3. The simulation system according to claim 1, wherein the activation unit included in the first simulator delays activation of the second simulator by the offset time when an offset time is given. A featured simulation system.
  4.  請求項1から3のいずれか1項に記載のシミュレーションシステムであって、前記モジュールには、複数の前記第2のシミュレータのそれぞれに対応した複数の前記リンク用モジュールが含まれることを特徴とするシミュレーションシステム。 4. The simulation system according to claim 1, wherein the module includes a plurality of the link modules corresponding to each of the plurality of second simulators. 5. Simulation system.
  5.  請求項1から4のいずれか1項に記載のシミュレーションシステムであって、前記第2のシミュレータは、動的リンク可能なライブラリプログラムとして実装され、前記第1のシミュレータの実行時に前記第2のシミュレータがリンクされることを特徴とするシミュレーションシステム。 5. The simulation system according to claim 1, wherein the second simulator is implemented as a dynamically linkable library program, and the second simulator is executed when the first simulator is executed. 6. A simulation system characterized by being linked.
  6.  他のシミュレータと同期してシミュレーションを実行するためのプログラムであって、
     コンピュータに、前記シミュレーションに係る処理を行うモジュールを同期させて実行させる実行制御処理機能を実現させ、
     前記モジュールには、前記他のシミュレータを起動する起動機能と、前記他のシミュレータからの所定の関数の呼び出しに応じて、前記実行処理制御機能により前記モジュールの実行を同期させる関数実行機能と、を前記コンピュータに実現させるプログラムであるリンク用モジュールが含まれ、
     前記他のシミュレータは、同期する必要がある場合に前記関数を呼び出すように構成されていること
     を特徴とするプログラム。
    A program for executing a simulation in synchronization with another simulator,
    A computer realizes an execution control processing function for executing a module for performing the processing related to the simulation in synchronization,
    The module includes an activation function for activating the other simulator, and a function execution function for synchronizing execution of the module by the execution process control function in response to a call of a predetermined function from the other simulator. A linking module that is a program to be realized by the computer is included;
    The other simulator is configured to call the function when it is necessary to synchronize.
  7.  請求項6に記載のプログラムであって、前記関数実行機能は、前記関数の呼び出しに応じて、前記モジュールの実行を同期させるとともに、前記第1のシミュレータが設定した変数の値を参照して前記第2のシミュレータに応答し、前記第2のシミュレータから与えられた値を前記第1のシミュレータが参照可能な変数に設定する機能を含むことを特徴とする、プログラム。 The program according to claim 6, wherein the function execution function synchronizes execution of the module in response to the call of the function, and refers to a value of a variable set by the first simulator. A program that includes a function of responding to a second simulator and setting a value given from the second simulator to a variable that can be referred to by the first simulator.
  8.  請求項6または7に記載のプログラムであって、前記起動機能は、オフセット時間が与えられた場合に、前記オフセット時間だけ前記他のシミュレータの起動を遅らせることを特徴とするプログラム。 8. The program according to claim 6, wherein the start function delays start of the other simulator by the offset time when an offset time is given.
  9.  請求項6から8のいずれか1項に記載のプログラムであって、前記モジュールには、複数の前記他のシミュレータのそれぞれに対応した複数の前記リンク用モジュールが含まれることシミュレーション時刻を管理する機能を有しシミュレーションを行う別のソフトウェアを複数接続可能なことを特徴とするプログラム。 The program according to any one of claims 6 to 8, wherein the module includes a plurality of link modules corresponding to the plurality of other simulators, respectively, and a function of managing a simulation time A program characterized in that a plurality of different software for performing simulation can be connected.
  10.  請求項6から9のいずれか1項に記載のプログラムであって、前記他のシミュレータは、動的リンク可能なライブラリプログラムとして実装され、前記プログラムには前記ライブラリプログラムがリンクされることを特徴とするプログラム。 10. The program according to claim 6, wherein the other simulator is implemented as a dynamically linkable library program, and the library program is linked to the program. Program to do.
  11.  シミュレーションを行うソフトウェアである第1及び第2のシミュレータを協調動作させる方法であって、
     前記第1のシミュレータは、前記シミュレーションに係る処理を行う複数のモジュールと、前記モジュールを同期させて実行させる実行制御処理部と、を備え、
     前記モジュールにはリンク用モジュールが含まれ、
     前記リンク用モジュールは、前記第2のシミュレータを起動し、前記第2のシミュレータからの所定の関数の呼び出しに応じて前記実行制御処理部を呼び出し、
     前記実行制御処理部は、前記モジュールの実行を同期し、
     前記第2のシミュレータは、前記第1のシミュレータと同期する必要がある場合に前記関数を呼び出すように構成されていること
     を特徴とする、シミュレーション方法。
    A method for cooperatively operating first and second simulators, which are software for performing simulations,
    The first simulator includes a plurality of modules that perform processing related to the simulation, and an execution control processing unit that executes the modules in synchronization with each other,
    The module includes a linking module,
    The linking module activates the second simulator, calls the execution control processing unit in response to a call of a predetermined function from the second simulator,
    The execution control processing unit synchronizes execution of the module,
    The simulation method, wherein the second simulator is configured to call the function when it is necessary to synchronize with the first simulator.
  12.  請求項11に記載のシミュレーション方法であって、前記リンク用モジュールは、オフセット時間が与えられた場合に、前記オフセット時間だけ前記第2のシミュレータの起動を遅らせることを特徴とする、シミュレーション方法。 12. The simulation method according to claim 11, wherein the link module delays activation of the second simulator by the offset time when an offset time is given.
PCT/JP2014/060214 2014-04-08 2014-04-08 Simulation system, simulation method and program WO2015155839A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/060214 WO2015155839A1 (en) 2014-04-08 2014-04-08 Simulation system, simulation method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/060214 WO2015155839A1 (en) 2014-04-08 2014-04-08 Simulation system, simulation method and program

Publications (1)

Publication Number Publication Date
WO2015155839A1 true WO2015155839A1 (en) 2015-10-15

Family

ID=54287442

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/060214 WO2015155839A1 (en) 2014-04-08 2014-04-08 Simulation system, simulation method and program

Country Status (1)

Country Link
WO (1) WO2015155839A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005339029A (en) * 2004-05-25 2005-12-08 Canon Inc Program cooperation system
JP2008059192A (en) * 2006-08-30 2008-03-13 Oki Electric Ind Co Ltd Simulator for verifying coordination between hardware and software
US20090222250A1 (en) * 2008-02-28 2009-09-03 Oki Electric Industry Co., Ltd. Hard/Soft Cooperative Verifying Simulator

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005339029A (en) * 2004-05-25 2005-12-08 Canon Inc Program cooperation system
JP2008059192A (en) * 2006-08-30 2008-03-13 Oki Electric Ind Co Ltd Simulator for verifying coordination between hardware and software
US20090222250A1 (en) * 2008-02-28 2009-09-03 Oki Electric Industry Co., Ltd. Hard/Soft Cooperative Verifying Simulator

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KAORU SEKI ET AL.: "An Prototype of Integrated Simulator for ITS", IPSJ SIG NOTES, vol. 2010 -IT, no. 11, 15 October 2010 (2010-10-15), pages 1 - 8 *

Similar Documents

Publication Publication Date Title
US10866842B2 (en) Synthesis path for transforming concurrent programs into hardware deployable on FPGA-based cloud infrastructures
US9746845B2 (en) Support device, recording medium, and method for facilitating data exchange between different types of progrrammable logic controllers
EP2738632A2 (en) Input output cloning for industrial automation
JP2015060600A (en) Testing device for real-time testing of virtual control unit
KR102283736B1 (en) Method and apparatus for generating automatically setup code of application software baesed autosar
CN110704070B (en) Method for constructing DDS communication middleware under partitioned real-time operating system
KR102146602B1 (en) Method and apparatus of providing deep learning development platform based on container using docker
JP6550269B2 (en) PROGRAM CREATION SUPPORT DEVICE, CONTROL METHOD, AND PROGRAM
Ernst et al. System level LET: Mastering cause-effect chains in distributed systems
US11022967B2 (en) Method for generating a technical system model, executable on a test unit, and the test unit
KR101704751B1 (en) Apparatus for simulating of multi-core system by using timing information between modules, and method thereof
JP2007011720A (en) System simulator, system simulation method, control program, and readable recording medium
Dömer et al. Specfic methodology for high-level modeling
WO2015155839A1 (en) Simulation system, simulation method and program
Bradatsch et al. Data age diminution in the logical execution time model
JP2012203451A (en) Semiconductor integrated circuit simulation device and semiconductor integrated circuit simulation method
Gajski et al. The specc methodology
US10261817B2 (en) System on a chip and method for a controller supported virtual machine monitor
WO2020138386A1 (en) Cooperative simulation repeater employing previous trace data
US20210141710A1 (en) Development support device
US11719749B1 (en) Method and system for saving and restoring of initialization actions on dut and corresponding test environment
US20230385027A1 (en) Systems and methods for frontend web application creation for a cloud computing platform
JP2014179100A (en) System-on-chip and method of operating the same
WO2024147967A1 (en) Systems and methods for frontend web application creation for a cloud computing platform
Naderlinger Subjecting Legacy Simulink Models to Timing Specifications

Legal Events

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

Ref document number: 14889124

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP