Comtrol eCos User Manual

Page 756

Advertising
background image

Running a Synthetic Target Application

#filter ipv4

-hide 1

#filter ipv6

-hide 1

}

A target definition file is actually a Tcl script that gets run in the main interpreter of the I/O auxiliary during ini-
tialization. This provides a lot of flexibility if necessary. For example the script could open a socket to a resource
management server of some sort to determine which hardware facilities are already in use and adapt accordingly.
Another possibility is to adapt based on

command line arguments

. Users who are not familiar with Tcl program-

ming should still be able to edit a simple target definition file without too much difficulty, using a mixture of
cut’n’paste, commenting or uncommenting various lines, and making small edits such as changing

tap4

to

eth2

.

Each type of device will have its own entry in the target definition file, taking the form:

synth_device

<

device type

>

{

<

options

>

}

The documentaton for each synthetic target device should provide details of the options available for that device,
and often a suitable fragment that can be pasted into a target definition file and edited. There is no specific set of
options that a given device will always provide. However in practice many devices will use common code exported
by the main I/O auxiliary, or their implementation will involve some re-use of code for an existing device. Hence
certain types of option are common to many devices.

A good example of this is filters, which control the appearance of text output. The above target definition file defines
a filter

trace

for output from the eCos application. The regular expression will match output from the infrastructure

package’s tracing facilities when

CYGDBG_USE_TRACING

and

CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE

are

enabled. With the current settings this output will not be visible by default, but can be made visible using the
menu item

System Filters

. If made visible the trace output will appear in an unusual colour, so users can easily

distinguish the trace output from other text. All filters accept the following options:

-hide [0|1]

This controls whether or not text matching this filter should be invisible by default or not. At run-time the
visibility of each filter can be controlled using the

System Filters

menu item.

-foreground

<

colour

>

This specifies the foreground colour for all text matching this filter. The colour can be specified using an RGB
value such as

#F08010

, or a symbolic name such as

"light steel blue"

. The X11 utility showrgb can be

used to find out about the available colours.

-background

<

colour

>

This specifies the background colour for all text matching the filter. As with

-foreground

the colour can be

specified using a symbolic name or an RGB value.

Some devices may create their own subwindows, for example to monitor ethernet traffic or to provide additional
I/O facilities such as emulated LED’s or buttons. Usually the target definition file can be used to control the

layout

of these windows.

The I/O auxiliary will not normally warn about synth_device entries in the target definition file for devices that are
not actually needed by the current eCos application. This makes it easier to use a single file for several different
applications. However it can lead to confusion if an entry is spelled incorrectly and hence does not actually get

652

Advertising