A method for providing a real-time-capable simulation for control unit development, the real-time-capable simulation simulates a control unit or an environment of the control unit or a combination of the control unit and the environment of the control unit, the real-time-capable simulation comprises a co-simulation of a real-time-capable sub-simulation and a non-real-time-capable sub-simulation that interacts with the real-time-capable sub-simulation, the real-time-capable sub-simulation and the non-real-time-capable sub-simulation being adapted for communication of simulation data, the real-time-capable sub-simulation has a first simulation time corresponding to real time and the non-real-time-capable sub-simulation has a virtual, second simulation time that is coupled to the first simulation time and that matches the first simulation time at a start of the real-time-capable simulation, the method comprising:
- checking, by the real-time-capable sub-simulation, whether the non-real-time-capable sub-simulation has provided calculated simulation data Sn for a pending macro-simulation step at a given time and determining a check result of
- provided when the non-real-time-capable sub-simulation has provided the calculated simulation data Sn for the pending macro-simulation step at the given time and
- not provided when the non-real-time-capable sub-simulation has not provided the calculated simulation data Sn for the pending macro-simulation step at the given time;
- when the check result is determined to be the provided, using, by the real-time-capable sub-simulation, the calculated simulation data Sn for the pending macro-simulation step such that upon determining that the non-real-time-capable sub-simulation has completed calculating the calculated simulation data Sn for the pending macro-simulation step and has provided the calculated simulation data Sn to the real-time-capable sub-simulation, the calculated simulation data Sn is used for the pending macro-simulation step;
- when the check result is determined to be the not provided, creating estimated simulation data Sq for use in the pending macro-simulation step such that upon determining that the non-real-time-capable sub-simulation has not completed calculating any calculated simulation data Sn for the pending macro-simulation step and has not provided the calculated simulation Sn data to the real-time-capable sub-simulation, the estimated simulation data Sg is created;
- when the check result is determined to be the not provided, setting the second simulation time to the first simulation time after completion of a calculation of the calculated simulation data Sn that was not provided by the given time;
- and
- when the check result is determined to be the provided, after the pending macro-simulation step, providing the calculated simulation data Sn for the pending macro-simulation step to the real-time-capable sub-simulation and to an error handling system.