IBM
Contents Index Previous Next



Targeting using the Cmicro Package


Directory Structure

At first it is necessary to know the directory structure the Cmicro Package is stored in.

On UNIX, the Cmicro Package is contained in $sdtdir/cmicro.

In Windows, the Cmicro Package is contained in %SDTDIR%\cmicro.

cmicro
+-- include
+-- kernel
+-- mcod
+-- template
+-- commlink
+-- tester

Furthermore all files, which are used when targeting Cmicro, are definitely stored in this directory tree. Otherwise the files are generated by the Cmicro SDL to C Compiler or by the Targeting Expert.

Prerequisites

Before starting the targeting with Cmicro it is necessary to have an SDL system designed and already tested with the help of the Simulator.

This means targeting begins when the first testing phase is finished.

All steps of targeting will be discussed in the following sub-sections.

Different Steps in the Work Flow

All the different operation steps listed here will completely supported by the Targeting Expert (see The Targeting Expert).

  1. To start the Targeting Expert, select the entry Targeting Expert in the Organizer's Generate menu.
  2. Select pre-defined integration settings or <user defined> for a new integration. See Pre-defined Integration Settings.
    • select the Code Generator Cmicro (if not automatically done)
    • select the compiler (if not automatically done)
      The Cmicro SDL to C Compiler will automatically be invoked and generates the following files (assumed that separation is not selected):

sdl_cfg.h

the automatic configuration

<systemname>.c

the SDL system

<systemname>.ifc

the environment header file

<systemname>_gen.m

the sub-makefile (Targeting Expert)

<systemname>.xrf

the X-References (not used)

<systemname>.sym

the symbol file (SDL Target Tester)

  1. Specify the compiler, linker and make settings (if not automatically done).
    Please view Configure Compiler, Linker and Make.
  2. Configure and scale the generated C code and the Cmicro Library.
  3. Copy template files.
    Several files of the Cmicro Package are delivered as template files. This is done because lots of things can only be done by the user as they must fit to the user's SDL system. The template files give easy to use C functions including help to adapt them to the user's needs.
    All the files mk_stim.c, mk_user.c and mk_cpu.c should be copied into the project's directory tree (generated by the Targeting Expert). All these files are stored in the template directory.
    If the SDL Target Tester should also be used it is necessary to copy the files mg_dl.c and the files describing the preferred communications link (e.g. the file 8051_v24.[ch] if an 8051 micro controller and a V.24 interface should be used) into the project directory, too. The file mg_dl.c is stored in the template directory and the communications link files are stored in template/commlink if contained in the Cmicro Package delivery. Please view the sub-section The Communications Link's Target Site to get information about how to create an own communication link.
    Please view also Source Files to get information on how to add more files to the list of files to be compiled. The Targeting Expert will automatically add these files to the makefile.
  4. Full make the complete system.
    It is probably necessary to do an environment connection first (see Connecting the SDL Environment).
  5. Download and execute the executable.
    The following sections in the Targeting Expert's manual (The Targeting Expert) should be checked to find out how these steps can be eased:

Connecting the SDL Environment

From the Cmicro Package's point of view the SDL environment is represented in template C functions. A short overview of this C functions is given here. For further information please view Bare Integration.

Note:

All the modifications of env.c should only be done between the comments /* BEGIN User Code */ and /* END User Code */. All the other modifications will be lost when re-generating the env.c file.

Note:

All the modifications of env.c should only be done between the comments /* BEGIN User Code */ and /* END User Code */. All the other modifications will be lost when re-generating the env.c file.

The compilation and linkage of the environment functions can be prevented by using the flags given in Compilation Flags.

Different Forms of Target Integration

Different forms of target integration, that is, integrating generated C code, are distinguished:

Bare and Light integration represent the most easiest form of integration.

Bare integration is described in Bare Integration.

Light integration is described in Light Integration.

Tight integration can be performed with Cmicro, but the complexity makes it difficult to describe the integration in this section. It is a generic solution available, which guides thought the integration.

Please contact IBM Rational local sales office/Professional Services for further information.


http://www.ibm.com/rational
Contents Index Previous Next