Suite56™ DSP Tools: User's Manual, Release 6.3
Suite56™ DSP Tools: User's Manual, Release 6.3
DSPS56TOOLSUM/D
Document Rev. 1.0, 07/1999
Suite56, OnCe, and MFAX are trademarks of Motorola, Inc.
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no
warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does
Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims
any and all liability, including without limitation consequential or incidental damages. “Typical” parameters which may
be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual
performance may vary over time. All operating parameters, including “Typicals” must be validated for each customer
application by customer’s technical experts. Motorola does not convey any license under its patent rights nor the
rights of others. Motorola products are not designed, intended, or authorized for use as components in systems
intended for surgical implant into the body, or other applications intended to support life, or for any other application in
which the failure of the Motorola product could create a situation where personal injury or death may occur. Should
Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify
and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims,
costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of
personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that
Motorola was negligent regarding the design or manufacture of the part.
Motorola and are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative
Action Employer.
All other tradenames, trademarks, and registered trademarks are the property of their respective owners.
Chapter 1
Selecting Tools
1.1 Compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.2 Assemblers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.3 Linkers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.4 Simulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
1.4.1 Data Streams and the Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
1.4.2 User Interfaces to the Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
1.4.3 Debugging with the Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
1.4.4 Online Help for the Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
1.5 Hardware Debugger: ADS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
1.5.1 User Interfaces to the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
1.5.2 Online Help for the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
Chapter 2
Testing Your Hardware Installation
2.1 Testing Your Installation of the Command Converter. . . . . . . . . . . . . . . . . . . . . 2-3
2.1.1 Testing through the Graphic User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
2.1.2 Testing through the Command-Line Interface . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2.1.3 Understanding the Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2.2 Testing Your Installation of a Target Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2.3 Testing a Low-Frequency Target Device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2.4 Choosing a Connector for the EVM Power Supply . . . . . . . . . . . . . . . . . . . . . . . 2-6
Chapter 5
Answers to Frequently Asked Questions
5.1 How do I customize Suite56 tools for my tasks? . . . . . . . . . . . . . . . . . . . . . . . . 5-1
5.2 I’m tired of initializing my development environment every time I start work.
Is there any way to save my development environment? . . . . . . . . . . . . . . . 5-2
5.3 I logged a sequence of commands to a command log file.
How do I run that sequence of commands again? . . . . . . . . . . . . . . . . . . . . . 5-3
5.4 I logged a sequence of commands to a command log file and tried to run it.
No luck. What should I do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
5.5 I’m having trouble debugging at low frequencies. . . . . . . . . . . . . . . . . . . . . . . . 5-3
5.6 How do I halt in mid-cycle in a Suite56 simulator? . . . . . . . . . . . . . . . . . . . . . . 5-4
5.7 Can I link my customized libraries to a Suite56 simulator? . . . . . . . . . . . . . . . . 5-5
5.8 How do I simulate input and output?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.9 How do I plot memory use?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.10 How do I get a listing with cycle counts? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.11 My program runs, but I want it to go faster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.12 My program runs, but it is too big. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.13 What does this error message mean?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Glossary
Index
If you have already chosen specific Motorola products, this manual explains how to
combine and use those products effectively. Furthermore, this manual is meant to be
platform-independent; whether you are working on a Unix work station, Windows NT,
or other host, this manual provides general guidance about getting the most from
Motorola code-development tools.
Audience
This manual is intended for software developers, applications programmers, or
hardware developers who are evaluating Motorola products or who are just beginning
to develop projects using Motorola components. It introduces you to generating and
debugging code for digital signal processors with Motorola tools.
Prerequisites
We assume that you are familiar with the host computer (i.e., the development platform)
where you are developing your own application or product and that if you encounter
difficulties there, you can consult your system administrator or other technical support.
Motorola code-development tools run on the following platforms:
• Windows NT
• Windows 95
• Hewlett-Packard HP-UX
• Sun OS 4
• Sun Solaris
As you work, you will need the reference manual for your cross-compiler or assembler.
There is a specific manual for each of the Motorola cross-compilers; there is a single
manual to cover all the available Motorola assemblers. You can retrieve copies of those
manuals from the Motorola website:
http://www.motorola-dsp.com/documentation
Similarly, you can find documentation for Motorola digital signal processors, including
their technical data sheets, their family reference manuals, and their device-specific
reference or user’s manuals at the same website.
To download examples of code that appear in this manual, go to the following website:
http://www.motorola-dsp.com/documentation/downloadable
Organization
This manual is organized into several chapters.
• Chapter 1, “Selecting Tools,” covers possible configurations of Motorola tools and
devices.
• Chapter 2, “Testing Your Hardware Installation,” supplies trouble-shooting
guidelines in the unlikely event you encounter difficulty while installing
Motorola tools.
• Chapter 3, “Debugging C and Assembly Code,” walks you through both C and
assembly programs, showing you how to set break points; how to create watch
lists; how to integrate C with assembly programs in the same application; how to
use memory control and map files.
• Chapter 4, “Tips about Special Projects,” is based on information gleaned from
Motorola customers who have used these development tools successfully in their
own projects.
• Chapter 5, “Answers to Frequently Asked Questions,” collects handy information
to help you customize your development environment and to avoid known
pitfalls.
A glossary and an index complete the manual.
Bibliography
The following documents are available from the Motorola Literature Distribution Center
(LDC) or on the Motorola website: http://www.motorola-dsp.com/documentation.
Motorola DSP56303 ADM Reference Manual (and other device-specific ADM manuals,
web only)
Motorola DSP56303 EVM Reference Manual (and other device-specific EVM manuals, web
only)
co m pile r
lin ker
no longer AA1641
Figure 1-1. Simple Code Development Cycle: Compile, Link, Execute to Debug
1.1 Compilers
Motorola recommends purchase of the Tasking C compiler for the DSP56300 and
DSP56600 families of digital signal processors. Motorola markets the m568c C compiler
for the DSP56800 family. Alternatively, Motorola distributes enhanced versions of the
ANSI-compliant GNU C compiler. These compilers are specific to families of Motorola
devices; that is, the g563c is an optimizing C compiler for the DSP56300 family of
devices, and the g566c for the DSP56600 family. There is no GNU C Compiler for the
DSP56800 Family. From its website, Motorola distributes these enhanced, optimizing,
GNU C compilers along with device-specific utilities, such as preprocessors, to give you
greater control over the runtime environment. Each of those optimizing, family-specific
C compilers implements the C programming language according to ANSI X3.159-1989.
The Suite56 C preprocessor that Motorola distributes also conforms to an ANSI standard.
It facilitates inclusion of arbitrary text files, supports conditional compilation, allows
macro definition and expansion. In fact, as an independent program, the preprocessor may
be used as a general purpose macro preprocessor.
op tio n -c
linker
By default, when you compile a C program with the Suite56 compiler, it silently calls the
assembler and then the linker to produce executable object code, as in Figure 1-2. If your
project can be contained in a straightforward C source file that does not require linking to
external libraries or other object files, then default compilation offers you a streamlined
path to project development. In contrast, if you choose the option -c, then the compiler
silently calls only the assembler, to produce object files that must be explicitly linked.
This option to link explicitly is obviously a good choice under several different conditions:
• if your project consists of many, large C source files; if those files are compiled
with option -c, then changes to one file will simply require recompilation of that
file and relinking to the others; you can save the time required to recompile the
unchanged files;
• if your project consists of a mixture of C source and assembly code;
• if your project needs to link to existing libraries or other object-code modules.
1.2 Assemblers
Each Motorola digital signal processor recognizes a set of machine instructions. A Suite56
assembler translates mnemonic operation codes (recognizable by humans) into machine
instructions recognized by a Motorola digital signal processor. An assembler also accepts
mnemonic directives indicating how it should behave. Suite56 assemblers, for example,
accept include directives, allowing you to put include files into applications based on
assembly code.
Suite56 assemblers understand algebraic expressions as arguments to directives and as
immediate operands in certain instructions. Suite56 assemblers also accept user-defined
macros, even nested macros, converting them into appropriate sequences of machine
instructions. Suite56 assemblers support conditional assembly, and they provide a suite of
transcendental functions (such as sine, cosine, natural logarithm) widely used in digital
signal processing. These features are documented in the Motorola DSP Assembler
Reference Manual. Figure 1-3 on page 1-4 illustrates some of the features of these Suite56
assemblers.
An assembler can produce various kinds of output:
• a relocatable object file (option -b)
• a listing of the source program (option -l)
• an object file with symbolic information from the source file (option -g)
• verbose reports about its progress (option -v)
• a report about loadtime and runtime memory use (option -mu)
• an absolutely located object file or executable object file (option -a) or relocatable
overlays (default)
equate files
assembler
relocatable object file
option -l
(*.cln)
listings
executable object file (*.lst)
COFF format (*.cld)
option -mu
linker
memory use reports
option -m
executable object file
COFF format (*.cld) map file
(*.map)
1.3 Linkers
A linker combines relocatable object files (such as files generated by a compiler or an
assembler) or object modules (such as parts of a library) into a single, new, absolute
executable file. With the option -i, the Suite56 linker can also produce a single, new,
relocatable file; such output can then in turn be linked itself, thus giving you a way to link
incrementally to produce a final executable file.
The executable output of a linker can be used in a variety of ways:
• it can be executed on a target platform;
• it can be loaded into a simulator and executed there;
• it can be downloaded into a system in development;
• it can be converted to Motorola S-record format to program into various types of
non-volatile memory (e.g., Flash, EPROM, PROM);
• it can be sent to Motorola to generate mask ROM for devices that include ROM;
• it may include symbolic information from the source code to use in a debugger
(option -g).
In addition to its executable output, the Suite56 linker can optionally produce other kinds
of output:
• map files (option -m);
• sorted list of symbols and their load-time values (option -m also).
You can control the Suite56 linker by means of command files. With the option -f, you
can control the linker through a command-line file. With the option -r, you can use a
memory-control file as in Figure 1-4.
C source files
make utility
compiler
One of the most powerful features of the Suite56 linker is its facility for memory control
files. Through a memory control file, you can manage how the linker fills in addresses in
relocatable object files. This ability means that you can place sections of code precisely in
memory on your target device, at designated addresses according to your directives to the
linker in memory control files. This facility is indispensable, of course, for managing
overlays of sections in program memory, X data memory, or (on certain Motorola digital
signal processors) Y data memory. For details about memory maps for specific Motorola
devices, see the memory map chapters of the device family manual (e.g., DSP56300
Family Manual) and device user’s manual (e.g., DSP56307 User’s Manual). For an
example of a memory control file and memory map file, see Section 3.5, "Exploiting
Memory Control Files," on page 3-25 in this manual, as well as the Motorola DSP
Linker/Librarian Reference Manual.
1.4 Simulators
A Suite56 simulator is a software implementation of a hardware device, such as a digital
signal processor. As such, a simulator is advantageous in a number of ways:
• Whereas hardware for code development may be costly or limited in number,
software simulators can serve any number of developers.
• As software, a simulator may be more portable—in the sense of traveling from
office to home, for example—than comparable hardware for code development.
• Simulators can be reset remotely, unlike hardware for code development. If you are
working remotely (from home, for example), a simulator reset is much less
cumbersome than a physical hardware reset.
• Suite56 simulators also offer detailed profiles of code execution—profiles
unavailable through hardware for code development.
icrophone
A/D CODEC synchronous serial
analog digital interface (SSI) port
real-time application
analog digital
D/A CODEC Motorola dsp
speaker
synchronous serial
simulated input file interface (SSI) port
simulated development
simulated output file
Suite56 dsp simulator
Help menu
The Motorola DSP Simulator Reference Manual documents options available for both
interfaces of the simulator. In this manual, the answer to a frequently asked question offers
guidelines for customizing your interface to a Suite56 simulator (Section 5.1, "How do I
customize Suite56 tools for my tasks?," on page 5-1).
session window
command line
help line
Figure 1-7. Text-Based Interface of the Simulator
37-pin 14-pin
interface ribbon
cable cable
host computer
Motorola DSP
host-bus
interface card
command
converter
Help menu
In the text-based, command-line interface, when you type a command on the command
line, then the syntax of that command appears automatically on the help line. If you type a
question mark after a command on the command line, then more help, in addition to the
command syntax, appears in the window.
host computer
Motorola DSP
host-bus
interface card
command
converter
In contrast to the previous test, where both commands were prefixed by “c” to direct them
to the command converter, these commands are directed to the application development
module, the evaluation module, or your own target board. The first command, force s,
resets both the command converter and the target device. The second command displays
the contents of registers on the target device.
If both commands execute successfully and, as a consequence, you see register contents,
then you can be sure that your hardware installation is correct. If you encounter difficulty
at this point, then check whether the cable between the command converter and the target
device is working properly. If your cable is sound and your target device is a Suite56
product (e.g., Suite56 ADM or EVM), then contact your Motorola distributor for help in
determining whether your target board is defective and requires replacement.
Anytime you want to repeat that sequence of logged commands, from the File menu,
choose Macro. A dialogue box appears for you to indicate which file you want to execute.
From the text-based, command-line interface, you can also save a sequence of commands
in a log file. You type the log command with two parameters: the option “c” to indicate
that you want to log only commands and the argument of a file name for the log file. With
a third option, you can also indicate whether you want to overwrite an existing file or
append new commands to an existing file, as in Example 3 -1.
To reuse such a command log file later, simply type the name of the log file on the
command line. (In the graphic user interface, the command line is located in the Command
window.) If you have difficulty with this step, check the answers to the FAQs about
command log files on page 5-3.
Example 3 -1. Logging Commands to a File for Reuse
> log c mycommands.cmd -a ; appends commands to mycommands.cmd
> log c mycommands.cmd -o ; overwrites mycommands.cmd with new commands
The routine main initializes two input buffers and then invokes the routine ltp. This
routine consists of an internal and external loop, which together compute a sum of
products calculated from elements of the two input arrays. In other words, ltp
implements a convolution. To do so, it uses these features:
• The two arrays, signal_lin[] and signal_dpri[], are vectors of fractions.
• Fractional multiplication is performed by result = lmult (inp1, inp2).
• Fractional addition is performed by result = add_long (inp1, inp2).
With this example, we will highlight these debugging tasks: setting breakpoints and using
the go command effectively; defining a watch list; tracing; evaluating C expressions
(Don’t forget the curly brackets!); and casting.
Note: The C code in Example 3 -2 will not actually link successfully. It lacks the
definition of two C library routines, add_long(); and lmult();. Because
both of those routines are platform-dependent, in a linkable example, we use
#define for those definitions.
2. Under Breakpoint Number select the number you want to assign to this
breakpoint. The default number that is shown is the next available number.
Breakpoint numbers do not have to be consecutive, they can be assigned arbitrarily.
For example, it may be convenient to allocate breakpoints so that one function is
assigned breakpoints 1 to 10, another 11 to 20, and so on.
3. Under Count secify how many times the Debugger should encounter the
breakpoint before performing the action. For example, if you set the count to 3, the
breakpoint will be triggered the third time that the breakpoint is encountered. Real
time execution will be affected if you set the count to more than one.
4. If you have assigned an input file, you can mark EOF. The breakpoint will be acted
upon when the input file reaches an end-of-file. If you have marked EOF, under
Input File Number select the number of the input file. The input file number is the
number that you designated when you assigned the input file.
5. Under Type select the type of software breakpoint to set. If you select al, the
breakpoint will always be acted upon. Breakpoint types other than al are
conditional and device specific.
6. Under Address, type the address where you want the breakpoint to be set. For
example, to set a breakpoint at address $103 in p memory, type: p:$103
Note: This address must be the first word of an instruction.
Note: If you have set the breakpoint type (in step 5) to a conditional breakpoint (that
is, any type other than al), the breakpoint can only be set to an address which
contains a nop. Setting the breakpoint to an address which contains any other
opcode will cause your program to execute incorrectly.
7. Under Expression you can type an expression. The expression will be evaluated
when the address you specified is reached. If the expression is true, the breakpoint
will be triggered. If the expression is false, no action is taken and program
execution continues. Be aware that a side effect of evaluating an expression
(whether it is true or false) is that the program will not be executed in real time.
8. Under Action select what action is taken when the breakpoint is encountered:
Note Displays the breakpoint expression in the Session window each time it is true. Program
execution continues. The display in the Session window is not updated until program
execution stops.
Command Executes a Debugger command at the breakpoint. Device execution commands, such as
TRACE or GO, will not execute.
3. Click OK.
The breakpoints you selected are now deleted.
Breakpoints will not be renumbered. For example, if you have set breakpoints #1,
#2, and #3, and then clear breakpoint #2, the remaining breakpoints will be
numbered #1 and #3.
Notice that breakpoints are indicated in the Assembly window and the Source window (if
applicable). Enabled breakpoints appear in blue. Disabled breakpoints appear in pink.
2. Under Type select the type of hardware breakpoint to set. Breakpoint types are
device specific. See Table 3-2 for an explanation of each type of breakpoint.
3. Under Memory Space, select the memory space in which the breakpoint is to be
set.
4. Under First Condition specify the conditions under which the breakpoint occurs.
Under Access indicate what kind of access should be detected by the breakpoint.
For example, if you want the breakpoint to detect when a memory location is read
but not written to, select Read. If you want either a read or a write to be detected,
chose Read/Write, etc.
Under Address Qualifier indicate the qualifier for the address location.
Under Address type the address that the breakpoint references.
Note Displays the breakpoint expression in the Session window each time it is true. Program
execution continues. The display in the Session window is not updated until program
execution stops.
Command Executes a Debugger command at the breakpoint. Device execution commands, such
as TRACE or GO, will not execute.
11. If the action specified is to execute a command, under Command type the
Debugger command.
12. Click OK.
In the text-based interface, to define a watch list, use the watch command, as in Example
3 -3.
Example 3 -3. Defining a Watch List
> watch r0 ; adds the register to the watch list
> watch x:0 ; adds memory location to the watch list
> watch {signal_lin[ind1]} ; adds item of array to the watch list
> watch ; displays the current watch list
To remove an item from a watch list, in the graphic user interface, from the Display menu,
choose Watch, and then select Off. A dialogue box appears for you to select items to
remove from the watch list.
To remove an item from a watch list in the text-based interface, use the watch command
followed by the number of the watch item and the off option, as in Example 3 -4
Example 3 -4. Removing Items from a Watch List
> watch ; displays current watch list to show item numbers
> watch off ; removes all items from the watch list
> watch #1 off ; removes first item from the watch list
To trace in the graphic user interface, from the Execute menu, choose
Trace. A dialogue box appears for you to indicate cycles, lines, or
instructions, how many, and whether to halt at breakpoints.
To trace in the text-based interface, type the trace command with
options and parameters to indicate how you want the trace to proceed.
Use the Next button on the toolbar to skip over subroutine calls and step through
execution routine by routine. In other words, the Next button recognizes which
assembly instructions make up a C routine, effectively executes each routine to
completion, and then steps from that executed routine to the first instruction of the next
routine. (See Section 3.3.2, "Tracing Assembly Code," on page 3-23, for suggestions
about stepping through code instruction by instruction.)
again and choose Close. A dialogue box opens for you to indicate that you want to close
the Profile log file. Closing that file will end that profile.
In the text-based interface of the simulator, first load your executable program, both
symbols and memory. Then use the log command with two arguments: the option p to
indicate profile and a name for the profile log file. A third option indicates whether to
append the profile to an existing file (option -a), to overwrite any existing file of the same
name (option -o), or to cancel the profile if a file of the same name already exists
(option -c). To end a profile, use the log command with the option off.
include "iodata.h"
define P_MEM "0"
define X_MEM "1"
define Y_MEM "2"
define L_MEM "3"
org y:
data_in ds1
data_out ds1
set
i 0
xdef
coefficients
coefficients dupa coef,-
21.0/231.0,14.0/231.0,39.0/231.0,54.0/231.0,59.0/231.0,54.0/231.0,39.0
/231.0,14.0/231.0,-21.0/231.0
dc coef
set i i+1
endm
num_taps equ i ;number of taps in filter
reg_stack ds 10 ;stack space for registers
org x:0
buffer dsm data_points ;saved data out
states dsm num_taps ;filter states
org p:0
jmp begin
dup $100-*
nop
endm
org p:$100
begin
move #reg_stack,r7 ;point to register stack
move #0,sp ;clear stack pointer
move #states,r1 ;point to filter states
move #num_taps-1,m1 ;mod(num_taps)
move #coefficients,r5 ;point to filter coefficients
move #num_taps-1,m5 ;mod(num_taps)
move #buffer,r6 ;point to storage buffer
move #data_points-1,m6 ;mod(data_points)
move #0,x0
rep #num_taps
move x0,x:(r1)+ ;clear tap states
rep #data_points
move x0,x:(r6)+ ;clear data points
.loop
do #data_points,end_fir ;one loop for each tap
jsr fir_filter
fir_filter
clr a x0,x:(r1)+ y:(r5)+,y0 ;save first state
rep #num_taps-1
mac x0,y0,a x:(r1)+,x0 y:(r5)+,y0
macr x0,y0,a (r1)-
rts
endsec
end
Breakpoints can have several different effects. How you set the breakpoint depends in part
on the effects that you want to achieve:
• To set a halt breakpoint.
In the graphic user interface, double-click in the Assembly window on the
instruction where you want the break to occur. The break command then appears
automatically in the Command window, and the Assembly window highlights the
address you clicked.
• To set a breakpoint that increments a counter:
In the graphic user interface, from the Execute menu, choose
Breakpoint, and then select Set. A dialogue box appears for
you to indicate in the Action pane which counter to increment.
•To set a breakpoint that writes to a Session window:
In the graphic user interface, from the Execute menu, choose
Breakpoint, and then select Set. In the dialogue box that
appears then, indicate Note in the Action pane of the window.
Regardless of how you set them, breakpoints are numbered, so that you can refer to them
as you watch them, disable them (i.e., turn them off), reenable them (i.e., turn them on
again), or direct execution to continue until it reaches a particular breakpoint. Moreover,
you can set more than one breakpoint at the same place to achieve more than one effect
(e.g., halt and increment a counter and write to the Session window and execute a
user-defined routine).
To continue execution after a breakpoint, in the graphic user interface, click the Go
button. In the text-based interface, type the go command on the command line.
You can also step through in groups of instructions. In the graphic user
interface, from the Execute menu, when you choose Step, a dialogue
box appears for you to indicate in the Count pane how many
instructions make a step. For the same effect, you can also use the
count option of the step command in the Command window.
For a different effect, use the Next button on the toolbar to step through routine
by routine. In other words, the Next button recognizes which instructions make
up a routine, effectively executes each routine to completion, and then steps from
that executed routine to the first instruction of the next routine.
To assemble those two files, we use the commands to the assembler in Example 3 -11. The
option -b makes the assembler produce object files. Since no other option appears in each
command, the assembler will produce relocatable object files.
The commands in Example 3 -11 create relocatable object files, section_a.cln and
section_b.cln, that can then be linked. For the purpose of this example, we assume
that we want the block of zeroes set up by section_a.asm to start at location x:$333
and the block of ones set up by section_b.asm to start at x:$555. We use the memory
control file in Example 3 -12 to place those blocks at the target locations.
Example 3 -12. A Memory Control File: sec.ctl
section section_b
base x:$555
section section_a x:$333
The two files are linked with the command in Example 3 -13. The option -b indicates that
an object file will be created as linker output. The option -m indicates that a map file
named out.map will be created as well. (That file is of particular interest to us in this
example.) The option -r indicates that the linker should consult a memory control file (in
this example, named sec.ctl) to determine where to place sections in memory on the
target device.
Example 3 -13. Command to Link Memory Control File to Object Files
> dsplnk -b -mout.map -rsec.ctl section_a section_b
You see the contents of the resulting map file in Example 3 -14. When you use memory
control files (as we did in this example), check the resulting map file to determine whether
you achieved the memory mapping that you expected. By consulting the user’s manual of
the target device (in this example, DSP56300), particularly the chapter about memory
mapping, we know that certain parts of X memory are reserved; those parts are marked
UNUSED in the map file. If those reserved portions of memory were in use, then we would
know that our program was mapping memory inappropriately, and we would
consequently search for the source of that bug.
X Memory (0 - default)
command
host-bus converters1
interface card
14-pin
ribbon
cables
DSP0 DSP7
Notes: 1. There is a jumper setting on each command converter to select address, DSP0 . . . DSP7.
In contrast, if all the digital signal processors in your project have a JTAG interface, then
you can connect up to 24 such devices through a single command converter for debugging
through a Suite56 ADS debugger. From the point of view of the debugger, the digital
signal processor nearest TDO (test data output signal) on the JTAG interface of the
command converter is numbered device 0, and the digital signal processor nearest TDI
(test data input signal) on the JTAG interface of the command converter is the highest
numbered device, as in Figure 4-2. Connect each digital signal processor through its own
TDO to the TDI of its successor.
37-pin
interface
cable TDI TDO TDI TDO
DSP(n-1) DSP(n-2)
host computer
TDI
TDO
command
host-bus converter
interface card TDO TDI TDO TDI
DSP0 DSP1
Figure 4-2. Connecting Devices through Their JTAG Interfaces for Debugging
A simulator maintains a separate window of each of these types for each simulated device:
• Assembly window to display the assembled code loaded for that device;
• Breakpoints window to display the breakpoints defined for that device;
• Calls window to display function calls to that device;
• Input window to display simulated input to that device;
• Memory window to display designated locations on that device;
• Output window to display simulated output from that device;
• Register window to display designated registers of that device with their contents;
• Session window to display session activity with respect to that device;
• Stack window to display the C function stack (if appropriate);
• Source window to display C source code (if appropriate);
• Watch window to display items on a watch list for that device.
Those windows are titled with the device number (e.g., Dv00 Assembly or Dv28 Source)
to help you identify data associated with each device.
To tie pins together (so that the output from one pin becomes
input to another pin), from the File menu, select Input, and
then choose Pins. A dialogue box appears for you to indicate
which pins to tie together. In the same dialogue box, you also
indicate devices by number, so that you can tie together pins
on the same device or on different devices (if you are
working on a simulation of multiple devices).
To connect one memory location to another (so that the value read from one location
becomes the value written to another), from the File menu, choose Input, and then select
Address. A dialogue box opens for you to indicate which memory locations to connect.
Again, the locations may be on the same device or on different devices, so you can also
indicate the device of the source location.
To apply a pin file, in the File menu, choose Input, and then
select Open. A dialogue box appears for you to indicate in
the From pane that the input comes from a file and in the To
pane that it applies to a pin. In the File Name pane, you
indicate the name of the input file.
In the text-based interface, use the input command with the
pin name and file name as parameters to apply a pin file to a
pin.
4. Tie the output of the second device to the SSI input pin of the first simulated
device.
In the File menu, choose Input, and then select Pins. A dialogue box appears for
you to indicate that you want to tie the output of device 2 to the SSI input of
device 1.
5. Execute your program. For example, click the Go button.
You can create a startup.cmd file either by logging commands (as explained in
Section 5.1 ) or by writing its contents yourself with an ordinary text editor. Use the same
syntax as you use for commands on the command line of the tool, and use the same
conventions for indicating paths, directories, file names, and so forth as appropriate for
your operating system.
If you work on more than one development project, you can define a separate
startup.cmd file in its own project directory for each of your projects.
int
dsp_execp (int devindex)
The usual dsp_exec call is actually made up of a series of calls to internal phase
functions. Example 5 -3 shows you that function as it is implemented in simutil.c.
Example 5 -3. The Function dsp_exec
void
dsp_exec (int devindex)
{
if ((devindex < 0) ||
(devindex >= dv_const.maxdevices) ||
!(dv_var = dv_const.sv[devindex]))
{
return;
}
if (!dv_var)
return;
dsp_exec_t0_pos(devindex);
dsp_exec_t0_neg(devindex);
dsp_exec_t1_pos(devindex);
(void)dsp_exec_t1_neg(devindex);
}
When you assemble your application, use the option -mu to report loadtime memory use,
and use the option -g to include debugging information in the output of the assembler.
Then load your assembled application into your Suite56 simulator.
After loading the assembled application into the simulator, then from the File menu,
choose Log, and select Profile. A dialogue box appears for you to indicate the location
and name of a log file to save the profile that the simulator will generate for you.
Then execute your application in the usual way. The profile appears in two files: an
ordinary ASCII-file with the extension .log, and a PostScript file with the extension .ps.
You can view the contents of the .log file through any text editor or the PostScript file
through a PostScript viewer. The same information appears in both files:
• a routine call graph;
• a graph of dependencies between routines in your application;
• a list of which parts of your application executed;
• indications of program flow and control;
• lists of instructions used by instruction type;
• lists of memory locations and the number of reads and writes to those locations.
The error, exception, and page fault mean you are using the old, outdated DOS version of
a Suite56 tool, which depended on a memory extension mechanism that did not always
work reliably. We urge you to use the NT or Windows 95 version of the tool instead.
(Contrary to urban myth, the NT and‘95 versions of Suite56 tools are not greater “resource
hogs” than the DOS version.)
Motorola Glossary-1
overlaying is a strategy of repeatedly using the same location in memory for the
execution of different pieces of code at different times during the execution in order to
maximize limited memory.
radix is the basis for computing the value of a group of digits. For example, the digits 32
represent the number thirty-two when the radix is decimal but the number fifty when
the radix is hexadecimal; likewise, the digits 101 represent one-hundred one in decimal
radix, but five in binary radix.
relocatable object file is one in which the locations of symbols in memory are expressed
relatively. The file can thus be relocated on the basis of an absolute position supplied
later to produce an absolute executable file before execution.
simulation is a software implementation of a hardware phenomenon.
simulator is a program implementing hardware phenomena in software.
B D
break 3-12 data streams, simulated 1-7
breakpoint 3-9, 3-10, 3-11, 3-13, 3-14, 3-15, debugger 1-10
Glossary-1 see also ADS application development system
continuing execution after 3-22 dependencies graph 5-6
displaying 3-15 device
halt 3-8, 3-22, Glossary-1 low frequency 2-5
incrementing counters 3-8, 3-22 setting current 4-6
memory location 4-7, 4-8 setting default 4-6
multiple memory locations 4-7 directory
range of addresses 4-7 current 3-2, 5-1
registers 4-9 path 5-1
setting 3-8, 3-22, 4-7 working 3-2, 5-1
writing to Session window 3-8, 3-22 displaying
breakpoints 3-12, 3-13, 3-14, 3-15 breakpoints 3-15
call stack 3-18
C memory 3-5
peripheral names 4-5
call graph 5-6 pin names 4-4
call stack 3-18 registers 3-4
calling conventions 3-24 windows at start up 5-2
casting
C types 3-17 E
notation 3-17
user-defined types 3-17 error message 5-7
command converter evaluating
setting up 2-3 casts 3-17
testing 2-3 expressions 3-16
command log file EVM evaluation module Glossary-1
creating 5-2 power supply 2-6
executing 5-3 example
reusing 5-2 convolution 3-5
compiler 1-2, Glossary-1 downloadable from website xii
compiling finite impulse response filter (FIR) 3-19
Motorola Index-1
long-term predictor (LTP) 3-5 H
map file 3-26
memory control file 3-25 halting
test command converter 2-4 breakpoint Glossary-1
test target device 2-5 mid-cycle 5-4
exception in error message 5-7 on a clock phase 5-4
executable file on instruction boundary 5-4
absolute 1-4 hardware 3-12, 3-13
command file 5-3 hardware debugger see ADS application development
relocatable 1-4 system
startup.cmd 5-3 help
executing ADS debugger 1-12
after breakpoint 3-22 simulator 1-9
command log file 5-3
file of commands 3-3 I
macros 3-3
multiple devices 4-3 incremental linking 1-4
profiler 3-18 input
routines 3-17, 3-23 simulating 5-5
expression timed 5-5
evaluating 3-16 interrupt, simulating 4-4
notation 3-16
L
F
linker 1-4, Glossary-1
file command files for 1-5
absolute executable 1-4 customized libraries and 5-5
map 3-26 incremental 1-4
memory control 3-26 linking
pin 4-4 commands files and 1-5
relocatable executable 1-4 customized libraries 5-5
relocatable object 1-4, Glossary-2 incremental 1-4
startup.cmd 5-2 listing
file extension assembly source 1-3
.asm 1-3, 3-20 , 3-25 cycle counts 5-6
.c 3-7 logging
.cld 1-3 commands 3-2, 5-2
.cln 1-3, 3-26 session 3-3
.cmd 5-2, 5-3 low-frequency target device 2-5
.ctl 3-26
.h 3-21 M
.log 3-18, 5-6
map file
.lst 1-3
checking memory control 3-26
.map 1-3, 3-26
example 3-26
.ps 3-18, 5-6
memory
font, selecting 5-2
connecting locations 4-4
G displaying 3-5
profiling access 5-6
GO 3-14 memory control file
graphic user interface Glossary-1 checking results 3-26
ADS hardware debugger 1-12 example 3-25
simulator 1-8 extension 1-5
GUI see graphic user interface Motorola website xii, 5-1
Motorola Index-3
displaying source code 4-3
function calls 4-3
preferences 3-1, 5-2
session 4-3
simulated input 4-3
simulated output 4-3
watch list 4-3