SGS Thomson Microelectronics ST20-SWC-SUN, ST20-SWC-PC Datasheet

The information in this datasheet is subject to change 42 1669 01
December 1995
1/21
ST20 TOOLSET
ST20–SWC
ST20 software development and debugging tools
PRODUCT INFORMATION
File Execution E vents Variables O ptions W indow H elp
Program :C :\INQUEST\EXAMPLES\APP_C\APP .BTL
C:\INQUEST\EXAMPLES\APP_C\control.c
30 31 32 33 34 35 36 37 38
do {
printf(”Please type n : ”);
} while (scanf(”%d”, &n) !=1);
return (n);
}
void close_down (Channel *in, Channel *o
Continue
Interrupt
Step Next
Step Out
Step To
Break Watch
Delete
Print
Jump
Print *
Locate
Last Evt
FEATURES
ANSI C compiler (X3.159-1989). Excellent compile time diagnostics. Global and local optimization. Assembler inserts and standalone assembler. Support for EPROM programming. Support for placing code and data in user specified
memory locations. Support for dynamically loading programs and
functions. Small runtime overhead. Cross-development from PC and Sun-4 platforms. Support for trap and interrupt handlers.
INQUEST Interactive and post-mortem debugging:–
Windowing interface using X Windows or Windows. Programmable command language. Source code or assembly code view. Stack trace-back facility. Variableand Memory display facility. C expression interpreter.
INQUEST Interactive debugging:–
Process and thread break points. Single stepping of threads. Read/Write/Access watch point capability. Facilities to interrupt and find threads.
Performance analysis tools:–
Analysis of time spent in each function. Analysis of block executionfrequency. Analysis of processor idletime. Analysis of processor utilization.
DESCRIPTION
The ST20 ANSI C Toolset provides a complete high qualitysoftware development environment for the ST20 microcontroller and microprocessor. The compiler supports the full ANSI C language definition and includes both local and global optimizing features. Embedded application support is provided by both configuration and symbol maputilities.
An
interactive windowing debugger
provides single stepping, breakpoints, watchpoints and many other features for debugging sequential and multi-tasking programs.
Execution profilers
givevarious post-mortem
statistical analyses of the execution of a program.
Inquest - Browser
app main : running app control: stopped at #8001130d app sum: chan-waiting
FAreg: 0.000000 FBreg: 0.000000 FCreg: 0.000000
Processes
app feed: chan-waiting
Inquest - Cmdline
32>
3 1 app main : breakpoint 6 at <app.c 26 0> 0 0 > continue 0 0 > interrupt
3 2 app control : interrupted at #8001130d
ST20–SWC
2/21
Contents
1 Introduction 3................................................................
1.1 Applications 3............................................................
2 Code building tools 4.........................................................
2.1 How programs are built 4..................................................
2.2 ANSI C compilation system 5..............................................
2.3 Support for embedded applications 6........................................
3 INQUEST windowing debugger 9..............................................
3.1 Interactive debugging 12...................................................
3.2 Post-mortem debugging 13.................................................
4 Execution analysis tools 14....................................................
4.1 Execution profiler 14.......................................................
4.2 Utilization monitor 15.......................................................
4.3 Test coverage and block profiling tool 15......................................
5 Host interface and AServer 18..................................................
5.1 The application loader – irun 18............................................
5.2 AServer 18...............................................................
5.3 AServer features 19........................................................
6 ST20 Toolset product components 20..........................................
6.1 Documentation 20.........................................................
6.2 Software Tools 20.........................................................
6.3 Software libraries 20.......................................................
6.4 Operating requirements 20..................................................
6.5 Distribution media 21.......................................................
7 Support 21....................................................................
8 Ordering Information 21.......................................................
ST20–SWC
3/21
1 Introduction
The ST20 ANSI C Toolset provides a complete high quality software development environment for the ST20 microprocessor. The compiler supports the full ANSI C language definition and includes both local and global optimizing features. The run-time library includes both standard C functions, supported by hosttargetconnections, andST20specific functionstofacilitate real-time,multi-tasking and embedded control operations. The real-time and multi-tasking support uses the on-chip hard­ware micro-kernel and timers, so for many applications no operating system or real-time kernel software is needed.
An interactive windowing debugger provides single stepping, breakpoints, watchpoints and many other featuresfor debugging sequential and multi-tasking programs running on an ST20.Execution analysis tools give post-mortem statistical analyses including execution profiles, processor utiliza­tion, test coverage and block profiles.
The host interface is provided by the AServer.This can be used simply as an application loader and hostfileserver,invoked by the iruncommand. TheINQUEST toolshavetheirowncommandswhich in turn load irun in order to load the application. The AServer may also be used to customize the host interface if required.
1.1 Applications
Single- and multi-tasking; Embedded systems; Real-time applications; Low cost single chip applications; Low level device control applications; Porting of existing software and packages.
ST20–SWC
4/21
2 Code building tools
The ST20 ANSI C Toolsetprovides a complete C cross-development system for the ST20. It can be used to build single task and multi-tasking programs for the ST20. Programs developed with the toolset are both source and binary compatible across all host development machines.
The ST20 ANSI CToolset is available for the following development platforms:
IBM 386/486 PC and compatibles under MSDOS 5 and Windows 3.1, or later versions. Sun 4 under SunOS 4.1.3 or Solaris 2.4 with X11 Release 4 server or OpenWindows 3, or
later versions.
2.1 How programs are built
The toolset build process is shown diagrammatically in Figure 1.
Figure 1 The tool chain
ANSI C source files may be separately compiled into
object files
. The compiler and libraries are
described insection2.2.The
librarian
may beused tocollate objectfiles intolibraries.The
linker
links
object files and libraries into fully resolved linked units. A
configuration description
is a text file describing the target hardware and how the software maps
onto it.The
configurer
converts the configuration description file into a
configuration binary
file. The
collector
removes any debugging information,and usesthe configuration binary tocollect the linked
files with bootstrap code to make an executable file called a
bootable file
.
During development and forhosted systems, thebootable file may be loaded downa hardware serial link ontothe target hardwareusing the
application loader
. For stand-alone systems, the bootable file may beconverted, using the EPROM tool, to anindustry standard EPROM formatfor programming EPROMs.
In addition toloading programs down a hardware serial link, the application loader program provides access to host operating system facilities through a remote procedure call mechanism. This method is used to support the full ANSI C run-time library.
A memory configurer tool is supplied for describing a ST20450 memory configuration. This data is used to initializethe memory interface of theST20450.The memoryinterfacecanbe initialized either using the hardware serial link or from ROM.
ST20–SWC
5/21
2.2 ANSI C compilation system
2.2.1 Compiler operation
The compiler operates from a host command line interface. The preprocessor is integrated into the compiler for fast execution. The compile time diagnostics provided by the compiler are comprehen­sive and include type checking in expressions and type checking of function arguments.
2.2.2 ANSI conformance
The ST20 ANSI C Toolset supports the full standard language as defined in X3.159-1989. The compiler passes all the tests in the validation suites from Plum Hall and Perennial.
2.2.3 Local optimized code generation
The compiler implements a wide range of local code optimization techniques.
Constant folding. The compiler evaluates all integer and real constant expressions at compile
time.
Workspace allocation. Frequentlyused variables are placed atsmall offsets in workspace,thus
reducing the size of the instructions needed to access them, and hence increasing the speed of execution.
Dead-code elimination. Code that cannot be reached during the execution of the program is
removed.
Peephole optimization. Code sequences are selected that are the fastest for the operation. Constant caching. Some constants have their loadtime reduced by placing them in a constant
table.
Unnecessary jumps are eliminated. Switch statements can generate a number of different code sequences to cover the dense
ranges within the total range.
Special idioms that are better on ST20s are chosen for some code sequences.
2.2.4 Globally optimized code generation
The ANSI C globally optimizing compiler extends the types of optimizations it performs to global techniques. These have typically given a 15–25 percent improvement in speed over the local opti­mizations as measured by a suite of internal benchmarks.
Common sub-expression elimination removes the evaluation of an expression where it is
known that the value has already been computed; the value is stored in temporary local work­space. This improves the speed of a program and reduces code size.
Loop-invariant code motion can movethe positionwhere anexpression isevaluated fromwithin
alooptooutside it.Iftheexpressioncontains no variablesthat are changedduring theexecution of a loop, thenthe expression can beevaluated just once beforethe loop is entered.Bykeeping the result in a temporary, the speed of execution of the whole loop is increased.
Tail-call optimization reduces the number of calls and returns executed bya program. If the last
thing afunction does is to invoke another function and immediately return the value there from, then thecompiler attemptsto re-use the same workspace area by just jumping to (rather than calling) thelower level function.The called function thenreturnsdirectlytowherethe upper level function wascalled from. Inthe case where the call isa recursive call to thesame function,then the workspace is exactly theright size,and asaving is alsomadebecause the stackadjustment instructions are no longer neededeither.This optimization saves speed andtotal stack space.
ST20–SWC
6/21
Workspace allocation by coloring reduces the amount of workspace required by using the
same word for two variables when it can be determined that they are not both required at the same time.
The optimizing compiler also implements a pragma, IMS_nosideeffects, whereby the user can indicate that a function does not have any side-effectson external or static variables. The optimizer can then use this information to make assumptions about what state can be changed by a function invocation and hence about the validity of any previously computed expressions.
2.2.5 Libraries
The full set of ANSI libraries is provided. The standard library operates in double precision. Versions of the mathematical functions are
provided that operate on float arguments and return float values. These libraries provide improved performance for applications where performance requirements override accuracy requirements.
A reduced Clibraryis supplied to minimize code sizefor embedded systemsapplications. Thislibrary is appropriate for code which does not need to access host facilities.
Collections offunctions canbe compiled separately withthe ANSIC compiler andthen combinedinto a library.The linker is used to combine separately compiled functions into a program.
2.2.6 Assembler inserts
The ANSI C Toolset provides a very powerful assembler insert facility. The assembler insert facility supports:
Access to the full instruction set of the ST20; Symbolic access to C variables (automatic and static); Pseudo operations to load values into registers; Loading results of C expressions; Labels and jumps; Directives for instruction sizing, stack access, return address access etc.
2.3 Support for embedded applications
The toolset has been designed to support thedevelopment of embedded applications. The features include the ability to place code and data at particular places in memory,being able to access the ST20 instruction set efficiently from C, and to reduce theC run-time overhead to suit the application.
2.3.1 Placing code and data
At configurationlevel,aprogram consistsof itscode,stack, staticandheap segments.Theconfigurer allocates each of these separate segments a place in the memory of the processor.
By default, the configurer allocates all the code and data segments to a contiguous default block of memory. The location of this default block and the order of the segments may be defined in the configuration description. The configuration description canalso specify that any one ofthe code or data segmentsofan application are tobeallocated to particularplacesin memory outsidethe default block.
The compiler,linker and collector each willoptionally produce alisting of how the various parts ofan application are mappedintothesegments andmemory.A tool is provided that canread all thesemap files and produce a summary of the whole application, giving the locations of all the functions and static variables. Information iscollated aboutcodeanddatasegments includingthe start address and size.
ST20–SWC
7/21
2.3.2 Access to the instruction set
ANSI C is a good language for writing embedded applications, since it combines the constructs of a highlevelprogramming languagewith low level access tothe hardwarethrough assembler inserts.
Tomake the access tosomeof the ST20 instructions even more effective,a number ofspecial library functions have beendefined which the optimizing compiler canrender as in-linecode. This removes the overhead of a library call, but it also gives the optimizer more information on what the program is doing.
Normally, when the optimizer sees a function containing some assembler code, it must make very conservative assumptions about theeffect the codehas on its surroundings, e.g. on static variables and parameters. By using the functions defined to access the instructions, the optimizer knows exactly whatthe effectswill be and can makethe correct assumptions forthe side-effectsof thecode.
The ST20 instructions that can be accessed in this way include block moves, channel input and output, bit manipulation, CRC computations, semaphores and some scheduling operations.
2.3.3 Run-time overhead reduction
In order to support the full ANSI C language, a significant run-time library is necessary.The toolset is suppliedwith another library,known as the
reduced library
,which doesnot support file system and
environment requests, which depend on a host. If some of the other features in ANSI C are not used, thenit may be possible to reducethe overhead
further by modifying the run-time initialization, the source of which is provided.
2.3.4 Assembler inserts
Within the SGS-THOMSON implementation ofthe ANSI C language, assemblercode can be written at any point to achieve direct access to ST20 instructions for reasons of speed and code size. Full access is available to the ST20 instruction set and C program variables.
2.3.5 Assembler
If there is no other way to obtain the code required, for example when writing customized bootstrap mechanisms, then thetoolset contains an assembler as thefinal phase of the compiler.This can be invoked to assemble user-written code.
2.3.6 Dynamic loading of processes
The toolset can encapsulate the code and data of a process in a file called a
relocatable separately-
compiled unit
or rsc. This form is suitable for it to be loaded byanother application andcalled. A set of functions is provided for this to be achieved. The rsc can be found either in a file, or already in memory,or is inputalong achannel. The memory variant allows anrsc to be placed into ROMand executed if required. For example, if an application wishes to select a device driver to be placed in on-chip memory,then a number of possible drivers can be placed in ROM and the application can choose one for the occasion, copy it into low memory and execute it.
2.3.7 Bootstraps
The source code of the standard bootstraps are provided. The user can then write bootstraps that are tailored to a specific application by using the standard ones as templates.
2.3.8 Memory configuration
An interactive memory configurer tool is supplied for describing a ST20450 memory configuration. The memory interface of the ST20450 is configurable and must be initialized before the memory can be accessed. This data is used by the Toolset tools to generate the code to initialize the memory
Loading...
+ 14 hidden pages