Table of Contents Previous Chapter 46 The Cmicro Tester

46 The Cmicro Tester

The Cmicro Tester's intention is, to be a help tool, which can be used to find errors and illegal or unwanted behavior within a target system. It allows the programmer on the host machine to follow and to reproduce the execution flow of the SDL system in the target itself. The Cmicro Tester's strength is the minimum amount of storage it occupies in the target. Except trace of SDL tasks, decisions and procedure calls, there is no implicit dependency like: "The larger the system, the larger the necessary memory amount for the Cmicro Tester". That means, that the memory amount is a compiler specific constant. However, it is possible to reduce the amount of memory by reducing the functionality, if the memory is scarce. In order to use the Cmicro Tester, it is necessary that the system has been developed with the Cmicro Generator (see chapter 44, The Cmicro Generator) and the Cmicro Library (see chapter 45, The Cmicro Library. Furthermore, it is of course necessary that there is some kind of communications link between the host and target. Any kind of communications drivers can easily be connected to the Cmicro Tester system.

Introduction

The Cmicro Tester offers the following features:

The Cmicro Tester should be executed in a distributed fashion, i.e. some parts of the Cmicro Tester run on a host machine, while other parts run together with the Cmicro Kernel and the SDL application on the target machine, for example a micro controller. A prerequisite is a communications link between the host and target systems.

The "non distributed" execution, where the Cmicro Kernel and the Cmicro Tester are executed together on a development system, is not contained per default in this current version.

The both configurations are differentiated from one another, throughout this chapter, by the terms "distributed" and "non distributed".

Using the Cmicro Tester

Prerequisites

The Cmicro Tester is an optional part of the Cmicro Package, and is delivered when specifically ordered. It is an additional part of the Cmicro Library and consists of the following parts:

The host executable sdtmt is an optional part of the Cmicro Tester. sdtmt contains the default configuration for connecting host and target, within which all open interface functionality is utilized.

If the possibilities of the executable sdtmt do not meet the users requirements it is possible to reimplement functions. Therefore, it is possible to subscribe to the host library. The following picture explains the various options available for Cmicro Tester configuration:

Figure 585 : Cmicro Tester configuration possibilities 
-----
(fig)  
       
-----
The target library is mandatory, when the Cmicro Tester is ordered. By using the open interface, it is possible to connect user specific tools to the Cmicro Testers target library. The Cmicro Tester target library must be used together with the Cmicro Library on the target.

Overview

This diagram gives an overview of the Cmicro Tester functionality:

Figure 586 : Functionality of the Cmicro Tester 
-----
(fig)  
       
-----
The following components, as seen from the users' point of view, represent the Cmicro Tester:

The Cmicro Tracer is introduced in the following subsection "Following the Execution Flow - the Cmicro Tracer" on page 2982.

The Cmicro Recorder is introduced following the subsection "Reproduction of Errors - the Cmicro Recorder" on page 2984.

The command and debug interface is introduced in the subsection "Commands for the Host and Debugging Facilities" on page 2986.

The following subsections give an overview of how to use the Cmicro Tester. A detailed description of the necessary preparations and adaptations will be given in the sections:

These sections follow after the introduction subsections.

Following the Execution Flow - the Cmicro Tracer

General

The Cmicro Tracer transmits information about the execution flow of the SDL system on the target. Information traced includes the signals sent and received by processes, the SDL states and symbols entered in execution flow. A filter can be defined so that only partial trace information is created, for particular process instances or for particular SDL constructs. The tracer can be connected with the MSC editor on the host, thus allowing observation of dynamic signal trace between processes on the target.

Tracing SDL events

The following SDL events can be traced

-------------------------------------------------------------------
State             The SDL nextstate operation                        
Input             The SDL input operation                            
Save              The SDL save operation                             
Output            The SDL output operation                           
Create            The SDL create operation                           
Stop              The SDL stop operation                             
Static Create     Used at system start, appears for each statically  
                  created process                                    
Dynamic Create    Used at start of a dynamically created process     
Decision          Trace of SDL action decision                       
Task              Trace of SDL action task                           
Procedure         Trace of SDL procedure call                        
Set               Trace of SDL action: Set timer                     
Reset             Trace of SDL action: Reset timer                   
Signalparams      Used to switch on/off trace of signal parameters   
Implicit con      Trace of SDL implicit transition                   
sumption                                                             
Discard           Trace of SDL discard                               
-------------------------------------------------------------------
For each symbol in each process in the system the trace can be separately switched on or off.

Please consult the subsection "The API on Target" on page 3052 for information about how to set the different options.

Tracing other events

The following system events can be traced

-------------------------------------------------------------
Schedule     Used to trace scheduling events.                  
Error        Used to trace System errors, which are detected   
             either within the generated code, within the Cmi  
             cro Kernel, or within the Cmicro Tester.          
Showprio     Used to trace the event, when the scheduling      
             changes to a higher, or a lower priority level.   
-------------------------------------------------------------
Each system event can be separately switched on or off.

Please consult the subsection "The API on Target" on page 3052 for information about how to set the different options.

Display of Traces in the MSC Editor

By using the Cmicro Tester either with the sdtmt executable or the host library, it is possible to create traces on the MSC editor. Mainly two modes are of interest:

The first possibility, however, only makes sense if the processor has enough time to handle and display all the traces created during the runtime of the SDL system. That may also be a question of buffer dimensioning. On the other hand, there might be SDL systems, which do not have these timing constraints, for example, the SDL system may wait, until the MSC trace is completed.

The second possibility doesn't need that much processor power on the host side. In practice, this method is more useful.

The method to store information about an SDL execution, which gives the best real-time properties, is of course the one with the Cmicro Recorder. In comparison to the trace, the Cmicro Recorder stores only a reduced subset of information, in a compact format.

Reproduction of Errors - the Cmicro Recorder

General

Using the Cmicro Recorder, you can "record" the actions taken within an SDL system running on the target and save these to a file on the host machine. This file can later be "played" in order to run the system through the same state changes, so that the same actions are performed. In this way error situations, perhaps recorded by a client or a developer at another location, can be reproduced. In the following, a general description is given. A more detailed description of the internal procedures can be found in the subsection ""Type and Amount of Stored Information" on page 3098". The subsection ""General Restrictions on Record and Play" on page 3102"may also give you more information about how it works.

Recording an SDL Session

Using the Cmicro Recorder makes sense whenever an SDL system is executed in realtime on the target in combination with a host.

The amount of information transferred via the communications link and stored into a file on the hard disk is kept small and compact, so that the realtime properties are not influenced. Only information is stored, which is necessary in order to replay an SDL session later. It is the communication of the environment to the SDL system, and the expiry of timers, which is recorded.

---------------------------------------------------------------------
Caution!                                                               
The realtime properties, and in that way the behavior of the SDL       
system may be affected when recording. You have to ensure, that        
there is enough time to process the functions of the Cmicro Record     
er, and to transfer all the information via the communications link.   
In general, it is a good idea to use a high performance communica      
tions link with a large transmit buffer and a host machine, which is   
able to handle all recorded events at any time during the SDL exe      
cution. Please see the different self explanatory error messages in    
order to receive information about what happens in possible error      
cases.                                                                 
---------------------------------------------------------------------
It is not possible to receive information about the inner events of the recorded SDL system, by using the recorder only. The purpose of the Cmicro Recorder has nothing to do with the purpose of the Cmicro Tracer. You have to use the Cmicro Tracer additionally if you want to get information about inner events. Additional information is then transmitted via the communications link and stored into the file, which can be displayed dynamically or later when reading the file. It turned out to be difficult to get a realtime trace regarding the performance of the communications link. The more information traced via the link, the higher the performance should be.

The record mode must be switched on within the target (by using the C function interface on target), and on the host (by using an appropriate option flag - see subsection "Invoking sdtmt from the Command Line" on page 2993).

Replaying an SDL Session

After producing a file with the record mode, this file can be replayed in order to run the SDL system through the same system states.

When the end of file is reached and indicated with <Play mode off> to the target, the SDL system is able to react on ordinary environment signals coming from the real environment (if programmed by the user).

The play mode must be switched on within the target (by using the C function interface on target), and on the host (by using an appropriate option flag - see subsection "Invoking sdtmt from the Command Line" on page 2993). No environment signals may be handled by the user in the C function xInEnv during the play.

Reaching the Erroneous System State

Sometimes, when a file is replayed, the erroneous situation can directly be viewed on another device, i.e. if the SDL system runs in an emulator with breakpoints set, or if there is, for instance, an LC- display connected to the SDL environment.

In this case, it is not necessary to do a file compare. In other cases, it might be of interest to do a file compare as described later.

Comparing the Results

A comparison of two executions is possible, when two files containing the same type and amount of information are compared.

The procedure to do this is:

UNIX diff shows the differences between the two files by applying a re-synchronization.

Commands for the Host and Debugging Facilities

The command interface and the debugging facilities are very helpful in finding errors produced within the target.

For instance, after an SDL interpretation error occurred, it is possible to suspend the SDL system and to inspect the global state by viewing the process queues. The Cmicro Library uses - per default - a fixed upper limit of entries in the SDL queue. A peak hold can be asked for on host side. That allows it to dimension the queue. The correct processing of timers can be checked by a few commands.

The ability to set breakpoints during realtime execution and to execute a single step also helps to find an error situation.

The amount of trace information can dynamically be defined via commands. A differentiation is made between the information on the communications link and the information displayed.

The Cmicro Tester Host Executable-sdtmt

Introduction

One part of the Cmicro Tester is sdtmt, which integrates the functions of the Cmicro Tracer, the Cmicro Recorder and the command/debug interface in one tool.

sdtmt is the tool, which allows to communication with the target via a communications interface, to read/write files, display information on the screen and/or the MSC-editor. It allows trace of SDL and system events, to record events and to replay them later in order to reproduce error situations.

sdtmt features:

It is important to know how sdtmt works independently from the target. The machine to machine communication is built automatically when the communication between these is started. Thus, sdtmt doesn't need to be rebuilt when changing the target hardware! Only some minor cases force a rebuild, for instance, if the type definitions, used by the Cmicro Tracer, are basically changed in the target.

The user interface of sdtmt is described in the subsections of the manual.

Generating sdtmt

In order to generate sdtmt, no SDL to C code generation is necessary. The information used by sdtmt is read in from a file, which the Cmicro Generator creates during C code generation.

The following exceptions force a rebuild of sdtmt:

The last reason forces a rebuild whenever a new target is generated (target and host have to be generated together).

Executing sdtmt

The normal method to use sdtmt is to connect a host with a target machine. A communication link implemented by the user must exist between host and target. The target can be seen as a remote system, where sdtmt running on the host machine can be considered as a controlling unit. The following picture shows this possibility:

Figure 587 : sdtmt used for target control 
-----
(fig)  
       
-----
Another way to use sdtmt is to use it as a pure conversion tool. That is of interest, if a binary file has been written during earlier sessions with the target. The following picture explains sdtmt as a conversion tool:

Figure 588 : sdtmt used for file conversion 
-----
(fig)  
       
-----
Furthermore, if the user implements it in the host library, sdtmt can be used to simulate the SDL environment. However, no SDL environment is delivered with the Cmicro Tester, except utility functions to encode and decode messages sent via the data link.

Preparing the Host to Target Communication

After implementing the parts in the target, which are necessary to have a communication between host and target possible, the appropriate device on the host side is to be selected. This can be done in the file named

sdtmt.opt.
The default communications link of sdtmt

There is a V.24 interface implemented to transfer data between target and sdtmt.

Communication on UNIX Systems

The file sdtmt.opt should carry the following entries in order to configure the V.24 device:

V24_DEVICE      /dev/<ttydevicename>
Please ask your UNIX system administrator for the appropriate <ttydevicename> and its installation. It might be ttya or ttyb.

Then select the appropriate baud rate by specifying

BAUDRATE    19200
in the file sdtmt.opt. 19200 Baud is the default baud rate.

Communication on Microsoft MS-DOS / Microsoft Windows Systems

The file sdtmt.opt should carry one of the following entries in order to configure the V.24 device:

V24_DEVICE      com1
or

V24_DEVICE      com2
Please select the appropriate baud rate by specifying:

BAUDRATE 19200
in the file sdtmt.opt. 19200 Baud is the default baudrate.

Configuration Possibilities of sdtmt (sdtmt.opt)

If sdtmt is invoked, it searches for the configuration file named "sdtmt.opt". This file is always mandatory. It contains information about options of the target system like:

This file needs to be updated, if another target system is connected (e.g. for an MSP 58 C 80, the value for SIZEOF_CHAR is to be set to 2, whereas it is set to 1 for most other systems), or if some options of the Cmicro Library are modified (i.e. if the type definition for signal IDs, named xmk_T_SIGNAL within the Cmicro Library is changed from char to int).

Example 362 : sdtmt.opt   
SIZEOF_CHAR        1
xPID               2 /* 1 for char, 2 for 2oct-int*/
xmk_T_STATE        1
xmk_T_SIGNAL       1
xmk_T_PRIO         1
xmk_T_TIME         4 /* if long value            */
xmk_T_MESS_LENGTH  1 /* coding of message length */
XSTARTUP         255 /* internal kernel values   */
XDORMANT         252
XDASHSTATE       254
XCREATION        250
V24_DEVICE       /dev/ttya /* V24 for UNIX       */
BAUDRATE         19200     /* Baudrate for V.24  */
  

Setting the Environment of sdtmt

An environment is to be set for sdtmt as following.

The environment variable SDTMT_DIR refers to the directory, where sdtmt assumes to find the following files:

Under UNIX cshell csh, you can specify as an example:

setenv SDTMT_DIR ./
Under UNIX sh, you can specify for example:

SDTMT_DIR=./
Under MS-DOS or MS-Windows, you can specify as an example:

set SDTMT_DIR .\
In that case sdtmt assumes the above files are located under the directory where sdtmt has been started from.

If no environment variable was specified, then the tool reacts with the following message

Unable to find environment in SDTMT_DIR
after its invocation.

Invoking sdtmt from the Command Line

The tool must always be invoked with some appropriate options, which set it into the right mode. With no options specified sdtmt serves with a message, which explains the use. Users must pay attention to the correct syntax of the options. The options are explained in the following subsection.

Also, an environment should be set for sdtmt, as described in the previous subsection.

Syntax of sdtmt Command Line Options

The command line options of sdtmt are - in general - conform to UNIX getopt. Each option is entered by a single character, and is preceded by a minus character. There must be no space or any character between the minus sign and the character defining the option. If options are entered separately, they have to be separated with white spaces. If an option carries a parameter (for example, the -o option carries a filename as its parameter), there must be a white space between option and parameter, too. Generally, options without parameters may be entered all at once. The last option may carry a parameter, for example:

sdtmt -Idqo <outfile>.
Combinations of options are allowed, of course. A list of forbidden and allowed combinations is given in the subsection "List of Possible Options" on page 2999.

Invoking sdtmt with Different Options

Getting a Target Trace

In order to get a target trace, the target must be built with the facilities, which sdtmt needs to perform the trace. To get a first trace, enter:

sdtmt -d
That will be enough to route the traces, which are generated within the target to the screen. To write the trace to a binary file enter:

sdtmt -do <outfile>

Using the Cmicro Recorder

Using the Cmicro Recorder there is a distinction between record and play mode. Sdtmt cannot be invoked in both modes simultaneously. When changing from one mode to another, the following is to be considered:

------------------------------------------------------------------
Note:                                                               
sdtmt must be exited (for instance, by typing CTRL-Q or CTRL-D in   
any case), before a new mode can be entered.                        
------------------------------------------------------------------
Beginning with a record session the target system is to be reset (assuming it is compiled and linked appropriately with the Cmicro Recorder facility, and that the target is configured to the record mode). The host command could look like:

sdtmt -dro <outfile>
The -r stands for record.

If the information received suffices (following the trace on the screen, or at external devices connected to the target, if it has some), the record mode can be left by, for example CTRL-D. Sdtmt will prompt with:

Leaving SDT Cmicro Tester. Bye bye.
and then exit. There now exists a file named <outfile>, which contains the trace information generated by the target.

Replaying the previously recorded session the target should be reset and configured to the play mode.

The command line for sdtmt could be:

sdtmt -dpi <infile>
The -p above stands for play, the -i for input file. The input file to be specified, must be the filename of <outfile> of the previous record session.

Sdtmt now begins to replay the events stored in <infile>, event by event in synchronization with the target. This means each environment signal is sent via the communications link to the SDL system, where it is put into the process input queue and worked on. When the target requests the next environment signal, sdtmt sends it. Reaching the end of the file <infile>, sdtmt displays this message using stdout (which might be scrolled through very fast when a trace is running):

No more recorded events. Type CTRL-D after all 
remaining traces have been received.
The play mode is now left in the target and the user has to decide what to do.

It should be possible from now on to use the real environment again, which is connected to the target on hardware level (of course, functions have to be provided and initialized like ISR drivers). Further traces can be seen on host side when environment signals are sent to the SDL system using the real environment.

Possibly, the target shows the erroneous situation, which the user wanted to examine. From now on, traces can be inspected which have been created on the hard disk, or a hardware debugger can be used to inspect illegal behavior. This process of replaying the session repeatable as often as the user wants to. In this way erroneous system behavior is reproducible up to solving the problem.

Furthermore, the recorded file may be compared with a replayed one in order to validate correct system behavior in different sessions, specifying:

sdtmt -dpi <infile> -o<outfile>
After having two files, for instance record.dat and play.dat, they may be routed to a simple UNIX script, or to any tool which allows a comparison between two files. The following sequence of commands give an example:

Example 363   
sdtmt -i record.dat -s <symbolfile> > record.asc
sdtmt -i play.dat -s <symbolfile> > play.asc
sdiff record.asc play.asc | pg
  
Of course, all UNIX or MS-DOS commands can be used to process the output files record.asc and play.asc.

Replaying a Recorded Session in Simulated Real Time

Specifying - in play mode - the -R option on the command line, like

sdtmt -dpRi <infile> -o <outfile>
lets sdtmt replay the SDL environment events at the same absolute time values, as they occurred during the record session.

To do this, a time stamp is stored for each environment signal, which is compared within the target with the current value of SDL now. SDL now-and the time stamps in the signals are calculated with time value zero from target reset on.

The processing power of host and target together must be large enough to handle that. As a rule of thumb, the recorded environment signals may not be sent to the SDL system more often than one per a few hundred microseconds. This too depends on the communications link in use.

Using the Debug Interface

The interactive mode of sdtmt can be invoked by using the option -I:

sdtmt -dIo <outfile>
where -d and -o <outfile> are of course optional. It is now possible, to enter the commands which are listed in the section sdtmt commands below examining the system (for an error,..).

Writing a File on the Hard Disk

As mentioned earlier, the -o option can be used to create a file on the hard disk or any other device type. For instance:

sdtmt -o <outfile>
leads sdtmt to a conversion mode, where all messages which are received on the communications link, concerning the Cmicro Tester, are stored as received into the outfile.

---------------------------------------------------------------------
Caution!                                                               
The specified file will be overwritten, if it already exists. No warn  
ing message will be displayed.                                         
---------------------------------------------------------------------
The trace session can be left by typing CTRL-D. The outfile will be closed and can later be viewed as documented in the next subsection.

Reading and Converting a File Stored on Hard Disk

The outfile, which was previously written with the -o option, can be converted and be viewed on the screen, entering:

sdtmt -i <infile>
If infile contains more than one page information, the output of sdtmt should be made page by page. To do this and to display information using the outfile the user can enter:

sdtmt -s <symbolfile> -i <infile> | pg
if pg exists on the machine in use. Another possible type of pager is more:

sdtmt -s <symbolfile> -i <infile> | more
or, storing that information in a file:

sdtmt -s <symbolfile> -i <infile> > <asciifile>

General use of the MSC editor

The MSC editor can be used in several ways. In any case, it is activated during the invocation of sdtmt, with the -m option. On any workstation, enter

sdtmt -s <symbolfile> -m <diagramname>
where diagram name is any name. This name will be displayed on top of each MSC editor page.

Per default, sdtmt together with the MSC editor creates non Z.120 standard traces. These traces can be used to find out errors and to get more information about the inner behavior of SDL processes.

It is - as described subsequently - possible to generate an MSC diagram during the SDL execution, and later, after the trace information has been stored in a specified file.

Non Z.120 Standard Trace and Z.120 Standard Trace

sdtmt performs a non Z.120 standard trace per default. By entering:

sdtmt -s <symbolfile> -m <diagramname>
it produces a non Z.120 standard trace. An MSC editor will be activated on condition that at least the SDT postmaster is up and running. The internal actions executed in SDL processes (Task, Decision and Procedure call), are displayed as MSC actions within the diagram. If there is any error detected in the system, it will be displayed as an MSC action statement on another instance axes, named "Kernel" on the right side of the diagram.

By specifying the -Z 120 flag, the MSC trace created is conform to the Z.120 standard:

sdtmt -s <symbolfile> -m <diagramname> -Z 120
In exceptional cases, when an error occurs, the kernel instance axes mentioned above is displayed with an appropriate error message.

Trace During an SDL Execution by Using the MSC Editor

sdtmt will connect automatically to the target, and will write an MSC trace:

sdtmt -s <symbolfile> -m <diagramname>

Creating an MSCEeditor Trace from a File on Hard Disk

Providing, that an sdtmt binary file exists (on the hard disk) it can easily be converted and displayed using

sdtmt -s <symbolfile> -i <filename -m diagramname

Specifying a Symbol File

If sdtmt is invoked without any symbol file, there are a few restrictions. Parameters, which can be typed in for commands, cannot be checked. That may cause fatal errors within the target, if there is no local error check compiled. Moreover some commands cannot be entered, because sdtmt essentially needs some information from the symbol file. That is valid for the command? All-Processes. Furthermore, the trace output on the screen will come with decimal and hexadecimal values instead of symbolic values.

As a general recommendation a symbol file should always be specified. The symbol file is automatically generated by the Cmicro Generator. Thus, the user just has to add the symbol file whenever invoking sdtmt:

...... -s symbolfile ......
-----------------------------------------------------------------------
Caution!                                                                 
Since the symbol file is updated whenever code generation takes          
place, it is important to use the most recent version of this file. Oth  
erwise, the interpretation of binary data and therefore the results of   
the trace will be wrong!                                                 
-----------------------------------------------------------------------

Some Extra Options

A complete list of other sdtmt possibilities to work with is given with the following table.

List of Possible Options

The following options are possible with sdtmt. Users should consider that options may have dependencies to others. The exceptions are listed following the option list and the lists with examples.

-------------------------------------------------------------------
Option          Meaning                                              
-------------------------------------------------------------------
-h              Get a detailed help                                  
-I              Use the interactive mode with command inter          
                preter / debug interface                             
-i inputfile    Specify file to read from                            
-o outputfile   Specify file to write into                           
-s file         Specify file containing symbols to read. If a        
                symbol file is neither specified nor can be found,   
                no display of symbolic information is possible.      
-d              Route traces also to screen                          
-m diagramname  Trace on MSC editor. The diagram name will be        
                shown within the MSC editor and is used as a         
                filename to store MSC informations, too.             
-z 120          The trace on the MSC editor is be conform to         
                Z.120.                                               
-P              Do not show signal parameters on screen / on         
                MSC editor.                                          
-S              Single step for each event                           
-D nnn          Delay each environment signal for nnn seconds        
                when replaying with Cmicro Recorder                  
-q              Do work quiet                                        
-r              Record an SDL session into <outfile>           
-p              Replay a previously recorded SDL session from        
                the file specified with -i <infile>            
-R              Realtime simulation for Cmicro Recorders play        
                mode.                                                
-------------------------------------------------------------------
Examples for Cmicro Tracer

-------------------------------------------------------------------------
sdtmt invocation                  Meaning                                  
-------------------------------------------------------------------------
sdtmt -h                          Detailed usage                           
sdtmt -d                          V.24 -> Screen                        
sdtmt -m name                     V.24 -> MSC Editor                    
sdtmt -o <outfile>          V.24 -> File                          
sdtmt -o <outfile> -d       V.24 -> File and screen               
sdtmt -o <outfile> -m name  V.24 -> File and MSC editor           
sdtmt -o <outfile> -d -m    V.24. -> File, Screen and MSC editor  
name                                                                       
sdtmt -i <infile>           File -> Screen                        
sdtmt -i <infile> -m name   File -> MSC editor                    
sdtmt -di <infile> -m name  File -> Screen and MSC editor         
-------------------------------------------------------------------------
Examples for Cmicro Recorder

-------------------------------------------------------------------------
sdtmt invocation                    Meaning                                
-------------------------------------------------------------------------
sdtmt -ro <outfile>           record a session into <outfile>  
sdtmt -pi <infile>            replay a session from <infile>   
-------------------------------------------------------------------------
Exceptions in the use of options

----------------------------------------------------------------
Combination  Exception                                            
----------------------------------------------------------------
-r and -p    These options must not be specified together.        
-R and -D    These options must not be specified together.        
-d and -m    These options write to slow devices. This affects    
             the realtime properties of the communications        
             interface and therefore the target under test. The   
             faster mechanism is to write into a file, and to     
             display it later.                                    
----------------------------------------------------------------

sdtmt - prompt

sdtmt is quiet in most cases. Invoked with the built in command interpreter (using -I option flag), there will be some different prompts.

Not using the Cmicro Recorder, the command line will appear like:

0/Enter Command>
The number in front of the "/" character represents a current counter, which counts the traces of all SDL or system events received by sdtmt. That is useful when writing into a file only to keep the realtime properties. Whenever CR is entered the counter value is updated to enable the user to observe the trace in progress.

Using the Cmicro Recorder, the command line will appear like:

Figure 589 : Prompt at command line 
-----
(fig)  
       
-----
The first number in front of the "/" character again represents the current trace counter value.

The second number between the two "/" characters represents the recorder counter value used for the Cmicro Recorder.

If sdtmt is in record mode the recorder counter value represents the amount of signals which have been recorded at the environment to SDL interface. In this case, the counter value is updated continuously by the target.

If sdtmt is in play mode, then the recorder counter value represents the amount of signals at the environment to SDL interface, which have already been read and sent to the target. In this case, the counter value is updated by sdtmt.

The use of these counters is obvious: The amount of recorded signals during record can be compared with the amount of replayed signals during replay.

Leaving sdtmt

Sdtmt must be exited to use another program on the same command shell, or to alter to another mode of the tool. There are a few possibilities to exit sdtmt. The risk of losing information may exist. A problem may arise from exiting sdtmt before all trace information remaining in the receiver buffer have been displayed or stored.

Interactive sdtmt Commands

----------------------------------------------------------
                                                            
----------------------------------------------------------
CTRL-D  Unconditionally exit sdtmt. The opened files will   
        be closed and the communications link will be       
        disabled correctly.                                 
CTRL-Q  Same as CTRL-D                                      
CTRL-C  This is the hard form of ending sdtmt, which is     
        detected in more cases than the other exit com      
        mands. The signal is caught and the same            
        actions as with CTRL-D apply.                       
EXIT    This is the exit command of the interactive mode    
        of sdtmt.                                           
QUIT    Same as exit command                                
----------------------------------------------------------
One possibility to use sdtmt is to start it with the built in command interpreter by using the option switch -I. sdtmt will enter the interactive mode. The commands listed are available in interactive mode only.

The serial communications interface may be implemented faulty on target side. Some commands are implemented to help in debugging this. Please consult the subsection concerning the communications link, which can be found later, in order to get the details.

Syntax of sdtmt Commands

Command Names

Command names are entered character by character on the keyboard. Each command consists of ASCII characters, terminated by carriage return. A command is interpreted, after the carriage return was given. Commands may have parameters. Command names may be abbreviated by giving sufficient characters to distinguish it from other command names. The command names are interpreted from left to right. There is no distinction between upper and lower case letters.

Consider, as an example, the command ?breaklist. The command may be entered as ?b. However, if only ? is typed, sdtmt will respond with the error message

Command was ambigous
since the command cannot be distinguished from, for example the ?queue command.

Parameters

A parameter is separated from the command name by one or several spaces. The same is applicable to the separation of two parameters. There is no distinction between upper and lower case letters.

Each parameter is mandatory from a syntactical point of view and must be specified. No parameters may be left out.

If the parameter list following a command name is not complete, sdtmt responds with the error message

**ERR:Missing parameters at end of command.
Specifying more parameters than the command can handle, sdtmt prompts

**ERR:Extra parameters specified in command.
If the type of any parameter, which was entered, doesn't match the expected one, then sdtmt responds with an appropriate error message according to the expected type. Type

help commandname
or see the manual again.

Abbreviation of SDL Names

Command parameters that are SDL names, may also be abbreviated, as long as the abbreviation is unique. If a name is equal to the first part of another name, as for example Wait and Wait_For_Me, then any abbreviation of Wait is ambiguous. However, if all characters of the shorter name are given (Wait in this example), this is considered as an exact match and the short name will be selected.

Errors in Commands

If an error is detected in a command name or in one of its parameters, an appropriate, self explanatory error message is displayed on the screen. The command will be ignored.

Input and Output of Data Types

<Processtype:Instance>

Process type is an ASCII string identifying the SDL name of the process. Process names must be unique for all processes within the system. It is also possible to use the decimal value of the process type. The decimal value can be retrieved by looking into the symbol file, which is also automatically generated.

":"

This is the separator for process type and instance, and it must be specified, where an instance number must be given.

Instance

The value of the instance number is a decimal value beginning from 0 for the first instance of a process type. If the SDL System contains only (x, 1) declarations on SDL level, then you have to specify "0" in any case.

-----------------------------------------------------------------------
Note:                                                                    
There is a difference between the notation in the simulator and in the   
Cmicro Tester concerning instance numbering. The simulator al            
ways uses the value one as the first instance number whereas the         
Cmicro Tester begins numbering these at zero!                            
-----------------------------------------------------------------------
--------------------------------------------------------------------
Caution!                                                              
If no symbol file was specified, then neither process type nor In     
stance is checked within sdtmt! If the target is compiled without er  
ror checks, that might lead to an fatal error in the target system.   
--------------------------------------------------------------------

Symbols

Symbols are read in from a file called <systemname>.sym. There are a lot of error checks within sdtmt, which only work, if a symbol file has been specified (with the -s option) invoking sdtmt. As a general recommendation the symbol file should always be specified.

Help

Sdtmt serves the user with a quick help when entering:

Enter Command>help
A complete list of commands will be displayed on the screen. Commands, which are available in the current mode of sdtmt, are marked with an asterisk. Entering a command, which is not available in the current context sdtmt responds with:

Sorry. The current mode of sdtmt doesn't allow you to 
enter that command. 
The command has been ignored.
To get a short explanation, type:

Enter Command>help <commandname>
for instance type:

help help
To get a complete list of commands, type:

Enter Command>help *

sdtmt commands

General Commands

-------------------------------------------------------------
Command       Exit / Ex                                        
                                                               
  Parameters    (None)                                         
                                                               
Type          Local                                            
Description   The session will be terminated normally and      
              sdtmt will be exited. All opened files will be   
              closed. The communications interface is dis      
              abled. It is the same command as Quit.           
                                                               
-------------------------------------------------------------
--------------------------------------------------------------
Command       Help / He                                         
  Parameters    [<commandname>,*]                         
Type          Local                                             
Description   A complete list of commands will be displayed     
              on the screen. Commands available in the cur      
              rent mode of sdtmt are marked with an asterisk.   
--------------------------------------------------------------
Example 364   :
Entering the name of a command not being available in the current context sdtmt responds with

Sorry. The current mode of sdtmt doesn't allow you to 
enter that command.
The command has been ignored.
  
Example 365   
Type

Enter Command>help <commandname> , 
to get a short explanation of one or several commands, e.g.

help help
which is the same as

he he
  
Example 366     
A list of all commands beginning with b can be requested by typing:

help b
A complete list of commands can be requested by typing:

help *  
      
-------------------------------------------------------------
Command       History / Hi                                     
  Parameters    (None)                                         
Type          Local                                            
Description   Print out a command history and allow to reuse   
              commands given earlier by entering !number or    
              !!.                                              
              The command history behaves like the UNIX c-     
              shell.                                           
-------------------------------------------------------------
------------------------------------------------------------
Command       !                                               
  Parameters    <command-number>                        
Type          Local                                           
Description   By entering this command, you can reuse a pre   
              vious command which you typed in. First get a   
              history with the History command.               
------------------------------------------------------------
-----------------------------------------------------------
Command       !!                                             
  Parameters    (None)                                       
Type          Local                                          
Description   The last command in the command history will   
              be reused.                                     
-----------------------------------------------------------
---------------------------------------------------------
Command       Quit / Q                                     
  Parameters    (None)                                     
Type          Local                                        
Description   This is the same command as EXIT, but with   
              another name only.                           
---------------------------------------------------------
-----------------------------------------------------------------
Command       Any UNIX-command / MSDOS-command                     
  Parameters  As defined for UNIX / MSDOS-command                  
Type          Local                                                
 Description  Any command sdtmt cannot recognize, will be          
              taken as a system call and routed to the operating   
              system (UNIX / MS-DOS).                              
-----------------------------------------------------------------
Example 367
After getting the prompt, enter:

Enter command>ls -lsa     (for UNIX)
or

Enter command>dir       (for MS-DOS)
  
That will work just like calling the command directly from the OS shell. The command is useful in order to perform an ls or dir, to see, whether the output files are really written by sdtmt or not.

Please consider, that during the time, the OS command is executed, sdtmt is not active. If traces are to be received from the target, they may fail.

--------------------------------------------------------------------
Caution!                                                              
Do not enter silly commands here, for instance, do not call sdtmt re  
cursively. That will cause improper operation!                        
--------------------------------------------------------------------

Trace Commands

----------------------------------------------------------------
Command       ?Tracebuffer / ?Tr                                  
  Parameters    (None)                                            
Type          Remote                                              
Description   The target trace buffer can be asked for and will   
              be displayed by this command.                       
----------------------------------------------------------------
------------------------------------------
Note:                                       
This command is currently not implemented.  
------------------------------------------
----------------------------------------------------------
Command       Tr-Detail / Tr-D                              
  Parameters  level, where 0 <= level <= N.           
                                                            
Type          Local                                         
Description   Define Trace detail. The command is applied   
              locally within sdtmt and it works on stdout   
              traces only.                                  
----------------------------------------------------------
Both, output to a file and output to the MSC editor will not be affected by this command, thus, if the target is configured correctly, no inconsistency can occur, and no information stored in a file or on the MSC editor is incomplete.

We defined 5 levels. The higher the level, the more SDL events are traced. The different events are assigned to levels as depicted in the following table:

---------------------------------------------
Trace subject         L.1  L.2  L.3  L.4  L.5  
---------------------------------------------
PRINT STRING          *    *    *    *    *    
TASK                  -    -    -    -    *    
DECISION              -    -    -    -    *    
PROCEDURE             -    -    -    -    *    
SET                   -    -    -    *    *    
RESET                 -    -    -    *    *    
ACTUAL RESET          -    -    -    -    -    
STOP                  -    -    -    *    *    
STATE                 -    *    *    *    *    
STATIC CREATE         -    -    -    *    *    
DYNAMIC CREATE        -    -    -    *    *    
CREATE                -    -    -    *    *    
SAVE                  *    *    *    *    *    
TIMER                 *    *    *    *    *    
INPUT                 *    *    *    *    *    
OUTPUT                -    -    *    *    *    
DISCARD               *    *    *    *    *    
IMPLICIT CONSUMPTION  *    *    *    *    *    
---------------------------------------------
----------------------------------------------------------------
Command       Tr-off                                              
  Parameters    (None)                                            
Type           Remote                                             
Description   The command switches the Cmicro Tracer off          
              within the target. The current option settings      
              stored in the target will not be affected. After    
              this command is received within the target, the     
              trace immediately is suspended and can only be      
              resumed with the command Tr-on. The output          
              trace, that has been written, is interrupted.       
              Consider misinterpretation of the trace because     
              of missing traces after resuming the trace via Tr-  
              on.                                                 
----------------------------------------------------------------
-----------------------------------------------------------------
Command       Tr-on                                                
  Parameters    (None)                                             
Type           Remote                                              
Description   This command switches the Cmicro Tracer on, if       
              it is compiled within the target. All the current    
              option settings concerning trace within the target   
              will not be affected.                                
-----------------------------------------------------------------
-------------------------------------------------------------------
Command       Tr-Process / Tr-Pr                                     
  Parameters     <Process name> <Bitmask>or              
              ENV <Bitmask> or                                 
              * <Bitmask>                                      
Type           Remote                                                
Description   This command defines the trace for one or all          
              processes in the system. It is applied in the target   
              (remote command), so that the traffic load on the      
              communications interface can be reduced inter          
              actively.                                              
              This trace command works for all instances of          
              the given process type. No differentiation is pos      
              sible between different instances of one type.         
-------------------------------------------------------------------
-----------------------------------------------------------------
Command       Tr-Signal / Tr-S                                     
  Parameters    <Signal name> <flag> or                
              * <flag>                                       
Type           Remote                                              
Description   This command defines the trace for one or all        
              signals in the system. It is applied in the target   
              (remote command), so that the communications         
              interface's traffic load can be reduced interac      
              tively.                                              
              The signal name is the one from the SDL sys          
              tem. No qualifiers are possible, which means,        
              that signal names have to be unique for the          
              whole SDL system. The flag may be 0 (trace off)      
              or any other value (trace on). If an asterisk is     
              specified for signal name, then flag is applied to   
              all signal types. The command works for SDL          
              output only.                                         
-----------------------------------------------------------------

Recorder Commands

-----------------------------------------------------------------
Command       Rec-off                                              
  Parameters  (None)                                               
Type          Remote                                               
Description   Switches the Cmicro Recorder off. This com           
              mand may be specified any time during a record       
              ing session. It can be used in order to reduce the   
              amount of information sent via the communica         
              tions interface.                                     
-----------------------------------------------------------------
---------------------------------------------------------------
Command       Rec-on                                             
  Parameters    (None)                                           
Type           Remote                                            
Description   Switch Cmicro Recorder to record mode. It is       
              not a good idea to enter that command, when the    
              SDL system is currently processing transitions,    
              and is not idle. Furthermore, the question is,     
              whether it makes sense to start a record session   
              in the middle of an SDL execution or from the      
              startup of the SDL system.                         
---------------------------------------------------------------
---------------------------------------------------------------
Command       Rec-play                                           
  Parameters    (None)                                           
Type           Remote                                            
Description   The Cmicro Recorder's play mode will be set.       
              This command can be entered in a few states of     
              the Cmicro Kernel only. A negative confirmation    
              is displayed if necessary. The same explanations   
              as for Rec-on apply.                               
---------------------------------------------------------------

Message Sequence Charts Commands

In this implementation of sdtmt, it is possible to use the -m and the -z option on the command line, in order to get MSC diagram traces. No special command is implemented to change the MSC trace within the sdtmt session.

Execute Commands

---------------------------------------------------------------------
Command       Continue / Co                                            
  Parameters    (None)                                                 
Type          Remote                                                   
Description   This command can be used to continue process             
              ing, i.e. after a breakpoint was hit, or if the single   
              step mode is active. A negative confirmation is          
              printed out, when the command cannot be pro              
              cessed within the target system.                         
---------------------------------------------------------------------
------------------------------------------------------------------
Command       Next-Step / Next-St                                   
  Parameters    (None)                                              
Type          Remote                                                
Description   This command performs one step, if single step        
              is active, or if a breakpoint was encountered.        
              The Single-Step command must be given previ           
              ously, if neither single step is active, nor a break  
              point was hit.                                        
------------------------------------------------------------------
---------------------------------------------------------------
Command       Shutdown / Sh                                      
  Parameters    (None)                                           
Type          Remote                                             
Description   The command tries to shutdown the system,          
              which means normally to exit the main program.     
              The user can define the actions on exit within     
              the target. The same explanations as for the rein  
              itialization command apply.                        
---------------------------------------------------------------
-------------------------------------------------------------
Command        Single-Step / Si                                
  Parameters    (None)                                         
Type          Remote                                           
Description   This command switches the single step mode on.   
              Either Next-Step or Continue may follow.         
-------------------------------------------------------------
------------------------------------------------------------------
Note:                                                               
Timers are checked normally during single step and may expire, as   
documented for the Disable-Timer and Enable-Timer commands. It      
might be better to disable the timers (with Disable-Timer) before   
going into single step.                                             
------------------------------------------------------------------
-----------------------------------------------------------------
Command        Suspend                                             
  Parameters    (None)                                             
Type          Remote                                               
Description   Disable Cmicro Kernel from scheduling. The           
              transition currently running will not be affected    
              and will be ended first, before the command is       
              accepted. The suspended SDL system cannot            
              process any signals, neither internal signals, nor   
              signals coming from the environment. This may        
              lead to a queue overflow. It is recommended to       
              disable the timers to prevent this.                  
-----------------------------------------------------------------

View Commands

----------------------------------------------------------------
Command        ?All-Processes / ?A                                
  Parameters    (None)                                            
Type          Remote                                              
Description   The states of all process instances in the system   
              will be displayed on the screen. It is imple        
              mented as a procedure, which is controlled by       
              sdtmt. Depending on the traffic load on the com     
              munications interface the responses may be          
              delayed.                                            
----------------------------------------------------------------
-------------------------------------------------------------------
Caution!                                                             
The results printed on screen may be inconsistent. That depends on   
what the SDL system is doing during the query procedure. The re      
sults will be correct, however, if the whole SDL system is idle.     
-------------------------------------------------------------------
-----------------------------------------------------------------
Command        ?Errors / ?E                                        
  Parameters    (None)                                             
Type          Remote                                               
Description   Query last occurred error.                           
              The target system traces the last error within the   
              SDL execution and stores it. The result will be      
              displayed on the screen, both as a decimal value,    
              and as ASCII text with an explanation of the         
              error situation.                                     
              Especially, when the SDL system is executed for      
              the first time in a new hardware environment, the    
              command may help in finding problems. In addi        
              tion, after a long execution of the SDL system       
              any error situation arising may be detected. All     
              the errors, warnings and information, which are      
              handled by the ErrorHandler can be asked             
              (please see the explanations in the subsection       
              "User defined Actions for System Errors - the        
              ErrorHandler ()" on page 2769 in chapter 45,         
              The Cmicro Library).                                 
-----------------------------------------------------------------
-----------------------------------------------------------------
Command        ?Timer-Table / ?Ti                                  
  Parameters    (None)                                             
Type          Remote                                               
Description   Some characteristics of the current timer tables     
              are displayed. The command is useful in order to     
              inspect the state of the SDL system, or to see, if   
              it is hanging.                                       
-----------------------------------------------------------------
Example 368   
After typing the command, informations are printed on screen, which may look like:

Current Timer states:
SDL NOW                    :9147,d
Timer dimensioned to       :6
Currently                  :0 timer(s) active
Timer memory location at   :36bf0014,
  
Where SDL NOW represents the amount of units since system start. The value of 6 then tells the maximum of timer instances in the system. The third is self explaining. The last gives the physical memory allocation of the timer linked lists which may easy debugging.

---------------------------------------------------------------
Command        ?Process-State / ?P                               
  Parameters    <Processtype:Instance>                     
Type          Remote                                             
Description   The state of the given SDL process instance will   
              be displayed in its symbolic representation for    
              that process type. If a symbol file has been spec  
              ified, the Processtype and Instance are both       
              checked.                                           
---------------------------------------------------------------
--------------------------------------------------------------
Command        ?Queue / ?Q                                      
  Parameters    (None)                                          
Type          Remote                                            
Description   Some characteristics of the queue will be dis     
              played. The command is very useful in order to    
              dimension the queue. There is a peak hold,        
              which tells, how many entries in the queue have   
              been used at maximum since system start.          
--------------------------------------------------------------
Example 369   
After typing the command, informations are printed on screen, which may look like:

Current Queue state:
Queue size dimensioned to:Max.20 entries
Peak hold                :1 entry/entries
Currently                :0 entry/entries in queue
Queue memory location at :36a40010,x
  
The explanations for this is: A maximum of 20 entries in the queue can be handled by the system. Since system start, there was never more than one entry being used. Currently, no signal instance had been detected in any process input port. The last value displays the physical memory allocation of the queue, which helps in debugging.

Breakpoint Commands

A lot of error situations may occur when the system is downloaded for the first time. Possibly the basic functions in order to let the SDL system run in the target don't work. Possibly the compiler adaptations are wrong. The initialization of the environment may be incomplete. The compiler may generate faulty object code. The memory of the target may be exceeded, that is, either variables, constants, program code, stack or dynamic allocated memory. Also, realtime requirements may not be fulfilled.

In such situations, the possibility to set breakpoints in the target may be quite helpful. It is extremely powerful in its use in realtime target systems, because the breakpoint logic, which is implemented of course as software within the target, doesn't considerably affect the realtime properties in the target (a few statements only are necessary to check if a breakpoint is set and if it is hit).

The number of breakpoints selectable is user definable.

----------------------------------------------------------
Command        BA                                           
  Parameters    (None)                                      
Type          Remote                                        
Description   This command requests to clear all the break  
              points in the break list.                     
----------------------------------------------------------
----------------------------------------------------------------
Command        BC                                                 
  Parameters    <breakpoint-number> (depends on max. break  
              points)                                             
Type          Remote                                              
Description   This command requests to clear the given break      
              point number from the breakpoint list.              
----------------------------------------------------------------
-------------------------------------------------------------------------
Command        BP                                                          
  Parameters    <Processtype:Instance> <SignalName> <State  
              Name>                                                     
Type          Remote                                                       
Description   This command sets a breakpoint, both on the                  
              input and the nextstate of a given process. After            
              setting the breakpoint, try to query the break list          
              with the command ?Breaklist.                                 
              No parameter is optional. These combinations                 
              are allowed:                                                 
              processname:nr     *     statename  -   >Use command      
              BPS                                                          
              processname:nr     signalname   *    - >Use command       
              BPI                                                          
              processname:nr     *     *                                   
              processname:nr     signalname   statename                    
-------------------------------------------------------------------------
-----------------------------------------------------------------
Command         BPI                                                
  Parameters    <Processtype:Instance> <SignalName>    
Type            Remote                                             
Description     This command sets a breakpoint on the input of     
                a given process. No parameter is optional. These   
                combinations are allowed:                          
                processname:nr     *                               
                processname:nr     signalname                      
                processname     *                                  
                processname     signalname                         
-----------------------------------------------------------------
---------------------------------------------------------------
Command        BPS                                               
  Parameters  <Processtype:Instance> <StateName>     
Type          Remote                                             
Description   This command sets a breakpoint on the state of a   
              given process. A negative confirmation is given,   
              when the command cannot be processed within        
              the target system.                                 
              No parameter is optional. These combinations       
              are allowed:                                       
              processname:nr     statename                       
              processname     *                                  
              processname     statename                          
              processname:nr     *                               
---------------------------------------------------------------
------------------------------------------------------------------
Command       ?Breaklist / ?B                                       
  Parameters    (None)                                              
Type          Remote                                                
Description   This command requests the current breaklist           
              from the target and displays it on the screen as it   
              was entered. If a symbol file has been specified      
              during the invocation of sdtmt, then process-IDs,     
              signal-IDs and state-IDs are displayed with their     
              symbolic value.                                       
------------------------------------------------------------------

Environment Commands

Currently, there is no command implemented to control the environment. It is assumed, that the connection SDL to environment is fully under control of the user. If the SDL environment is implemented on the host side, for instance, it may be compiled and linked together with sdtmt, then there is one command named User, which you can find in the subsection explaining special commands.

Log Commands

In the current implementation, all log files, which can be read or written by sdtmt, are to be specified on the command line, when sdtmt is invoked. Please consult the subsection "Invoking sdtmt from the Command Line" on page 2993.

Change System Commands

------------------------------------------------------------------
Command        Active-Timer / Ac                                    
  Parameters    <Processtype:Instance> timername              
Type          Remote                                                
Description   Check, if a specific timer is set by a process, and   
              has not been expired.                                 
------------------------------------------------------------------
------------------------------------------------------------------
Command        Create / Cr                                          
  Parameters    <Parent-Processtype:Parent-Processinstance>   
              <Created-Processtype>                           
Type          Remote                                                
Description   This command creates an SDL Process of the            
              given type. The type-ID of the creating process       
              must be specified in param 1. The instance-ID         
              must be specified in param 2. If there is a free      
              process instance, which is currently dormant,         
              this one will be created and the start transition     
              will be executed, which can be seen in the trace.     
              If the system is under break condition, the com       
              mand will be ignored, because it is not possible      
              to send signals (dynamic creation uses signal         
              mechanism) in that case.                              
------------------------------------------------------------------
---------------------------------------------------------------------
Note:                                                                  
Please specify the <Parent-Processtype:Parent-Processinstance>   
according to the SDL system. There is no check, if the parent is       
specified correctly from the semantic point of view.                   
---------------------------------------------------------------------
-----------------------------------------------------------------
Command       Disable-Timer / Dis                                  
  Parameters    (None)                                             
Type          Remote                                               
Description   This command disables the processing of timers.      
              The command affects the SDL-timers only!             
              However, timers which are already expired and        
              are in the queue, will be input as normal. Keep in   
              mind, that the disabling of timers changes the       
              system behavior.                                     
-----------------------------------------------------------------
---------------------------------------------------------------
Command       Enable-Timer / En                                  
  Parameters    (None)                                           
Type          Remote                                             
Description   This command enables the processing of timers      
              again, when it was previously disabled with the    
              command Disable-Timers. Due to the fact, that      
              time cannot be stopped, it might occur that all    
              the previously set timers may expire at the same   
              moment. This may cause illegal system behav        
              ior, i.e. a queue overflow and the call of the     
              ErrorHandler or another illegal behavior.          
---------------------------------------------------------------
----------------------------------------------------------------
Command       Stop / St                                           
  Parameters  <Processtype:Instance>                        
Type          Remote                                              
Description   This command stops an SDL Process according         
              to the SDL semantics, no matter if the system is    
              suspended or under break condition. The com         
              mand is, after it was received, directly executed   
              within the target. All signals, which are in the    
              queue for this process are removed, including a     
              possible create signal.                             
----------------------------------------------------------------
-------------------------------------------------------------------
Command       Nextstate                                              
  Parameters  <Processtype:Instance> <Statename>         
Type          Remote                                                 
Description   This command sets the state of the given process       
              instance to the value of <Statename>. <State  
              name> must be one of the states which are           
              defined for the corresponding process type in          
              SDL. Normally, that only makes sense if the sys        
              tem is under break condition, or is idle.              
-------------------------------------------------------------------
-----------------------------------------------------------------
Command        Reinitialize / Re                                   
  Parameters    (None)                                             
Type          Remote                                               
Description   This command tries to reinitialize the system.       
              The reinitialization may fail, if the hardware       
              drivers cannot be reinitialized again. Further       
              more, all global auto variables in the C program     
              parts of the user cannot be reinitialized. How       
              ever, if there is a clean implementation of driver   
              initialization and deinitialization, and initializa  
              tion of global variables, the command will work      
              very well.                                           
-----------------------------------------------------------------
----------------------------------------------------------------
Command          Reset-All-Timers / Reset-A                       
  Parameters    <Processtype:Instance>                      
Type            Remote                                            
Description     This command resets all SDL timers of the given   
                process instance.                                 
----------------------------------------------------------------
----------------------------------------------------------------
Command          Reset-Timer / Reset-T                            
  Parameters    <Processtype:Instance> timername            
Type            Remote                                            
Description     This command resets a specific SDL timer of the   
                given process instance.                           
----------------------------------------------------------------
-------------------------------------------
Note:                                        
Timers with parameters are not implemented.  
-------------------------------------------
-------------------------------------------------------------
Command        Resume / Resu                                   
  Parameters    (None)                                         
Type          Remote                                           
Description   Resume Cmicro Kernel, after a suspend has been   
              accepted. The same explanations as for the Sus   
              pend command apply.                              
-------------------------------------------------------------
---------------------------------------------------------
Command        Remove-Queue                                
  Parameters    (None)                                     
Type          Remote                                       
Description    All signal instances in the queue will be   
              removed. The signal queue will be empty.     
---------------------------------------------------------
------------------------------------------------------------
Command        Remove-All-Signals / Remove-A                  
  Parameters  <Processtype:Instance>                    
Type          Remote                                          
Description   Remove all signals of the given receiver from   
              the signal queue.                               
------------------------------------------------------------
-------------------------------------------------------------
Command        Remove-Signal / Remove-S                        
  Parameters    <Processtype:Instance> signalname        
Type          Remote                                           
Description   Remove a specific signal of the given receiver   
              from the queue.                                  
-------------------------------------------------------------
-----------------------------------------------------------------
Command       Scale-Timers / Sc                                    
  Parameters  <factor>                                       
Type          Remote                                               
Description   Scale time when setting a timer.                     
              Often there is a need to simulate time during an     
              SDL execution. By specifying this command, it        
              is possible to make the run of SDL timers faster     
              or slower. The command is applied on newly set       
              timers only. I.e. if a timer is already running,     
              then it remains unaffected from the time scale.      
              Due to that fact, the command should only be         
              given at the start of the SDL system.                
              In record mode the scaled time will be stored,       
              this results in time being scaled in play mode. It   
              is impossible to scale time manually in play         
              mode!                                                
-----------------------------------------------------------------
-----------------------------------------------------------------
Command        Set-Timer / Se                                      
  Parameters  <Processtype:Instance> time value timer name   
Type          Remote                                               
Description   Set an SDL Timer for the given process instance      
              with the given value in units. The time value is a   
              long value, which you may specify in hex or          
              decimal as C long value. The long value carries      
              the same units as you specified within the SDL       
              system, so that you have to recalculate it.          
-----------------------------------------------------------------
Example 370    
set <Processtype:Instance> 4711 < timername>

set <Processtype:Instance> 0x0815 < timername>

  

Special Commands

--------------------------------------------------------------
Command       Line / Li                                         
  Parameters    (None)                                          
Type          Local                                             
Description   The command displays the line status of the       
              communications interface. It can be used in       
              order to see, if characters, frames, and XONs /   
              XOFFs have been received / transmitted, and       
              what kind of device is actually connected.        
--------------------------------------------------------------
-------------------------------------------------------------
Command        Remove-Command                                  
  Parameters    (None)                                         
Type          Local                                            
Description   For each command, which is sent to the target,   
              sdtmt waits for an explicit acknowledgment.      
              The last command can be removed, so that         
              sdtmt does not wait for that acknowledgment.     
              That can be used, when the communication is      
              hanging for any reason, for example, when the    
              command could not be sent to the target, or      
              wasn't received by the target, or the acknowl    
              edgment couldn't be received in sdtmt.           
-------------------------------------------------------------
------------------------------------------------------------------
Command        Synchronize-Coder / Sync                             
  Parameters    (None)                                              
Type          Local                                                 
Description   The command tries to synchronize the message          
              coder of sdtmt with the target. It might be useful,   
              when the target is reset again or already running,    
              when you invoke sdtmt.                                
------------------------------------------------------------------
If the message

The decoder is out of synchronization. Try SYNC 
command.
is displayed during an sdtmt session, then the Sync command will help sdtmt to understand the messages sent from target to host, and it will enable sdtmt to send messages to the target with the correct format.

After entering the command sdtmt searches for the file sdtmt.stt in the sdtmt directory. That file is automatically generated, if one trace has been successfully generated. The file contains information about the target, and is wanted within sdtmt in order to produce printable trace output, and to enable remote commands. If sdtmt wasn't able to find the file, then the following message will be displayed:

Unable to restore rules from file sdtmt.stt.
Resynchronization is impossible.
Typing a command during sdtmt not being synchronized with the target, this message will appear:

Sorry. The current mode of sdtmt doesn't allow you to 
enter that command. The command has been ignored.
----------------------------------------------------------------------------
Caution!                                                                      
If you alter from one type of target to another, you must ensure, that        
sdtmt uses the right sdtmt.stt file. If you are not sure if it is the right   
one, then delete the file sdtmt.stt. Reset the target, while sdtmt is al      
ready running. The file will now be created with correct information          
contents. If you are sure, that the different targets use the same mes        
sage coding, then it is possible to reuse an sdtmt.stt file.                  
----------------------------------------------------------------------------
-------------------------------------------------------------
Command        User-Command / Us                               
  Parameters    (None)                                         
Type          Local                                            
Description   The command lets sdtmt alter to the user input   
              mode. The command only makes sense, if the       
              SDL environment, or any user environment is      
              compiled and linked together with sdtmt. Using   
              the delivered sdtmt executable, the command      
              will not work.                                   
-------------------------------------------------------------

Debugging - A Few Guidelines

The following few guidelines may help to understand the different possibilities when searching for a specific command.

Setting Breakpoints

A lot of error situations may occur when the system is downloaded for the first time. Possibly the basic functions in order to let the SDL system run in the target don't work. Possibly the compiler adaptations are wrong. The initialization of the environment may be incomplete. The compiler may generate faulty object code. The memory of the target may be exceeded, that is, either variables, constants, program code, stack or dynamic allocated memory. Also, realtime requirements might not be fulfilled.

In all these situations, the possibility to set breakpoints in the target may be quite helpful.

Here are some examples:

Is any signal input in any process at any time?

BPI         *:*  *  *
Is any signal output to the environment?

No possibility, because the environment performs no input action and breakpoints only can be set on inputs. A possible work-around is to trace the input in the C function xOutEnv. Then a breakpoint can be set as usual.

Does a specific process instance (pid) receive any signal?

BPI       processname:nr       *
Does a specific process instance (pid) receive a specific signal?

BPI        processname:nr         signalname
Does any instance of a given process type receive any signal?

BPI       processname        *
Does any instance of a given process type receive a specific signal?

BPI      processname        signalname
Does a specific process instance (pid) go into any state (does it end any transition)?

BPS      processname:nr       *
Does a specific process instance (pid) go into a specific state

(does it end any transition, which leads to that state)?

BPS      processname:nr       statename
Does any instance of a given process type go into any state (does it end any transition)?

BPS        processname       *
Does any instance of a given process type go into a specific state

(does it end any transition, which leads to that state)?

BPS      processname       statename

Quick reference Guide

General Commands

-----------------------------------------------------------
Command          Parameters                                  
-----------------------------------------------------------
Continue / Co    None                                        
Exit / Ex        None                                        
Help / He        <commandname> or * for complete list  
History / Hi     None                                        
Quit / Q         None                                        
!                command line number from history            
!!               None                                        
UNIX-command     See operating system help                   
/ MSDOS-com                                                  
mand                                                         
-----------------------------------------------------------

Trace Commands

--------------------------------------------------
Command               Parameters                    
--------------------------------------------------
?Tracebuffer / ?Tr    None                          
Tr-Detail / Tr-D      level                         
Tr-off                None                          
Tr-on                 None                          
Tr-Process / Tr-Pr    Processtype:instance Bitmask  
Tr-Signal / Tr-S      Signalname Flag               
--------------------------------------------------

Recorder Commands

---------------------
Command    Parameters  
---------------------
Rec-off    None        
Rec-on     None        
Rec-play   None        
---------------------

Execute Commands

-----------------------------
Command            Parameters  
-----------------------------
Next-Step / Next-  None        
S                              
Shutdown / Sh      None        
Single-Step / S    None        
Suspend            None        
-----------------------------

View Commands

---------------------------------------
Command            Parameters            
?All-Processes /   None                  
?A                                       
?Errors / ?E       None                  
?Timer-Table /     None                  
?Ti                                      
?Process-State /   Processtype:instance  
?P                                       
?Queue / ?Q        None                  
---------------------------------------

Breakpoint Commands

-------------------------------------------------------------
Command     Parameters                                         
-------------------------------------------------------------
BA          None                                               
BC          Number of breakpoint to clear                      
BP          Processtype:instance <signalname> <state  
            name>                                           
BPI         Processtype:instance <signalname>            
BPS         Process:instance <statename>                 
?Breaklist  None                                               
-------------------------------------------------------------

Change System Commands

---------------------------------------------------------------------
Command              Parameters                                        
---------------------------------------------------------------------
Active-Timer /       Processtype:instance <timername>            
Ac                                                                     
Create / Cr          Parentprocesstype:instance childprocesstype       
Disable-Timer /      None                                              
Dis                                                                    
Enable-Timer /       None                                              
En                                                                     
Stop / St            Processtype:instance                              
Nextstate            Processtype:instance <statement>            
Reinitialize / Re    None                                              
Reset-All-Timers     Processtype:instance                              
/ Reset-A                                                              
Reset-Timer /        Processtype:instance <timername>            
Reset-                                                                 
Resume / Resu        None                                              
Remove-Queue         None                                              
Remove-All-          Processtype:instance                              
Signals /                                                              
Remove-A                                                               
Remove-Signal /      Processtype:instance <signalname>           
Remove-S                                                               
Scale-Timers / Sc    factor (100 - no scaling, <100 slower)         
Set-Timer / Se       Processtype:instance timevalue <timername>  
---------------------------------------------------------------------

Special Commands

---------------------------
Command          Parameters  
---------------------------
Line / Li        None        
Remove-Com       None        
mand                         
Synchronize-     None        
Coder / Sync                 
User-Command /   None        
Us                           
---------------------------

Traces

When a process instance executes actions within a transition, trace information describing the different actions is either printed on the screen, on the MSC editor, or written into a file specified by the user. The amount of information printed can be selected using the trace commands in the monitor system. All trace information is self explanatory. This trace example was created from the AccessControl:

Example 371 :
The following trace was created for the Access Control example:

STATIC CREATE:
     process    :Central_0 
    TASK:
     process    :Central_0 
     NextFree := ... 
    NEXTSTATE:
     process    :Central_0 
     state      :Idle 
  
STATIC CREATE:
     process    :PanelController_0 
    OUTPUT:
     signal     :Display 
     prio       :100 
     snd        :PanelController_0 
     rec        :ENVIRONMENT 
     time       :0      
     parameters :
     00 01                                              ..
    NEXTSTATE:
     process    :PanelController_0 
     state      :Idle 
  

Restrictions of sdtmt

sdtmt has a few restrictions:

The Host Library

General

The host library is an optional part of the Cmicro Tester and delivered only when ordered.

In order to use all the options, the host library must be compiled with the right switches.

Here the application program interface (API) of sdtmt is explained. A specific subsection is dedicated to the compilation of the host library.

File Structure

Description of Files

lex_yy.c

This file contains the functions and tables which are relevant to read in symbols (for mt_sym.c). It is not possible to modify any part of this file, because it is automatically generated.

ml_dec.c

This is the module, which exports all the functions to decode the elements of the Cmicro Protocol. The functions are only of interest for the host side.

ml_dec.h

This is the header file containing the external definitions of ml_dec.c.

ml_enc.c

This is the module, which exports all the functions to encode the elements of the Cmicro Protocol. The functions are only of interest for the host side.

ml_enc.h

This is the header file containing the external definitions of ml_enc.c.

ml_fil.c

This file contains some basic functions to open, close, read and write files in different formats for sdtmt.

ml_fil.h

This is the header file containing the external definitions and some other definitions of ml_fil.c.

ml_getop.c

This file contains functions to read in and evaluate the different command line options of sdtmt.

It is not delivered and listed for some internal reasons only.

ml_getop.h

This is the header file containing the external definitions and some other definitions of ml_getop.c.

It is not delivered and listed for some internal reasons only.

mt_host.c

This file contains the C function main of sdtmt and controls the command line options, performs reading and writing of devices, error checks and some other things.

mt_msc.c

This module represents the conversion from binary into the MSC editor format.

It is not delivered and listed for some internal reasons only.

mt_msc.h

This file contains the extern declarations of mt_msc.c.

It is not delivered and listed for some internal reasons only.

mt_sym.c

This module builds the symbol table dynamically within sdtmt by reading in the <systemname>.sym file generated by the Cmicro Generator. It also exports functions which allow to access the different sorts of symbols.

mt_sym.h

This is the header file containing the external definitions and some other definitions of mt_sym.c.

y_tab.c

These file is only relevant to read in symbols (for mt_sym.c). It is not possible to modify any part of this file, because it is automatically generated.

y_tab.h

These file is the header file of y_tab.c.

Implementing an SDL Environment at Host Side - the API

The C application program interface (API) of sdtmt can be used to integrate application specific functions, by using the functionality of the Cmicro Tester.

Environment Functions

xInitEnvHost

void xInitEnvHost ( void ) 
This function is called by sdtmt during the initialization phase of the system. The function is to be filled up by the users.

The function is called only, if the flag

 XMK_USE_SDL_ENV_ON_HOST
is set in the configuration file ml_mcf.h.

xInEnvHost

int xInEnvHost ( int MessageClass,   int Messagetag,
                 int MessageLength,   char *p_info,
                 char *p_RAWBuffer ) 
This function is called by sdtmt, after a message has been received from the communications interface, which cannot be passed to the Cmicro Tester. The function is to be filled up by the users. The user has to define actions upon the reception of such a message.

The first 3 parameters contain the values of Message class, Messagetag and Message length from the header of the data link frame of the Cmicro Protocol.

Parameter 4 points to the first character of the data field of the message.

Parameter 5 points to the first character of the whole message, i.e. the message class.

You should use the decoding functions from ml_dec, in order to make the decoding of information independent from the system which sent the message.

The function is called only, if the flag

 XMK_USE_SDL_ENV_ON_HOST 
is set in the configuration file ml_mcf.h.

xCyclic

void xCyclic ( void ) 
This function is called once per main loop in sdtmt. The function is to be filled up by the users. It is possible to introduce the SDL environment here, or any other kind of communications interface.

The function is called only, if the flag

 XMK_USE_SDL_ENV_ON_HOST 
is set in the configuration file ml_mcf.h.

xCloseEnvHost

void xCloseEnvHost ( void ) 
This function is called before exiting sdtmt. The function is to be filled up by the users.

The function is called only, if the flag

 XMK_USE_SDL_ENV_ON_HOST 
is set in the configuration file ml_mcf.h.

xmk_HostEncode

int  xmk_HostEncode ( int MessageClass, int Messagetag,                          
                    char *p_struct  , int struct_length) 
This is a free to use function for the host side, which encodes the given information into a data link frame of the Cmicro protocol format and sends it via the communications interface.

MessageClass may be in the range from 0 to 250,

Messagetag may be of any value.

p_struct is a pointer to a C structure which is to be transferred via the communications link.

struct_length is the result of the sizeof operator applied on this structure.

Decoding Functions

The functions listed in this subsection should be used in order to decode all information received at the host side, which are sent as C structures or C basic data types.

--------------------------------------------------------------
Note:                                                           
The decoding of structures is not implemented in this release.  
--------------------------------------------------------------

xmk_decode_uchar

int xmk_decode_uchar(char *p_RAWBuffer,
                    int cnt,
                    unsigned char * char_val ) 
This is a free to use function for the host side, which decodes a character from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_schar

int xmk_decode_schar(char *p_RAWBuffer,
                    int cnt,
                    char * char_val ) 
This is a free to use function for the host side, which decodes a character from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_ushort

int xmk_decode_ushort ( char *p_RAWBuffer,
                        int cnt, 
                        unsigned short * short_val )
This is a free to use function for the host side, which decodes an integer from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_sshort

int xmk_decode_sshort ( char *p_RAWBuffer,
                        int cnt, 
                        short * short_val )
This is a free to use function for the host side, which decodes an integer from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_uint

int xmk_decode_uint (char *p_RAWBuffer,
                     int cnt, 
                     unsigned int * int_val )
This is a free to use function for the host side, which decodes an integer from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_sint

int xmk_decode_sint ( char *p_RAWBuffer,
                     int cnt, 
                     int * int_val )
This is a free to use function for the host side, which decodes an integer from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_ulong

int xmk_decode_ulong ( char *p_RAWBuffer,
                       int cnt, 
                       unsigned long * long_val )
This is a free to use function for the host side, which decodes a long from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_slong

int xmk_decode_slong ( char *p_RAWBuffer,
                       int cnt, 
                       long * long_val )
This is a free to use function for the host side, which decodes a long from a raw buffer into the C value according to the defined coding rules. The function returns the amount of characters to skip in the raw buffer.

xmk_decode_char_buffer

int xmk_decode_char_buffer ( unsigned char *p_RAWBuffer,
                             int RAWBufferLength,
                             unsigned char *p_dest,
                             int *p_dest_length)
This is a free to use function for the host side, which decodes a char array with RAWBufferLength elements from the raw buffer given in parameter 1 into the C value in parameter 3, according to the defined coding rules. Parameter 4 must specify the remaining space in the destination buffer when the function is called. After returning, parameter 4 contains the amount of elements which are decoded into the destination buffer.

The function returns the amount of characters to skip in the raw buffer.

xmk_decode_pointer

int xmk_decode_pointer ( char *p_RAWBuffer,
                         int cnt, 
                         long * ptr_val )
The function is used for internal purposes only and should not be called by the user.

It decodes a pointer value from the raw buffer into the C value according to the defined coding rules.

Its purpose is to skip a pointer value in the raw buffer, in order to enable the decoding of the parameters following that pointer value. The result value in *ptr_val is a physical address within the memory space of the target. That pointer should never be used, except to display the address on screen.

The function returns the amount of characters to skip in the raw buffer.

Encoding Functions

The functions listed in this subsection should be used in order to encode all information which is to be sent to the target. The functions work only for C structures or C basic data types.

--------------------------------------------------------------
Note:                                                           
The encoding of structures is not implemented in this release.  
--------------------------------------------------------------

xmk_encode_uchar

int xmk_encode_uchar ( unsigned char char_val,
                       char *p_RAWBuffer,   
                       int max         )
This is a free to use function for the host side, which encodes a C char value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_schar

int xmk_encode_schar ( char char_val,
                       char *p_RAWBuffer,   
                       int max         )
This is a free to use function for the host side, which encodes a C char value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_ushort

int xmk_encode_ushort ( unsigned short short_val,
                        char *p_RAWBuffer,
                        int max         )
This is a free to use function for the host side, which encodes a C short value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_sshort

int xmk_encode_sshort ( short  short_val,
                        char *p_RAWBuffer,
                        int max         )
This is a free to use function for the host side, which encodes a C short value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_uint

int xmk_encode_uint ( unsigned int int_val,
                      char *p_RAWBuffer,
                      int max         )
This is a free to use function for the host side, which encodes a C int value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_sint

int xmk_encode_sint ( int  int_val,
                      char *p_RAWBuffer,
                      int max         )
This is a free to use function for the host side, which encodes a C int value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_ulong

int xmk_encode_ulong (unsigned long long_val,
                      char *p_RAWBuffer, 
                   int max         )
This is a free to use function for the host side, which encodes a C long value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_slong

int xmk_encode_slong ( long long_val,
                       char *p_RAWBuffer, 
                    int max         )
This is a free to use function for the host side, which encodes a C long value into a given raw buffer according to the defined coding rules. Max is the remaining place in p_RAWBuffer and is checked. If an error occurs, the C function xHostErrorHandler will be called.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_char_buffer

int xmk_encode_char_buffer(unsigned char *buffer,
                           int length,
                           unsigned char *p_RAWBuffer, 
                        int max         
The function is used only for internal purposes and should not be called by the user.

It encodes the given buffer in parameter 1 with the given amount of characters in parameter 2 (length), into the raw buffer according to the defined coding rules. The value of max defines the destination buffer size in p_RAWBuffer. It is checked within the function. The C function xHostErrorHandler will be called, if there is not enough space in the destination buffer.

The function returns the amount of characters which are encoded into the raw buffer.

xmk_encode_pointer

int xmk_encode_pointer ( long ptr_val,
                         char *p_RAWBuffer, 
                      int max         )
The function is used only for internal purposes and should not be called by the user.

It encodes a pointer value into the raw buffer according to the defined coding rules.

Its purpose is to skip a pointer value which has to be in the raw buffer, in order to enable the target to access the parameters which follow the pointer value in a C structure.

-------------------------------------------------------------------
Caution!                                                             
The encoded value in ptr_val is interpreted in the target as a phys  
ical address within the memory space of the target. That pointer     
should never be used within the target!                              
-------------------------------------------------------------------

Other Functions

xHostErrorHandler

void xHostErrorHandler (   int ErrorNumber    ) 
The function is called on the host side at some places in sdtmt or the member modules of sdtmt with an error number defined in ml_err.h. The function maps this error number to an appropriate reaction, e.g. a printf for warnings, and a process termination for fatal errors.

Compiling and Linking the Host Library

Some defines are to be set in order to compile and link the parts of the Cmicro Tester on host side correctly. These defines can be set either on the command line when invoking make, or within a make- or makeoptions file or in the header file ml_mcf.h. Be sure, that for each configuration possibility, all the defines are set appropriately. In the following, some configuration possibilities are discussed.

Here is a first idea of what you have to set in the configuration file ml_mcf.h (please view the subsection "Configurations / the File ml_mcf.h" on page 2762 in chapter 45, The Cmicro Library).

#define XMK_ADD_MICRO_TESTER
#define XMK_USE_CONFIG5
#define XMK_USE_ON_HOST
#define XMK_USE_COMMUNICATION
#define XMK_ADD_STDIO

Scaling of Cmicro Tester Functionalities

Scaling in general either can be done directly when invoking the compiler (e.g. in the makeoptions, or makefile in use), or it can be done by modifying the file ml_mcf.h (please view the subsection "Configurations / the File ml_mcf.h" in chapter 45, The Cmicro Library).

Configuration of buffers

Before a compilation of sdtmt is to be performed, the buffers must be configured previously. Each buffer must be able to handle the largest object which is stored within. In addition, the buffers must be dimensioned consistently. For instance, the message buffer of the communications link must be able to handle the largest parameter list of a signal from SDL. The same situation arises in the trace of SDL tasks and procedure names.

--------------------------------------------------------------------
Note:                                                                 
If any buffer is dimensioned too small or inconsistently, that will   
lead to an error message on screen.                                   
--------------------------------------------------------------------
The following defines exists to dimension buffers.

XMK_MAX_TSDL_PARAM

This define is used to restrict the amount of characters transferred via the communications link for SDL Output. Cmicro Tracer, and record and play mode is affected from this define.

Recommendation:

#define XMK_MAX_TSDL_PARAM 255

XMK_MAX_PRINT_STRING

This define is used to restrict the amount of characters transferred via the communications link for the C function xmk_PrintString which is used only by the user.

Recommendation:

#define XMK_MAX_PRINT_STRING 255

XMK_MAX_LEN_SYMBOL_NAME

This define is used to restrict the amount of characters transferred via the communications link for the SDL tasks and SDL procedure names.

Recommendation:

#define XMK_MAX_LEN_SYMBOL_NAME 255
The transmit and receive buffers of the default communications link software must be configured in the data link (dl) module, via the following defines:

Transmitter buffer:

#define MAX_SEND_ONE_ENTRY          255
#define MAX_SEND_ENTRIES            100
Receiver buffer:

#define MAX_RECEIVE_ONE_ENTRY       255
#define MAX_RECEIVE_ENTRIES         100
where *_ONE_ENTRY is the dimensioning of one message, and *_ENTRIES is the maximum amount of entries in the message FIFO of the data link module. Note, that *_ONE_ENTRY must be greater than the greatest of the XMK_MAX_* defines above, plus an reserve of 6 bytes.

The Target Library

General

The target library is an mandatory part of the Cmicro Tester, because the Cmicro Tester isn't useful without the functions and definitions contained within.

In order to use the options of sdtmt or the host library, the target library must be configured accordingly.

A lot of defines make it possible to reduce the Cmicro Testers functions within the target, so that memory requirements can be reduced when scarce.

Following, are explanations of the file structure, the application program interface (API) within the target. Specific subsection is dedicated to the compilation of the host library.

File Structure

The following picture explains the file structure for the Cmicro Testers target library.

Figure 590 : Files of Cmicro Library 
-----
(fig)  
       
-----

Description of Files

sdl_cfg.h (see also: Cmicro Library)

This file is generated automatically by the Cmicro Generator into the directory which is currently active. It contains compilation flags used for the automatic scaling of the Cmicro Library and the generated C code. The file must not be edited by the user.

------------------------------------------------------------------------
Caution!                                                                  
The file always carries the same name, for each SDL system gener          
ated and is stored into the currently active directory (use pwd to de     
termine). It comes to conflicts, if you try to generate several systems   
into the same directory.                                                  
Be sure to use different working directories for each SDL system,         
otherwise, you'll possibly get unpredictable results during runtime       
of the generated code, because then some automatic scalable fea           
tures are possibly not compiled                                           
------------------------------------------------------------------------

ml_typ.h (see also: The Cmicro Library functions and definitions)

This file is the central header file in the Cmicro Package. It contains

mt_cmd.c

This file is part of the command interface, which is not contained in this version of the Cmicro Tester, and listed for some internal reasons only.

mt_cmd.h

This file is part of the command interface, which is not contained in this version of the Cmicro Tester, and listed for some internal reasons only.

mt_opt.c

This module exports the functions which allow users of the Cmicro Tester to define options regarding the different components tracer, record and play.

Options are to be specified in order to reduce the traffic load of the system, especially where a slow communications interface is involved, and where the user wants to test in realtime.

mt_opt.h

This is the header file containing the external definitions of mt_opt.c.

mt_pco.c

This file is part of the PCO controller, which is not contained in this version of the Cmicro Tester, and listed for some internal reasons only.

mt_pco.h

This file is part of the PCO controller, which is not contained in this version of the Cmicro Tester, and listed for some internal reasons only.

mt_play.c

This file is part of the Cmicro Recorder, and it contains all functions for the play mode.

mt_play.h

This is the header file containing the external definitions of mt_play.c.

mt_rec.c

This file is part of the Cmicro Recorder, and it contains all functions for the record mode.

mt_rec.h

This is the header file containing the external definitions of mt_rec.c.

mt_tsdl.c

This module exports functions to trace SDL actions. The functions contained in this module are mainly not to be called by the users. The Cmicro Kernel and the Cmicro Tester themselves use / represent the functions contained here.

One simple exception may be valid: If a user writes SDL processes by hand, or uses C code in SDL tasks, he can possibly use two C functions exported by this module, namely

It is possible to trace either into RAM, into a file, onto the screen, or via a V.24 interface.

The module is common for all the trace methods mentioned above. The functions exported here are called directly by the Cmicro Kernel, if the Cmicro Tester or part of the Cmicro Tester are involved when executing the SDL system.

Due to the possibility to run the Cmicro Kernel / the Cmicro Tester on different systems, and the possibilities to direct the trace output to different devices (like HDD, screen, serial interface, RAM and MSC editor) the module offers a lot of functionality.

There is also a part included, which is compiled for the host system, if executing in a distributed environment.

mt_tsdl.h

This is the header file containing the external definitions of mt_tsdl.c.

mt_tsys.c

This module contains the functions which handle the trace of system events like scheduler events and trace of system errors. Additionally there is a part which is compiled for the host system, if executing in a distributed environment.

mt_tsys.h

This is the header file containing the external definitions of mt_tsys.c.

The API on Target

General

The C application program interface (API) can be used both by SDL processes and / or by any other C function on the target.

The simplest method, however, is to set some options before initializing the SDL system, and hold these options during the whole runtime. A more comfortable method is to set some options before initializing the SDL system, and then change the options in an SDL process, when a specific situation is detected. By using this method, it is possible to reduce the amount of information and to make it easier to find unwanted behavior or an erroneous situation in a trace. This can be achieved, for example by writing the necessary C function call(s) into an SDL task symbol, using the #CODE directive.

The following pages introduce the C function interface, which must be used in the target, to set the options to trace.

------------------------------------------------------------------------
Caution!                                                                  
Pay attention to the correct values of the parameters of the different    
functions in order to get the right results. Evaluate the return values   
of those functions, which are returning one.                              
------------------------------------------------------------------------

Initialization

void xmk_InitOptions ( void )
Initialization is absolutely necessary and is to be done before any other initialization, directly before the C function call xmk_InitSDL.

The Cmicro Tracer is initialized, so that trace is in principle possible. Nothing happens before the C function xmk_OptionsSymbol is called, and xmk_TracerActive is set to XMK_TRUE.

Switch the Cmicro Tracer on / off

xmk_TracerActive = XMK_TRUE | XMK_FALSE
In order to get an execution trace, it is absolutely necessary to switch it on. This should normally be done after the C function xmk_InitOptions.

The different options set or unset with the functions whose names begin with xmk_Options* remain unaffected when changing the above flag.

The flag is not set per default.

Selecting SDL Symbols to be Traced

xmk_OPT_INT xmk_OptionsSymbol (
unsigned char process-type-id, long bitmask )
This function is absolutely necessary to be called, in order to begin the execution trace of one, a subset of, or all SDL symbols. Per default, no symbol is selected.

Select the trace for process-type-id, set or unset different symbols with the bit mask. If anything goes wrong, the function will return XMK_ERROR, else XMK_OKAY.

It is possible to specify bit mask values for a specific SDL process, for all SDL processes, for the environment and for the kernel part of the Cmicro Library. The last is necessary to allow the optional trace for system events like error trace and trace of scheduling events.

Allowed values for process-type-id:

--------------------------------------------------------------------
0                     First process-type-id, XPTID_ from sdl_cfg.h    
1                     Second.....                                     
N-1                   Last... (N is the max number of process types)  
xNULLTYPE             specify trace for all processes                 
any other value       The environment                                 
MICROKERNEL           specify trace for Cmicro Kernel                 
ENV                   Indicates the SDL environment                   
--------------------------------------------------------------------
Allowed values for bit mask:

----------------------------------------
SDL symbols                System events  
----------------------------------------
TSDL_STATE                 TSYS_SCHEDULE  
TSDL_INPUT                 TSYS_ERROR     
TSDL_SAVE                  TSYS_SHOWPRIO  
TSDL_OUTPUT                               
TSDL_CREATE                               
TSDL_STOP                                 
TSDL_STATIC_CREATE                        
TSDL_DYNAMIC_CREATE                       
TSDL_DECISION                             
TSDL_TASK                                 
TSDL_PROCEDURE                            
TSDL_RESULT                               
TSDL_TIMER                                
TSDL_SET                                  
TSDL_RESET                                
TSDL_ACTUAL_RESET                         
TSDL_SIGNALPARAMS                         
TSDL_DISCARD                              
TSDL_IMPLICIT_CONSUMPTION                 
----------------------------------------

Preparing an MSC Trace

xmk_OPT_INT xmk_OptionsMSC ( unsigned char flag )
This function is used in order to ensure all information necessary for an MSC trace being transferred via the communications link. By calling this function, the minimum trace information for the MSC editor can be set appropriately, The following options exist:

The other trace possibilities, set by the other xmk_Options* functions, remain unaffected in any case.

The MSC trace is affected by the flag xmk_TracerActive, too.

Selecting SDL Signals to be Traced

xmk_OPT_INT  xmk_OptionsSignal ( xmk_T_SIGNAL signal id,  
                                 unsigned char bitmask )
This function is optionally called, because the trace of all SDL signals is switched on per default.

Select the trace for signal id, set or unset different symbols with bit mask. If anything went wrong, the function will return XMK_ERROR, else XMK_OKAY.

It is possible to specify "off" for all signals, "on" for all signals, "off" for a specific signal, and "on" for a specific signal.

Allowed values for signal-id:

--------------------------------------------------------
0                First signal-id, #define from generated  
                 C code and <systemname>.ifc        
1                Second.....                              
N-1              Last.....                                
XMK_ALLOW_NO     Specify trace for all processes          
XMK_ALLOW_ALL    Specify trace for Cmicro Kernel          
--------------------------------------------------------
Allowed values for bitmask:

Example to set Trace Options

A simple method to set the trace options is, to set them directly within the C function main, before the Cmicro Kernel is initialized. You will find this example as a template in the file example.c delivered with the Cmicro Package.

Example 372   
#include "sdl_cfg.h"
#include "ml_typ.h"
    ... main ( ... )    {
  extern     int   xmk_TracerActive ;
      long         bitmask = 0      ;
      int          result  = XMK_OKAY ;
/* Initialize Cmicro Tester */
xmk_InitOptions ( );
/* Set all options ON */
result = xmk_OptionsSymbol (xNULLPID, 0xffffffff);
if (result != XMK_OKAY) ErrorInUsage ();
/* Set some options ON */
bitmask   =   TSDL_INPUT  ;
bitmask   |=   TSDL_STATE  ;
bitmask   |=   TSDL_OUTPUT ;
  /*          +---- Proces-Type - Id (see automatically   */
                /*          |     generated file *.ifc)                   */
               /*          V                                               */
 result = xmk_OptionsSymbol (0, bitmask );
 if (result != XMK_OKAY) ErrorInUsage ();
 result = xmk_OptionsSymbol (1, 0x00000000 );
 if (result != XMK_OKAY) ErrorInUsage ();
/* S w i t c h   o n   t h e   t r a c e */
xmk_TracerActive                 = XMK_TRUE ;
/* Template to set options to filter signals */
                    /*                                               */
                    /* +---- Allow all Signals to be traced        */
                    /* V                                             */
 xmk_OptionsSignal (XMK_ALLOW_NO, 0);
    /* +---- Signal id is to be set correctly !      */
                    /* |     according to the automatically          */
    /* |     generated *.ifc - file                    */
                    /* V                                               */
 xmk_OptionsSignal (1, 0xff);
 xmk_OptionsSignal (2, 0xff);
 xmk_OptionsSignal (3, 0xff);
/* I n i t i a l i z e   m i C r o   K e r n e l */
xmk_InitSDL ()
/* R u n   m i C r o   K e r n e l */
if (xmk_RunSDL (0xff) != XMK_STOP);
exit (0);  }
  

Getting a Trace in SDL Tasks with C code

The Cmicro Generator only generates usable traces for SDL tasks, if it is a task containing at least one SDL assignment, or if the #ID directive (see "Naming Tasks in Trace Output - Directive #ID" on page 2690 in chapter 44, The Cmicro Generator) is used. Whenever C code is specified within a task symbol (by using the #CODE directive), the Cmicro Generator is not able to generate good trace information.

There are two C functions which enable a work around:

in order to get a trace from C code. The trace output of a call like

 xmk_PrintString ('Hello SDL world')
looks like:

USER:
    Hello SDL world
The strings have to be unique, in order to distinguish a trace of one process from another. Another difference between the above function is, that the C function xmk_PrintString does not check if a trace is wanted or not. The trace will be done unconditionally via the Cmicro Testers communications link.

Of course, the function may also be applied in non SDL program parts.

Using Record or Play Mode of the Cmicro Recorder

xmk_OPT_INT xmk_SetRecorderMode ( int mode )
This function must be called by the user in order to:

Allowed values for mode:

Example of how to Use the API at Target Side

In the appendix of this manual, there is an elegant way to use the Cmicro Tester function interface on the target. The idea is, that parts of the Cmicro Tester can be specified within a separate SDL process, which is to be linked together with the SDL application written by the user.

Environment Functions

xInEnv ()

void  xInEnv ( void )
This function is called each time the Cmicro Kernels main loop is entered. Here it is possible to read the communications interface by calling the C function xmk_dl_read, if the data link module of the Cmicro Package is used. After reading a message from the interface, it can be decoded by calling the C function xmk_Cod_Decode, which is described a few steps later. A more detailed description of the C function xInEnv can be found in the Cmicro Library reference manual part.

xOutEnv ()

int  xOutEnv ( xmk_T_SIGNAL sig,
               xmk_T_PRIO prio,
               xmk_T_MESS_LENGTH data_len,
               void *p_data,
               xPID Receiver       )
This function is called each time the SDL system wants to output a signal to the environment. If the environment should be another system (e.g., an MS DOS PC), the signal can be sent directly by calling the C function xmk_Cod_Encode, which is described in the following section. A more detailed description of the C function xOutEnv can be found in the Cmicro Library reference manual part.

xmk_Cod_Decode ()

int  xmk_Cod_Decode ( char *p_RAWBuffer,     In
                      int *p_MessageClass,   Out
                      int *p_Messagetag,     Out
                      int *p_MessageLength,  Out
                      char *p_dest,          In/Out
                      int dest_len )         In
This is a free to use function for the target side, which decodes a given data link frame in the Cmicro Protocol format into the different informations. MessageClass may be in the range from 0 to 249, Messagetag may be of any value. p_struct is a pointer to a C structure which is to be transferred via the communications link. Struct_length is the result of the sizeof operator applied to this structure.

The function is the counterpart to the C function xmk_Cod_Encode.

xmk_Cod_Encode ()

 int  xmk_Cod_Encode ( int MessageClass, 
                       int Messagetag, 
                         char *p_data, 
                       int length )
This is a free to use function for the target side, which encodes the given information into a data link frame of the Cmicro Protocol format and sends it via the communications interface. MessageClass may be in the range from 0 to 249, Messagetag may be of any value. P_struct is a pointer to a C structure which is to be transferred via the communications link. Struct_length is the result of the sizeof operator applied to this structure.

The function is the counterpart to the C function xmk_Cod_Decode.

---------------------------------------------------------------
Note:                                                            
The maximum amount of characters which can be transferred is re  
stricted to 255 per default.                                     
---------------------------------------------------------------

Compiling and Linking the Target Library

Some defines are to be set in order to compile and link the parts of the Cmicro Tester correctly. These defines can be set either on the command line when invoking make, or within a make- or makeoptions file or in the header file ml_mcf.h. Be sure, that for each configuration possibility, all the defines are set appropriately.

Here is a first idea of what you have to set in the configuration file ml_mcf.h:

#define XMK_ADD_MICRO_TESTER
#define XMK_USE_CONFIG5
#define XMK_USE_ON_TARGET
#define XMK_ADD_V24_TRACE
#define XMK_USE_COMMUNICATION

Scaling of Cmicro Tester Functionalities

In order to reduce the amount of memory - e.g., if memory gets scarce within a progressing project - it is possible to reduce the Cmicro Testers functionality at target side.

It is not necessary to recompile the host executables again, if these are using a particular functionality, which is not compiled within the target.

For instance, if the recorder isn't compiled within the target, the user may not use the functions of the Cmicro Recorder on host side.

Removing the whole Cmicro Tester

It is quite simple to remove any functionality used by the Cmicro Tester by specifying:

#undef XMK_ADD_MICRO_TESTER

Removing the Cmicro Tracer

This is possible by specifying

#define  XMK_ADD_MICRO_TESTER.
#undef   XMK_ADD_MICRO_TRACER

Removing the Cmicro Recorder

This is possible by specifying

#define  XMK_ADD_MICRO_TESTER.
#undef   XMK_ADD_MICRO_RECORDER
In order to use both record and play mode, the following must be defined:

#define  XMK_ADD_MICRO_TESTER.
#define  XMK_ADD_MICRO_RECORDER
#define  XMK_ADD_MICRO_PLAY

Removing the Command and Debug Interface

This is possible by specifying

#definef XMK_ADD_MICRO_TESTER.
#undef   XMK_ADD_MICRO_COMMAND
Partial functionality may be left out by undefining one of the defines described under "Message Transfer and Presentation of Messages" on page 3064.

Configuration of Buffers

Users must configure buffers used by the Cmicro Tester.

The reason behind this is, that the Cmicro Tester uses an efficient way to handle those buffers, which is of great importance especially for micro controllers.

Additionally, these buffers must be dimensioned consistently. For instance, the message buffer of the communications link must be able to handle the largest parameter list of a signal from SDL. The same situation arises in the trace of SDL tasks and procedure names.

---------------------------------------------------------------------
Caution!                                                               
If any buffer is dimensioned too small, this may result in a runtime   
error.                                                                 
---------------------------------------------------------------------
The following defines exists to dimension buffers.

XMK_MAX_TSDL_PARAM

This define is used to restrict the amount of characters transferred via the communications link for SDL Output. Cmicro Tracer, and record and play mode is affected from this define.

XMK_MAX_PRINT_STRING

This define is used to restrict the amount of characters transferred via the communications link for the C function xmk_PrintString which is used only by the user.

XMK_MAX_LEN_SYMBOL_NAME

This define is used to restrict the amount of characters transferred via the communications link for the SDL tasks and SDL procedure names.

The transmit and receive buffers of the default communications link software must be configured in the data link (dl) module, via the following defines:

Transmitter buffer:

#define MAX_SEND_ONE_ENTRY          80
#define MAX_SEND_ENTRIES            100
Receiver buffer:

#define MAX_RECEIVE_ONE_ENTRY       80
#define MAX_RECEIVE_ENTRIES         100
where *_ONE_ENTRY is the dimensioning of one message, and *_ENTRIES is the maximum amount of entries in the message fifo of the data link module. Note, that *_ONE_ENTRY must be greater than the greatest of the XMK_MAX_* defines above, plus a reserve of 6 bytes.

Connection of Host and Target

General

The subsections following here will detail the technical requirements and the technical implementation of the connection between host and target. The following items will be outlined:

Structure of Communications Link Software

This is the structure for the communications link software, which is - in principle - applicable for host, as well as for target side:

Figure 591 : Structure of the communications link software 
-----
(fig)  
       
-----
The following subsections describe the current implementation and how to implement a new communications link software.

Default implementation of Communications Link Software

Message Transfer and Presentation of Messages

State Machine and Handshake

For all the commands and messages, there is a small state machine to handle the correct transfer of information. All messages, which have the suffix _REQ in its name, are to be confirmed from target with one of the _CNF messages.

For the messages carrying parameters, there is always (no exception), a special _CNF message which carries these back to the requestor. The requestor mostly is the host, or indirectly, the user which holds the session at the host.

For the messages, which do not carry parameters, a positive confirmation is done via the message CMD_OKAY_CNF.

If a message can't be recognized or processed within the target, a negative confirmation CMD_ERROR_CNF is used in all cases.

Each _REQ message must be confirmed first, before the next one can be sent.

Messages with an _IND suffix are mostly sent from target to host in order to indicate a specific situation. For these messages, the sender is always the originator.

Message Formats

The following subsections give a complete list of messages which can be sent to and received from the target.

Each typedef shown below is packed into a data link frame in its target representation.

That means, a simple memcpy (destbuffer,struct,sizeof(struct)) is performed to copy a structure to/from the data link frame.

On host side, it is therefore necessary to perform message coding and message decoding.

General Formats

Message tag: CMD_START_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Request coding rules from target
Sent when            :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:-
Message description: Normally, it is not mandatory to use this command. The target always sends the correct information as initiated by itself using CMD_START_IND. The host library doesn't use the command.

Message tag: CMD_START_IND

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate coding rules to host
Sent when          :automatically at start
Direction          :T->H
Typedefinition     :xmk_TST_STRUCTURE
Conditional compile:-
Message description: This message is sent automatically from target to host at the beginning of a trace session or any session with the Cmicro Tester.

Formats Concerning the Cmicro Tracer

Message tag: CMD_INFO_IND

Messageclass       :currently
Meaning            :unused
Sent when          :Indicate current traceoptions to host
Direction          :T->H
Typedefinition     :-
Conditional compile:-
Message description: This command is currently not implemented.

Message tag: CMD_TTASK

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Task
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_NAME
Conditional compile:XMK_ADD_TNAME
Message description: The message is sent, when a task symbol is entered in generated C Code and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TSET

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Set
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_SET
Conditional compile:XMK_ADD_TSET
Message description: The message is sent, when a timer set is performed in generated C Code and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TRESET

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Reset
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_RESET
Conditional compile:XMK_ADD_TRESET
Message description: The message is sent, when a timer reset is performed in generated C Code and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TSTOP

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Stop
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_STOP
Conditional compile:XMK_ADD_TSTOP
Message description: The message is sent, when an SDL process stop is performed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TSTATE

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL State
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_STATE
Conditional compile:XMK_ADD_TSTATE
Message description: The message is sent, when an SDL nextstate is performed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TSTATIC_CREATE

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Static create
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_STATICCREATE
Conditional compile:XMK_ADD_TSTATICCREATE
Message description: The message is sent for each statically created SDL process, for which the start transition is executed, and for which the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TCREATE

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Create
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_CREATE
Conditional compile:XMK_ADD_TCREATE
Message description: The message is sent, when the SDL action create is performed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TDYNAMIC_CREATE

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Dynamic create
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_DYNAMICCREATE
Conditional compile:XMK_ADD_TDYNAMICCREATE
Message description: The message is sent for each dynamically created SDL process, when its start transition is executed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TDECISION

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Decision
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_DecisionValue
Conditional compile:XMK_ADD_TDecisionValue
Message description: The message is sent, when an SDL decision is executed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TSAVE

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Save
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_SAVE
Conditional compile:XMK_ADD_TSAVE
Message description: The message is sent, when a signal save is performed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TTIMER

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Timer
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_TIMER
Conditional compile:XMK_ADD_TTIMER
Message description: The message is sent, when an SDL timer had been expired and is input in the owner process, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TINPUT

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Input
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_INPUT
Conditional compile:XMK_ADD_TINPUT
Message description: The message is sent, when an SDL input is performed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TPROCEDURE

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Procedure
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_NAME
Conditional compile:XMK_ADD_TNAME
Message description: The message is sent, when an SDL procedure is entered, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TOUTPUT

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Output
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_OUTPUT
Conditional compile:XMK_ADD_TOUTPUT
Message description: The message is sent, when an SDL output is performed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TDISCARD

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Discard
Sent when          :Execution of that SDL symbol
Direction          :T->H
Typedefinition     :xmk_TSDL_DISCARD
Conditional compile:XMK_ADD_TDISCARD
Message description: The message is sent, when an SDL discard has been detected, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TIMPLICIT_CONSUMPTION

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Implicit consumption
Sent when          :Implicit consumption occurs
Direction          :T->H
Typedefinition     :xmk_TSDL_IMPLICIT_CONSUMPTION
Conditional compile:XMK_ADD_TIMPLICIT_CONSUMPTION
Message description: The message is sent, when an SDL implicit consumption is performed, and when the trace is set for this symbol. Furthermore, the trace must be active.

Message tag: CMD_TACTUAL_RESET

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of SDL Actual reset
Sent when          :SDL timer is actually reset
Direction          :T->H
Typedefinition     :xmk_TSDL_ACTUAL_RESET
Conditional compile:XMK_ADD_TACTUAL_RESET
Message description: The message is sent, when an SDL timer is actually reset, and when the trace is set for this symbol. Furthermore, the trace must be active. An actual reset applies only, if a timer was previously set and has not been expired.

Message tag: CMD_TSYS_ERROR

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of system error
Sent when          :Any kind of systemerror was detected
Direction          :T->H
Typedefinition     :xmk_TSYS_ERROR
Conditional compile:XMK_ADD_TERROR
Message description: The message is sent, when a system error of any type has been detected, and when the trace is set for this event. Furthermore, the trace must be active.

Message tag: CMD_TSYS_SCHEDULE

Messageclass       :XMK_MICRO_TRACER
Meaning            :Trace of system schedule event
Sent when          :When scheduling is performed
Direction          :T->H
Typedefinition     :xmk_TSYS_SCHEDULE
Conditional compile:XMK_ADD_TSCHEDULE
Message description: The message is sent, when the Cmicro Kernel begins scheduling, and when the trace is set for this event. Furthermore, the trace must be active.

Message tag: CMD_TSYS_SHOWPRIO

Messageclass       :XMK_MICRO_TRACER
Meaning              :Trace of system event : change priority level
Sent when          :When changing to another prioritylevel
Direction          :T->H
Typedefinition     :xmk_TSYS_SHOWPRIO
Conditional compile:XMK_ADD_TSHOWPRIO
Message description: The message is sent, when the Cmicro Kernel schedules from one priority level to another, and when the trace is set for this event. Furthermore, the trace must be active.

Message tag: CMD_PRINT_STRING

Messageclass       :XMK_MICRO_TRACER
Meaning            :User command Print string
Sent when          :Execution of fct.xmk_PrintString()
Direction          :T->H
Typedefinition     :xmk_T_PrintString
Conditional compile:XMK_ADD_CPRINT_STRING
Message description: The message is sent unconditionally, when the C function xmk_PrintString is called by the user.

Formats Concerning the Cmicro Recorder

Message tag: CMD_RECORD_COUNT_IND

Messageclass       :XMK_MICRO_RECORDER
Meaning            :Show recorded event counter to host
Sent when          :When ENV->SDL stimuli detected
Direction          :T->H
Typedefinition     :xmk_TREC_EVENT_COUNTER
Conditional compile:XMK_ADD_MICRO_RECORDER
Message description: The message is sent, when the Cmicro Recorder is active and is in record mode. It is sent together with, but always before CMD_RECORD_OUTPUT_ENV2SDL.

Message tag: CMD_RECORD_OUTPUT_ENV2SDL

Messageclass       :XMK_MICRO_RECORDER
Meaning            :Indicate stimuli ENV->SDL to host
Sent when          :When ENV->SDL stimuli detected
Direction          :T->H
Typedefinition     :xmk_TSDL_OUTPUT
Conditional compile:XMK_ADD_MICRO_RECORDER
Message description: The message is sent, when the Cmicro Recorder is active and is in record mode. It is sent after CMD_RECORD_COUNT_IND.

Message tag: CMD_RECORD_OUTPUT_SDL2ENV

Messageclass       :XMK_MICRO_RECORDER
Meaning            :unused
Sent when          :-
Direction          :T->H
Typedefinition     :-
Conditional compile:XMK_ADD_MICRO_RECORDER
Message description: This message is currently unused and is never sent.

Message tag: CMD_PLAY_SECTION_REQ

Messageclass       :XMK_MICRO_RECORDER
Meaning            :Request next sections from host
Sent when          :When current cnt reaches debit cnt
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_MICRO_RECORDER&XMK_ADD_MICRO_PLAY
Message description: The message is sent, when the Cmicro Recorder is active and is in play mode. It is sent, if the target has to put in the next stimuli (an environment signal).

Message tag: CMD_PLAY_COUNT

Messageclass       :XMK_MICRO_RECORDER
Meaning            :Transfer Debitcounter to target
Sent when          :When target requests next sections
Direction          :H->T
Typedefinition     :xmk_TREC_EVENT_COUNTER
Conditional compile:XMK_ADD_MICRO_RECORDER&XMK_ADD_MICRO_PLAY
Message description: The message is sent, when the Cmicro Recorder is active and is in play mode. It is sent, if the target requests the next stimuli (an environment signal). It is also sent in the initialization phase of the play mode. Outside the initialization phase, it is always sent together with, but behind CMD_PLAY_OUTPUT_ENV2SDL.

Message tag: CMD_PLAY_OUTPUT_ENV2SDL

Messageclass       :XMK_MICRO_RECORDER
Meaning            :Transfer stimuli ENV->SDL to target
Sent when          :When target requests next sections
Direction          :H->T
Typedefinition     :xmk_TSDL_OUTPUT
Conditional compile:XMK_ADD_MICRO_RECORDER&XMK_ADD_MICRO_PLAY
Message description: The message is sent, when the Cmicro Recorder is active and is in play mode. It is sent together with, but always before CMD_PLAY_COUNT, if the target request the next stimuli (an environment signal).

Message tag: CMD_PLAY_OUTPUT_SDL2ENV

Messageclass       :XMK_MICRO_RECORDER
Meaning            :unused
Sent when          :-
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_MICRO_RECORDER&XMK_ADD_MICRO_PLAY
Message description: This message is currently unused and is never sent.

Message tag: CMD_RECORDER_OFF

Messageclass       :XMK_MICRO_RECORDER
Meaning            :Switch off recorder
Sent when          :When at end of replay session detected
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_MICRO_RECORDER&XMK_ADD_MICRO_PLAY
Message description: This message is sent, if the host detected an end of file, after the target requests the next stimuli (an environment signal). It switches the Cmicro Recorder within the target off and execution returns from simulation to realtime.

Formats concerning the Command and Debug Interface

Message tag: CMD_SUSPEND_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Suspend Cmicro Kernel
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CSUSPEND
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_RESUME_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Resume  Cmicro Kernel
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CRESUME
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_SYSTEM_REINIT_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Reinitialize SDL system
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CREINIT
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_SYSTEM_SHUTDOWN_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Shutdown SDL system
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CSHUTDOWN
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_SINGLE_STEP_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Go into single step
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CSINGLE_STEP
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_DISABLE_TIMER_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Disable processing of timers
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CDISABLE_TIMER
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_ENABLE_TIMER_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Enable processing of timers
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CENABLE_TIMER
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_NEXT_STEP_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Execute next step
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CNEXT_STEP
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_SYSTEM_CONTINUE_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Continue system, if halted
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CCONTINUE
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_SET_BREAKPOINT_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Set breakpoint
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_DebBreakpoints
Conditional compile:XMK_ADD_CBREAK_LOGIC
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_BREAK_INPUT_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Set breakpoint on SDL input
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_BreakInputReq
Conditional compile:XMK_ADD_CBREAK_LOGIC
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_BREAK_STATE_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Set breakpoint on nextstate
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_BreakStateReq
Conditional compile:XMK_ADD_CBREAK_STATE
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_CLEAR_BREAKPOINT_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Clear specified breakpoint from list
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_ClearBreakpoint
Conditional compile:XMK_ADD_CBREAK_LOGIC
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_CLEAR_ALL_BREAKPOINT_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Clear all breakpoints
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CBREAK_LOGIC
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_QUERY_BREAKPOINT_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Query the breakpoint list
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CBREAK_LOGIC
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_QUERY_ERROR_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Query last error occured in system
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CQUERY_ERROR
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_NEXT_STATE_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Modify processstate to value
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_NextStateReq
Conditional compile:XMK_ADD_CNEXTSTATE
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_CREATE_PROCESS_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Create SDL process
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_CreateProcessReq
Conditional compile:XMK_ADD_CCREATE_PROCESS
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_TBUF_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Query Tracebuffer
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CTBUF
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_KILL_PROCESS_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Kill process
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_KillProcessReq
Conditional compile:XMK_USE_CMD_KILL&XMK_ADD_CKILL_PROCESS
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_PCO_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Define PCO
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:-
Message description: This message is currently not implemented and is never sent.

Message tag: CMD_QUERY_PROCESS_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Query process state
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_QueryProcessReq
Conditional compile:XMK_ADD_CQUERY_PROCESS
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_QUERY_QUEUE_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Query all queues
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CQUERY_QUEUE
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_RMQUEUE_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Flush all queues
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CRM_QUEUE
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_SET_TIMER_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Set SDL timer
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_SetTimerReq
Conditional compile:XMK_ADD_CSET_TIMER
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_RESET_TIMER_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Reset SDL timer
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_ResetTimerReq
Conditional compile:XMK_ADD_CRESET_TIMER
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_QUERY_TIMER_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Query timertables
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:XMK_ADD_CQUERY_TIMER
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_ACTIVE_TIMER_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Query, if timer active
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_ActiveTimerReq
Conditional compile:XMK_ADD_CACTIVE_TIMER
Message description: Message tag: CMD_FLUSH_SIGNAL_BY_SID_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Flush signals with given ID
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_FlushSignalBySIDReq
Conditional compile:XMK_ADD_CFLUSH_SIGNAL_BY_SID
Message description:This message is sent, if the user typed in the appropriate command.

Message tag: CMD_FLUSH_SIGNALS_BY_PID_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Flush signals of process
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_FlushSignalsByPIDReq
Conditional compile:XMK_ADD_CFLUSH_SIGNALS_BY_PID
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_RESET_ALL_TIMERS_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Reset all timers
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_ResetAllTimersReq
Conditional compile:XMK_ADD_CRESET_ALL_TIMERS
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_SCALE_TIMER_REQ

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Scale timers
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_ScaleTimerReq
Conditional compile:XMK_ADD_CSCALE_TIMER
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_REC_OFF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Switch recorder off
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:-
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_REC_PLAY

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Switch recorder to play mode
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:-
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_REC_RECORD

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Switch recorder to record mode
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:-
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_TRACE_ON

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Switch trace on in general
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:-
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_TRACE_OFF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Switch trace off in general
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :-
Conditional compile:-
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_TRACE_PROCESS

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Modify traceoptions for process
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_TraceProcessReq
Conditional compile:-
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_TRACE_SIGNAL

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Modify traceoptions for signal
Sent when          :User typed in command
Direction          :H->T
Typedefinition     :xmk_T_TraceSignalReq
Conditional compile:-
Message description: This message is sent, if the user typed in the appropriate command.

Message tag: CMD_BREAK_HIT_IND

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate breakpoint hit to host
Sent when          :Breakpoint hit in target
Direction          :T->H
Typedefinition     :xmk_T_BreakHitInd
Conditional compile:XMK_ADD_CBREAK_LOGIC
Message description: This message is sent, if one of the a breakpoints defined in the breaklist has been hit. The SDL system is halted and waits on the next commands from that point on.

Message tag: CMD_ERROR_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Negative acknowledge on command
Sent when          :A command couldn't be executed
Direction          :T->H
Typedefinition     :xmk_T_ESTATE
Conditional compile:unconditional
Message description: This message is sent, if the target wasn't able to respond to a command from the user.

Message tag: CMD_TBUF_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate Tracebuffercontents
Sent when          :Response to user command
Direction          :T->H
Typedefinition     :xmk_TBF_ENTRY
Conditional compile:-
Message description: This message is currently not implemented and will never be sent.

Message tag: CMD_OKAY_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Command acknowledge
Sent when          :Command correctly executed
Direction          :T->H
Typedefinition     :-
Conditional compile:unconditional
Message description: This message is sent from target to host, as a response for all commands, which do not carry parameters or any kind. It is used within the host library as a general confirmation of most messages.

Message tag: CMD_QUERY_PROCESS_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate process state
Sent when          :Response to user command
Direction          :T->H
Typedefinition     :xmk_T_PSTATE
Conditional compile:XMK_ADD_CQUERY_PROCESS
Message description: This message is sent as a reaction to the message CMD_QUERY_PROCESS_REQ. It carries information about the process state.

Message tag: CMD_QUERY_QUEUE_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate queue states
Sent when          :Response to user command
Direction          :T->H
Typedefinition     :xmk_T_QSTATE
Conditional compile:XMK_ADD_CQUERY_QUEUE
Message description: This message is sent as a reaction to the message CMD_QUERY_QUEUE_REQ. It carries information about the queue state.

Message tag: CMD_QUERY_TIMER_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate timer table
Sent when          :Response to user command
Direction          :T->H
Typedefinition     :xmk_T_TSTATE
Conditional compile:XMK_ADD_CQUERY_TIMER
Message description: This message is sent as a reaction to the message CMD_QUERY_TIMER_REQ. It carries information about the timer tables.

Message tag: CMD_ACTIVE_TIMER_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate, if timer is active
Sent when          :Response to user command
Direction          :T->H
Typedefinition     :xmk_T_ActiveTimerCnf
Conditional compile:XMK_ADD_CACTIVE_TIMER
Message description: This message is sent as a reaction to the message CMD_ACTIVE_PROCESS_REQ. It carries information about the state of a timer according to SDL semantics.

Message tag: CMD_QUERY_BREAKPOINT_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate breaklist to host
Sent when          :Response to user command
Direction          :T->H
Typedefinition     :xmk_T_DebBreakpoints [XMK_MAXBREAKPOINTS]
Conditional compile:-
Message description: This message is sent as a reaction to the command CMD_QUERY_BREAKPOINT_REQ. It carries the breaklist from target to host.

Message tag: CMD_QUERY_ERROR_CNF

Messageclass       :XMK_MICRO_COMMAND
Meaning            :Indicate last error occured
Sent when          :Response to user command
Direction          :T->H
Typedefinition     :xmk_T_ESTATE
Conditional compile:-
Message description: This message is sent as a reaction to the message CMD_QUERY_ERROR_REQ. It carries information about the last error which has occurred in the target.

Used Default Protocol

The data link part of the communication link is represented by the data link module and the coder module. The coder module ensures, that each data link frame is encoded / decoded according to definitions of the default protocol.

Each frame of the Cmicro Protocol is seen from the physical layer as binary data.

Each frame consists of the following items:

The following is an example of a coded Cmicro Protocol frame for a MS DOS PC, where Messagetag is coded as CMD_TSTATIC_CREATE. Note, this is only an example, and the real coding may be different.

Example 373 :Coding for MSDOS PC   
--------------------------------------------------------------
Message-  Message-
SYNC Message- -any kind of data- CRC class tag length 0xF1 0x06 0xAA 0x02 0x?? --------------------------------------------------------------
The functions described in "The API on Target" on page 3052 and the functions described within section "The Host Library" on page 3035 can be used to encode / decode these frames.

The Data Link Layer

General

The data link of the communications link usually handles the messagewise transfer of information from host to target and the other way around.

The data link uses the services and functions of the physical layer in order to transmit and receive information.

The data link offers functionality that makes it possible to send and to receive messages via the physical layer assigned to the data link. This functionality can be used by all programs (if implemented so). Mainly, it is the Cmicro Tester, which uses the data link layer services in order to send and to receive messages. But also, users may want to send and receive messages. This is possible by using the data link layer functions and by regarding the defined protocol used for each message.

The data link layer offers the following functionalities:

The data link layer is represented by the following functions, which are exported by the data link (dl) - module.

Data Link Functions used by Cmicro Tester

The Cmicro Tester uses the following C functions of the dl - module. The body of each C function may be rewritten according to the users needs.

------------------------------------------------
xmk_dl_init    Initialization of data link        
xmk_dl_query   Polling the receiver of data link  
xmk_dl_read    Reading a message from data link   
xmk_dl_write   Writing a message to data link     
xmk_dl_deinit  Deinitialization of data link      
------------------------------------------------

The Physical Layer

General

Any type of physical communications link can be used to connect host and target, i.e. it could be a V.24 an IEEE 488 interface, or it could be any other serial or parallel interface.

The physical layer of the communications link normally handles the bytewise transfer of messages from host to target and the other way around.

It uses the services of the underlaying hardware, like interrupts, CPU registers or memory mapped I/O.

The physical layer offers functionality to the data link in order to make it possible to transfer any kind of information, including Cmicro Tester data and / or user data.

The physical layer offers the following functionalities:

Physical Layer Functions used by Data Link (Default Implementation)

Distributed with the Cmicro Tester, you will find the modules ml_com.[ch] and ml_v24ux.[ch], which both represents the physical layer of a V.24 interface. ml_com.[ch] was compiled with the Borland C compiler 3.1, and is guaranteed to work correctly only for this. ml_v24ux.[ch] is used for the several UNIX platforms we deliver.

Both modules are mainly of interest for the host machine. Both transfer directions are supported. However, if the target machine is the same one as the host machine, the modules may be used in the following combinations (the left side should always be considered as host):

UNIX <-> Cmicro Controller

PC <-> Cmicro Controller

UNIX <-> UNIX

PC <-> PC

UNIX <-> PC

Look at the modules. There are some options to be selected:

Baudrate : 9600 Baud recommended, 19200 Baud also allowed under some circumstances

Com : Com1 or Com2 interface of the MS DOS PC

other flags :......please inspect ml_com.c and ml_v24ux.c

The physical interface uses a modified XON/XOFF and allows the transfer of binary data by escaping control characters.

The data link module delivered with the Cmicro Tester uses the following C functions:

---------------------------------------------------------
xmk_com_Init       Initialization of physical layer        
xmk_com_Query      Polling the receiver of physical layer  
xmk_com_Receive    Receiving a message on physical layer   
xmk_com_Send       Sending a message via physical layer    
xmk_com_Deinit     Denationalization of physical layer     
---------------------------------------------------------

Current Restrictions for Default Communications Link Software

SDL Restrictions

It is impossible to transfer pointer values via the communications link. An example may be the SDL predefined sort charstring, which is per default implemented as a pointer in C.

To avoid problems, users must not use SDL charstring, whenever it is of interest to send / receive them via the communications link (e.g. Cmicro Tracer or Cmicro Recorder functionality).

Message Length

The message length is restricted in its maximum length.

An explanation follows:

Each message is transferred as:

Header + Data + CRC
The length field contained in the header may represent the values from 0 to 255. If the MSB in the Messagetag is set to '1', then the length field is expected to be a 2 octet values, which makes it possible to represent the values from 256 to 65535.

However, the length field consisting of 2 octets is currently not implemented.

As a fact, no message may be greater than 4 + 255 + 1 = 260 characters in total (1 character normally is equal to 1 Byte, which consists of 8 Bit).

How to Reimplement Parts

If the functionality of sdtmt, as it is delivered with the Cmicro Tester, doesn't fulfill the users needs, or if existing software is to be connected to the Cmicro Tester at target side, then it is possible to use the open interface, which is described in subsection "Open Interface" on page 3091.

If the communications link which is delivered as default, and therefore the software representing it, doesn't fulfill the users needs, it is possible to reimplement parts of it.

To do so, you should first read the introduction at the beginning of this section "Structure of Communications Link Software" on page 3063.

Second, you must have good knowledge in C programming and also must know details concerning the Cmicro Tester and Cmicro Library.

It is possible to reimplement the data link layer only, the physical layer only, or both together.

In most, both parts are to be reimplemented when a new type of communications link is to be implemented.

Reimplementation of the Data Link Layer

It is quite easy to reimplement the data link layer for host as well as for the target side.

For instance, it may be necessary for a particular physical layer to introduce a ACK/NACK or a Retry-Request/Retry-Confirm mechanism.

The Cmicro Tester uses only these functions, which are described within the subsection "The Data Link Layer" on page 3085. Users therefore only have to reimplement the body of these functions.

As a possibility, users can use the functions of the default physical layer, as they are described within the subsection "The Physical Layer" on page 3086.

Reimplementation of the Physical Layer

It is quite easy also to reimplement the physical layer for host as well as for the target side, from a C point of view.

The functions of the physical layer are called within the data link layer (described within the subsection "The Data Link Layer" on page 3085).

Users therefore only have to reimplement the body of the physical layer functions.

It may - on the other hand - be hard to implement these functions for a specific micro controller. Users should pay extra attention to restrictions concerning the hardware which is to be used (e.g. Interrupts, processor registers).

Some tips can be found in the following subsection.

Connection of a Newly Implemented Communications Link

The Cmicro Tester uses only a few C function calls in order to send and receive information via the communications link. From the C syntax point of view, users only have to implement the body of these functions and to link them together with the micro Tester to one executable program. That is valid for the host as well as for the target part of the Cmicro Tester.

However, if considering timing constraints, critical paths, interrupts and similar things, users have to note the following.

Critical Paths

Critical paths do occur in any type of software, which uses interrupts. It is especially the transfer of information between ordinary C code and interrupt service routines, which must be considered. For the communication from the physical layer (which may be implemented as an ISR) and the data link layer (which may be implemented as ordinary C functions),

Critical paths may occur at any place in the software, which accesses global C variables.

The beginning of each critical path must be blocked with something like "disable interrupts". The end of a critical path must be released with something like "enable interrupts".

Timing Constraints

Often, there are timing constraints to be considered within the target system. Timing problems must be prevented. Each ISR must be implemented with a few statements only, in order to make the execution time as short as possible.

Interrupts

C functions which should be compiled as ISR's by the C compiler in use, mostly are marked by a preprocessor directive or by a special C compiler keyword. The C compilers reference manual must be consulted in order to implement ISR's.

Open Interface

The open interface can be used to implement user host executables, which are able to communicate with the Cmicro Tester at the target side. The Cmicro Tester at the target side is represented by the target library. Using the open interface

In order to use the open interface in this way, this is of interest:

It is not of great interest, what the format of the data link frames is, because it is possible either to use the existing protocol, or to reimplement the protocol (e.g. It may be necessary in order to integrate the Cmicro Tester into an existing communications link software).

The host side must send each message in target representation.

For instance, if the target system uses integers as 2 octet values in the ordering higher octet first, then the host must send an integer value with higher octet and then lower octet, irrespective of its own layout.

For the other direction (reception of messages at host side), the host also must map the information according to the target memory layout to its own internal representation.

Accessing the Data Link by User

The user can send information via the communication link by calling the C function xmk_dl_write with appropriate parameters. The following example shows one possibility.

Example 374   
#define HelloWorldTag <AnyValueAllowed>
char buffer     [20];
char helloworld [15];
int  length     = 0;
strcpy (helloworld, 'Hello World'); 
buffer [0] = 0x11; 
length ++;
/* any value for Messageclass, except      */
/* reserved values for Cmicro Tester       */
/* reserved values begin from 250 to 255   */
buffer [1] = HelloWorldTag; 
length ++;
/* any value for Messagetag                */
/* Messagetag is made unique together      */
/* with Messageclass, so that no           */
/* conflict occurs.                        */
buffer [2] = strlen (helloworld); 
length ++;
/* length of data for this message         */
/* length is given without calculating     */
/* the CRC field                           */
memcpy (buffer [3], helloworld, strlen (helloworld);
length += strlen (helloworld);
/* It is assumed, that no stringterminator */
/* is included in the message (the length  */
/* can be calculated from Messagelength)   */
buffer [length] = xmk_EvalChkSum (buffer, length); 
/* Evaluate the checksum of current buffer */
xmk_dl_write (buffer, 5 + strlen (helloworld));
/* transmit buffer via communications link */
  
The user can receive informations from the communication link by calling the C function xmk_dl_read with appropriate parameters, e.g. within the C function xInEnv.

Example 375  xInEnv ():  
char buffer [256];
int  result;
int  MessageClass;
int  Messagetag;
int  MessageLength;
char *p_data;
int  signalid;
p_data = xmk_dl_read () ;
if (p_data != (char *) NULL)
{
  /* if anything received, decode it    */
  /* according to Cmicro Protocol       */
  result = xmk_Cod_Decode (p_data, 
                           &MessageClass,
                                     &Messagetag,
                                     &MessageLength,
                                     buffer,
                                 sizeof (buffer));
if (MessageClass == XMK_MICRO_COMMAND)
{
    result = xmk_HandleCmd ( Messagetag, (xmk_U_CMDS*) buffer );
    return;
}
/*
** Received user message
*/
if (MessageClass != 0x11)
{
    ErrorHandler (-7777);
    return ;
}
if (HelloWorldTag == Messagetag)
{
  /* HelloWorldTag is used in this example to */
  /* identify the hello world message         */
  /* The user can choose any value for the    */
  /* Message tag                               */
  char helloworld [15];
  memset (helloworld, 0, sizeof (helloworld)); 
  memcpy (helloworld, buffer, MessageLength);
  printf ('%s', helloworld);
}
  
The above examples assume, that the Cmicro protocol, which is described in within subsection "Used Default Protocol" on page 3083, is used.

More Technical Descriptions

The File Formats of sdtmt

General

This section deals with the general file format of the different files, which are written or read by sdtmt. The section is not of common interest, and must be read only when implementing and connecting other tools to sdtmt. The format of the file containing symbols is described in the subsection "The Symbol Tables" on page 3095.

File sdtmt.stt

This file contains the startup record which once was received from the target. At the beginning of any host - target session, the target sends a startup record containing information about the memory layout and information about several C types to sdtmt.

If the startup record neither can be found in this file sdtmt.stt, nor can be read from the communications link, then sdtmt is not able to work.

If the file sdtmt.stt was created in earlier sessions, it will not be overwritten. It is assumed, that the file always carries the information of the target, which sdtmt is communicating with in the current session.

As an example, the file contains this record (from an 80186 controller):

The first 4 octets and the last one (CRC) represent a typical data link frame. The octets following the first 4 octets represent information about types and memory layout of C variables which are interpreted by the decoder in sdtmt.

<infile> and <outfile>

Physically, there is the same file format behind the sdtmt option -i <infile> and -o <outfile>. These files store the information as received via the communications interface in a 1:1 format. The trace of the SDL execution flow and the information from the record mode is simply copied into the file on the hard disk. The same header informations is used as on the communications link. This gives some advantages.

There is no exception: The format of the information stored in <infile> or <outfile> is exactly the same as the format of the Cmicro Protocol. So, these files are using the memory layout of the target system.

The reason for this is, that binary files are always more compact than readable ASCII files.

The message decoder of the host must be active only when information are to be converted, for example, if they are to be displayed. That can decrease the performance a little.

The Symbol Tables

The symbol tables which are used by the Cmicro Tester are automatically generated by the Cmicro Generator. Most of the intelligence to interpret SDL traces and recorded events is implemented on the host system. Normally, the host system has enough memory and performance to do the interpretation, whereas the target has not. This is the reason, why the symbol tables used by the Cmicro Package mainly reside on the host. However, some parts of the symbol table reside where the Cmicro Kernel physically is executed, i.e. within the target system.

The Target Symbol Table

The following table is generated by the Cmicro Generator. For each SDL process, there is one entry in the table representing a pointer to the different trace options for that process.

/******************************************************
**  Symbol trace table
******************************************************/
#ifdef XMK_ADD_TEST_OPTIONS
XSYMTRACETBL *xSYMTRACETBL[MAX_SDL_PROCESS_TYPES+1] =
{
  (XSYMTRACETBL_ENTRY *)  NULL,
...........
..........
  (XSYMTRACETBL_ENTRY *)  NULL,
  X_END_SYMTRACE_TABLE
};
#endif

The Host Symbol Table

Generated File <systemname>.sym

The host symbol table is generated by the Cmicro Generator into a file called <systemname>.sym. This file is to be specified when sdtmt is invoked (see subsection "Invoking sdtmt from the Command Line" on page 2993). For the different SDL objects process, signal, timer and state, the symbolic information is stored in the following format:

description  : description expression
               | /* NULL */
expression  : ProcessDescr
            | SignalDescr
            | StateDescr;
ProcessDescr  :  BEGIN_PROCESSES ProcessList  END_PROCESSES            
SignalDescr    : BEGIN_SIGNALS SignalList END_SIGNALS              
StateDescr     : BEGIN_STATES StateList END_STATES               
ProcessList    : ProcessListElem
                   | ProcessListElem  ProcessList                           
SignalList     : SignalListElem
                  | SignalListElem   SignalList                          
StateList      : StateListElem
                   | StateListElem    StateList                             
ProcessListElem  : PROCESS  '('
                 PROCESS_NAME    ','
                 PROCESS_TYPE_ID ','
                 MAXINST
                 ')'
SignalListElem  : SIGNAL    '('
                SIGNAL_NAME     ','
                SIGNAL_C_NAME   ','
                SIGNAL_ID
                    ')'
                |   TIMER    '('
                SIGNAL_NAME     ','
                SIGNAL_C_NAME   ','
                SIGNAL_ID
                ')'
StateListElem  : STATE    '('
               PROCESS_TYPE_ID_ST ','
               STATE_NAME      ','
               STATE_ID
               ')'
PROCESS_NAME  : CHARSTRING
PROCESS_TYPE_ID  : DECIMAL
PROCESS_TYPE_ID_ST  : DECIMAL
MAXINST  : DECIMAL
SIGNAL_NAME  : CHARSTRING
SIGNAL_C_NAME  : C_NAME
SIGNAL_ID  : DECIMAL
STATE_NAME  : CHARSTRING
STATE_ID  : DECIMAL
DECIMAL  : [0-9]+
C_NAME  : [a-zA-Z_]+
CHARSTRING   : "\".*\""
Example 376 : Generation for "AccessControl":  
/* File generated for system AccessControl */
BEGIN_PROCESSES
  PROCESS ("Central", 0, 1)
  PROCESS ("PanelController", 1, 1)
  PROCESS ("DoorController", 2, 4)
  PROCESS ("DoorMonitor", 3, 1)
  PROCESS ("Controller", 4, 1)
END_PROCESSES
BEGIN_SIGNALS
  TIMER ("MyTimer", MyTimer, 1)
  TIMER ("PanelTimer", PanelTimer, 2)
  TIMER ("DoorTimer", DoorTimer, 3)
  TIMER ("MyTimer", MyTimer, 4)
  SIGNAL ("Allocate", Allocate, 5)
  SIGNAL ("Doornb", Doornb, 6)
  SIGNAL ("Allocated", Allocated, 7)
  SIGNAL ("NotAllocated", NotAllocated, 8)
  SIGNAL ("Code", Code, 9)
  SIGNAL ("PrefDoor", PrefDoor, 10)
  SIGNAL ("Abort", Abort, 11)
  SIGNAL ("Opened", Opened, 12)
  SIGNAL ("Open", Open, 13)
  SIGNAL ("Close", Close, 14)
  SIGNAL ("Display", Display, 15)
  SIGNAL ("Card", Card, 16)
  SIGNAL ("KeyStroke", KeyStroke, 17)
  SIGNAL ("CardAndCode", CardAndCode, 18)
  SIGNAL ("Ok", Ok, 19)
  SIGNAL ("NotOk", NotOk, 20)
  SIGNAL ("Registered", Registered, 21)
  SIGNAL ("NotRegistered", NotRegistered, 22)
  SIGNAL ("StartRegister", StartRegister, 23)
END_SIGNALS
BEGIN_STATES
  STATE (0, "Idle", 1)
  STATE (0, "WaitRegister", 2)
  STATE (1, "Idle", 1)
  STATE (1, "WaitDisplay", 2)
  STATE (1, "WaitKeyStroke", 3)
  STATE (1, "WaitOk", 4)
  STATE (1, "WaitSelectDoor", 5)
  STATE (1, "WaitOpened", 6)
  STATE (2, "WaitDoorTimer", 1)
  STATE (2, "created", 2)
  STATE (2, "Idle", 3)
  STATE (3, "Idle", 1)
  STATE (4, "WaitAllocated", 1)
  STATE (4, "Idle", 2)
  STATE (4, "WaitCode", 3)
  STATE (4, "WaitCentral", 4)
  STATE (4, "WaitPrefDoor", 5)
  STATE (4, "WaitOpened", 6)
END_STATES
  

Internal Symbol Table Structure

The module mt_sym.[ch] is responsible to read in the different symbols. It stores them into variables, so that the symbols of a trace can be found during the conversion of internal information into a displayable format. In order to minimize the required RAM memory, the symbols are stored by using dynamic memory management. In the case of insufficient RAM memory, it is ensured, that the Cmicro Tester works correctly. Not all symbols can be converted and displayed in this case.

The following three SDL objects are treated:

They are handled in the same way. Namely by building a linked list of symbols for processes, a linked list for signals and a linked list for states. Several C functions xmk_GetProcess*, xmk_GetSignal* and xmk_GetState* make it possible to convert an integer value of a given object type in addition with another information into a displayable symbol string.

Cmicro Recorder

The information given in the following are valid both for host and target, and there is no differentiation made between these.

Type and Amount of Stored Information

As already mentioned in earlier sections, using the Cmicro Recorder makes more sense in those cases, where an SDL system is executed in realtime in the target.

That's why the amount of stored information is to be kept very small. Of course, this leads to the problem, that not all types of errors can be found with the Cmicro Recorder, but there is a good chance to find most of them. The information, which the Cmicro Recorder produces at target side, and which the Cmicro Recorder uses at host side, cannot be configured in their dimension. The packets, which are to be transmitted via the communications link, are always the same. During the next subsections, a technical description follows.

Record Mode

First, the SDL system executes the start transitions of all statically created processes. At the occurrence of a "counted" symbol, an internal counter variable is incremented (which was set to zero before going into the SDL startup phase). The counter will simply be incremented, until the first environment signal is sent from the environment to a process in the SDL system, or until the first timer expires within the SDL system.

These are special events for the Cmicro Recorder.

In that case, the Cmicro Recorder at the target side sends the following messages to the host:

Host <-------- <Counter value> ------------ Target
Host <-------- <Event> -------------------- Target
Both messages are stored in the <outfile> on the host.

The counter is reset to zero again and the procedure restarts by counting the "counted" symbols and sending the above messages to the host, either when an environment signal is sent from the environment to a process in the SDL system, or until the first timer expires within the SDL system.

The <outfile> is closed, when the user terminates the record mode on the host side, i.e. it is not possible to close the file by ending the record mode on the target side. The record mode can be finished at any time.

After the record mode has been switched off, it is not allowed to switch the record mode or the play mode on again.

The <outfile> on the host now contains messages like this:

<trace event 1>
....
<trace event N>
<Counter value>
<Event>
<trace event N+1>
....
<trace event N+1+M>
<Counter value>
<Event>
As you can see, the following sections are stored in the file, whereas each section is optional:

For all events in the target
           [Store trace section]
           [Store Counter value section]
           [Store Event section]

Counted Symbols

The occurrence of the following SDL symbols will be "counted" by an internal counter (a C integer variable):

-------------------------------------------------------
STATE                   The SDL nextstate operation      
INPUT                   The SDL input operation          
SAVE                    The SDL save operation           
CREATE                  The SDL create operation         
STOP                    The SDL stop operation           
STATIC CREATE           Used at system start, appears    
                        for each statically created pro  
                        cess                             
DYNAMIC CREATE          Used at start of a dynamically   
                        created process                  
DECISION                SDL decision                     
TASK                    SDL task (not C Code)            
OUTPUT                  The SDL output operation (see    
                        remarks below)                   
PROCEDURE               SDL procedure call               
SET                     SDL action: Set timer            
RESET                   SDL action: Reset timer          
DISCARD                 SDL Discard.                     
IMPLICIT CONSUMPTION -  SDL implicit transition          
-------------------------------------------------------
A special case is the SDL output operation:

If the output is done from one process in the SDL system to another process in the SDL system, or, if the output is from one SDL process in the SDL system to the environment, the occurrence of this symbol is counted.

Else, if the output is from the environment to a process within the SDL system, this is a special event for the Cmicro Recorder like the timer expiry is.

C code in an SDL task is normally not counted when recording. The users are free to count C code by calling:

xmk_Record (CMD_TTASK) for the record mode and

C code written into an SDL Task (i.e. by using the #CODE directive)

xmk_Play (CMD_TTASK) for the play mode.

Play Mode

In play mode, the target accepts signals coming from the SDL environment only from the Cmicro Recorder. These signals are read from the file which was previously written in record mode.

----------------------------------------------------------------
Caution!                                                          
No environment signals may be handled by the user in the C func   
tion xInEnv! At the beginning of xInEnv, there should be a state  
ment like                                                         
if (xmk_RecorderMode == XMK_RECORDER_PLAY)                        
   return (XMK_OKAY));                                            
In addition, no signal may be sent by any other environment func  
tion (like ISR's) to the SDL system.                              
----------------------------------------------------------------
At the beginning of the play mode, the host reads the first <counter value> from the <infile> and sends it to the target.

Host -------- <Counter value> ---------------> Target
The meaning of this is: Please execute the amount of "counted" symbols as indicated in the <counter value>. The target executes the start transitions of all statically created processes (startup-phase). When preemption is used, it might be the case, that a transition, which is not a start transition, is executed. Each "counted" symbol increments a counter value which is compared against the debit, which was indicated by <counter value>.

If the current counter value reaches the debit counter value, then an environment signal (or timer expiry) plus the next <counter value> is requested by the Cmicro Recorder.

Host <------- <Request> ---------------------- Target
Host ---------------- <Event> ---------------> Target
Host -------- <Counter value> ---------------> Target
If the target has requested the next <Event> and <Counter value>, the target is waiting for these messages only and is not able to handle other messages. This is not a restriction, because the environment is disabled in play mode in the target.

If the end of file of <infile> has been reached, the host indicates the end of the play mode to the target. <Counter value> and <event> are always stored together in record mode. So, the end of file can only be reached after reading an EnvSig or Timer expiry an

Host -------- <Play mode off> ---------------> Target
----------------------------------------------------------------
Note:                                                             
After the play mode has been switched off, it is not allowed to   
switch the record mode or the play mode on again.                 
----------------------------------------------------------------

General Restrictions on Record and Play

Of course, there are restrictions in the use of the Cmicro Recorder, especially for the play mode. However, there may be situations, where the Cmicro Recorder doesn't help in finding the source of the problem. A description of the restriction follow, thus enabling the user to decide when the Cmicro Recorder can be properly utilized.

Firstly, you have to ensure to use the same configurations for hardware and software, in order to allow the comparison between the results of a recorded session with the ones of the replayed session. That is only a general recommendation. Possibly you even would like to compare two different hardware configurations, and the Cmicro Recorder is supposed to help you finding the differences between these. As a more general recommendation we could say: You should compare only those configurations, from which you know, that they are comparable.

Secondly, starting and ending the record and the play mode must be as described. Host and target are to be synchronized. In the default solution, which we show here, the synchronization is performed by the low level protocol with XON / XOFF: Both sides, host and target, do not send any information, before they have received an XON character.

Restrictions when Starting Record

The target may not transfer informations to sdtmt, until sdtmt has become active.

Therefore, sdtmt should be started first.

If the target is started (e.g. reset-button), it has to wait on sdtmt, before transmitting information. It depends on the implementation within the target, what you have to do now:

Restrictions when Ending Record

Ending the record session is to be done within mt_host. You can enter any exit commands at any time. You should pay attention to the exact time when you exit. If exit is performed in the middle of a running SDL transition in the target, then the traces following will not be stored! The last information may then be any possible SDL action.

Restrictions when Starting Replay

The target may not transfer information to sdtmt, until sdtmt has become active. sdtmt may not transfer information to the target, before the target has become active.

Therefore, sdtmt should be started first.

If the target is started (e.g. reset-button), it has to wait for sdtmt, before transmitting information. It depends on the implementation within the target, what you have to do now:

Restrictions when Terminating Replay

In principle, the play mode reaches the end, when the last stimuli stored in the file with recorded events was read and sent to the target. Actually, the play mode should end, when all the transitions which follow that stimuli have ended. This is a discrepancy, which is solved as follows: When the target has received the last stimuli from the recorded session, it enters the "recorder off" mode. The problem behind that is, that timers are simulated during the play mode, but are no longer simulated if changing to "recorder off" mode. Timers do expire now as they have been set, and the realtime clock is used to let them expire instead of the simulated timer expiry in the Cmicro Recorder.

Realtime Play Mode

sdtmt tries to replay the SDL environment events at the same absolute time values, as they occurred during the record session, if so required by the user (see subsection "Invoking sdtmt with Different Options" on page 2994).

Internally, a timestamp is stored for each environment signal, which is compared within the target with the current value of SDL now. SDL now- and therefore the timestamps in the signals are calculated with the value 0 from system reset on. The target generates the now values in any case.

Of course, the processing power of host and target together must be large enough, in order to handle this. As a rule of thumb, the recorded environment signals may not be sent to the SDL system more often than one per a few hundred microseconds. But that - of course - also depends on the communications link in use.

Restrictions when Using Preemption

Of course, there are some restrictions when the Cmicro Recorder is used in combination with preemption. The problem is, that in a realtime execution, signals coming from the environment (this may be a hardware interface) can cause a preemption of a running SDL process by a new process with a higher priority. The preemption may occur at any time, that means, at any machine instruction (see notes below). On the other hand, only SDL symbols are registered by the Cmicro Recorder.

This means, that the play mode may produce another system behavior than the recorded one.

The only alternative to implement an exact reproduction of the recorded session would be the use of a special debugger hardware, which is not possible as a general solution from our point of view.

Some Additional Comments

No realtime behavior is to be expected in play mode. The environment of the SDL system is to be cut off, considering the direction environment to SDL. Users must ensure that in the C function xInEnv. If considering the other direction, from SDL to environment, it is not absolutely necessary to cut this connection off (C function xOutEnv). It may be a good idea to let this connection be as it is in record mode. For example, if there is a display driver in the environment, which is controlled by SDL, it is then possible to see the reactions on the display in the same way as they have been observed in record mode.

Utility Functions

File Structure

Description of Files

The modules and functions described in this subsection are used to handle first in-first out buffering, ring buffering, message coding and other possibilities.

ml_buf.c

This module contains functions to handle first in-first out buffers and ring buffers.

It is mainly used internally by the Cmicro Tester to write and read trace information into/from a first in-first out buffer within the RAM.

The functions are also free for users.

Three functions are implemented representing the low level functions. Each entry has to be of the same size, because the handling is in principle similar to an array. The type of each entry is not relevant. In addition, the caller of the functions contained in this module defines the memory for the trace buffer as well as a control structure representing all the internal data and variables necessary to administrate the trace buffer.

As a result, users are free to have more than 1 instance of this buffer type.

ml_buf.h

This is the header file containing the external definitions of ml_buf.c.

ml_cod.c

This is the module, which exports all the functions to encode / decode any message of the Cmicro Protocol. The functions are used for the target part, as well as for the host part.

Some functions are compiled, too if sdtmt is built without any communications interface.

ml_cod.h

This is the header file containing the external definitions and some other definitions of ml_cod.c.

ml_com.c

This module is a template to implement a V.24 Interface for an MS DOS PC. It can be used for configuration 5, if target is a PC as well.

ml_com.h

This is the header file containing the external definitions and some other definitions of ml_com.c.

ml_rul.c

This is the module, which exports all the functions, which are necessary to derive the rules to encode and decode information, which are to be exchanged via the communications link. As well for the target part, as for the host part.

Some functions are compiled also, if a sdtmt is linked without any communications interface.

ml_rul.h

This is the header file containing the external definitions and some other definitions of ml_rul.c.

ml_v24ux.c

This module is used to implement a V.24 Interface for any UNIX machine. It is a not delivered part and listed only for some internal reasons.

ml_v24ux.h

This is the header file containing the external definitions and some other definitions of ml_v24ux.c

This page intentionally left blank