WO2012023397A1 - シミュレーション方法、システム及びプログラム - Google Patents

シミュレーション方法、システム及びプログラム Download PDF

Info

Publication number
WO2012023397A1
WO2012023397A1 PCT/JP2011/067132 JP2011067132W WO2012023397A1 WO 2012023397 A1 WO2012023397 A1 WO 2012023397A1 JP 2011067132 W JP2011067132 W JP 2011067132W WO 2012023397 A1 WO2012023397 A1 WO 2012023397A1
Authority
WO
WIPO (PCT)
Prior art keywords
processor
plant
emulator
time
peripheral scheduler
Prior art date
Application number
PCT/JP2011/067132
Other languages
English (en)
French (fr)
Inventor
郁生 松村
周一 清水
Original Assignee
インターナショナル・ビジネス・マシーンズ・コーポレーション
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by インターナショナル・ビジネス・マシーンズ・コーポレーション filed Critical インターナショナル・ビジネス・マシーンズ・コーポレーション
Priority to KR1020137005015A priority Critical patent/KR101522477B1/ko
Priority to US13/817,597 priority patent/US9147016B2/en
Priority to EP11818040.5A priority patent/EP2608040A4/en
Priority to CN201180038696.1A priority patent/CN103098032B/zh
Priority to JP2012529543A priority patent/JP5583773B2/ja
Publication of WO2012023397A1 publication Critical patent/WO2012023397A1/ja

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/261Functional testing by simulating additional hardware, e.g. fault simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/28Error detection; Error correction; Monitoring by checking the correct order of processing
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B17/00Systems involving the use of models or simulators of said systems
    • G05B17/02Systems involving the use of models or simulators of said systems electric

Definitions

  • the present invention relates to a simulation of a physical system such as an automobile, and more particularly to a software-based simulation system.
  • the ECU generally includes an input interface for A / D conversion, for example, an input interface from a sensor, a logical operation unit (microcomputer) that processes a digital input signal in accordance with a predetermined logic, and the processing result as an actuator. And an output interface for converting into an operation signal.
  • a / D conversion for example, an input interface from a sensor
  • microcomputer logical operation unit
  • ABS Anti-lock Breaking System
  • ESC Electronic Stability Control
  • power steering wiper control and security monitoring system
  • mechanical parts not only mechanical parts but also electronic parts and software account for an important proportion.
  • the development cost for the latter is said to be 25% or 40% of the total, accounting for 70% for hybrid type vehicles.
  • an automobile is composed of a power device such as an engine, a power transmission device, a traveling device such as a steering, a brake device, and other machine parts (plants) such as a body system.
  • the operation of these plants is 30 to 70.
  • the program of the electronic control unit (ECU) described above is dynamically determined according to sensor input (speed etc.) or human input (accelerator etc.).
  • Each ECU basically controls the operation of one plant.
  • the amount and timing of fuel injection (Fuel ⁇ Injection) and ignition (Ignition) into the engine are determined by software by the engine control unit. Since it is software, it is possible to increase or decrease the fuel injection amount according to the mode in a luxury car with a “sport” mode.
  • the engine speed can be adjusted by automatically blipping in accordance with the downshift timing.
  • the ECU of the engine and the ECU of the transmission need to operate in cooperation.
  • ESC Electronic Stability Control
  • Such an “intervention” function can be easily cut because it is software.
  • Such ECU simulations are: (1) Model-in-the-Loop (Simulation) (MILS), which logically expresses the operation of the controller using an expression form such as a state machine, (2) Data accuracy in the logical operation Software-in-the-Loop Simulation (SILS), which introduced some hardware constraints, such as (3) Processor-in-the-Loop Simulation (PILS), which fully implements the software and emulates an ECU processor Or Virtual Hardware-in-the-Loop Simulation (V-HILS), and (4) Hardware-in-the-Loop Simulation (HILS) that fully implements the ECU board and connects with real-time plant simulation.
  • MILS Model-in-the-Loop
  • Simulation Simulation
  • S Software-in-the-Loop Simulation
  • PILS Processor-in-the-Loop Simulation
  • V-HILS Virtual Hardware-in-the-Loop Simulation
  • HILS Hardware-in-the-Loop Simulation
  • MILS / SILS is mainly used in the trial and error phase to bring out the basic performance of the plant.
  • V-HILS uses completed ECU software, so it is very promising as a method for finding and solving unexpected operations (bugs) of the software.
  • HILS is always performed for the final operation check of the completed ECU board, but even if a failure is found, reproducibility is not guaranteed, so it cannot be used for debugging purposes.
  • V-HILS is particularly expected to solve this problem.
  • a typical V-HILS configuration consists of a plurality of ECU emulators, a plurality of plant simulators, and a global scheduler that schedules the overall operation.
  • the ECU emulator consists of a processor emulator and a peripheral emulator.
  • the plant simulator includes a brake simulator, an engine simulator, and the like.
  • the processor emulator operates with a relatively high resolution clock of, for example, 80 MHz.
  • the plant simulator is a physical mechanism simulator, it operates at a relatively low resolution of, for example, 10 KHz. In general, since a low resolution can be simulated at a higher speed, a plant simulator is often faster.
  • Plant simulators do not always perform numerical calculations repeatedly with a fixed processing step time, but there are cases where variable steps are required depending on the timing of discontinuous change points, etc. Many.
  • an instruction signal is received from the controller in each step, and the internal state is output to the sensor. Note that the instruction signal is often pulsed in order to represent the on / off state of the switch.
  • the peripheral emulator is the interface part of the I / O IV of the ECU emulator and connects the plant simulator and processor emulator to each other. It can be seen that it typically operates at a resolution of about 10MHz (on average). This is faster than a plant simulator but slower than a processor emulator.
  • the peripheral emulator sends a pulse signal to the plant simulator. Also, the internal state is read as quantitative data from the plant simulator.
  • the peripheral emulator sends and receives data to the processor emulator in response to a read / write (R / W) request and sends an interrupt (INT).
  • a network function such as CAN (controller area network) that connects processors to each other
  • the transmission data is received from the processor (W)
  • communication is performed between peripherals via a bus
  • the processor Sends an interrupt (INT) and responds to the received data read request (R) from the processor.
  • the peripheral is the center of the system that interconnects the plant, processor, and processors. If there is a time resolution sufficient to distinguish the order of signals passing through the peripherals, the order can be correctly reproduced with respect to the interaction between the plant and the processor. However, if the time taken until the next signal determines the accuracy of the data (such as speed calculation), the finer the time resolution, the better. That is, the magnitude of the data error is determined according to the time resolution.
  • Time synchronization In this method, simulations are executed while the processor emulator communicates with each other. There is a trade-off between execution speed and time accuracy, and there is a time quantization error. Further, as described above, this method is not a realistic solution because the synchronous communication cost between the processor and the emulator is high.
  • Optimistic event synchronization In this method, each processor / emulator sends and receives events with time information and synchronizes with the other party. However, since the simulation is executed speculatively while leaving the possibility of “flying”, if the speculation is off, it is necessary to roll back the processor emulator appropriately.
  • each processor / emulator sends and receives events with time information and synchronizes with the other party.
  • a deadlock may occur due to waiting for an event.
  • the cost of avoidance may increase, such as sending special null messages frequently for sending time.
  • Japanese Patent Application Laid-Open No. 2007-11720 is intended to solve the problem that the configuration of a system simulator can be flexibly changed while supporting a system having a complicated configuration.
  • this prior art does not suggest a technique for optimizing the synchronization between the peripheral and the CPU.
  • the inventors of the present application have developed a conservative event synchronization mechanism and provided a simulation technique using a peripheral scheduler described in the specification of Japanese Patent Application No. 2009-238954.
  • the peripheral scheduler starts parallel operation by clearing (OFF) the completion flag of all peripheral emulators. Then, the peripheral scheduler finds the peripheral emulator that is scheduled to reach the earliest process break based on the set process break timing of each individual peripheral emulator. I will call it Peripheral P. Assuming that the time between the processes is T, the peripheral scheduler advances the execution of each processor emulator and each plant simulator until the time T is reached. Then, the peripheral scheduler waits for the peripheral P completion flag to be set. In response to the peripheral P completion flag being set, the peripheral scheduler synchronizes data between the peripheral P and the processor emulator and plant simulator.
  • JP 2007-11720 A Japanese Patent Application No. 2009-238954
  • an object of the present invention is to perform simulation at a high speed with sufficient time accuracy and small data error in a system having a plurality of ECUs and plants that notify (interrupt) data asynchronously with each other.
  • asynchronous data notification refers to, for example, notifying a controller of a state change that occurs irregularly in a plant, asynchronous CAN communication between processors, and the like.
  • Another object of the present invention is to couple three types of processor emulator, peripheral emulator, and plant simulator so as to simulate an entire system having an ECU and a plant to be controlled.
  • peripherals are divided into three types of mutual peripherals, external peripherals, and internal peripherals, and a unique scheduler is provided for each. These three types of schedulers cooperate to realize an efficient and accurate coupled operation.
  • the mutual peripheral is an intermediate layer that handles communication between processors, and has a unique mutual peripheral scheduler. It has a function to process asynchronous communication between processors at high speed.
  • External peripheral is an intermediate layer that connects a plant and a processor, and has a specific external peripheral scheduler. It has a function of receiving an asynchronous notification from the plant and transmitting it to the processor, and sending an instruction from the processor to the plant.
  • the internal peripheral is a peripheral layer that is connected only to a specific processor. For example, Watch Dog Timer and memory are applicable. There is no exchange of signals with the plant or other processors. Has its own internal peripheral scheduler (or processor scheduler).
  • the mutual peripheral scheduler, the external peripheral scheduler, and the internal peripheral scheduler operate in parallel in the form of a coroutine.
  • the plant simulator is preferably created by a continuous numerical simulation modeling system such as MATLAB (R) / Simulink (R).
  • the peripheral emulator is a transaction type emulator, and is preferably created by SystemC / TLM.
  • the processor emulator performs emulation by an instruction set simulator (ISS).
  • the external peripheral scheduler selects the earlier of the “reaction delay time” of the processor emulator and the time when the next event occurs, and executes the plant simulator in advance until that time. Then, all processor schedulers (or internal peripheral schedulers) are notified so as to execute the execution up to the time when the plant simulator actually stops.
  • the reaction delay time refers to the minimum time difference between the time when a notification of a state change is received from the plant, the time when the instruction to the corresponding plant is calculated, and the time when the instruction is actually effective in the plant.
  • the inter-peripheral scheduler selects all the processor schedulers (or internal peripheral schedulers) so that the “communication delay time” between processor emulators and the time until the next event occurs are selected earlier, and execution is performed up to that time.
  • the communication delay time refers to the minimum time required from when a processor transmits data to when another processor receives the data.
  • the processor scheduler (or internal peripheral scheduler) proceeds to the earliest time of the notified target synchronization time. In this way, deadlock between processors can be avoided at low cost by proceeding conservatively toward the synchronization time given by two types of peripheral schedulers without adjusting the time between processors. To do.
  • Each peripheral layer receives the time of the slowest progressing processor as an event, and advances its processing until that time. Further, the next synchronization time notification is determined based on the updated time.
  • the simulation proceeds in the order of the plant, the processor, and the peripheral, so that the processing in which the cooperation between different types is coupled as a whole is realized.
  • the processor emulator since the processor emulator is executed in advance using the reaction delay time of the processor emulator and the communication delay time between the processor emulator, a conservative event without overhead for avoiding deadlock. High-speed simulation by synchronization is possible.
  • the synchronization method is based on an event that can represent an arbitrary time instead of synchronization at a fixed time interval, an accurate simulation with a small time error is possible.
  • FIG. 6 illustrates an example of a peripheral emulation operation. It is an example of the simulation operation of a plant. It is a figure which shows the component of an internal peripheral scheduler. It is a figure which shows the flowchart of a process of an internal peripheral scheduler. It is a figure which shows the flowchart of a process of an internal peripheral scheduler.
  • DELTA communication delay
  • Tc of a processor. It is a diagram for explaining a reaction delay [Delta] T R of the processor. It is a figure for demonstrating the simulation of a shared memory access. It is a figure for demonstrating emulating the peripheral with high communication frequency with a processor by the same core as ISS. It is a figure for demonstrating the simulation of the operation
  • FIG. 1 computer hardware used to implement the present invention will be described.
  • a plurality of CPU1 104a, CPU2 104b, CPU3 104c,..., CPUn 104n are connected to the host bus 102.
  • the host bus 102 is further connected to a main memory 106 for arithmetic processing of the CPU 1 104a, CPU 2 104b, CPU 3 104c,.
  • a keyboard 110, a mouse 112, a display 114, and a hard disk drive 116 are connected to the I / O bus 108.
  • the I / O bus 108 is connected to the host bus 102 via the I / O bridge 118.
  • the keyboard 110 and the mouse 112 are used by an operator to input commands and click menus.
  • the display 114 is used to display a menu for operating the process with the GUI as necessary.
  • CPU1 104a, CPU2 104b, CPU3 104c,..., CPUn 104n are, for example, Intel (R) Xeon (R), and the operating system is Windows (trademark) Server 2003.
  • the operating system preferably has a multitasking function.
  • the operating system is stored on the hard disk drive 116 and is read from the hard disk drive 116 into the main memory 106 when the computer system is started.
  • a multiprocessor system is generally intended to be a system that uses a processor having a plurality of cores of processor functions that can independently perform arithmetic processing. Therefore, a multicore single processor system, a single core multiprocessor system, or It should be understood that either a processor system or a multi-core multi-processor system may be used.
  • the hardware of the computer system that can be used for carrying out the present invention is not limited to IBM (R) System X, and any hardware can be used as long as it can run the simulation program of the present invention.
  • a computer system can be used.
  • the operating system is not limited to the Windows (R) system, and any operating system such as Linux (R) or Mac OS (R) can be used.
  • a computer system such as IBM (R) System P whose operating system is AIX (trademark) based on POWER (trademark) 6 may be used.
  • the hard disk drive 116 further stores programs such as a processor emulator, a peripheral emulator, a plant simulator, an internal peripheral scheduler, a mutual peripheral scheduler, an external peripheral scheduler, and a CAN emulator, which will be described later. Each of them is loaded into the main memory 106 when the computer system is started up, assigned to the individual CPUs 1 to CPUn as individual threads or processes, and executed. For this reason, the computer system shown in FIG. 1 is preferably individually assigned to individual threads such as a processor emulator, a peripheral emulator, a plant simulator, a mutual peripheral scheduler, an external peripheral scheduler, and a CAN emulator. Has a sufficient number of CPUs.
  • FIG. 2 shows a processor emulator, a peripheral emulator, a plant simulator, a mutual peripheral scheduler, an external peripheral scheduler, a CAN emulator, etc. that are assigned to the individual CPU1 to CPUn and operate as individual threads or processes. It is a functional block diagram which shows the cooperation relationship between processing programs.
  • This configuration is a simulation system consisting of a processor emulator and peripheral emulator corresponding to the ECU, and a plant simulator. Peripheral emulators are divided into mutual peripherals and external peripherals. Although not shown in the figure, it should be understood that the internal peripheral is included in the block of the processor emulator. As a whole, it can be regarded as a four-layer simulation system in the horizontal direction of the figure.
  • processor emulators 202a, 202b,... 202z function as a central controller of the ECU functions in the simulation system.
  • the processor emulators 202a, 202b,... 202z load software code and perform emulation by an instruction set simulator (ISS).
  • ISS instruction set simulator
  • the peripheral emulators 204a, 204b,... 204z and the CAN emulator 212 are transaction-type emulators, and are preferably created by SystemC / TLM.
  • the plant simulators 206a, 206b,... 206z are preferably created by a continuous numerical simulation modeling system such as MATLAB® / Simulink®. Each of the plant simulators 206a, 206b,... 206z corresponds to a power device such as an engine, a power transmission device such as a transmission, a traveling device such as a steering, and an automobile mechanism device such as a brake device.
  • a power device such as an engine
  • a power transmission device such as a transmission
  • a traveling device such as a steering
  • an automobile mechanism device such as a brake device.
  • the processor emulators 202a, 202b,... 202z typically operate with a relatively high resolution clock of 80 MHz, for example.
  • the plant simulators 206a, 206b,... 206z are physical mechanism simulators, for example, they typically operate at a relatively low resolution of 10 KHz.
  • the peripheral emulators 204a, 204b since the processor emulators 202a, 202b,... 202z and the plant simulators 206a, 206b,... 206z cannot be directly connected, the peripheral emulators 204a, 204b,. Intervening, changes in state from the plant simulator and sensor values are converted into events and passed to the processor simulator. Conversely, instructions (signaling) from the processor emulator are converted into events and converted into the plant simulator. Play a passing role.
  • the internal peripheral scheduler schedules the processor emulator and the peripheral emulator connected to it.
  • the peripheral emulator connected to the processor emulator processes peripheral functions (internal peripheral) such as ROM, RAM, watch dog timer, etc. that are not directly related to other processors and plants.
  • peripheral functions internal peripheral
  • the internal peripheral scheduler refers to the memory map specification of the ECU, and has an important function of distributing the load / store instruction from the ISS to the internal peripheral scheduler, the mutual peripheral scheduler, and the external peripheral scheduler.
  • the internal peripheral scheduler may be described in other words as a processor scheduler, but it should be noted that both indicate the same function.
  • the external peripheral scheduler 208 is a scheduler that processes the peripheral emulators 204a, 204b,... 204z connected to the plant simulators 206a, 206b,.
  • the external peripheral scheduler 208 schedules the plant simulators 206a, 206b,... 206z to be executed in advance by the reaction delay time (or time until the next event) of the processor emulators 202a, 202b,. To do.
  • the plant simulator stops at a specified time or an earlier time if notification of an internal state update is required. Then, the processor emulator is notified to execute in advance until the time when the plant simulators 206a, 206b,.
  • the external peripheral scheduler 208 gives signaling or sampling instructions requested by the controller to the plant simulators 206a, 206b,.
  • the signaling is an event for the controller to actuate the plant, for example, an operation for instructing a switch ON / OFF signal.
  • Sampling is an event for instructing reading of a value when the controller monitors the state of the plant. For example, the controller reads the voltage value of the battery cell (plant).
  • the controller is a logic that generates a control signal for the plant by software loaded in the processor emulator. In the signaling and sampling, the controller determines the timing regardless of whether the processing to be emulated is periodic.
  • the external peripheral scheduler 208 receives a notification as a state change event from the plant simulators 206a, 206b,... 206z. This is an event in which the plant notifies the controller of a change in state, and the plant determines its timing. This may also be periodic or aperiodic.
  • the mutual peripheral scheduler 210 is a scheduler that provides a mutual peripheral function for connecting the processor emulators 202a, 202b,... 202z.
  • the mutual peripheral scheduler 210 executes the processor emulators 202a, 202b,... 202z in advance by the communication delay time (or time until the next event) between the processor emulators 202a, 202b,. Notice.
  • the processor emulators 202a, 202b,... 202z proceed conservatively until the earliest time of the notified times.
  • communication between the processor and the emulator is performed by, for example, a CAN (Controller Area Network) emulator 212.
  • a simulation when a shared memory is used for communication between the processors of the ECU will be described later with reference to FIG.
  • an event from the external peripheral scheduler 208 and the mutual peripheral scheduler 210 to the processor emulators 202a, 202b,... 202z takes place in the form of an interrupt (INT).
  • Events from the emulators 202a, 202b,... 202z to the external peripheral scheduler 208 and the mutual peripheral scheduler 210 are performed in a read / write (R / W) format.
  • the external peripheral scheduler 208 causes the plant simulator 206 to execute in advance.
  • T plant be the time that actually preceded. - the upper limit of the preceding is to time, the following signaling or is closer of [Delta] T R.
  • ⁇ T R is the minimum delay time from the input time from the plant simulator until the response of the processor emulator is transmitted to the plant simulator and becomes effective. Is made.
  • the external peripheral scheduler 208 notifies the processor emulator 202 to perform execution up to the position (T plant ) where the plant simulator 206 actually stopped.
  • the mutual peripheral scheduler 210 executes the processor emulator 202 in advance until the earlier communication delay time between the processor emulator 202 and the time until the next event. To be notified. In the figure, an example in which the communication delay time is earlier is shown. The communication delay time ⁇ T c will be described in more detail with reference to FIG.
  • the processor emulator 202 advances the process conservatively to the earliest time of the notified two times, but the process is not necessarily interrupted until that time.
  • the emulation of the processor is realized as an ISS (Instruction Set Simulator).
  • the processor emulation is executed aiming at a specified time, issues an access (R / W) request according to an instruction (instruction word), and accepts irregular interrupts generated from peripherals.
  • an instruction to the ISS and a request from the ISS are described as follows.
  • FIG. 4 shows an example of the emulation operation of the processor according to such an instruction.
  • the processor receives an instruction of advance (t g ).
  • the processor outputs load (t 1 , a 1 ) at time t 1 .
  • the processor receives resume (v 1 ).
  • the processor outputs store (t 2 , a 2 , v 2 ) at time t 2 .
  • the processor When the time tg is reached, the processor outputs complete () according to the previously received advance (t g ). The processor may then receive interrupt (i) depending on the plant response. Otherwise, it receives the next advance () instruction.
  • peripheral emulation performs transactions according to events stuck in the task queue.
  • Events include register READ requests and WRITE requests.
  • peripheral emulation these events are sequentially extracted from the top of the task queue, interpreted, executed as a transaction, converted into a new event, and inserted into the task queue again. It may be converted into one or more events, or it may not generate any events at all. The interpretation and execution of events depends on the function of the individual peripheral. By repeating this process until the event runs out, peripheral emulation is performed. That is, it is a repetition of pop (retrieve), execute (execute), push (insert).
  • the peripheral scheduler adds the event to the appropriate task queue. That is, it is a repetition of pop, execute, push or ⁇ ⁇ ⁇ ⁇ export (insertion or transfer), import (transfer).
  • import ⁇ ⁇ ⁇ ⁇ ⁇ is optional (none) depending on the cycle.
  • the input / output to the plant simulator is a ⁇ port_update, t, p, v> event. This notifies the value “y” that the port “p” takes at the time “t”. For example, an instruction (signaling) to the plant and a notification of a state change from the plant are expressed by this.
  • Requests issued from the processor are ⁇ read, t, r> event and ⁇ write, t, r, v> event, respectively, an event requesting reading of the value taken by the register r at time t, and register r at time t. This event requests that the value v be written to.
  • the processor receives a ⁇ register_update, t, r, v> event, which notifies the value of the register r at time t in response to the ⁇ read, t, r> request.
  • ⁇ interrupt, t, i> is a reception event, which is an event notifying that an interrupt i occurs at time t.
  • New events returned by next include internal events closed to peripherals, such as timer firing.
  • events that should be passed to other peripherals are ⁇ interrupt, t, i>, ⁇ register_update, t, r, v> And ⁇ port_update, t, p, v>.
  • FIG. 5 shows an example of peripheral emulation operation.
  • the task queue operation instruction insert e 1 [t 1 ]
  • the event e 1 is accumulated in the task queue so as to be a FIFO. Or a task queue is empty, the time of other events if there is later than t 1, e 1 is clogged at the beginning of the task queue.
  • e 1 is a register read request.
  • FIG. 5 (3) represents a state in which a state change notification is received from the plant and is transmitted to the processor using an interrupt signal.
  • the scheduler puts a notification of a state change in the task queue and inserts it from (insert (e 3 [t 3 ])) and executes it, it is converted into a new event ⁇ interrupt, t, i> It is transferred (exported) to the processor.
  • the plant simulation is preferably realized by a continuous numerical simulation modeling system such as MATLAB® / Simulink®.
  • the plant first calculates an output (vector) according to an internal state (vector) and an external input (vector) at a specified time.
  • the internal state change (vector) is output.
  • the internal state change is adjusted based on the specified error range, plant-specific maximum step width, zero crossing, etc. Determine the next step time.
  • FIG. 6 shows an example of a plant simulation operation.
  • advance (t g ) arrives at the plant.
  • the plant outputs output (t 1 , y 1 ) at simulation time t 1 .
  • input (u 1 ) arrives at the plant.
  • the plant outputs output (t 2 , y 2 ) at simulation time t 2 .
  • the internal peripheral scheduler, the mutual peripheral scheduler, and the external peripheral scheduler play major roles.
  • an outline of a conservative event synchronization simulation and its terms will be described.
  • FIG. 7 is a diagram showing processing related to the input queue and the output queue in the internal peripheral scheduler.
  • the input queue includes IP (Input Queue from Processors), that is, a queue that receives an event (shared memory update notification) from another processor, and IQ, that is, a message from a mutual peripheral or an external peripheral.
  • IP Input Queue from Processors
  • IQ a queue that receives an event (shared memory update notification) from another processor
  • IQ that is, a message from a mutual peripheral or an external peripheral.
  • P i and P j are the i-th and j-th processors, respectively.
  • the data placed in the IQ is a CAN reception or interrupt event message or a null message.
  • the output queue includes OP (Output (Queue to Processors), that is, a queue that sends an event (shared memory update notification) to another processor, and an OQ, that is, a queue that sends a message to a mutual peripheral or an external peripheral. is there.
  • the data placed in the OQ is a CAN transmission event message or a progress null message.
  • IP and OP When exchanging events between processors, one set of IP and OP is used for each partner processor.
  • T k of the kth event that arrives at IQ / IP satisfies the following condition. T k ⁇ T k + 1
  • the internal peripheral scheduler waits for queue input e in step 802, and in step 804, determines whether all IQs are filled (one or more messages have arrived), and if so, in step 806 Then, the earliest time in all IQs is set to T 0, and a subroutine “parallel” is called in step 808 to perform the process of proceeding in parallel with other processors.
  • the processing of the “parallel” subroutine will be described later with reference to the flowchart of FIG.
  • the internal peripheral scheduler determines in step 902 whether the process was “read” and if so, calls the “fill” subroutine in step 904.
  • step 906 If the process is not “read” in step 902, the process proceeds directly to step 906.
  • step 908 the internal peripheral scheduler, the processor, to execute the aim of T 1. In other words, the process proceeds until the time specified by the mutual peripheral scheduler or the external peripheral scheduler.
  • step 910 the internal peripheral scheduler advances the time T while executing the processor, and in step 912, OQ / OP is updated / flushed.
  • step 916 If it is determined at step 916 that the last notification from the ISS is not "read”, then at step 918, either writing to shared memory, sending CAN, or sending a null message is performed, Return to step 908.
  • the internal peripheral scheduler creates a temporary list of entries in the IP queue. After creating the temporary list, all messages having a time stamp older than the current time in the IP are removed and added to the temporary list.
  • step 1004 the internal peripheral scheduler determines whether all IPs are filled. If so, in step 1006, all the events in the temporary list (writing to the shared memory from other processors) are reflected in order of time stamp. After processing the temporary list, the fill subroutine is complete.
  • step 1004 If it is determined in step 1004 that all IPs are not filled, the process proceeds to step 1008, where the internal peripheral scheduler waits for an event e from the IP.
  • step 1010 it is determined whether or not T> T e, and if so, in step 1014, and updated by the addition of e to the temporary list, returns to step 1008.
  • step 1010 if it is determined not equal T> T e, the internal peripheral scheduler, in addition to e to the IP at step 1012, it returns to step 1004.
  • FIG. 11 is a diagram illustrating a process related to a queue in the mutual peripheral scheduler. As shown in the figure, the input queue IQ receives an event from P i and P j , which is transmitted to the CAN emulator.
  • a task queue TQ which causes firing of CAN emulator reception.
  • an event clogged in a task queue may be called a task in order to distinguish it from an input queue or an output queue.
  • step 1202 the inter-peripheral scheduler waits for an IQ update.
  • step 1204 it is determined whether all IQs are filled. Otherwise, the process returns to step 1202 to continue waiting for the IQ update.
  • step 1204 the mutual peripheral scheduler, the entire IQ is determined to [filled, in step 1206, placing the closest time and T 0 in all IQ.
  • event e 1 is an event that reads the value of register r at ⁇ read, t, r>, that is, time t
  • event e 2 is a register at time ⁇ write, t, r, v>, that is, time t This event updates the value of r to v.
  • an ⁇ interrupt, t, i>, ⁇ register_update, t, r, v> event that is notified to the processor when CAN data is received occurs.
  • step 1222 the mutual peripheral scheduler updates all OQs and returns to step 1216.
  • the mutual peripheral scheduler adds a null message at time min (T + ⁇ T c , T top ) to all OQs in step 1226, flushes the OQ in step 1228, and proceeds to step 1204.
  • ⁇ T c is the communication delay time of the processor.
  • the mutual peripheral scheduler flushes the OQ at step 1228 and returns to step 1204.
  • FIG. 15 shows an example of entering / exiting the TQ and the corresponding IQ and OQ events along the time in the mutual peripheral scheduler for reference. Dotted arrows indicate the progress of guest time.
  • events of messages arriving at the IQ from the processor scheduler are CAN abort, CAN transmission, null (progress message event), and CAN reset in chronological order. All the messages other than null are events that occur when the processor issues a command to the CAN device (register writing).
  • CAN abort is an event that issues a command to cancel the transmission standby state when arbitration is lost and to notify the processor of an interrupt.
  • CAN transmission is an event that issues a command to transmit data set in advance.
  • FIG. 15 shows an example in which CAN transmission events arrive continuously from two different processors.
  • the CAN reset is an event that issues a command to disconnect the CAN device from the bus and return to the initial state.
  • the event of the message sent from the OQ to the processor scheduler is null (null message event), abort notification, and CAN reception in chronological order.
  • the CAN reception is an event in which the CAN device notifies the processor that CAN data has been received by an interrupt.
  • the abort notification is an event in which the CAN device notifies the processor that the arbitration has been lost by an interrupt.
  • a CAN transmission event occurs (arrives at IQ)
  • data that has started transmission may be being transferred.
  • a CAN reception event (first) is accumulated at the beginning of the TQ due to the completion of the previously started transfer.
  • arbitration for the next data transfer is performed.
  • the time stamp of the null event arriving at the IQ is the same as the CAN reception / arbitration guest time.
  • the inter-peripheral scheduler of the present invention includes a process of notifying (sending a null message) to the processor / scheduler so that the preceding execution is performed until the start time of the TQ.
  • the null that arrives at IQ in FIG. 15 is a progress message that the processor scheduler notifies that the processor has reached the time notified by this processing.
  • the null message that is initially sent in the OQ in the figure indicates that the processor / scheduler is notified of the preceding execution in this process.
  • FIG. 13 is a diagram showing processing related to a queue in the external peripheral scheduler. As shown in the figure, messages come from P i and P j to the input queue IQ.
  • An interrupt notification event message and a null message are sent to the output queue OQ, which are taken out by P i and P j .
  • Task queue TQ is sorted by time stamp (time stamp).
  • the external peripheral scheduler holds the current signal value of the I / O port connected to the plant.
  • step 1402 the external peripheral scheduler waits for an IQ update.
  • step 1404 it is determined whether all IQs are filled. If not, the process returns to step 1402 to continue waiting for the IQ update.
  • step 1404 the external peripheral scheduler, the entire IQ is determined to [filled, in step 1406, placing the closest time and T 0 in all IQ.
  • a T ⁇ T 0 ⁇ T P, T P is the current plant time.
  • event e 1 is an event that reads the value of register r at ⁇ read, t, r>, that is, time t
  • event e 2 is a register at time ⁇ write, t, r, v>, that is, time t This event updates the value of r to v.
  • e 4 is an event for executing the plant until time min ⁇ T top , T + ⁇ T R ⁇ .
  • step 1418 the process proceeds to a determination step of step 1420.
  • T T P not equal when it is determined directly, the process proceeds to step 1420.
  • step 1426 When the external peripheral scheduler determines in step 1420 that k is a plant execution, in step 1426, it calls advance () to execute the plant.
  • the external peripheral scheduler updates the TQ. Specifically, it receives output (t, y), executes pusg (e 3 [t]), refers to PV, and notifies input (u). Then send a null message.
  • e 3 is an event in which the value of the port p is updated to v by ⁇ port_update, p, v>.
  • next step 1430 the external peripheral scheduler updates T p, and in the next step 1432, it is determined whether the processing is completed. If it is determined that the process is completed, the process returns to step 1420. If it is determined that the process is not completed, the task is returned in step 1434 and then the process returns to step 1420.
  • the external peripheral scheduler proceeds to step 1436 and calls next () to execute the task. Specifically, it executes ⁇ interrupt>, ⁇ register value>, ⁇ register_update>, ⁇ port_update> and sends a null message.
  • the external peripheral scheduler updates the OQ.
  • add tasks ⁇ plant_go> ignite at time T + [Delta] T R to TQ. That is, insert (e 4 [T + ⁇ T R ]) is executed, but more specifically, e 4 is to execute the plant up to time min ⁇ T top , T + ⁇ T R ⁇ .
  • step 1440 the external peripheral scheduler flushes the OQ and returns to step 1420.
  • deadlock occurs when performing conservative event synchronization, and that a null message is necessary to avoid it. This is not a new discovery, but a knowledge that has been known.
  • FIG. 16 shows the configuration of the logical process.
  • the logical process includes an input queue IQ for message reception, an output queue OQ for message transmission, and a scheduled simulation task. It has a task queue TQ for storing and a scalar value indicating the current time. IQ and OQ are FIFOs, and TQs are sorted in time order.
  • FIG. 17 is a diagram illustrating a state in which a plurality of logical processes (LP1 to LP4) are connected via a communication channel.
  • each logical process has IQ and OQ for each communication channel.
  • the logical process exchanges messages having time information (time stamps) using IQ and OQ.
  • the time stamp of a message sent / received to / from IQ / OQ increases monotonously every time sending / receiving is performed. Therefore, when a logical process receives a message from all other logical processes, the simulation can proceed without rolling back to the smallest time stamp among the received messages.
  • Exchanged messages include event messages and null messages.
  • the event message related to the event e at time t is a message notifying that “the time of the next event that occurs from the transmission side to the reception side is t and the event that occurs is e”.
  • the null message at time t is a message that tells that "the time of the next event that occurs from the sender to the receiver is later than t" and has an effect on the simulation area of the receiver. Absent.
  • the purpose of the null message is to prevent the deadlock described below.
  • conservative event synchronization in order to prevent rollback, processing is stopped until a message with a time stamp greater than the current time is received from all other logical processes. However, when the other logical process waiting for message reception also waits for reception from the logical process at the same time, as shown in FIG. Thus, “prefetching” how far an event from outside does not occur from the current time and sending a null message as shown in FIG. 18B prevents deadlock.
  • a null message (null message having the current time at the time of transmission as a time stamp) that does not perform “look ahead” is particularly called a progress message.
  • the purpose of the progress message is to avoid frequent synchronization caused by null messages with a small read-ahead width.
  • the internal peripheral scheduler sends a progress message. This is because the ISS that drives the internal peripheral scheduler can only predict the next event to other logical processes with a small width.
  • the communication delay ⁇ T c of the processor will be described with reference to FIG. That is, as shown, from the writing to each other peripherals (write), the minimum value of the delay until the interrupt to a receiving / transmitting-side processor is generated is communication delay [Delta] T c of the processor.
  • the maximum delay of the data frame is 44 ⁇ s (the minimum number of bits of the frame is 44), which is a reference value for ⁇ T c .
  • reaction delay [Delta] T R of the processor that is, the reaction delay [Delta] T R of the processor, as shown, from the input time of the plant, due to the reaction of the processor it is the minimum of delay until the effective transmitted to plant.
  • T R is the minimum time at which the reaction of the processor may reach the plant when TQ is empty.
  • T trigger ⁇ T R ⁇ T reaction
  • time T trigger the time from when the processor determines the operation (time T trigger ) to when the actuator operates (time T reaction ) is prefetched. It does not lose time accuracy, in order to utilize the knowledge that the reaction delay [Delta] T R of the processor is used.
  • processor response delay As a first example, in engine fuel injection control, when a rotation pulse (state change) is generated from the plant every 15 ° of crank, fuel injection and ignition instructions use a timer to make the time accurate. Executed. Since the time set to the timer is calculated when one or more previous rotation pulses occur, one or more pulse intervals before injection / ignition, that is, a pulse interval of ⁇ 250 ⁇ s or more is sufficient at a maximum speed of 10,000 rpm There is a significant delay. This is the reaction delay.
  • the reaction delay is very small.
  • this type of control often performs periodic tasks for physical phenomena that are dull compared to a processor (eg, a PWM signal indication to a fan with a controlled temperature as a control temperature, a throttle with a vehicle speed as a controlled variable) Opening instruction).
  • the guideline for the control cycle of temperature, speed, and torque is 1 second, 1 millisecond, and 0.1 millisecond, respectively, and there is no need to give instructions to the plant with finer time granularity. For this reason, the time determined from the coarse time granularity of the plant is used as the reaction delay.
  • FIG. 22 shows an example of assignment of the ISS, peripheral emulator, plant simulator, and three scheduler functions of the present invention to the core of the host computer.
  • the internal peripheral scheduler refers to the memory map specification of the ECU, and distributes load / store instructions from the ISS to internal peripherals (SystemC in the core), mutual peripherals, and external peripherals.
  • FIG. 23 shows an example in which the two processors 1 and 2 make a CAN frame transmission request to the CAN device.
  • the frame requested by the processor 1 has a higher priority than the frame requested by the processor 2.
  • the processor 2 issues a command to the CAN device to cancel the transmission standby state and notify the interrupt when the arbitration is lost (Abort Set).
  • the vertical arrows in the figure indicate the progress of the guest time.
  • the CAN device emulator (described in SystemC or the like) starts the arbitration process.
  • the arbitration start event is added to the TQ by the CAN device emulator, and all processors synchronize the guest time at this time (start arbitration) by the processing of the mutual peripheral scheduler.
  • the abort set, two transmission sets, and arbitration in this example correspond to the CAN abort arriving at IQ, the two CAN transmissions arriving at IQ, and the arbitration event added to TQ in FIG.
  • the processing of the mutual peripheral scheduler that synchronizes the processor time in FIG. 23 is the transmission of a null message and reception of a progress message at the beginning of the TQ, and is the same as the processing described in relation to FIG. .
  • FIG. 23 shows that when arbitration is started, the emulator of the CAN device adds an event of the loss notification time to the TQ.
  • the time stamp of the null message to be sent is not ⁇ T C but the time of the loss notification added here. For this reason, the processor 2 does not pass the loss notification time (overhead requiring rollback).
  • the processor 1 that issued a CAN frame request with a high priority between the start of the arbitration and the completion of the arbitration (confirmation of victory and defeat of the frame) Indicates resetting.
  • arbitration is started, as described in the example of FIG. 23, an event for abort notification to the processor 2 is added to the TQ by the emulator of the CAN device.
  • the CAN device emulator checks whether there is a reset notification before issuing an abort notification and determines whether to perform the abort notification. It shows that
  • the CAN device emulator recalculates which CAN frame wins the arbitration when there is a reset notification.
  • the processor is not notified of the abort.
  • FIG. 24 shows that the scheduled abort notification is not performed as a result of the CAN frame (scheduled to be lost at the start of arbitration) that the processor 2 has requested for transmission having won arbitration as a result of recalculation.
  • the processor erroneously receives an abort notification (overhead requiring a rollback) even though no abort occurs due to the reset. There is no.
  • processor emulators 2502a,..., 2502m, 2504a,..., 2504n are functionally substantially the same as the processor emulators 202a,.
  • Peripheral emulators 2506a,..., 2506m, 2508a,..., 2508n are functionally substantially the same as the peripheral emulators 204a,.
  • the configuration of FIG. 25 is different from the configuration of FIG. 2 in that the plant simulator is an active plant simulator 2510a,..., 2510m, and a passive plant simulator 2512a,. , 2512n.
  • the active plant simulator is a plant simulator having a function of autonomously determining the timing of state change and the like, like an engine simulator.
  • the engine is a plant that informs the crank angle in pulses of 15 degrees, but the timing cannot be determined on the controller (ECU) side.
  • a passive plant simulator is a plant simulator in which the controller can determine the timing, for example, a plant that monitors (samples) the voltage of the battery at a specified timing.
  • a sensor plant such as a temperature sensor, a pressure sensor, and a rotation speed sensor corresponds to a passive plant. If the brake or suspension senses the state by sampling, it is classified as a passive plant.
  • the external peripheral scheduler In response to the sorting of such an active plant simulator and a passive plant simulator, the external peripheral scheduler also schedules an external peripheral scheduler 2514a for scheduling a peripheral emulator connected to the active plant simulator, An external peripheral scheduler 2514b is provided that schedules a peripheral simulator connected to the passive plant emulator.
  • the peripheral processor connected to the active plant simulator has a two-way action of receiving a state change while the corresponding processor emulator notifies the signal update, but the passive plant simulator In principle, the corresponding processor emulator only notifies the signal update and the sampling notice to the connected peripheral emulator.
  • the operation of the mutual peripheral scheduler 2516 is substantially the same as that of FIG. It is the same as the mutual peripheral scheduler 210, and the CAN emulator 2518 is substantially the same as the CAN emulator 212 of FIG.
  • the external peripheral scheduler 2514a for the active plant simulator is functionally substantially identical to the external peripheral scheduler 208 of FIG. 2, but the external peripheral scheduler 2514b for the passive plant simulator. Does not require a process of calculating a time width for causing the processor to precede the plant.
  • the external peripheral scheduler for the passive plant simulator only has to repeat the process of catching up with the time of the preceding processor every time the time is notified.
  • step 2602 the external peripheral scheduler 2514 b waits for the IQ update.
  • step 2604 it is determined whether all IQs are filled. If not, the process returns to step 2602 to continue waiting for the IQ update.
  • step 2604 the external peripheral scheduler 2514b is, when all the IQ is determined to [filled, at step 1406, the closest time in the entire IQ put and T 0.
  • step 2616 the external peripheral scheduler 2514b executes the plant up to T.
  • the external peripheral scheduler 2514b does not receive notification of a state change.
  • the external peripheral scheduler 2514b executes the TQ entry (T) in step 2618 and returns to step 2604.
  • CAN is described as the in-vehicle LAN protocol handled by the mutual peripheral scheduler
  • the simulation system of the present invention is not limited to CAN, and can be applied to any in-vehicle LAN protocol such as LIN and FlexRay. is there.
  • the present invention is not limited to a specific computer architecture or platform, and can be implemented on any platform capable of realizing multitasking.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • Debugging And Monitoring (AREA)

Abstract

ECUエミュレータであるプロセッサ・エミュレータ、プラント・シミュレータ、外部ペリフェラル・スケジューラ、および相互ペリフェラル・スケジューラの4層からなるシミュレーション・システムが提供される。外部ペリフェラル・スケジューラは、プロセッサ・エミュレータの反応遅延時間(あるいは次イベントまでの時間)だけ、プラント・シミュレータを先行実行させ、実際にプラント・シミュレータが停止した時間まで、プロセッサ・エミュレータに先行実行するよう通知する。相互ペリフェラル・スケジューラは、プロセッサ・エミュレータ間の通信遅延時間(あるいは次イベントまでの時間)だけ、プロセッサ・エミュレータに先行実行するように通知する。プロセッサ・エミュレータは、通知された時間のうち最も早い時刻まで保守的に処理を進める。

Description

シミュレーション方法、システム及びプログラム
 本発明は、自動車などの物理システムのシミュレーションに関し、より詳しくは、ソフトウェア・ベースでのシミュレーション・システムに関するものである。
 自動車は、その初期の時代の20世紀初頭は、動力としてのエンジンと、ブレーキ、アクセル、ハンドル、トランスミッション、サスペンジョンを含む、機構部品からなっていたが、エンジンのプラグの点火、ヘッドライト以外は、電気的な仕組みはほとんど利用していなかった。
 ところが、1970年代頃から、大気汚染、石油危機などに備えて、エンジンを効率的に制御する必要性が生じ、このためエンジンの制御に、ECUが使用されるようになってきた。ECUは、一般的に、センサからの入力信号を、例えばA/D変換する入力インターフェースと、決められた論理に従ってディジタル入力信号を処理する論理演算部(マイクロコンピュータ)と、その処理結果を、アクチュエータ作動信号に変換する出力インターフェースとから構成される。
 いまや、エンジンやトランスミッションなどの制御システム、Anti-lock Breaking System (ABS)、Electronic Stability Control (ESC)、パワーステアリングだけでなく、ワイパー制御やセキュリティ・モニタリング・システムなどに至るまで、最近の自動車では、機構部品だけでなく、エレクトロニクス部品やソフトウエアが重要な比率を占める。後者に関する開発費は全体の25%とも40%とも言われ、ハイブリッド型の自動車では70%を占める。
 ところで、自動車は、エンジンなどの動力装置や動力伝達装置、ステアリングなどの走行装置、ブレーキ装置、その他ボディ系などの機械部品(プラント)で構成され、また、これらのプラントの動作は、30~70以上の電子制御ユニット(ECU)のプログラムがセンサ入力(速度など)や人間からの入力(アクセルなど)に応じて、動的に決定する。
 ECUは、基本的に各々が一つのプラントの動作を制御する。たとえば、エンジンへの燃料噴射(Fuel Injection)や点火(Ignition)は、エンジン・コントロール・ユニットがその量やタイミングをソフトウエアにより決定する。ソフトウエアなので、「スポーツ」モードを用意するような高級車では、モードに応じて燃料噴射量を増量・減量することもできる。また、シフトダウンのタイミングにあわせて、自動的にブリッピング(空ぶかし)してエンジンの回転数を合わせることもできる。この場合には、エンジンのECUとトランスミッションのECUが連携して動作する必要がある。自動車の横滑りなどを防止するための統合車両姿勢安定制御(ESC: Electronic Stability Control)システムでは、さらにブレーキなどの制動装置との連動も必要となり、ECUソフトウエアは複雑になる。なお、このような「介入」機能は、ソフトウエアであるがゆえに、容易にカットすることができる。
 さて、プラントの性能を十分に引き出し、かつ、安全に動作させるためには、ECUソフトウエアの設計開発の過程において、動作パラメータのチューニングとテストを十分に行うことが重要である。一般に、実車をプロトタイプしてから、チューニングとテストを繰り返すのではコストと時間がかかりすぎるので、プロトタイプする前にコントローラとプラントを計算機の中で仮想的に実現して、高速にかつ正確に動かして、その動作を確認する方法が強く望まれる。このようなECUシミュレーションは、(1)ステートマシンなどの表現形式を用いてコントローラの動作を論理的に表現する Model-in-the-Loop Simulation (MILS)、(2)その論理動作に、データ精度などハードウエアの制約を一部導入した Software-in-the-Loop Simulation (SILS)、(3)ソフトウエアを完全に実装してECUプロセッサをエミュレートするProcessor-in-the-Loop Simulation (PILS)あるいは Virtual Hardware-in-the-Loop Simulation (V-HILS)、そして、(4)ECUボードを完全に実装して、リアルタイム・プラント・シミュレーションと接続する Hardware-in-the-Loop Simulation (HILS) の4種類の方式があり、 この順序で、よりプロトタイプに近くなる。
 MILS/SILSは主に、プラントの基本的な性能を引き出すための試行錯誤フェーズに用いられている。しかし、実際にECUに搭載されるソフトウエアとは異なる動作をするので、製品の検証用途には利用することができない。一方、V-HILSは完成したECUソフトウエアを利用するので、ソフトウエアの期待しない動作(バグ)を発見して解決するための方式として非常に有望視されているが、再現性のある動作を達成するものとしては、まだ実現した例はない。HILSは、完成したECUボードの最終的な動作確認のために必ず実施されるが、障害が見つかっても再現性が保証されないのでデバッグ目的には利用できない。
 HILSにおいて動作が再現できない理由は、HILSの構成が不完全だからではなく、CANなどのネットワークにより各ECUが相互に接続しているためである。一般に、ネットワークはモジュール間の疎な結合を実現しているため、モジュール動作の微妙なタイミングの違いでデータの到着順序が入れ替わり、結果として、システム全体の挙動が異なることがある。したがって、たとえ実車をプロトタイプしたとしても、動作の再現性は期待できない。並列分散システムのデバッグが非常に困難であることと同じ理由である。
 このように、HILSの構成のまま、すなわち、ECUボードとプラント・シミュレータとの疎結合という構成のままでは、それぞれのコンポーネントを高速化しても動作の一貫性は実現できない。コミュニケーションの順序の一貫性を実現することが、動作の再現性を実現するために必要である。V-HILSは特に、この問題を解消することが期待される。
 従来の概念に従う、典型的なV-HILSの構成は、複数のECUエミュレータと、複数のプラント・シミュレータと、全体の動作をスケジュールするグローバル・スケジューラからなる。
 ECUエミュレータは、プロセッサ・エミュレータと、ペリフェラル・エミュレータからなる。一方、プラント・シミュレータには、ブレーキ・シミュレータ、エンジン・シミュレータなどが含まれる。
 このとき、プロセッサ・エミュレータは例えば、80MHzという相対的に高解像度のクロックで動作する。一方、プラント・シミュレータは、物理機構のシミュレータであるため、例えば、10KHzという相対的に低解像度で動作する。一般に、低解像度のほうが高速にシミュレーションできるので、プラント・シミュレータのほうが高速である場合が多い。
 プラント・シミュレータは必ずしも、固定長の処理ステップ時間で繰り返して数値計算を行うわけではなく、計算誤差の影響を抑えたり、不連続な変化点のタイミングなどに応じて可変ステップが必要となるケースが多い。いずれにしても、各ステップにおいてコントローラから指示信号を受け取り、また、センサーに向けて内部状態を出力する。なお、指示信号は、スイッチのオンとオフを表現するためにパルス状であることが多い。
 ペリフェラル・エミュレータは、ECUエミュレータのI/O のインターフェイス部にあたり、プラント・シミュレータとプロセッサ・エミュレータを相互に接続する。典型的には(平均的には)10MHz 程度の解像度で動作すると捉えることができる。これは、プラント・シミュレータより高速だが、プロセッサ・エミュレータよりは低速となる。ペリフェラル・エミュレータは、プラント・シミュレータに対しては、パルス状の信号を送る。また、プラント・シミュレータから内部状態を量的なデータとして読み取る。
 ペリフェラル・エミュレータは、プロセッサ・エミュレータに対しては、読み書き(R/W)の要求を受けてデータを送受信することと、割り込み(INT)を送ることを行う。特に、プロセッサ間を相互に接続するCAN(controller area network)などネットワークの機能では、プロセッサから送信データを受け取り(W)、ペリフェラル間でバスを経由して通信を行い、データを受信したときにはプロセッサに割込みを送り(INT)、プロセッサからの受信データ読み込みの要求(R)に応える。
 一側面からみると、ペリフェラルは、プラントとプロセッサ、及びプロセッサ間を相互に接続する、システムの中心である。ペリフェラルを通過する信号の順序を互いに区別できるだけの時間解像度があれば、プラントとプロセッサ間の相互作用に関しては、その順序は正しく再現できる。しかし、次の信号までにかかる時間がデータの精度を決定する(速度の算出など)なら、時間解像度は細かければ細かいほど良い。つまり、時間解像度に応じてデータ誤差の大きさが決まる。
 データ誤差の問題以外にもオーバヘッドの問題がある。すなわち、固定の同期間隔を設ける方法では、同期の間隔を短くすれば、より正しい動作を実現できるが、逆に、同期処理にかかるオーバヘッドを大きくするので全体処理にかかる時間が増加する。
 したがって、同期の間隔を固定にして最大限まで小さくする、というアプローチは、データ誤差とオーバヘッドの両面から現実的な解法とはなりえない。
 このように、V-HILSにおいて、同期の問題は重要であり、整理すると、次のような3つの方式が考えられる。
(1) 時間同期:この方式では、プロセッサ・エミュレータが互いに通信しつつ、シミュレーションを実行する。実行速度と時間精度のトレードオフがあり、時間の量子化誤差がある。また、上記でも示したように、この方式では、プロセッサ・エミュレータ間の同期通信コストが大きいので、現実的な解法とはならない。
(2) 楽観的なイベント同期:この方式では、各プロセッサ・エミュレータが時刻情報付きのイベントを送り、また受信することで相手と同期する。ただし、「フライング」となる可能性を残したまま、投機的にシミュレーションを実行するので、その投機が外れていた場合には、プロセッサ・エミュレータを適宜、ロールバックする必要がある。同期にかかるコストは、時間同期の方法に比べて小さいが、ロールバックに備えて、状態を遂次記録しておいたりするコストが大きすぎて、現実的でない。
(3) 保守的なイベント同期:この方式では、各プロセッサ・エミュレータが時刻情報付きのイベントを送り、また受信することで相手と同期する。ただし、因果関係が矛盾しないように「保守的」にシミュレーションを進めるために、互いにイベントを待ちあうことになってデッドロックが生じることがある。そのようなデッドロックを避けるためには、時間送りのために特別な nullメッセージを高頻度で送るなど、回避のためのコストが大きくなることがある。
 V-HILSの従来技術として、特開2007-11720号公報は、複雑な構成のシステムに対応しつつ、システムシミュレータの構成を柔軟に変更可能とすることを解決すべき課題とするもので、システムシミュレータを、CPUの動作をシミュレートするインストラクションセットシミュレータ、バスの動作をシミュレートするバスシミュレータ、ペリフェラルの動作をシミュレートするペリフェラルシミュレータの3種類で構成し、各シミュレータ間で互いの状態を参照・変更可能な各インターフェースをそれぞれ設けることを開示する。しかし、この従来技術は、ペリフェラルとCPU間の同期を最適化する技法について示唆するものではない。
 そこで、本願発明者らは、保守的なイベント同期の仕組みを発展させて、特願2009-238954号明細書に記述されている、ペリフェラル・スケジューラを用いたシミュレーション技法を提供した。この技法においては、ペリフェラル・スケジューラは、全てのペリフェラル・エミュレータの完了フラグを解除(OFF)することによって、並列動作を開始する。そうして、ペリフェラル・スケジューラは、設定された個々のペリフェラル・エミュレータの処理の区切りタイミングに基づき、最も早く処理の区切りを迎える予定のペリフェラル・エミュレータを見出す。それをペリフェラルPと呼ぶことにする。その処理の区切りの時間をTとすると、ペリフェラル・スケジューラは、時間Tに達する時点まで、各プロセッサ・エミュレータと、各プラント・シミュレータの実行を進める。そうして、ペリフェラル・スケジューラは、ペリフェラルPの完了フラグが設定されるのを待つ。ペリフェラルPの完了フラグが設定されたことに応答して、ペリフェラル・スケジューラは、ペリフェラルPと、プロセッサ・エミュレータ及びプラント・シミュレータの間でデータを同期させる。
 ところが最近になって、複数のECUを同時に、マルチコアのホスト・コンピュータ上でエミュレートするような、より実機の動作全体に近いシミュレーションに対する要望があらわれてきた。すると、複数のECUの個々のホスト上での実行速度が互いに異なるため、それらの間に明示的な同期処理が必要となるが、ECU間では不定期に割り込むようにして通信が行われるために、複数のECUを同期させることは容易でない。特願2009-238954号明細書に記述されている技法は、単独のECUを対象としているために、そのままでは複数のECUをもつシステムのシミュレーションに、適用できない。
特開2007-11720号公報 特願2009-238954号明細書
 従って、本発明の目的は、互いに非同期的にデータを通知(割込み)する複数のECUとプラントを持つシステムにおいて、十分な時間精度および小さなデータ誤差で、且つ、高速にシミュレーションを実行することを可能とする技法を提供することにある。ここで、非同期的なデータ通知とは、たとえば、プラントで不定期に起こる状態変化をコントローラに通知することや、プロセッサ間の非同期的なCAN通信などをさす。
 この発明の他の目的は、ECUとその制御対象であるプラントを持つシステム全体をシミュレートするように、プロセッサ・エミュレータ、ペリフェラル・エミュレータ、およびプラント・シミュレータの3種類を連成することにある。
 本発明によれば、ペリフェラルが、相互ペリフェラル、外部ペリフェラル、および内部ペリフェラルの3種類に分割されて、それぞれに固有のスケジューラが提供される。この3種類のスケジューラが協調して、効率的で正確な連成動作を実現する。
 相互ペリフェラルは、プロセッサ間の通信を処理する中間層であり、固有の相互ペリフェラル・スケジューラを持つ。プロセッサ間の非同期通信を高速に処理する機能をもつ。
 外部ペリフェラルは、プラントとプロセッサとを接続する中間層であり、固有の外部ペリフェラル・スケジューラを持つ。プラントからの非同期的な通知を受けてプロセッサに伝達すること、また、プラントに向けてプロセッサからの指示を送り出す機能をもつ。
 内部ペリフェラルは、特定のプロセッサとのみ接続されるペリフェラル層であり、たとえば、Watch Dog Timer やメモリなどが該当する。プラントやほかのプロセッサとの信号の交換はない。固有の内部ペリフェラル・スケジューラ(あるいは、プロセッサ・スケジューラ)を持つ。
 相互ペリフェラル・スケジューラ、外部ペリフェラル・スケジューラ、および内部ペリフェラル・スケジューラは、コルーチンの形式で並列に動作する。
 なお、プラント・シミュレータは、好適には、MATLAB(R)/Simulink(R)のような連続的数値シミュレーション・モデリング・システムで作成される。ペリフェラル・エミュレータは、トランザクション型のエミュレータであり、好適には、SystemC/TLMで作成される。プロセッサ・エミュレータは、命令セット・シミュレータ(ISS)によるエミュレーションを行う。
 外部ペリフェラル・スケジューラは、プロセッサ・エミュレータの「反応遅延時間」と次イベントが起きる時間までの早い方を選び、その時間までプラント・シミュレータを先行実行させる。そして、実際にプラント・シミュレータが停止した時間まで先行実行するように、すべてのプロセッサ・スケジューラ(あるいは内部ペリフェラル・スケジューラ)に通知する。なお、反応遅延時間とは、プラントから状態変化の通知を受けてから、それに対応するプラントへの指示を計算して、実際にその指示がプラントにおいて有効になる時刻までの最小の時間差をさす。
 相互ペリフェラル・スケジューラは、プロセッサ・エミュレータ間の「通信遅延時間」と次イベントが起きる時間までの早いほうを選び、その時間まで先行実行するように、すべてのプロセッサ・スケジューラ(あるいは内部ペリフェラル・スケジューラ)に通知する。なお、通信遅延時間とは、プロセッサがデータを送信してから、別のプロセッサがそれを受信するまでにかかる最小時間をさす。
 プロセッサ・スケジューラ(あるいは内部ペリフェラル・スケジューラ)は、通知された目標同期時間のうち最も早い時刻まで処理を進める。このようにして、プロセッサ間では時間調整を行うことなく、2種類のペリフェラル・スケジューラから与えられた同期時刻に向かって保守的に処理を進めることにより、低いコストで、プロセッサ間のデッドロックを回避する。
 各ペリフェラル層は、最も進捗の遅いプロセッサの時刻をイベントとして受け取って、その時刻まで自身の処理を進める。また、その更新された時刻に基づいて、次の同期時間通知を決定する。
 以上のように、プラント、プロセッサ、ペリフェラルの順にシミュレーションが進行して、全体として異種間の連携を連成した処理が実現される。
 本発明によれば、プロセッサ・エミュレータの反応遅延時間及びプロセッサ・エミュレータ間の通信遅延時間を利用して、プロセッサ・エミュレータを先行実行させるので、デッドロック回避のためのオーバヘッドがない、保守的なイベント同期による高速なシミュレーションが可能となる。また、固定時間間隔による同期ではなくて、任意の時刻を表現できるイベントに基づく同期手法なので、時間に関する誤差の小さい正確なシミュレーションが可能となる。
本発明を実施するために使用されるコンピュータのハードウェアの一例を示すブロック図である。 本発明を実施するための機能ブロックの一実施例を示す図である。 プロセッサ、ペリフェラル及びプラントにおける遅延を説明する図である。 プロセッサのエミュレーションの機能を説明する図である。 ペリフェラルのエミュレーション動作の一例を示すである。 プラントのシミュレーション動作の一例を示すである。 内部ペリフェラル・スケジューラの構成要素を示す図である。 内部ペリフェラル・スケジューラの処理のフローチャートを示す図である。 内部ペリフェラル・スケジューラの処理のフローチャートを示す図である。 内部ペリフェラル・スケジューラの処理のフローチャートを示す図である。 相互ペリフェラル・スケジューラの構成要素を示す図である。 相互ペリフェラル・スケジューラの処理のフローチャートを示す図である。 外部ペリフェラル・スケジューラの構成要素を示す図である。 外部ペリフェラル・スケジューラの処理のフローチャートを示す図である。 相互ペリフェラル・スケジューラにおける、TQと、それに対応するIQ及びOQのイベントの時間に沿った出入りの例を示す図である。 論理プロセスの構成を示す図である。 接続された論理プロセス群を示す図である。 nullメッセージによりデッドロックを防ぐ様子を示す図である。 プロセッサの通信遅延ΔTcを説明するための図である。 プロセッサの反応遅延ΔTRを説明するための図である。 共有メモリ・アクセスのシミュレーションを説明するための図である。 プロセッサと通信頻度の高いペリフェラルを、ISSと同じコアでエミュレートすることを説明するための図である。 CANデバイスへのアボート時に調停に敗れる動作のシミュレーションを説明するための図である。 CANデバイスのリセットのシミュレーションを説明するための図である。 本発明を実施するための機能ブロックの別の実施例を示す図である。 受動的プラント・シミュレータ用の外部ペリフェラル・スケジューラの動作のフローチャートを示す図である。
 以下、図面を参照して、本発明の一実施例の構成及び処理を説明する。以下の記述では、特に断わらない限り、図面に亘って、同一の要素は同一の符号で参照されるものとする。なお、ここで説明する構成と処理は、一実施例として説明するものであり、本発明の技術的範囲をこの実施例に限定して解釈する意図はないことを理解されたい。
 先ず、図1を参照して、本発明を実施するために使用されるコンピュータのハードウェアについて説明する。図1において、ホスト・バス102には、複数のCPU1 104a、CPU2 104b、CPU3 104c、・・・CPUn 104nが接続されている。ホスト・バス102にはさらに、CPU1 104a、CPU2 104b、CPU3 104c、・・・CPUn 104nの演算処理のためのメイン・メモリ106が接続されている。
 一方、I/Oバス108には、キーボード110、マウス112、ディスプレイ114及びハードティスク・ドライブ116が接続されている。I/Oバス108は、I/Oブリッジ118を介して、ホスト・バス102に接続されている。キーボード110及びマウス112は、オペレータが、コマンドを打ち込んだり、メニューをクリックするなどして、操作するために使用される。ディスプレイ114は、必要に応じて、処理をGUIで操作するためのメニューを表示するために使用される。
 この目的のために使用される好適なコンピュータ・システムのハードウェアとして、IBM(R)System Xがある。その際、CPU1 104a、CPU2 104b、CPU3 104c、・・・CPUn 104nは、例えば、インテル(R)Xeon(R)であり、オペレーティング・システムは、Windows(商標)Server 2003である。オペレーティング・システムは、好適には、マルチタスクの機能を有するものである。オペレーティング・システムは、ハードティスク・ドライブ116に格納され、コンピュータ・システムの起動時に、ハードティスク・ドライブ116からメイン・メモリ106に読み込まれる。
 本発明を実施するためには、マルチプロセッサ・システムを用いることが望ましい。ここでマルチプロセッサ・システムとは、一般に、独立に演算処理し得るプロセッサ機能のコアを複数もつプロセッサを用いるシステムであることを意図しており、従って、マルチコア・シングルプロセッサ・システム、シングルコア・マルチプロセッサ・システム、及びマルチコア・マルチプロセッサ・システムのどれかでよいことを理解されたい。
 なお、本発明を実施するために使用可能なコンピュータ・システムのハードウェアは、IBM(R)System Xに限定されず、本発明のシミュレーション・プログラムを走らせることができるものであれば、任意のコンピュータ・システムを使用することができる。オペレーティング・システムも、Windows(R)系に限定されず、Linux(R)、Mac OS(R)など、任意のオペレーティング・システムを使用することができる。さらに、シミュレーション・プログラムを高速で動作させるために、POWER(商標)6ベースで、オペレーティング・システムがAIX(商標)のIBM(R)System Pなどのコンピュータ・システムを使用してもよい。
 ハードティスク・ドライブ116にはさらに、後述するプロセッサ・エミュレータ、ペリフェラル・エミュレータ、プラント・シミュレータ、内部ペリフェラル・スケジューラ、相互ペリフェラル・スケジューラ、外部ペリフェラル・スケジューラ、CANエミュレータなどのプログラムが格納されており、その各々は、コンピュータ・システムの起動時にメイン・メモリ106にロードされて、個別のスレッドまたはプロセスとして個々のCPU1~CPUnに割当てられて、実行される。このため、図1に示すコンピュータ・システムは、好適には、プロセッサ・エミュレータ、ペリフェラル・エミュレータ、プラント・シミュレータ、相互ペリフェラル・スケジューラ、外部ペリフェラル・スケジューラ、CANエミュレータなどの個々のスレッドに個別に割り当てるに十分な個数のCPUをもつ。
 図2は、そのように個々のCPU1~CPUnに割当てられて個別のスレッドまたはプロセスとして動作するプロセッサ・エミュレータ、ペリフェラル・エミュレータ、プラント・シミュレータ、相互ペリフェラル・スケジューラ、外部ペリフェラル・スケジューラ、CANエミュレータなどの処理プログラムの間の協働関係を示す機能ブロック図である。
 この構成は、ECUにあたるプロセッサ・エミュレータおよびペリフェラル・エミュレータ、そして、プラント・シミュレータからなるシミュレーション・システムである。ペリフェラル・エミュレータは、相互ペリフェラルと外部ペリフェラルに分かれる。なお、図では示されていないが、内部ペリフェラルは、プロセッサ・エミュレータのブロックに含まれると理解されたい。全体では、図の横方向に、4層のシミュレーション・システムであると捉えることができる。
 図2において、プロセッサ・エミュレータ202a、202b、・・・202zは、シミュレーション・システムにおいて、ECUの機能のうちコントローラの中心的な働きをする。プロセッサ・エミュレータ202a、202b、・・・202zは、ソフトウエア・コードをロードして、命令セット・シミュレータ(ISS)によるエミュレーションを行う。
 ペリフェラル・エミュレータ204a、204b、・・・204z、および、CANエミュレータ212は、トランザクション型のエミュレータであり、好適には、SystemC/TLMで作成される。
 プラント・シミュレータ206a、206b、・・・206zは、好適には、MATLAB(R)/Simulink(R)のような連続的数値シミュレーション・モデリング・システムで作成される。プラント・シミュレータ206a、206b、・・・206zの各々は、エンジンなどの動力装置、トランスミッションなどの動力伝達装置、ステアリングなどの走行装置、及びブレーキ装置などの自動車の機構装置に対応する。
 プロセッサ・エミュレータ202a、202b、・・・202zは例えば典型的には、80MHzという相対的に高解像度のクロックで動作する。一方、プラント・シミュレータ206a、206b、・・・206zは、物理機構のシミュレータであるため、例えば典型的には、10KHzという相対的に低解像度で動作する。
 従って、プロセッサ・エミュレータ202a、202b、・・・202zとプラント・シミュレータ206a、206b、・・・206zを直接接続することができないので、ペリフェラル・エミュレータ204a、204b、・・・204zがそれらの間に介在して、プラント・シミュレータからの状態変化やセンサーの値をイベントに変換してプロセッサ・シミュレータに渡したり、逆に、プロセッサ・エミュレータからの指示(シグナリング)をイベントに変換してプラント・シミュレータに渡す役割を果たす。
 内部ペリフェラル・スケジューラは、プロセッサ・エミュレータと、それに接続するペリフェラル・エミュレータのスケジューリングを行う。プロセッサ・エミュレータに接続するペリフェラル・エミュレータは、ROM、RAM、ウォッチ・ドッグ・タイマーなど、他のプロセッサやプラントに直接関係しないペリフェラル(内部ペリフェラル)機能を処理する。内部ペリフェラル・スケジューラは、ECUのメモリマップ仕様を参照して、ISSからのload/store命令を、内部ペリフェラル・スケジューラ、相互ペリフェラル・スケジューラ、外部ペリフェラル・スケジューラに振り分けるという重要な機能を有する。なお、以下では、内部ペリフェラル・スケジューラをプロセッサ・スケジューラと言い換えて説明することがあるが、両者は同一の機能を指すことに注意されたい。
 外部ペリフェラル・スケジューラ208は、プラント・シミュレータ206a、206b、・・・206zに接続するペリフェラル・エミュレータ204a、204b、・・・204zを処理するスケジューラである。外部ペリフェラル・スケジューラ208は、プロセッサ・エミュレータ202a、202b、・・・202zの反応遅延時間(あるいは次イベントまでの時間)だけ、プラント・シミュレータ206a、206b、・・・206zを先行実行させるようにスケジューリングする。プラント・シミュレータは指定された時間か、あるいは内部状態の更新の通知が必要であれば、それより前の時間で停止する。そして、実際にプラント・シミュレータ206a、206b、・・・206zが停止した時間まで、プロセッサ・エミュレータに先行実行するよう通知する。
 外部ペリフェラル・スケジューラ208は、プラント・シミュレータ206a、206b、・・・206zに対して、コントローラから要求されたシグナリングまたはサンプリングの指示を与える。シグナリングはコントローラがプラントを操作(actuate)するためのイベントであり、例えば、スイッチのON/OFF信号を指示するような動作である。また、サンプリングは、コントローラがプラントの状態をモニター(sense)する際に値の読み取りを指示するためのイベントであり、例えば、バッテリーセル(プラント)の電圧値をコントローラが読取るような動作である。ここで、コントローラとは、プロセッサ・エミュレータにロードされたソフトウエアで、プラントに対する制御信号を作るロジックのことである。シグナリングとサンプリングは、エミュレーション対象の処理が周期的か否かによらず、コントローラがそのタイミングを決定するものである。
 一方、外部ペリフェラル・スケジューラ208は、プラント・シミュレータ206a、206b、・・・206zから、状態変化(state change)のイベントとして通知を受ける。これは、プラントが状態の変化をコントローラに通知するイベントであり、プラントがそのタイミングを決定する。これも、周期的である場合もあり、非周期的である場合もある。
 相互ペリフェラル・スケジューラ210は、プロセッサ・エミュレータ202a、202b、・・・202z間を接続する、相互ペリフェラル機能を提供するスケジューラである。相互ペリフェラル・スケジューラ210は、プロセッサ・エミュレータ202a、202b、・・・202z間の通信遅延時間(あるいは次イベントまでの時間)だけ、プロセッサ・エミュレータ202a、202b、・・・202zに先行実行するように通知する。プロセッサ・エミュレータ202a、202b、・・・202zは、通知された時間のうち最も早い時刻まで保守的に処理を進める。このとき、プロセッサ・エミュレータ間の通信は例えば、CAN(Controller Area Network)エミュレータ212によって行う。ECUのプロセッサ間の通信に共有メモリが用いられる場合のシミュレーションは、図21を用いて後述する。
 図2に示されているように、外部ペリフェラル・スケジューラ208及び相互ペリフェラル・スケジューラ210からプロセッサ・エミュレータ202a、202b、・・・202zへのイベントは、割込み(INT)の形式で行われ、プロセッサ・エミュレータ202a、202b、・・・202zから外部ペリフェラル・スケジューラ208及び相互ペリフェラル・スケジューラ210へのイベントは、読み書き(R/W)の形式で行われる。
 図3を参照して、プロセッサ・エミュレータ(あるいはプロセッサ・スケジューラ)、相互ペリフェラル・スケジューラ、外部ペリフェラル・スケジューラ、及びプラント・シミュレータにおける遅延を利用した先行実行について説明すると、以下のとおりである。
・先ず、図3(1)に示すように、外部ペリフェラル・スケジューラ208が、プラント・シミュレータ206を先行実行させる。実際に先行した時間を、Tplantとする。
・先行させる時間の上限は、次のシグナリング、あるいは、ΔTRの近い方である。ここで、ΔTRとは、プラント・シミュレータからの入力時刻から、それによるプロセッサ・エミュレータの反応がプラント・シミュレータに伝わって有効となるまでの遅延の最小値であり、図20で、より詳しい説明がなされる。
・次に、図3(2)に示すように、外部ペリフェラル・スケジューラ208は、実際にプラント・シミュレータ206が停止した位置(Tplant)まで、プロセッサ・エミュレータ202に先行実行するように通知する。
・次に、図3(3)に示すように、相互ペリフェラル・スケジューラ210は、プロセッサ・エミュレータ202間の通信遅延時間および次のイベントまでの時間の早いほうまで、プロセッサ・エミュレータ202に先行実行するように通知する。図では、通信遅延時間のほうが早い例を示している。
・通信遅延時間ΔTcについては、図19で、より詳しい説明がなされる。
・次に、図3(4)に示すように、プロセッサ・エミュレータ202は、通知された2つの時間のうち最も早い時刻まで保守的に処理を進めるが、必ずしもその時刻まで中断することなく処理を進められるとは限らず、たとえば、共有メモリの読取り(R)があるとその時刻で一旦停止する。図では、時刻(3)まで処理を進める前に時刻(4)で一旦停止している様子を示している。共有メモリへのアクセスがなければ、時刻(3)まで一度に進む。
・図3(5)に示すように、相互ペリフェラル・スケジューラ、外部ペリフェラル・スケジューラは、プロセッサから受取ったイベントのうち最も早い時刻まで、自身の処理を進める。
 次に、図4を参照して、プロセッサのエミュレーションの機能を説明する。上述のように、プロセッサのエミュレーションは、ISS(Instruction Set Simulator)として実現される。プロセッサのエミュレーションは、指定された時刻を目指して実行し、インストラクション(命令語)に応じてアクセス(R/W)の要求を出し、また、ペリフェラルから発生した不定期な割込みを受け付ける。
 特にこの実施例では、説明の便宜のため、ISSへの指示とISSからの要求を以下のように記述する。
ISSへの指示あるいは通知
 advance(t) :  最大で時刻 t まで実行するようにISSに指示する。ただし、その時刻に達する前にコミュニケーションが必要であれば、ISSはその要求を出して処理を中断する。
 resume(v) :   読み出しの要求に対応するデータをISSに通知して実行を再開する。
 interrupt(i) :  割込み i が生じたことをISSに通知する。
ISSからの要求あるいは通知
 load(t,a) :   時刻tにa番地のデータを読み出すことを要求する。その後、resume 通知を受けるまで処理を中断する。
 store(t,a,v) :  時刻tにa番地にデータvを書き込むことを要求する。
 complete() :   advanceで指示された時刻 t まで進んだら、完了の通知を行う。
 図4は、このような命令による、プロセッサのエミュレーション動作の一例を示すものである。図4において先ず、プロセッサは、advance(tg)という命令を受け取る。プロセッサは時刻t1で、load(t1,a1)を出力する。これに応答して、プロセッサは、resume(v1)を受け取る。プロセッサは時刻t2で、store(t2,a2,v2)を出力する。
 時刻tgに達したときプロセッサは、前に受け取っていたadvance(tg)に従い、complete()を出力する。その後、プロセッサはプラントの反応に応じて、interrupt(i)を受け取ることがある。そうでなければ、次の advance() 指示を受け取る。
 次に、図5を参照して、ペリフェラルのエミュレーションの動作を説明する。上述のように、ペリフェラルのエミュレータは、好適にはSystemCによって実現される。ペリフェラルのエミュレーションは、タスク・キューに詰まれたイベントに従って、トランザクション実行を行うものである。
 イベントには、レジスタのREAD要求およびWRITE要求などがある。ペリフェラルのエミュレーションは、このイベントをタスク・キューの先頭から順に取り出して解釈してトランザクションとして実行して新たなイベントに変換して、再びタスク・キューに挿入する。一つあるいは二つ以上のイベントに変換する場合もあるし、イベントをまったく生成しない場合もある。イベントの解釈と実行は、個々のペリフェラルの機能による。この処理をイベントが尽きるまで繰り返すことで、ペリフェラルのエミュレーションが行われる。すなわち、pop(取り出し)、execute(実行)、push(挿入)の繰り返しである。
 この実施例では、ペリフェラルに閉じたシミュレーションではなくて、プロセッサやプラントと連成するシミュレーションなので、複数のペリフェラル・エミュレータのタスク・キューをまたがってイベントが行き来する。この場合、ペリフェラル・スケジューラが、適切なタスク・キューにイベントを追加する。すなわち、pop、execute、push or export (挿入あるいは転送)、import(転入)の繰り返しである。ただし、import はサイクルによってはオプション(なし)となる。
 プラント・シミュレータへの入出力は、<port_update,t,p,v> イベントである。これは、時刻 t にポート p がとる値 y を通知する。たとえば、プラントへの指示(シグナリング)やプラントからの状態変化の通知が、これで表現される。
 プロセッサから発する要求は、<read,t,r> イベントおよび <write,t,r,v> イベントであり、それぞれ、時刻 t にレジスタ r がとる値の読み出しを要求するイベント、時刻 t にレジスタ r に値 v を書き込むことを要求するイベントである。逆に、プロセッサが受け取るのは <register_update,t,r,v> イベントで、これは、<read,t,r> 要求に呼応して時刻 t のレジスタ r の値 v を通知する。また、<interrupt,t,i> も受信イベントで、これは、時刻 t に割込み i が発生することを通知するイベントである。
 特にこの実施例では説明の便宜のため、ペリフェラルのタスク・キューに関する操作を以下のように記述する。
 insert(e[t]) :  時刻tに発生するイベント e[t]をタスク・キューに追加する
 next() : k :  タスク・キューの先頭を取り出(pop)して発火(execute)して、その応答として必要なら、新しいイベントを返す。
 peek() : t :  タスク・キューの先頭にあるイベントの時刻tを返す。
 nextが返す新しいイベントには、タイマーの発火などペリフェラルに閉じた内部イベントもあるが、特に、他のペリフェラルに渡すべきイベントは、<interrupt,t,i>、<register_update,t,r,v>、および <port_update,t,p,v> の3通りである。
 ペリフェラルの動作は勿論、これで尽きている訳ではないが、とりあえず、本発明の動作に関連するものを説明した。
 図5は、ペリフェラルのエミュレーション動作の一例を示すものである。図5(1)において先ず、スケジューラからペリフェラルにタスク・キュー操作命令insert(e1[t1]) が到来するので、タスク・キューにイベント e1をFIFOとなるように積む。タスク・キューが空であったり、その他のイベントの時刻が t1 よりも後であるなら、e1はタスク・キューの先頭に詰まれる。ここで、e1はレジスタのread要求であるとする。
 次に、操作命令 next() が到来すると、タスク・キューの先頭のイベントが解釈されてトランザクションとして実行されて、新たなイベント <register_update,t1,r1,v1> が出力される。この例は、プロセッサがレジスタの値を読みとる要求を出してから、その回答を得るまでの一連の処理の流れである。外部に送るべきイベントなので元のタスク・キューには挿入(push)されずに、プロセッサのスケジューラに転送(export)される。
 図5(2)に示すように、ペリフェラルに、レジスタへの write要求insert(e2[t2]) およびnext() 命令が順に到来したときも同様に、タスク・キューに詰まれた e2が先頭なら、時刻t2で e2 がポップされて、たとえば、新しいイベント <port_update,t2,p2,v2> がスケジューラに返される。この例は、プロセッサがプラントに向けてシグナリングの指示を出したケースである。新しいイベントは、プラント・シミュレータが解釈できる形式に変換されて伝えられる。
 図5(3)の例は、プラントから状態変化の通知があって、それを割り込み信号を用いてプロセッサに伝える様子を表す。スケジューラはタスク・キューに状態変化の通知を積んで(insert(e3[t3]))から取り出し(pop)て実行(execute)すると、新しいイベント <interrupt,t,i>に変換されて、プロセッサに転送(export)される。
 次に、図6を参照して、プラントのシミュレーションの動作を説明する。上述のように、プラントのシミュレーションは、好適にはMATLAB(R)/Simulink(R)のような連続的数値シミュレーション・モデリング・システムによって実現される。プラントは、まず、指定された時刻の内部状態(ベクトル)や外部入力(ベクトル)にしたがって出力(ベクトル)を計算する。次に、内部状態の変化分(ベクトル)を出力するが、このとき、指定された誤差の範囲、プラント固有の最大ステップ幅、ゼロクロッシングなどに基づいて、内部状態の変化分を調整して、次のステップ時刻を決定する。
 特にこの実施例では説明の便宜のため、プラントの動作を以下のように記述する。
プラントへの指示
 advance(t) : 最大で時刻 t まで実行するようにプラントに指示する。ただし、時刻 t までステップを伸ばせない場合には、それ以前の時刻で停止する。
 input(u) :  プラントへの入力ベクトル u を更新する
プラントからの通知
 complete() : advance で指定された時刻まで実行が完了したことを通知される
 output(t,y) : 時刻 t において、プラントからの出力ベクトル y が更新されたことを通知される
 プラントの動作は勿論、これで尽きている訳ではないが、とりあえず、本発明の動作に関連するものを説明した。
 なお、参考までに、Simulink(R)のS-Functionコールバックルーチンとの対応を示す。
mdlGetTimeOfNextVarHit()の呼出し     complete()
mdlGetTimeOfNextVarHit()のリターン  advance(t)
mdlOutputs()の呼出し                  output(t,y)
mdlOutputs()のリターン                input(u)
 図6は、プラントのシミュレーション動作の一例を示すものである。図6において先ず、プラントに、advance(tg)が到来する。プラントは、シミュレーション時間t1に、output(t1,y1)を出力する。
 次にプラントに、input(u1)が到来する。プラントは、シミュレーション時間t2に、output(t2,y2)を出力する。
 次にプラントに、input(ug)が到来する。シミュレーション時間tgに到達すると、プラントは、complete()を出力する。
 このように、advanceとcomplete、また、outputとinputはそれぞれペアになる。
 本発明において、内部ペリフェラル・スケジューラ、相互ペリフェラル・スケジューラ、および外部ペリフェラル・スケジューラが主要な役割を果たす。これら3つのスケジューラの動作を説明するために以下では、まず、保守的なイベント同期のシミュレーションの概要とその用語を説明する。
 先ず、図7は、内部ペリフェラル・スケジューラにおける入力キューと出力キューに関係する処理を示す図である。図示されているように、入力キューには、IP(Input Queue from Processors)、すなわち、他のプロセッサからのイベント(共有メモリの更新通知)を受取るキューと、IQすなわち、相互ペリフェラルまたは外部ペリフェラルからメッセージを受取るキューとがある。Pi, Pjというのはそれぞれ、i番目とj番目のプロセッサである。IQに置かれるデータは、CAN受信や割込みのイベントメッセージまたはnullメッセージである。
 一方、出力キューには、OP(Output Queue to Processors)、すなわち、他のプロセッサへのイベント(共有メモリの更新通知)を送り出すキューと、OQすなわち、相互ペリフェラルまたは外部ペリフェラルへメッセージを送るキューとがある。OQに置かれるデータは、CAN送信のイベントメッセージまたは進捗nullメッセージである。
 プロセッサ同士でイベントをやりとりする際、IP、OPを相手のプロセッサごとに一組、使用することになる。
 次に、図8~図10フローチャートを参照して、内部ペリフェラル・スケジューラの処理を説明する。図8のフローチャートの初期値は、全てのIQ/IPは空、全てのOQは時刻ゼロの進捗イベント、全てのOPは空であり、T := 0である。
 また、IQ/IPにk番目に到着するイベントの時間Tkは、以下の条件を満たす。
 Tk ≦ Tk+1
 内部ペリフェラル・スケジューラは、ステップ802で、キュー入力eを待ち、ステップ804では、全IQがfilled(1つ以上のメッセージが到着した状態)になったかどうかを判断し、もしそうなら、ステップ806で、全IQ中の最早時刻をT0とし、ステップ808で「parallel」というサブルーチンを呼び出して、他のプロセッサと並行して進める処理を行う。「parallel」のサブルーチンの処理は、図9のフローチャートを参照して後で説明する。
 ステップ810で、内部ペリフェラル・スケジューラは、Te = T in Qすなわち、Te = Tの条件をみたすイベントeがIQにあるかどうかを判断する。そして、もしそうなら、内部ペリフェラル・スケジューラは、ステップ812で、IQからeをポップして処理し、ステップ810に戻る。
 ステップ810で、もしTe = TをみたすイベントeがIQにないなら、処理は、ステップ804での判断に戻る。
 次に、図9のフローチャートを参照して、ステップ808での「parallel」の処理をより詳細に説明する。内部ペリフェラル・スケジューラは、ステップ902で、処理が"read"「読取り」であったかどうか判断し、もしそうなら、ステップ904で「fill」のサブルーチンを呼び出す。
 「fill」のサブルーチンについては、図10のフローチャートを参照して後で説明する。ステップ904の後はステップ906に進む。ステップ902で、処理が"read"「読取り」でなかった場合は、直接ステップ906に進む。
 ステップ906は、T1 := min(T0,Ttop)によって、T1に値を入れる。
Ttopは、IPの先頭時刻であり、IPがない(共有メモリ通信を行うプロセッサがない)またはIPが空の場合はTtop = ∞とおく。
 ステップ908では、内部ペリフェラル・スケジューラは、プロセッサを、T1を目指して実行させる。すなわち、相互ペリフェラル・スケジューラまたは外部ペリフェラル・スケジューラが指示する時間まで進むことになる。
 ステップ910では、内部ペリフェラル・スケジューラは、プロセッサを実行させつつその分の時間Tを進め、ステップ912では、OQ/OPの更新・フラッシュを行う。
 ステップ914では、内部ペリフェラル・スケジューラは、T = T1かどうか判断し、もしそうでなければ、ステップ916で、ISSからの最後の通知が"read"「読取り」であったかどうか判断し、もしそうなら、ステップ904に戻る。
 ステップ916で、ISSからの最後の通知が"read"「読取り」でないと判断されたなら、ステップ918で、共有メモリへの書込み、CANの送信、またはnullメッセージ送信のどれかが行われて、ステップ908に戻る。
 ステップ914で、T = T1であるなら、ステップ920に進み、そこでTe = T in IPすなわち、Te = Tの条件をみたすイベントがIPにあるかどうかを判断する。もしそうなら、ステップ922で、IPからイベントeをポップして処理し、ステップ920に戻る。
 ステップ920で、イベントeの時刻をもつイベントがIPにないと判断されると、ステップ924で、T = T0であるかどうか判断され、もしそうなら、処理を終了する。
 ステップ924で、T = T0でないと判断されると、ステップ926で、共有メモリ上の読取り、またはnullメッセージの受信のどれかが行われ、ステップ902での判断に戻る。
 次に、図10のフローチャートを参照して、ステップ904での「fill」の処理をより詳細に説明する。図10において、内部ペリフェラル・スケジューラは、IPのキューにあるエントリの一時リストを作成する。一時リスト作成後、IPの中で現在時刻より古い時刻印をもつメッセージを全て取り除き、一時リストに追加する。
 ステップ1004では、内部ペリフェラル・スケジューラは、全IPがfilledかどうか判断する。もしそうなら、ステップ1006で、一時リスト内のイベント(他プロセッサからの共有メモリへの書込み)を時刻印順に全て反映する。一時リストを処理すると、fillのサブルーチンは完了である。
 ステップ1004で、全IPがfilledでないと判断されると、ステップ1008に進み、そこで、内部ペリフェラル・スケジューラは、IPからのイベントeを待つ。
 ステップ1010で、 T > Teかどうか判断し、もしそうなら、ステップ1014で、一時リストにeを加えて更新し、ステップ1008に戻る。
 ステップ1010で、 T > Teでないと判断されたなら、内部ペリフェラル・スケジューラは、ステップ1012でIPにeを加えて、ステップ1004に戻る。
 図11は、相互ペリフェラル・スケジューラにおけるキューに関係する処理を示す図である。図示されているように、入力キューIQには、Pi, Pjからイベントが入来し、それは、CANエミュレータに送信される。
 一方、出力キューOQには、CANエミュレータからイベントが入来し、それは、プロセッサが取り出すことになる。
 さらに、タスクキューTQが設けられ、それは、CANエミュレータ受信の発火をもたらす。なお、以下では入力キューや出力キューと区別するために、タスク・キューに詰まれるイベントをタスクと呼ぶことがあることに注意されたい。
 次に、図12のフローチャートを参照して、相互ペリフェラル・スケジューラの処理を説明する。ここでの初期値は、全てのIQは空、全てのOQは空、TQは空、T := 0である。ステップ1202で、相互ペリフェラル・スケジューラは、IQの更新待ちを行い、ステップ1204では、全IQがfilledかどうか判断し、そうでなければステップ1202に戻って、IQの更新待ちを続ける。
 そうしてステップ1204で、相互ペリフェラル・スケジューラが、全IQがfilledと判断すると、ステップ1206で、全IQ中最も近い時刻をT0とおく。
 ステップ1208では、相互ペリフェラル・スケジューラは、Te = T0 in IQ、すなわち、IQにTe = T0となるタスクeがあるかどうかを判断する。もしそうなら、相互ペリフェラル・スケジューラは、ステップ1210でイベントeをポップし、ステップ1212で insert(e1[t])、insert(e2[t])により、TQの更新を行う。ここで、イベントe1は、<read,t,r>すなわち、時刻tにレジスタrの値を読み込むイベントであり、イベントe2は、<write,t,r,v>すなわち、時刻tにレジスタrの値をvに更新するイベントである。
 ステップ1212の後はステップ1208に戻り、そこで、相互ペリフェラル・スケジューラがIQにTe = T0となるタスクeがないと判断すると、ステップ1214で、T := T0とセットし、ステップ1216で、peek()を使って、Tk = T in TQすなわち、TQにTk = Tとなるタスクkがあるかどうか判断する。
 ステップ1216で、TQにTk = Tとなるタスクkがあると判断すると、相互ペリフェラル・スケジューラはステップ1218でkをポッブし、ステップ1220で、next()によりタスクを実行する。ここではCANデータを受信する際にプロセッサに通知される <interrupt,t,i>、<register_update,t,r,v>イベントが発生する。
 ステップ1222では、相互ペリフェラル・スケジューラは全OQを更新し、ステップ1216に戻る。
 ステップ1216で、TQにTk = Tとなるタスクkがないと判断すると、ステップ1224に進み、そこで、相互ペリフェラル・スケジューラは、OQに更新があったかどうかを判断する。
 OQに更新がない場合、相互ペリフェラル・スケジューラは、ステップ1226で、全OQに時刻min(T+ΔTc,Ttop)のnullメッセージを追加し、ステップ1228で、OQをフラッシュしてステップ1204に戻る。なおここで、ΔTcは、プロセッサの通信遅延時間である。
 OQに更新があった場合、相互ペリフェラル・スケジューラは、ステップ1228で、OQをフラッシュして、ステップ1204に戻る。
 図15に、参考までに、相互ペリフェラル・スケジューラにおける、TQと、それに対応するIQ及びOQのイベントの時間に沿った出入りの例を示す。点線矢印はゲスト時間の進行を示す。
 この例でIQにプロセッサ・スケジューラ(内部ペリフェラル・スケジューラ)から到着するメッセージのイベントは、時系列順にCANアボート、CAN送信、null(進捗メッセージのイベント)、CANリセットである。上記のnull以外のメッセージは全て、プロセッサがCANデバイスに対して指令を出す(レジスタ書込みを行う)ことによって生じるイベントである。このうちCANアボートは、調停に敗れた場合に送信待機状態の解除を行い、さらにプロセッサに割込み通知をするよう、指令を出すイベントである。CAN送信は、事前にセットしたデータを送信するよう、指令を出すイベントである。図15は、2つの異なるプロセッサからCAN送信イベントが続けて到着する例を示している。CANリセットは、CANデバイスをバスから切り離して初期状態に戻るよう、指令を出すイベントである。
 この例でOQからプロセッサ・スケジューラに送出されるメッセージのイベントは、時系列順にnull(nullメッセージのイベント)、アボート通知、CAN受信である。CAN受信は、CANデバイスがプロセッサに対して、CANのデータを受信したことを割り込みによって通知するイベントである。アボート通知は、CANデバイスがプロセッサに対して、調停に敗れたことを割り込みによって通知するイベントである。
 CAN送信イベントが発生(IQに到着)した時点では、以前に送信開始されたデータが転送中である事がある。図15の例では、2つ目のCAN送信イベントが到着した時点で、TQの先頭に以前開始された転送の完了に伴う、CAN受信イベント(1つめ)が積まれている。CAN受信イベントの直後に、次のデータ転送のための調停が行われる。この図の例では簡単のため、CAN受信のイベントと調停のイベントの時刻が同じであるとする。IQに到着するnullイベントの時刻印は、CAN受信・調停のゲスト時刻と同じである。ここで本発明の相互ペリフェラルスケジューラは、TQの先頭時刻まで先行実行するようプロセッサ・スケジューラに通知(nullメッセージを送出)する処理を含む。図15のIQに到着するnullは、プロセッサがこの処理によって通知された時刻まで到達したことを、プロセッサ・スケジューラが通知する進捗メッセージのものである。また、図のOQで最初に送出されているnullメッセージは、この処理でプロセッサ・スケジューラに先行実行を通知したものを示す。
 調停が行われると、2つのプロセッサから要求されたCAN送信のうち、一方が受け入れられ(調停への勝利)、もう一方が保留される(調停への敗退)。図は、前者の送信要求を行ったプロセッサへのCAN受信のイベントが、後者の送信要求を行ったプロセッサへのアボート通知のイベントが、それぞれTQに追加されることを示している。CANデバイスのエミュレーションの進行に伴って、追加された2つのイベントが順に処理され、対応するイベント(アボート通知、CAN受信)がOQを通してプロセッサ・スケジューラにそれぞれ通知される。
 図13は、外部ペリフェラル・スケジューラにおけるキューに関係する処理を示す図である。図示されているように、入力キューIQには、Pi, Pjからメッセージが入来する。
 出力キューOQには、割込み通知のイベントメッセージ及びnullメッセージが送出され、それらは、Pi, Pjが取り出す。
 タスク・キューTQは、タイムスタンプ(時刻印)でソートされている。
 また、外部ペリフェラル・スケジューラは、プラントに接続するI/Oポートの現在の信号値を保持する。
 次に、図14のフローチャートを参照して、外部ペリフェラル・スケジューラの処理を説明する。ここでの初期値は、全てのIQは空、全てのOQは空、TQは空、PV(ポート値)はECU仕様での初期値、T := 0, TR := ΔTRである。
 ステップ1402で、外部ペリフェラル・スケジューラは、IQの更新待ちを行い、ステップ1404では、全IQがfilledかどうか判断し、そうでなければステップ1402に戻って、IQの更新待ちを続ける。
 そうしてステップ1404で、外部ペリフェラル・スケジューラが、全IQがfilledと判断すると、ステップ1406で、全IQ中最も近い時刻をT0とおく。ここで、T ≦ T0 ≦ TPであって、TPは現在のプラント時間である。
 ステップ1408では、外部ペリフェラル・スケジューラは、Te = T0 in IQ、すなわち、IQにTe = T0となるタスクeがあるかどうかを判断する。もしそうなら、外部ペリフェラル・スケジューラは、ステップ1410でイベントeをポップし、ステップ1412で insert(e1[t])、insert(e2[t]) により、TQの更新を行う。ここで、イベントe1は、<read,t,r>すなわち、時刻tにレジスタrの値を読み込むイベントであり、イベントe2は、<write,t,r,v>すなわち、時刻tにレジスタrの値をvに更新するイベントである。
 ステップ1412の後はステップ1408に戻り、そこで、外部ペリフェラル・スケジューラがIQにTe = T0となるタスクeがないと判断すると、ステップ1414で、T := T0とセットし、ステップ1416で、T = TPであるかどうか判断する。
 もしステップ1416で、T = TPであると判断すると、外部ペリフェラル・スケジューラはステップ1418で、insert(e4[T])を呼び出して、TQに、時刻Tで発火するタスク<plant_go>を追加する。ここでe4とは、プラントを時刻min{Ttop,T + ΔTR}まで実行するイベントである。Ttopは、TQの先頭時刻であり、TQが空の場合はTtop = ∞とおく。ここはすなわち、全てのプロセッサがプラントに追いついたら、ブラント先行実行ざせる処理である。
 ステップ1418の次は、ステップ1420の判断ステップに進む。ステップ1416で、T = TPでないと判断された場合は直接、ステップ1420に進む。
 ステップ1420では、外部ペリフェラル・スケジューラは、peek()を呼び出して、TQに、Tk = Tとなるイベントkがあるかどうかを判断する。もしなければ、処理は、ステップ1404に戻る。
 ステップ1420で、TQにTk = Tとなるイベントkがあると判断すると、外部ペリフェラル・スケジューラはステップ1422で、kをポップし、ステップ1424で、kがプラント実行かどうか判断する。
 外部ペリフェラル・スケジューラが、ステップ1420で、kがプラント実行であると判断すると、ステップ1426で、advance()を呼び出してプラントを実行する。
 次のステップ1428では、外部ペリフェラル・スケジューラは、TQの更新を行う。具体的には、output(t,y)を受けて、pusg(e3[t])を実行し、PVを参照して、input(u)を通知する。そして、nullメッセージを送信する。ここでe3とは、<port_update,p,v>でポートpの値をvに更新するというイベントである。
 次のステップ1430で、外部ペリフェラル・スケジューラはTpを更新し、次のステップ1432で、処理の完了かどうか判断する。もし処理の完了であると判断されると、処理はステップ1420に戻る。処理の完了でないと判断されると、ステップ1434でタスクを戻してから、処理はステップ1420に戻る。
 ステップ1424に戻って、kがプラント実行でないと判断すると、外部ペリフェラル・スケジューラはステップ1436に進み、next()を呼び出して、タスクを実行する。これは具体的には、<interrupt>、<register value>、<register_update>、<port_update>を実行し、nullメッセージを送信する。
 次のステップ1438では、外部ペリフェラル・スケジューラは、OQの更新を行う。ここで、OQにnull以外のメッセージを追加した場合、TQに時刻T + ΔTRで発火するタスク<plant_go>を追加する。すなわち、insert(e4[T + ΔTR])を実行するのであるが、より具体的に言うと、e4は、プラントを時刻min{Ttop,T+ ΔTR}まで実行するものである。ここで、Ttopは、TQの先頭時刻であり、TQが空の場合はTtop = ∞とおく。
 次のステップ1440では、外部ペリフェラル・スケジューラは、OQをフラッシュして、ステップ1420に戻る。
 以下では、保守的なイベント同期を行う際にデッドロックが生じること、また、それを回避するためには nullメッセージが必要であることを説明する。なお、これは新しい発見ではなくて、従来より知られた知見である。
 シミュレーション対象を分割し各領域のシミュレータ(またはエミュレータ)を接続して全体のシミュレーションを行う際、通信インタフェースを含む各領域のシミュレーション単位を論理プロセスと呼ぶ。図16に、論理プロセスの構成を示す。
 図16に示すように、保守的なイベント同期のシミュレーションにおいては、論理プロセス(LPk)は、メッセージ受信のための入力キューIQと、メッセージ送信のための出力キューOQと、予定されたシミュレーションタスクを記憶するためのタスクキューTQと、現在時刻を示すスカラー値をもつ。IQとOQはFIFOであり、TQは時間順にソートされている。
 図17は、複数の論理プロセス(LP1~LP4)が通信チャネルを介して接続されている様子を示す図である。このように接続を図るために、個々の論理プロセスは、IQとOQを通信チャネル毎にもつ。
 論理プロセスはIQ、OQを用いて、時刻の情報(時刻印)を持つメッセージを交換する。IQ/OQに送出/受信されるメッセージの時刻印は、送出/受信を行うたびに単調増加する。このため、論理プロセスが他の全ての論理プロセスからメッセージを受取ると、受取ったメッセージのうち最も小さい時刻印までロールバックすることなくシミュレーションを進めることができる。交換されるメッセージにはイベントメッセージとnullメッセージがある。
 時刻tのイベントeに関するイベントメッセージとは、「送信側から受信側に対して発生する次のイベントの時刻がtであり、発生するイベントはeである」ことを伝えるメッセージである。
 時刻tのnullメッセージとは、「送信側から受信側に対して発生する次のイベントの時刻が、tより後である」ことを伝えるメッセージであり、受信側のシミュレーション領域そのものには影響を与えない。nullメッセージの目的は、下に述べるデッドロックを防ぐことである。保守的なイベント同期ではロールバックを防ぐために、他の全ての論理プロセスから現在時刻より大きな時刻印のメッセージを受信するまで処理を停止する。しかし、メッセージの受信を待つ相手の論理プロセスも同じ時刻でその論理プロセスからの受信を待つ場合、図18(a)のようにお互いがメッセージを待ち合って処理を再開できない。そこで、現在時刻からどれだけ先まで外部へのイベントが発生しないかを「先読み」して、図18(b)のように、nullメッセージを送ることで、デッドロックを防ぐ。
 論理プロセスの処理の概要は、次のとおりである。
(1) 全てのIQにメッセージが到着するまで待機
(2) IQの中で最も時刻の早いメッセージ(t = T0)をポップ
(3) T0まで現在時刻を進めながら、シミュレーションを実行(タスクキューをポップして実行)
  (a) 未来のイベントはタスクキューに追加
  (b) 発生した外部へのイベントは逐次OQに追加
  (c) イベント追加がないOQには、nullメッセージを追加(t = 現在時刻 + 先読み時間)
(2)でポップしたメッセージを処理して(1)に戻る
 なお、本発明では特に、「先読み」を行わないnullメッセージ(送信時の現在時刻を時刻印としてもつnullメッセージ)を進捗メッセージと呼ぶ。 進捗メッセージの目的は、微小な先読み幅をもつnullメッセージによって生じてしまう頻繁な同期を回避することである。本発明では、内部ペリフェラル・スケジューラが進捗メッセージを送信する。これは、内部ペリフェラル・スケジューラを駆動するISSが、微小な幅でしか他の論理プロセスへの次のイベントを予測できないからである。
 次に図19を参照して、プロセッサの通信遅延ΔTcについて説明する。すなわち、図示されているように、相互ペリフェラルへの書込み(write)から、受信側/送信側プロセッサへの割込みが発生するまでの遅延の最小値がプロセッサの通信遅延ΔTcである。
 ちなみに、最大ボーレート1.0MbpsのCANによる通信では、データフレームの最大遅延は44μ秒(フレームの最小ビット数が44)で、これがΔTcの参考値である。
 次に図20を参照して、プロセッサの反応遅延ΔTRについて説明する。すなわち、プロセッサの反応遅延ΔTRとは、図示されているように、プラントの入力時刻から、それによるプロセッサの反応がプラントに伝わって有効となるまでの遅延の最小値である。図20でTRとは、TQが空の場合にプロセッサの反応がプラントに到達する可能性のある最小時刻である。
 前提として、プラントの状態変化に起因する割込みを受け付けてから、TR以内に、プラントへの最初のイベント発生時刻Treactionを決めるレジスタ書込み(例:タイマスタートレジスタへの書込み)が発生する。この書込み時刻をTtriggerと表記すると、下記の式が成立する。
Ttrigger << TR ≦ Treaction
 プロセッサが動作を決定(時刻Ttrigger)してからアクチュエータが動作(時刻Treaction)するまでの時間を先読みとしてプラントを先行実行しても。時間正確性は失わない、という知見を利用するために、プロセッサの反応遅延ΔTRが使用される。
 次に、プロセッサ反応遅延の例を示す。最初の例として、エンジン燃料噴射制御において、クランク15°毎にプラントから回転パルス(state change)が発生する場合、燃料噴射や点火の指示は、その時間を正確にするためにタイマーを利用して実行される。タイマーへの時間セットは、ひとつ以上前の回転パルスが発生したときに計算するので、噴射・点火までには、ひとつ以上のパルス間隔、すなわち、最大回転数10,000 rpmではパルス間隔 250μ秒以上の十分な遅延がある。これを反応遅延とする。
 別の例として、プラントからの入力に対しプロセッサが即時に指示を返す制御では、反応遅延は非常に小さい。しかしこの種の制御では、プロセッサに比べて鈍い物理現象に対し周期的なタスクを実行するものが多い(例: 温度を制御量としたファンへのPWM信号の指示、車速を制御量としたスロットル開度の指示)。温度、速度、トルクの制御周期の目安はそれぞれ1秒、1ミリ秒、0.1ミリ秒であり、これより細かな時間粒度でプラントへの指示行う必要はない。このため、プラントの粗い時間粒度から定めた時間を、反応遅延として利用する。
 次に、図21を参照して、共有メモリ・アクセスのシミュレーションを説明する。図21においては、プロセッサPr1、Pr2、Pr3が共有メモリにアクセスするとする。そこで、プロセッサPr1、Pr2が先行していて、プロセッサPr3がプロセッサPr1、Pr2に追随するものとする。すると、プロセッサPr3は、IQの内容から、自分が最も昔の時刻にいること、及び後ろから2番手のプロセッサの時刻が分かる。そこで、storeとloadを実行し、2番手に追随する。最後に、load直前で停止し、IQに到達した過去のstoreを時間順に全て反映してからloadを実行して再開する。
 すると、全てのプロセッサが必ずどこかで「最も昔の時刻」に到達して再開していくので、デッドロックが回避される。逆に言えば、このように R/W が同期的に動作する論理プロセスの場合には、デッドロックは生じない。こうして、読書きの一貫性を保ちながら、デッドロックなくシミュレーションすることが可能となる。
 図22は、ISS、ペリフェラル・エミュレータ、プラントシミュレータおよび本発明の3つのスケジューラ機能の、ホスト計算機のコアへの割当て例を示している。プロセッサと通信頻度の高い内部ペリフェラル・スケジューラとISSを同じコア2204でエミュレートすることで、シミュレーションを高速に実行することができる。。
 内部ペリフェラル・スケジューラは、ECUのメモリマップ仕様を参照して、ISSからのload/store命令を、内部ペリフェラル(コア内のSystemC)、相互ペリフェラル、 外部ペリフェラルに振り分ける。
 尚、図中の表記は、次のとおりである。
<ISS>
int: interrupt
rs: resume
a:  advance
l:  load
s:  store
c:  complete
<SystemC>
r:  read
w:  write
ru: register update
int: interrupt
pu: port update
<plant>
a: advance
i: input
c: complete
o: output
<通信チャネル>
r: read
w: write
ru: register update
int: interrupt
 次に図23を用いて、CANデバイスが調停の敗退後にプロセッサへアボート通知を行う動作を、相互ペリフェラル・スケジューラが保守的に(ロールバックさせることなく)エミュレートできることを説明する。 図23は、2つのプロセッサ1、2がCANデバイスに対してCANフレームの送信要求を行う例を示している。プロセッサ1が送信要求するフレームは、プロセッサ2が送信要求するフレームより優先度が高い。プロセッサ2はCANデバイスに対し、調停に敗れた場合には送信待機状態の解除を行って割込み通知をするよう、指令を出している(アボートセット)。また、図の縦方向の矢印はゲスト時間の進行を示す。
 図23の例では、2つのプロセッサがCANデバイス(相互ペリフェラル)に、アボートセットと送信セットを行った後、CANデバイスのエミュレータ(SystemC等で記述)が調停処理を開始する。調停開始のイベントはCANデバイスのエミュレータによってTQに追加されたものであり、相互ペリフェラル・スケジューラの処理によって、全てのプロセッサがこの時刻(調停開始)でゲスト時間の同期を取る。この例におけるアボートセット、2つの送信セット、調停はそれぞれ、図15において、IQに到着するCANアボート、IQに到着する2つのCAN送信、TQに追加される調停イベントに対応する。また図23でプロセッサの時刻の同期をとる相互ペリフェラル・スケジューラの処理とは、TQ先頭の時刻のnullメッセージの送出と進捗メッセージの受信であり、図15に関連して説明した処理と同一である。
 また図23の例は、調停が開始されると、CANデバイスのエミュレータが敗退通知時刻のイベントをTQに追加することを示している。相互ペリフェラル・スケジューラが次にプロセッサに先行実行を通知する際、送出するnullメッセージの時刻印は、ΔTCではなく、ここで追加された敗退通知の時刻である。このため、プロセッサ2が、敗退通知の時刻を通り過ぎること(ロールバックを要するオーバーヘッド)がない。
 次に図24を用いて、高優先度のCANフレームを送信要求したプロセッサがCANデバイスをリセットする場合の動作を、相互ペリフェラル・スケジューラが保守的に(ロールバックさせることなく)エミュレートできることを説明する。これは、CANデバイスのエミュレータにおいて、敗退を通知する前にリセットの有無をチェックすることで可能となる。図24に示す動作は、調停開始までは図23と同じである。
 図24の例は、ゲスト時間上、調停が開始されてから調停が完了(フレームの勝利と敗退が確定)するまでの間に、優先度の高いCANフレーム要求を出したプロセッサ1がCANデバイスをリセットすることを示している。調停が開始された時点で、図23の例で述べたように、CANデバイスのエミュレータによって、プロセッサ2に対してアボート通知のためのイベントがTQに追加される。
 図24の例では、ここで追加されたアボート通知のためのイベントの処理において、CANデバイスのエミュレータが、アボート通知を行う前にリセット通知の有無をチェックし、アボート通知を行うか否かを決定することを示している。
この決定処理でCANデバイスのエミュレータは、リセット通知があった場合、どのCANフレームが調停に勝利するかを再び計算する。再計算の結果、調停開始時に敗退する予定であったフレームが調停に勝利した場合、アボートが発生しないので、プロセッサにアボートを通知しない。図24の例は、プロセッサ2が送信要求を出したCANフレーム(調停開始時には敗退予定)が再計算の結果調停に勝利した結果、予定されていたアボート通知が行われないことを示す。
 再計算の結果、調停開始時に敗退する予定であったフレームが再び調停に敗退した場合、アボートが発生するので、予定通りプロセッサにアボートを通知する。また、上の決定処理においてリセット通知がなかった場合、CANフレームの勝敗が調停開始時から変わることはない。このため、リセット通知がなかった場合も、調停開始時に予定されたアボートをプロセッサに通知する。
 このように、CANデバイスのエミュレータにおいて敗退を通知する前にリセットの有無をチェックすることで、リセットによってアボートが発生しないにも関わらず誤ってプロセッサがアボート通知を受取る(ロールバックを要するオーバーヘッド)ことがない。
 次に、図25を参照して、本発明を実施するための別の実施例を説明する。図25において、プロセッサ・エミュレータ2502a、・・・、2502m、2504a、・・・、2504nは、図2に示すプロセッサ・エミュレータ202a、・・・、202zと機能的に実質的に同一である。
 ペリフェラル・エミュレータ2506a、・・・、2506m、2508a、・・・、2508nも、図2に示すペリフェラル・エミュレータ204a、・・・、204zと機能的に実質的に同一である。
 図25の構成が、図2の構成と異なるのは、プラント・シミュレータが、能動的(active)プラント・シミュレータ2510a、・・・、2510mと、受動的(passive)プラント・シミュレータ2512a、・・・、2512nに分かれていることである。ここで、能動的プラント・シミュレータとは、エンジン・シミュレータのように、状態変化のタイミングなどを自律的に決定する機能をもつプラント・シミュレータである。例えば、エンジンは、クランク角度を15度刻みのパルスで知らせるプラントであるが、そのタイミングは、コントローラ(ECU)側で決定することはできない。
 一方、受動的(passive)プラント・シミュレータとは、タイミングを、コントローラが決定できるプラント・シミュレータで、例えば、電池の電圧を指定されたタイミングでモニター(サンプル)するプラントがそれに該当する。それ以外にも、温度センサ、圧力センサ、回転速度センサなど、センサ系のプラントが、受動的プラントに該当する。ブレーキやサスペンションもサンプリングによって状態をセンスする場合には、受動的プラントとして分類する。
 このような能動的プラント・シミュレータと、受動的プラント・シミュレータの仕分けに対応して、外部ペリフェラル・スケジューラも、能動的プラント・シミュレータに接続されたペリフェラル・エミュレータをスケジューリングする外部ペリフェラル・スケジューラ2514aと、受動的プラント・エミュレータに接続されたペリフェラル・シミュレータをスケジューリングする外部ペリフェラル・スケジューラ2514bとが設けられる。能動的プラント・シミュレータに接続されたペリフェラル・エミュレータに対して、対応するプロセッサ・エミュレータは、シグナル更新を通知する一方で、状態変化を受取るという双方向の働きかけがあるが、受動的プラント・シミュレータに接続されたペリフェラル・エミュレータに対して、対応するプロセッサ・エミュレータは、原則的に、シグナル更新とサンプリング予告を通知するだけである。
 能動的プラント・シミュレータと、受動的プラント・シミュレータの仕分けは、基本的には、プロセッサ・エミュレータ間の通信には影響を与えないので、相互ペリフェラル・スケジューラ2516の動作は、実質的に図2の相互ペリフェラル・スケジューラ210と同一であるし、CANエミュレータ2518も、図2のCANエミュレータ212と、実質的に同一である。
 ところで、能動的プラント・シミュレータのための外部ペリフェラル・スケジューラ2514aは、図2の外部ペリフェラル・スケジューラ208と機能的に実質的に同一であるが、受動的プラント・シミュレータのための外部ペリフェラル・スケジューラ2514bは、プロセッサに対してプラントを先行させる時間幅を計算する処理が不要である。
 そこで、外部ペリフェラル・スケジューラ2514bの動作を、図26のフローチャートを参照して説明する。ここでの初期値は、全てのIQは空、全てのOQは空、TQは空、PV(ポート値)はECU仕様での初期値、T := 0である。受動的プラント・シミュレータのための外部ペリフェラル・スケジューラは、先行するプロセッサの時刻が通知される度にその時刻に追いつく、という処理を繰り返すだけでよい。
 ステップ2602で、外部ペリフェラル・スケジューラ2514bは、IQの更新待ちを行い、ステップ2604では、全IQがfilledかどうか判断し、そうでなければステップ2602に戻って、IQの更新待ちを続ける。
 そうしてステップ2604で、外部ペリフェラル・スケジューラ2514bが、全IQがfilledと判断すると、ステップ1406で、全IQ中最も近い時刻をT0とおく。
 ステップ2608では、外部ペリフェラル・スケジューラ2514bは、Te = T0 in IQ、すなわち、IQにTe = T0となるタスクeがあるかどうかを判断する。もしそうなら、外部ペリフェラル・スケジューラ2514bは、ステップ2610でイベントeをポップし、ステップ2612で、TQの更新を行う。
 ステップ2612の後はステップ2608に戻り、そこで、外部ペリフェラル・スケジューラ2514bがIQにTe = T0となるタスクeがないと判断すると、ステップ2614で、T := T0とセットする。
 次にステップ2616に進み、そこで外部ペリフェラル・スケジューラ2514bは、プラントをTまで実行する。このとき、プラントは受動的プラントであるので、外部ペリフェラル・スケジューラ2514bは、状態変化の通知を受けることはない。
 次に外部ペリフェラル・スケジューラ2514bは、ステップ2618で、TQエントリ(T)を実行して、ステップ2604に戻る。
 尚、相互ペリフェラル・スケジューラが扱う車載LANプロトコルとして、CANの場合について説明したが、本発明のシミュレーション・システムは、CANに限定されず、LIN、FlexRayなどの任意の車載LANプロトコルにも適用可能である。
 以上、自動車用の複数のシミュレーション・システムに関連して、本発明の特定の実施例を説明してきたが、本発明はこのような特定の実施例に限定されず、飛行機用のシミュレーション・システムなど、一般的な電子機械制御系システムのシミュレーション・システムに適用可能であることを、この分野の当業者であるなら、理解するであろう。
 また、本発明は、特定のコンピュータのアーキテクチャやプラットフォームに限定されることなく、マルチタスクを実現可能な任意のプラットフォームで実装可能である。
102              ホスト・バス
104a,・・・104n     CPU
106              メイン・メモリ
116              ハードティスク・ドライブ
202,2502,2504    プロセッサ・エミュレータ
204,2506,2508    ペリフェラル・エミュレータ
206,2510,2512    プラント・シミュレータ
208,2514a,2514b  外部ペリフェラル・スケジューラ
210,2516         相互ペリフェラル・スケジューラ
212,2518         CANエミュレータ

Claims (21)

  1.  コンピュータの処理により、シミュレーションを行なうシミュレーション・システムにおいて、
     前記コンピュータ上で実行される複数のプロセッサ・エミュレータと、
     前記コンピュータ上で実行される複数のプラント・シミュレータと、
     前記コンピュータ上で実行され、前記プロセッサ・エミュレータの反応遅延時間まで、前記プラント・シミュレータを先行実行させ、実際に前記プラント・シミュレータが停止した時間まで前記プロセッサ・エミュレータに先行実行するようにペリフェラル・エミュレータを介して通知する、外部ペリフェラル・スケジューラと、
     前記コンピュータ上で実行され、前記プロセッサ・エミュレータ間の通信遅延時間だけ、前記プロセッサ・エミュレータに先行実行するように通知する、相互ペリフェラル・スケジューラとを有し、
     前記プロセッサ・エミュレータは、通知された時間まで、保守的に処理を進められる、
     シミュレーション・システム。
  2.  前記コンピュータが、マルチタスク・システムであり、前記複数のプロセッサ・エミュレータと、前記複数のプラント・シミュレータと、前記外部ペリフェラル・スケジューラと、前記相互ペリフェラル・スケジューラは、個別のスレッドまたはプロセスとして実行される、請求項1に記載のシミュレーション・システム。
  3.  前記コンピュータが、マルチコアまたはマルチプロセッサ・システムであり、前記複数のプロセッサ・エミュレータと、前記複数のプラント・シミュレータと、前記外部ペリフェラル・スケジューラと、前記相互ペリフェラル・スケジューラは、前記マルチプロセッサ・システムの異なるプロセッサまたはコアに個別に割り当てられて個別のスレッドまたはプロセスとして実行される、請求項2に記載のシミュレーション・システム。
  4.  前記プラント・シミュレータと、該プラント・シミュレータと通信する前記ペリフェラル・エミュレータが、同一のコアまたはプロセッサに割りあてられている、請求項3に記載のシミュレーション・システム。
  5.  前記複数のプラント・シミュレータは、自発的に状態を決定する能動的プラント・シミュレータと、タイミングを前記プロセッサ・エミュレータ側で決定する受動的プラント・シミュレータを有し、前記外部ペリフェラル・スケジューラは、前記能動的プラント・シミュレータと通信する能動的プラント用の外部ペリフェラル・スケジューラと、前記受動的プラント・シミュレータと通信する受動的プラント用の外部ペリフェラル・スケジューラからなる、請求項1に記載のシミュレーション・システム。
  6.  CANエミュレータをもち、該CANエミュレータは、相互ペリフェラル・スケジューラによってスケジュールされる、請求項1に記載のシミュレーション・システム。
  7.  前記プロセッサ・エミュレータはそれぞれ、キューをもつ内部ペリフェラル・スケジューラと協働し、該キューの書込みイベントの時間により、複数の前記プロセッサ・エミュレータによる共有メモリ・アクセスのデッドロックが回避される、請求項1に記載のシミュレーション・システム。
  8.  コンピュータの処理により、シミュレーションを行なうシミュレーション方法において、
     前記コンピュータ上で、複数のプロセッサ・エミュレータを実行させるステップと、
     前記コンピュータ上で、複数のプラント・シミュレータを実行させるステップと、
     前記コンピュータ上で、前記プロセッサ・エミュレータの反応遅延時間まで、前記プラント・シミュレータを先行実行させ、実際に前記プラント・シミュレータが停止した時間まで前記プロセッサ・エミュレータに先行実行するようにペリフェラル・エミュレータを介して通知する、外部ペリフェラル・スケジューラを実行させるステップと、
     前記コンピュータ上で、前記プロセッサ・エミュレータ間の通信遅延時間だけ、前記プロセッサ・エミュレータに先行実行するように通知する、相互ペリフェラル・スケジューラを実行させるステップとを有し、
     前記プロセッサ・エミュレータは、通知された時間まで、保守的に処理を進められる、
     シミュレーション方法。
  9.  前記コンピュータが、マルチタスク・システムであり、前記複数のプロセッサ・エミュレータと、前記複数のプラント・シミュレータと、前記外部ペリフェラル・スケジューラと、前記相互ペリフェラル・スケジューラは、個別のスレッドまたはプロセスとして実行される、請求項8に記載のシミュレーション方法。
  10.  前記コンピュータが、マルチコアまたはマルチプロセッサ・システムであり、前記複数のプロセッサ・エミュレータと、前記複数のプラント・シミュレータと、前記外部ペリフェラル・スケジューラと、前記相互ペリフェラル・スケジューラは、前記マルチプロセッサ・システムの異なるプロセッサまたはコアに個別に割り当てられて個別のスレッドまたはプロセスとして実行される、請求項9に記載のシミュレーション方法。
  11.  前記プラント・シミュレータと、該プラント・シミュレータと通信する前記ペリフェラル・エミュレータが、同一のコアまたはプロセッサに割りあてられている、請求項10に記載のシミュレーション方法。
  12.  前記複数のプラント・シミュレータは、自発的に状態を決定する能動的プラント・シミュレータと、タイミングを前記プロセッサ・エミュレータ側で決定する受動的プラント・シミュレータを有し、前記外部ペリフェラル・スケジューラは、前記能動的プラント・シミュレータと通信する能動的プラント用の外部ペリフェラル・スケジューラと、前記受動的プラント・シミュレータと通信する受動的プラント用の外部ペリフェラル・スケジューラからなる、請求項8に記載のシミュレーション方法。
  13.  CANエミュレータを実行させるステップを有し、該CANエミュレータは、相互ペリフェラル・スケジューラによってスケジュールされる、請求項8に記載のシミュレーション方法。
  14.  前記プロセッサ・エミュレータはそれぞれ、キューをもつ内部ペリフェラル・スケジューラと協働し、該キューの書込みイベントの時間により、複数の前記プロセッサ・エミュレータによる共有メモリ・アクセスのデッドロックが回避される、請求項8に記載のシミュレーション方法。
  15.  コンピュータの処理により、シミュレーションを行なうシミュレーション・プログラムにおいて、
     前記コンピュータに、
     複数のプロセッサ・エミュレータを実行させるステップと、
     複数のプラント・シミュレータを実行させるステップと、
     前記プロセッサ・エミュレータの反応遅延時間まで、前記プラント・シミュレータを先行実行させ、実際に前記プラント・シミュレータが停止した時間まで前記プロセッサ・エミュレータに先行実行するようにペリフェラル・エミュレータを介して通知する、外部ペリフェラル・スケジューラを実行させるステップと、
     前記プロセッサ・エミュレータ間の通信遅延時間だけ、前記プロセッサ・エミュレータに先行実行するように通知する、相互ペリフェラル・スケジューラを実行させるステップを実行させ、
     前記プロセッサ・エミュレータは、通知された時間まで、保守的に処理を進められる、
     シミュレーション・プログラム。
  16.  前記コンピュータが、マルチタスク・システムであり、前記複数のプロセッサ・エミュレータと、前記複数のプラント・シミュレータと、前記外部ペリフェラル・スケジューラと、前記相互ペリフェラル・スケジューラは、個別のスレッドまたはプロセスとして実行される、請求項15に記載のシミュレーション・プログラム。
  17.  前記コンピュータが、マルチコアまたはマルチプロセッサ・システムであり、前記複数のプロセッサ・エミュレータと、前記複数のプラント・シミュレータと、前記外部ペリフェラル・スケジューラと、前記相互ペリフェラル・スケジューラは、前記マルチプロセッサ・システムの異なるプロセッサまたはコアに個別に割り当てられて個別のスレッドまたはプロセスとして実行される、請求項16に記載のシミュレーション・プログラム。
  18.  前記プラント・シミュレータと、該プラント・シミュレータと通信する前記ペリフェラル・エミュレータが、同一のコアまたはプロセッサに割りあてられている、請求項17に記載のシミュレーション・プログラム。
  19.  前記複数のプラント・シミュレータは、自発的に状態を決定する能動的プラント・シミュレータと、タイミングを前記プロセッサ・エミュレータ側で決定する受動的プラント・シミュレータを有し、前記外部ペリフェラル・スケジューラは、前記能動的プラント・シミュレータと通信する能動的プラント用の外部ペリフェラル・スケジューラと、前記受動的プラント・シミュレータと通信する受動的プラント用の外部ペリフェラル・スケジューラからなる、請求項15に記載のシミュレーション・プログラム。
  20.  CANエミュレータを実行させるステップを有し、該CANエミュレータは、相互ペリフェラル・スケジューラによってスケジュールされる、請求項15に記載のシミュレーション・プログラム。
  21.  前記プロセッサ・エミュレータはそれぞれ、キューをもつ内部ペリフェラル・スケジューラと協働し、該キューの書込みイベントの時間により、複数の前記プロセッサ・エミュレータによる共有メモリ・アクセスのデッドロックが回避される、請求項15に記載のシミュレーション・プログラム。
PCT/JP2011/067132 2010-08-20 2011-07-27 シミュレーション方法、システム及びプログラム WO2012023397A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
KR1020137005015A KR101522477B1 (ko) 2010-08-20 2011-07-27 시뮬레이션 방법, 시스템 및 프로그램
US13/817,597 US9147016B2 (en) 2010-08-20 2011-07-27 Multi-ECU simulation by using 2-layer peripherals with look-ahead time
EP11818040.5A EP2608040A4 (en) 2010-08-20 2011-07-27 Simulation method, system and program
CN201180038696.1A CN103098032B (zh) 2010-08-20 2011-07-27 仿真方法和系统
JP2012529543A JP5583773B2 (ja) 2010-08-20 2011-07-27 シミュレーション方法、システム及びプログラム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2010184845 2010-08-20
JP2010-184845 2010-08-20

Publications (1)

Publication Number Publication Date
WO2012023397A1 true WO2012023397A1 (ja) 2012-02-23

Family

ID=45605058

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/067132 WO2012023397A1 (ja) 2010-08-20 2011-07-27 シミュレーション方法、システム及びプログラム

Country Status (6)

Country Link
US (1) US9147016B2 (ja)
EP (1) EP2608040A4 (ja)
JP (1) JP5583773B2 (ja)
KR (1) KR101522477B1 (ja)
CN (1) CN103098032B (ja)
WO (1) WO2012023397A1 (ja)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682214A (zh) * 2012-05-14 2012-09-19 于永利 基于保守机制的小步长时间推进算法
JP2015106179A (ja) * 2013-11-28 2015-06-08 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation シミュレーション装置、シミュレーション方法、およびプログラム
CN105843071A (zh) * 2016-03-21 2016-08-10 大连理工大学 一种智能车辆运动控制实物仿真系统
CN111123764A (zh) * 2019-12-04 2020-05-08 东风电驱动系统有限公司 一种can信号打包处理方法及系统

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5332006B2 (ja) * 2009-08-07 2013-11-06 株式会社日立製作所 計算機システム、プログラム及びシミュレーションに使用する計算資源を割り当てる方法
JP5528294B2 (ja) * 2010-10-20 2014-06-25 インターナショナル・ビジネス・マシーンズ・コーポレーション シミュレーション制御方法、システム及びプログラム
US9817410B2 (en) * 2012-03-30 2017-11-14 Mitsubishi Electric Corporation Air conditioner testing system, air-conditioning system simulator, and program
US9251308B2 (en) * 2012-07-23 2016-02-02 International Business Machines Corporation Simulation method, system, and program
CN103441904B (zh) * 2013-09-03 2017-04-12 北京邮电大学 一种基于时间限制的通信调度模拟方法
EP2851815A1 (de) * 2013-09-18 2015-03-25 dSPACE digital signal processing and control engineering GmbH Testeinrichtung zum Echtzeittest eines virtuellen Steuergeräts
EP3117276A1 (en) * 2014-03-10 2017-01-18 MHWirth AS Improved method for testing a control system
US9870476B2 (en) 2014-09-23 2018-01-16 Accenture Global Services Limited Industrial security agent platform
CN105159755A (zh) * 2015-10-12 2015-12-16 无锡还有网络科技有限公司 多处理器的仿真处理系统
US11314907B2 (en) * 2016-08-26 2022-04-26 Hitachi, Ltd. Simulation including multiple simulators
CN106326599B (zh) * 2016-09-14 2020-03-10 苏州浪潮智能科技有限公司 一种多处理器系统仿真的系统状态监测方法和装置
US10157158B2 (en) * 2017-01-27 2018-12-18 Ford Global Technologies, Llc Method and apparatus for distributed computing using controller area network protocols
JP6770935B2 (ja) * 2017-07-03 2020-10-21 日立オートモティブシステムズ株式会社 車両制御装置用の検証装置
EP3454234A1 (de) * 2017-09-06 2019-03-13 dSPACE digital signal processing and control engineering GmbH Verfahren zum bereitstellen einer echtzeitfähigen simulation für die steuergerätentwicklung und simulationsvorrichtung für die steuergerätentwicklung
CN108447330B (zh) * 2018-01-30 2020-07-03 王志强 一种虚实结合的数控设备级联系统及方法
EP3521949B1 (de) * 2018-02-01 2021-01-13 Siemens Aktiengesellschaft Vorrichtung zum simulieren einer gesteuerten maschine oder anlage sowie verfahren
CN109101456B (zh) * 2018-08-30 2021-10-15 浪潮电子信息产业股份有限公司 一种仿真ssd中的数据交互通信方法、装置及终端
CN110059329B (zh) * 2018-12-05 2023-06-20 中国航空工业集团公司西安飞机设计研究所 一种精细化的机电系统能量综合仿真方法及综合仿真系统
KR102608939B1 (ko) * 2021-12-28 2023-12-01 재단법인대구경북과학기술원 멀티코어 프로세서를 이용한 주변 장치 공유 방법 및 이를 이용하는 전자 장치
CN115643124A (zh) * 2022-06-23 2023-01-24 南京轶诺科技有限公司 一种pc机模拟汽车can总线通信系统
CN115134254B (zh) * 2022-06-28 2023-11-03 抖音视界(北京)有限公司 一种网络模拟方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10312315A (ja) * 1997-05-12 1998-11-24 Nec Corp ソフトウェア/ハードウェア協調シミュレーション方式
JP2007011720A (ja) 2005-06-30 2007-01-18 Sharp Corp システムシミュレータ、システムシミュレート方法、制御プログラムおよび可読記録媒体
JP2009238954A (ja) 2008-03-26 2009-10-15 Fujifilm Corp 金属研磨用組成物、及び化学的機械的研磨方法
JP2010002968A (ja) * 2008-06-18 2010-01-07 Internatl Business Mach Corp <Ibm> シミュレーション方法、システム及びプログラム

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5737711A (en) * 1994-11-09 1998-04-07 Fuji Jukogyo Kabuishiki Kaisha Diagnosis system for motor vehicle
JP2002073374A (ja) 2000-08-30 2002-03-12 Canon Inc 割り込みシミュレーション方法及び装置
JP4152659B2 (ja) 2001-04-06 2008-09-17 株式会社ガイア・システム・ソリューション データ処理システムおよび設計システム
JP2004206699A (ja) 2002-12-12 2004-07-22 Matsushita Electric Ind Co Ltd シミュレーション装置、シミュレーション方法及びプログラム
JP4057989B2 (ja) 2003-09-26 2008-03-05 株式会社東芝 スケジューリング方法および情報処理システム
JP2005128692A (ja) 2003-10-22 2005-05-19 Matsushita Electric Ind Co Ltd シミュレータ及びシミュレーション方法
TW200532560A (en) 2003-11-13 2005-10-01 Qualcomm Inc System and method for dynamically simulating devices at a computing device
JP4717492B2 (ja) * 2005-04-12 2011-07-06 富士通株式会社 マルチコアモデルシミュレータ
JP4997360B2 (ja) 2005-10-28 2012-08-08 株式会社神戸機械製作所 成形米飯食品製造装置
US8352231B2 (en) * 2007-08-30 2013-01-08 International Business Machines Corporation System for performing a co-simulation and/or emulation of hardware and software
JP5153465B2 (ja) * 2008-06-09 2013-02-27 インターナショナル・ビジネス・マシーンズ・コーポレーション シミュレーション方法、システム及びプログラム
US20100070748A1 (en) * 2008-09-17 2010-03-18 Au Group Electronics Device and methods for simulating controller area network signals
JP4629768B2 (ja) * 2008-12-03 2011-02-09 インターナショナル・ビジネス・マシーンズ・コーポレーション 並列化処理方法、システム、及びプログラム
JP4988789B2 (ja) * 2009-05-19 2012-08-01 インターナショナル・ビジネス・マシーンズ・コーポレーション シミュレーション・システム、方法及びプログラム
JP4852629B2 (ja) * 2009-06-02 2012-01-11 インターナショナル・ビジネス・マシーンズ・コーポレーション シミュレーション・システム、方法及びプログラム
JP5065344B2 (ja) * 2009-07-14 2012-10-31 インターナショナル・ビジネス・マシーンズ・コーポレーション シミュレーション方法、システム及びプログラム
CN102576325B (zh) 2009-10-16 2015-04-15 国际商业机器公司 模拟方法、系统及程序

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10312315A (ja) * 1997-05-12 1998-11-24 Nec Corp ソフトウェア/ハードウェア協調シミュレーション方式
JP2007011720A (ja) 2005-06-30 2007-01-18 Sharp Corp システムシミュレータ、システムシミュレート方法、制御プログラムおよび可読記録媒体
JP2009238954A (ja) 2008-03-26 2009-10-15 Fujifilm Corp 金属研磨用組成物、及び化学的機械的研磨方法
JP2010002968A (ja) * 2008-06-18 2010-01-07 Internatl Business Mach Corp <Ibm> シミュレーション方法、システム及びプログラム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2608040A4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682214A (zh) * 2012-05-14 2012-09-19 于永利 基于保守机制的小步长时间推进算法
JP2015106179A (ja) * 2013-11-28 2015-06-08 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation シミュレーション装置、シミュレーション方法、およびプログラム
US9563471B2 (en) 2013-11-28 2017-02-07 International Business Machines Corporation Simulation apparatus, simulation method, and program
CN105843071A (zh) * 2016-03-21 2016-08-10 大连理工大学 一种智能车辆运动控制实物仿真系统
CN111123764A (zh) * 2019-12-04 2020-05-08 东风电驱动系统有限公司 一种can信号打包处理方法及系统

Also Published As

Publication number Publication date
US9147016B2 (en) 2015-09-29
JPWO2012023397A1 (ja) 2013-10-28
EP2608040A4 (en) 2018-02-07
JP5583773B2 (ja) 2014-09-03
KR101522477B1 (ko) 2015-05-21
US20130151220A1 (en) 2013-06-13
CN103098032B (zh) 2015-10-14
CN103098032A (zh) 2013-05-08
EP2608040A1 (en) 2013-06-26
KR20130105609A (ko) 2013-09-25

Similar Documents

Publication Publication Date Title
JP5583773B2 (ja) シミュレーション方法、システム及びプログラム
Zeng et al. Stochastic analysis of can-based real-time automotive systems
EP2318922B1 (en) Controlling real time clock during embedded system development
JP5295355B2 (ja) シミュレーション方法、システム及びプログラム
US20090306952A1 (en) Simulation method, system and program
US9251308B2 (en) Simulation method, system, and program
JP5651251B2 (ja) シミュレーション実行方法、プログラム及びシステム
CN103823706A (zh) 一种基于RTLinux的被控对象模型模拟仿真实时调度方法
CN103853598B (zh) 实现嵌入式虚拟机硬实时虚拟定时器响应的方法
JP5224957B2 (ja) シミュレーション方法、システム及びプログラム
WO2011046089A1 (ja) シミュレーション方法、システム及びプログラム
Wurst et al. System performance modelling of heterogeneous hw platforms: An automated driving case study
JP2012093899A (ja) 計算機システム、シミュレーション方法、及びプログラム
Rehm et al. Performance modeling of heterogeneous HW platforms
JP5186290B2 (ja) シミュレーション方法、システム及びプログラム
US9612863B2 (en) Hardware device for accelerating the execution of a systemC simulation in a dynamic manner during the simulation
EP4092531A1 (en) Systems, methods, and apparatus for coordinating computation systems
JP2590179B2 (ja) 並列論理シミュレーション制御方式
JP2010086207A (ja) シミュレーション方法、システム及びプログラム
Orlic et al. Real-time and fault tolerance in distributed control software
CN114021311A (zh) 一种基于rtx的异构并行半实物仿真装置和方法
Grolleau Introduction to Real‐Time Scheduling
Köhler Connection between hardware and simulation
Vopata Distributed discrete-event simulation in Concurrent C
Idasiak et al. A predictive real-time software for robotic application

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180038696.1

Country of ref document: CN

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

Ref document number: 11818040

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2012529543

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 2011818040

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 13817597

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20137005015

Country of ref document: KR

Kind code of ref document: A