Engineer-to-Engineer Note EE-202
a
Technical notes on using Analog Devices DSPs, processors and development tools
Contact our technical support at dsp.support@analog.com and at dsptools.support@analog.com
Or vi sit our o n-li ne r esou rces htt p:/ /www.analog.com/ee-notes and http://www.analog.com/processors
Using the Expert Linker for Multiprocessor LDFs
Contributed by Maikel Kokaly-Bannourah Rev 2 – September 10, 2004
Introduction
This EE-Note explains the use of the Expert
Linker (EL) for creating Linker Description Files
(LDFs) for Multiprocessor (MP) systems.
Although, this concept applies to VisualDSP++™
for all SHARC® Processor families (ADSP21x6x and ADSP-TSxxx), the examples shown
throughout this document are for the ADSPTS101S TigerSHARC® Processor.
The example code used for this note is based on
Introduction to TigerSHARC Multiprocessor
Systems Using VisualDSP++(EE-167) [4] and it
was written using VisualDSP++ 3.5 for 32-Bit
TigerSHARC Processors (Update July 2004).
Expert Linker Overview
The Expert Linker is a graphical tool that
simplifies complex tasks such as memory map
manipulation, code and data placement, overlay
and shared memory creation, and C stack/heap
usage. This tool provides a visualization
capability enabling new users to take immediate
advantage of the powerful LDF format flexibility
in a very user-friendly way.
Files (LDFs) (EE-69) [3] for a general
description on the LDF), and EE-167 (for an
explanation on the different multiprocessor
linker commands).
Expert Linker LDF Wizard
The Expert Linker (EL) wizard is used to
generate an LDF for new VisualDSP++ projects.
However, the Expert Linker can also be used to
view or modify an already existing LDF.
Open the project (MP TS101.dpj) attached to this
note. The source code comes with no LDF,
which will be created, step-by-step, through this
note.
Please note that an MPTS101_orig_ldf.txt
containing an already created LDF file is
available as a reference.
Let’s now get started with the creation of the
LDF. First of all, to invoke the Expert Linker
wizard choose from the pull-down menu as
shown in Figure 1.
This note assumes a basic understanding of the
Linker Description File as well as the way the
linker utility (linker.exe) operates. For detailed
information on this utility as well as the LDF,
please use the VisualDSP++ on-line help. Also,
refer to the VisualDSP++ 3.5 Linker and Utility
Figure 1. Invoking the Expert Linker Wizard
Manual for 32-Bit Processors [2] and
Understanding and Using Linker Description
Copyright 2004, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of
customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property
of their respective holders. Information furnished by Analog Devices Applications and Development Tools Engineers is believed to be accurate and reliable, however
no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices’ Engineer-to-Engineer Notes.
Figure 2 shows the start up window when first
invoking the EL wizard.
Figure 2. Expert Linker Wizard Start-up Window
Click Next.
Project type
At this stage, the user needs to specify the project
information corresponding to the project type for
which the LDF is being generated. As shown in
Figure 3, the type can be C, C++, Assembly or
VDK.
Figure 3. Project Type
Click Next.
Selecting an MP LDF
By default, the LDF is for single processors.
Choose the Multiprocessor box for MP support
(Figure 4).
a
Note that in case a mix of assembly and C files
or any other combination is used, the most
abstract programming language should be
selected. For example, for a project with C and
assembly files, a C LDF should be selected.
Similarly, for a C++ and C project the C++ LDF
should be selected.
In this particular example, the files source code
is assembly, and therefore the selected project
type is also Assembly.
The LDF name is specified here as well, which
by default uses the same as the project name.
Note that if an LDF file already exists, the user
will be prompted whether to replace the existing
file.
Using the Expert Linker for Multiprocessor LDFs (EE-202) Page 2 of 10
Determining the Number of Processors and MP
Memory Offset Values
Right click on the Processor Properties box to
add the desired number of processors to be
included in the LDF. For this particular example,
a dual processor system is selected. Therefore, a
second processor (P1) needs to be added to the
list.
Figure 4. Multiprocessor LDF selection
a
Figure 5. Processors and MMS Offset
As it can be seen in the Processor window
(Figure 5), the multiprocessor memory space
(MMS) offset value is automatically added in by
the EL. This helps the user to avoid having to
worry about specific MP addresses and memory
offsets, making the use of MP commands much
easier. This is an automatic replacement for the
linker command MPMEMORY used in the LDF
source file.
Linking Processors Executables
In the Output File box, the user can specify the
name of the executable file for each processor in
the system. By default, the EL selects the same
name for the .dxe file as for the processor name.
In this case, P0.dxe and P1.dxe are selected as
the names for the DSP executable files and are
placed in the Debug folder within the project
folder.
Figure 6. Executables to Link Against
As it would be done in the LDF source file with
the LINK_AGAINST command, the EL allows
the user to resolve symbols declared within MP
space. This is done by simply specifying for each
processor to which DSP to link against.
In this particular example, symbols referenced in
P0, but declared in P1 can be resolved by the
linker by adding
$COMMAND_LINE_OUTPUT_DIRECTORY/P1.dxe to the
Executable to Link Against box (Figure 6) for P0.
Similarly, $COMMAND_LINE_OUTPUT_DIRECTORY/P0.dxe is
added for P1. In cases where more than one .dxe
is added to this box, commas or spaces can be
used as separators.
Now that an MP LDF has been selected, the
processors have been added to the list, and the
relevant linker commands have been specified,
the LDF is ready for completion.
Click Next.
Note that in the case where shared external
memory is used (shared.sm), this would also
need to be added to the link against command
box. This is automatically handled by the EL and
will be explained later on.
Using the Expert Linker for Multiprocessor LDFs (EE-202) Page 3 of 10