Usage of C-Sim for Fault Tolerant System Simulation
The typical application area of C-Sim is functional validation of
distributed, parallel and fault-tolerant systems and programs.
A number of applications using the C-Sim library (version 4.1) has been
created within the scope of EU project FIT.
From this applications the Sine-Wave application has been selected to
demonstrate the posibilities of C-Sim.
The Sine-Wave Application
To understand the Sine-Wave Application (further only SWA) it is necessary to
describe the underlaying architecture. The application is based on a simulation
model of TTP/C protocol (Time Triggered protocol
for SAE class C applications). The protocol is intended for safety critical
applications, it defines a comunication network based on fail-silent nodes that
are connected with replicated channels.
The model of TTP/C provides a process that simulates the behavior of a single
TTP/C node and also a process that simulates one transmission channel. It is possible
to use up to 64 nodes in one TTP/C cluster although the SWA utilizes only four.
Every node in the cluster executes an application program that is implemented also as
a C-Sim process.
What SWA does
The purpose of the application was to make a simple and functional demonstration of
the TTP/C model, so the number of external inputs as well as the number of nodes
is minimal. There are four nodes in the application, labeled G1, G2, F and R. These nodes
are dived into two groups, so called fault tolerant units (FTUs). Every node is attached
to a generator of sine-wave signal (to the same) and the nodes meassure that signal periodicaly,
all at the same time. Later the nodes output the measssured value to an external register.
The output function is dependant on the FTU unit. the first FTU comprises three nodes and so
a voting mochanism is used to ensure that only a majority value is sent to output. The second FTU
is only a single node so the output cannot be checked and is allways written.
The connections between the nodes can be clearly seen on the next picture.
Fig. 1: Screenshot of the Sine-Wave application graphical interface
Visual interface (GUI)
The C-Sim library is written is pure ANSI C with regard to a future posible use with C++ programs.
Due to this fact it is possible to compile C-Sim based simulation models within object oriented
visualisation tools (in this particular case the Borland C++ Builder). The main simulation loop
has been encapsulated as a single thread that can run parallel with the GUI. The essential part
of the model - the definition of processes and data types - remains the same.
Fault injection
The SWA alone is not very usefull. To evaluate the fault tolerant properties of TTP/C a fault
injector has been added. The injector is an independant process that can be used in other simulation
models. The application together with the fault injector is able to evaluate the influence of
random faults that damage memory. In particular it is possible to meassure the recovery speed of
TTP/C nodes under fault injection.
SWA parameters
The application comprises 25 C-Sim processes (5 per node, 2 channels, fault
injector, 2 output monitors). SWA provides exceptional performance (for the
given bus-speed of 2Mbit/sec) - using an 1GHz Athlon processor it is
approximately 3 times faster than a real-time implementation.