Page 95 - Mechatronic Systems Modelling and Simulation with HDLs
P. 95
84 5 SOFTWARE IN HARDWARE DESCRIPTION LANGUAGES
Table 5.1 Methods of hardware/software co-simulation according to Rowson [355]
Approach Speed in inst. / sec. Model necessary
Exact pin timing 1–100 Yes
Cyclically precise pin timing 50–1000 Yes
Instruction level 2000–20 000 Yes
Timing disregarded Typically limited by the hardware simulation No
to connect to the hardware by means of a type of ‘handshake’. Thus the software
will be executed at the full speed of the simulation workstation. A further situ-
ation in which the timing may be neglected to a certain degree is the situation
in which the execution of the software is defined in a fixed time period. Accord-
ingly, events and new inputs are only exchanged at fixed time points. Now, if we
can ensure that the software is always fast enough to conclude the calculations
before the end of the current grid interval, then the timing can be disregarded.
Makki et al. [254] suggest this for a realisation with hardware description lan-
guages, but details are not provided. Another approach is followed by van Zanten
et al. [407] and Adamski et al. [3]. In this the controller core and the mechanics
model — both formulated in the programming language C — are linked together
and simulated jointly in the initial system investigations. The controller software is
thus considered without taking into account the underlying hardware. However, this
simple model of the co-simulation of hardware and software is often not adequate.
The reasons for this are numerous. For example, one reason is the possible influ-
ence of an underlying real-time operating system. Also, the occurrence of further
interrupts — perhaps for communication with other controllers — often frustrates
the use of this variant. Finally, in some cases the aim is for the simulation to
reach the speed limit, for example, in order to construct fast controllers with short
calculation intervals.
Further increases in speed can only be achieved by omitting parts of the model
or by the use of emulation. The latter two options will not be considered further
in the following.
It is often necessary for the development of the electronics for mechatronic
and micromechatronic systems to record the timing between software, electron-
ics and mechanics with a large degree of precision, in order to thereby correctly
evaluate the dynamics between the domains. A good compromise here is a sim-
ulation that reflects the temporal behaviour of the running software with regard
to processor cycles. The consideration of approaches for the cyclically correct
co-simulation of software, electronics and mechanics forms the focal point of this
chapter. In addition to the abstractions already mentioned we must also give some
thought to the realisation of the co-simulation. One possibility is to use a simulator
backplane, see Gasteier and Glesner [112] or Ghosh et al. [118]. By contrast, the
methods represented in Sections 5.2 and 5.3 increasingly point in the direction of a
model transformation on the basis of hardware description languages. Finally, the
method described in Section 5.4 aims at the cyclically correct coupling of software