GOAL modules). Errors: nonconformance to behaviors described by observers. Never-simulated symbols. Process queues overflow (if a stop condition is used, otherwise the number of states for each queue is displayed in the simulation results if define verify_stats true is set). Infinite number of global states (for models small enough to finish the simulation). Other Simulator Features 8.1 TAU SDL SUITE 8.1.1 Writing in the Simulator trace To write a message in the Simulator trace (only if you do not use its graphical interface, i.e. if you launch the executable directly in a DOS or Unix shell), you can call the C function printf. Executing the example shown in Figure 8.1 produces the trace: n = 0 * PROCESS proc1 /*#CODE printf("***n=%d**\n",#(n)); */ Figure 8.1 Calling printf The task starts with two single quotes, to create an informal empty task. Then the C code is placed inside an SDL comment /* */. Note that the SDL variables in the generated code such as n are accessed by the expression #(n). 8.1.2 Calling external C code 8.1.2.1 Introduction You may want to reuse existing C code: for example, in the V.76 SDL model, instead of writing a complex CRC (a kind of checksum) computation in the procedure CRCok, you could call an existing C function. Validation of Communications Systems with SDL: The Art of SDL Simulation and Reachability Analysis. Laurent Doldi © 2003 John Wiley & Sons, Ltd ISBN: 0-470-85286-0 268 Validation of Communications Systems with SDL The Tau SDL Suite Simulator provides several ways to call external C (or C++) code: SDL operators and SDL procedures can be implemented as C functions. The same interfacing mechanisms are provided in the C application generators. By just inserting a .h file into the Tau SDL Suite Organizer, the H2SDL (or CPP2SDL) utility translates the C (or C++) definitions into an SDL package, which can be used in the SDL model. 8.1.2.2 Example of SDL procedure implemented as a C function We will modify our SDL V.76 model to replace the SDL procedure CRCok by the C function CR