Analog Devices, Inc. reserves the right to change this product without
prior notice. Information furnished by Analog Devices is believed to be
accurate and reliable. However, no responsibility is assumed by Analog
Devices for its use; nor for any infringement of patents or other rights of
third parties which may result from its use. No license is granted by implication or otherwise under the patent rights of Analog Devices, Inc.
Trademark and Service Mark Notice
The Analog Devices logo, the CROSSCORE logo, VisualDSP++,
Blackfin, SHARC, TigerSHARC, and EZ-KIT Lite are registered
trademarks of Analog Devices, Inc.
All other brand and product names are trademarks or service marks of
their respective owners.
CONTENTS
PREFACE
Purpose of This Manual ................................................................. vii
Intended Audience ......................................................................... vii
Manual Contents .......................................................................... viii
What’s New in This Manual .......................................................... viii
Technical or Customer Support ....................................................... ix
Supported Processors ....................................................................... ix
Product Information ....................................................................... xi
MyAnalog.com .......................................................................... xi
Processor Product Information ................................................... xi
Related Documents .................................................................. xii
Online Technical Documentation ............................................ xiii
Accessing Documentation From VisualDSP++ ...................... xiv
Accessing Documentation From Windows ............................ xiv
Accessing Documentation From the Web ............................... xv
Printed Manuals ........................................................................ xv
VisualAudio or VisualDSP++ Documentation Set .................. xv
Hardware Tools Manuals ....................................................... xv
Processor Manuals ................................................................. xv
VisualDSP++ 4.5 Getting Started Guideiii
CONTENTS
Data Sheets ......................................................................... xvi
Contacting DSP Publications ................................................... xvi
Notation Conventions ................................................................... xvi
FEATURES AND TOOLS
VisualDSP++ Features .................................................................. 1-1
Code Development Tools .............................................................. 1-5
Connecting to a Debug Session ..................................................... 1-6
Exercise One: Using Profile-Guided Optimization ......................... 3-2
Step 1: Load the Project ........................................................... 3-4
Step 2: Configure a Data Set .................................................... 3-5
Step 3: Attach an Input Stream .............................................. 3-10
Step 4: Configure Additional Data Sets .................................. 3-15
Step 5: Create PGO Files and Optimize the Program .............. 3-17
Step 6: Compare Execution Times ......................................... 3-18
Exercise Two: Using Background Telemetry Channel ................... 3-22
Adding BTC to Your DSP Application ................................... 3-22
Running the BTC Assembly Demo ........................................ 3-24
Step 1: Load the BTC_AsmDemo Project .......................... 3-25
Step 2: Examine the BTC Commands ................................ 3-26
Step 3: Set Up the BTC Memory Window and View Data . 3-29
Running the BTC FFT Demo ................................................ 3-37
Step 1: Build the FFT Demo ............................................. 3-38
Step 2: Plot BTC Data ...................................................... 3-39
Step 3: Record and Analyze BTC Data ............................... 3-44
VisualDSP++ 4.5 Getting Started Guidev
CONTENTS
INDEX
viVisualDSP++ 4.5 Getting Started Guide
PREFACE
Thank you for purchasing Analog Devices, Inc. development software for
signal processing applications.
Purpose of This Manual
The VisualDSP++ 4.5 Getting Started Guide provides basic and advanced
tutorials that highlight many VisualDSP++ features. By completing the
step-by-step procedures, you will become familiar with the VisualDSP++
environment and learn how to use these features in your own digital signal
processing (DSP) development projects.
Intended Audience
This manual is intended for DSP programmers who are familiar with
Analog Devices processors. The manual assumes that the audience has a
working knowledge of Analog Devices processor architecture and instruction set.
DSP programmers who are unfamiliar with Analog Devices processors
should refer to their processor’s Hardware Reference and Instruction Set
Reference, which describe the processor architecture and instruction set.
Note that the ADSP-BF533 Blackfin Processor Hardware Reference includes
information about the ADSP-BF531 and ADSP-BF532 processors.
VisualDSP++ 4.5 Getting Started Guidevii
Manual Contents
Manual Contents
This manual consists of:
•Chapter 1, “Features and Tools”
Provides an overview of VisualDSP++ features and code
development tools
•Chapter 2, “Basic Tutorial”
Provides step-by-step instructions for creating sessions, and for
building and debugging projects by using examples of C/C++ and
assembly sources
The tutorial is organized to follow the steps that you take in
developing a typical programming project. Before you begin actual
programming, you should be familiar with the architecture of your
particular processor and the other software development tools.
•Chapter 3, “Advanced Tutorial”
Provides step-by-step instructions for using profile-guided
optimization (PGO) and background telemetry channel (BTC)
What’s New in This Manual
This manual contains updated example screens and procedures for the 4.5
Integrated Development and Debugging Environment (IDDE).
viiiVisualDSP++ 4.5 Getting Started Guide
Technical or Customer Support
You can reach Analog Devices, Inc. Customer Support in the following
ways:
•Visit the Embedded Processing and DSP products Web site at
•Contact your Analog Devices, Inc. local sales office or authorized
distributor
Preface
•Send questions by mail to:
Analog Devices, Inc.
One Technology Way
P.O. Box 9106
Norwood, MA 02062-9106
USA
Supported Processors
The name “Blackfin®” refers to a family of Analog Devices 16-bit,
embedded processors. VisualDSP++ currently supports the following
Blackfin processors:
” and “TigerSHARC®” refer to the family of Analog
Devices 32-bit, digital signal processors. VisualDSP++ currently supports
the following SHARC processors.
VisualDSP++ currently supports the following TigerSHARC processors.
ADSP-TS101ADSP-TS202
ADSP-TS201ADSP-TS203
xVisualDSP++ 4.5 Getting Started Guide
Preface
Product Information
You can obtain product information from the Analog Devices website,
from the product CD-ROM, or from the printed publications (manuals).
Analog Devices is online atwww.analog.com. Our website provides information about a broad range of products—analog integrated circuits,
amplifiers, converters, and digital signal processors.
MyAnalog.com
MyAnalog.com is a free feature of the Analog Devices website that allows
customization of a webpage to display only the latest information on
products you are interested in. You can also choose to receive weekly email
notification containing updates to the webpages that meet your interests.
MyAnalog.com provides access to books, application notes, data sheets,
code examples, and more.
Registration:
Visit www.myanalog.com to sign up. Click Register to use MyAnalog.com.
Registration takes about five minutes and serves as means for you to select
the information you want to receive.
If you are already a registered user, just log on. Your user name is your
email address.
Processor Product Information
For information on embedded processors and DSPs, visit our Web site at
www.analog.com/processors, which provides access to technical publica-
tions, data sheets, application notes, product overviews, and product
announcements.
VisualDSP++ 4.5 Getting Started Guidexi
Product Information
You may also obtain additional information about Analog Devices and its
products in any of the following ways.
For hardware information, refer to your processor’s hardware reference,
programming reference, or data sheet. All documentation is available
online. Most documentation is available in printed form.
Visit the Technical Library Web site to access all processor and tools
manuals and data sheets:
Online documentation comprises VisualDSP++ Help system and tools
manuals, Dinkum Abridged C++ library and FlexLM network license
manager software documentation. You can easily search across the entire
VisualDSP++ documentation set for any topic of interest. For easy printing, supplementary .PDF files for the tools manuals are also provided.
Preface
A description of each documentation file type is as follows.
File Description
.CHMHelp system files and VisualDSP++ tools manuals.
.HTMLDinkum Abridged C++ library and FlexLM network license manager software doc-
umentation. Viewing and printing the
net Explorer 5.01 (or higher).
.PDFVisualDSP++ tools manuals in Portable Documentation Format, one .PDF file for
each manual. Viewing and printing the
Adobe Acrobat Reader (4.5 or higher).
.HTML files require a browser, such as Inter-
.PDF files require a PDF reader, such as
VisualDSP++ 4.5 Getting Started Guidexiii
Product Information
If documentation is not installed on your system as part of the software
installation, you can add it from the VisualDSP++ CD-ROM at any time
by running the VisualDSP++ installation. Access the online documentation from the VisualDSP++ environment, Windows
®
Explorer, or the
Analog Devices Web site.
Accessing Documentation From VisualDSP++
From the VisualDSP++ environment:
•Access VisualDSP++ online Help from the Help menu’s Contents, Search, and Index commands.
•Open online Help from context-sensitive user interface items
(toolbar buttons, menu commands, and windows).
Accessing Documentation From Windows
In addition to any shortcuts you may have constructed, there are other
ways to open VisualDSP++ online Help or the supplementary documentation from Windows.
Help system files (.CHM) are located in the Help folder, and .PDF files are
located in the Docs folder of your VisualDSP++ installation CD-ROM.
Using Windows Explorer
•Double-click the vdsp-help.chm file, which is the master Help
system, to access all the other
.CHM files.
•Double-click any file that is part of the VisualDSP++ documentation set.
Select a processor family and book title. Download archive (.ZIP) files, one
for each manual. Use any archive management software, such as WinZip,
to decompress downloaded files.
Printed Manuals
For general questions regarding literature ordering, call the Literature
Center at 1-800-ANALOGD (1-800-262-5643) and follow the prompts.
VisualAudio or VisualDSP++ Documentation Set
To purchase VisualDSP++ manuals, call 1-603-883-2430. The manuals
may be purchased only as a kit.
If you do not have an account with Analog Devices, you are referred to
Analog Devices distributors. For information on our distributors, log onto
http://www.analog.com/salesdir/continent.asp.
Hardware Tools Manuals
®
To purchase EZ-KIT Lite
and In-Circuit Emulator (ICE) manuals, call
1-603-883-2430. The manuals may be ordered by title or by product
number located on the back cover of each manual.
Processor Manuals
Hardware reference and instruction set reference manuals may be ordered
through the Literature Center at 1-800-ANALOGD (1-800-262-5643),
or downloaded from the Analog Devices Web site. Manuals may be
ordered by title or by product number located on the back cover of each
manual.
VisualDSP++ 4.5 Getting Started Guidexv
Notation Conventions
Data Sheets
All data sheets (preliminary and production) may be downloaded from the
Analog Devices Web site. Only production (final) data sheets (Rev. 0, A,
B, C, and so on) can be obtained from the Literature Center at
1-800-ANALOGD (1-800-262-5643); they also can be downloaded from
the Web site.
To have a data sheet faxed to you, call the Analog Devices Faxback System
at 1-800-446-6212. Follow the prompts and a list of data sheet code
numbers will be faxed to you. If the data sheet you want is not listed,
check for it on the Web site.
Contacting DSP Publications
Please send your comments and recommendations for improving our
manuals and online Help. You can contact us by sending an email to
dsp.techpubs@analog.com:
Notation Conventions
Text conventions used in this manual are identified and described as
follows.
ExampleDescription
Close command
(File menu)
{this | that}Alternative required items in syntax descriptions appear within curly
[this | that]Optional items in syntax descriptions appear within brackets and
xviVisualDSP++ 4.5 Getting Started Guide
Titles in reference sections indicate the location of an item within the
VisualAudio environment’s menu system (for example, the Close
command appears on the File menu).
brackets and separated by vertical bars; read the example as
that. One or the other is required.
separated by vertical bars; read the example as an optional this or
.
that
this or
Preface
ExampleDescription
[this,…]Optional item lists in syntax descriptions appear within brackets
delimited by commas and terminated with an ellipse; read the example
as an optional comma-separated list of
.SECTIONCommands, directives, keywords, and feature names are in text with
letter gothic font.
filenameNon-keyword placeholders appear in text with italic style format.
Note: For correct operation, ...
A Note provides supplementary information on a related topic. In the
L
a
[
online version of this book, the word Note appears instead of this
symbol.
Caution: Incorrect device operation may result if ...
Caution: Device damage may result if ...
A Caution identifies conditions or inappropriate usage of the product
that could lead to undesirable results or product damage. In the online
version of this book, the word Caution appears instead of this symbol.
Warn in g: Injury to device users may result if ...
A Warning identifies conditions or inappropriate usage of the product
that could lead to conditions that are potentially hazardous for devices
users. In the online version of this book, the word Wa rnin g appears
instead of this symbol.
this.
L
VisualDSP++ 4.5 Getting Started Guidexvii
Additional conventions, which apply only to specific chapters, may
appear throughout this document.
Notation Conventions
xviiiVisualDSP++ 4.5 Getting Started Guide
1FEATURES AND TOOLS
This chapter contains the following topics.
•“VisualDSP++ Features” on page 1-1
•“Code Development Tools” on page 1-5
•“Connecting to a Debug Session” on page 1-6
VisualDSP++ Features
VisualDSP++ provides these features:
•Extensive editing capabilities. Create and modify source files by
using multiple language syntax highlighting, drag-and-drop, bookmarks, and other standard editing operations. View files generated
by the code development tools.
•Flexible project management. Specify a project definition that
identifies the files, dependencies, and tools that you use to build
projects. Create this project definition once or modify it to meet
changing development needs.
VisualDSP++ 4.5 Getting Started Guide1-1
VisualDSP++ Features
•Easy access to code development tools. Analog Devices provides
these code development tools: C/C++ compiler, assembler, linker,
splitter, and loader. Specify options for these tools by using dialog
boxes instead of complicated command-line scripts. Options that
control how the tools process inputs and generate outputs have a
one-to-one correspondence to command-line switches. Define
options for a single file or for an entire project. Define these
options once or modify them as necessary.
•Flexible project build options. Control builds at the file or project
level. VisualDSP++ enables you to build files or projects selectively,
update project dependencies, or incrementally build only the files
that have changed since the previous build. View the status of your
project build in progress. If the build reports an error, double-click
on the file name in the error message to open that source file. Then
correct the error, rebuild the file or project, and start a debug
session.
•VisualDSP++ Kernel (VDK) support. Add VDK support to a
project to structure and scale application development. The Kernel
page of the Project window enables you to manipulate events,
event bits, priorities, semaphores, and thread types.
•Flexible workspace management. Create up to ten workspaces and
quickly switch between them. Assigning a different project to each
workspace enables you to build and debug multiple projects in a
single session.
•Easy movement between debug and build activities. Start the
debug session and move freely between editing, build, and debug
activities.
1-2VisualDSP++ 4.5 Getting Started Guide
Features and Tools
Figure 1-1 shows the Integrated Development and Debugging
Environment (IDDE).
Figure 1-1. The VisualDSP++ IDDE
VisualDSP++ 4.5 Getting Started Guide1-3
VisualDSP++ Features
VisualDSP++ reduces debugging time by providing these key features:
•Easy-to-use debugging activities. Debug with one common,
easy-to-use interface for all processor simulators and emulators, or
hardware evaluation and development boards. Switch easily
between these targets.
•Multiple language support. Debug programs written in C, C++, or
assembly, and view your program in machine code. For programs
written in C/C++, you can view the source in C/C++ or mixed
C/C++ and assembly, and display the values of local variables or
evaluate expressions (global and local) based on the current
context.
•Effective debug control. Set breakpoints on symbols and addresses
and then step through the program’s execution to find problems in
coding logic. Set watchpoints (conditional breakpoints) on
registers, stacks, and memory locations to identify when they are
accessed.
•Tools for improving performance. Use the trace, profile, and
linear and statistical profiles to identify bottlenecks in your DSP
application and to identify program optimization needs. Use
plotting to view data arrays graphically. Generate interrupts,
outputs, and inputs to simulate real-world application conditions.
1-4VisualDSP++ 4.5 Getting Started Guide
Code Development Tools
Code development tools include:
•C/C++ compiler
•Run-time library with over 100 math, DSP, and C run-time library
routines
•Assembler
•Linker
•Splitter
•Loader
•Simulator
Features and Tools
•Emulator (must be purchased separately from VisualDSP++)
These tools enable you to develop applications that take full advantage of
your processor’s architecture.
The VisualDSP++ linker supports multiprocessing, shared memory, and
memory overlays.
VisualDSP++ 4.5 Getting Started Guide1-5
Connecting to a Debug Session
The code development tools provide these key features:
•Easy-to-program C, C++, and assembly languages. Program in
C/C++, assembly, or a mix of C/C++ and assembly in one source.
The assembly language is based on an algebraic syntax that is easy
to learn, program, and debug.
•Flexible system definition. Define multiple types of executables for
a single type of processor in one Linker Description File (
Specify input files, including objects, libraries, shared memory
files, overlay files, and executables.
•Support for overlays, multiprocessors, and shared memory executables. The linker places code and resolves symbols in multiprocessor memory space for use by multiprocessor systems. The
loader enables you to configure multiple processors with less code
and faster boot time. Create host, link port, and PROM boot
images.
.LDF).
Software and hardware tool kits include context-sensitive Help and
manuals in PDF format.
For details about assembly syntax, refer to the VisualDSP++ 4.5 Assembler and Preprocessor Manual for your target processor.
Connecting to a Debug Session
From the Windows Start menu, navigate to the VisualDSP++ environment via the Programs menu. After a second or two, the main
VisualDSP++ window appears on the screen. When VisualDSP++
launches for the first time, it does not connect to any session (Figure 1-2).
1-6VisualDSP++ 4.5 Getting Started Guide
Features and Tools
Figure 1-2. VisualDSP++ Main Window
VisualDSP++ is able to connect to a number of different debug sessions,
where each session has its own application and benefits. The session types
available with VisualDSP++ are
1
:
•EZ-KIT Lite. This is the dedicated USB connection between the
PC and EZ-KIT Lite. An EZ-KIT connection is simple to manage
and is part of the EZ-KIT Lite. However, the connection is available with the kit only. Once your custom hardware board is
available for development, you use an emulator session (described
below) to connect to the custom hardware.
•Simulator. This is a software model of the processor. Simulators
offer unique advantages, the first is that no external hardware is
required, a great benefit when using VisualDSP++ on the road.
1
Third-party software may add additional session types.
VisualDSP++ 4.5 Getting Started Guide1-7
Connecting to a Debug Session
Furthermore, simulators offer a unique insight to the internal
workings of the processor (pipelines, caches, and more), which is
not possible with hardware-based sessions. The downside is that a
simulator is several orders of magnitude slower than actual hardware. The software model simulates only the processor, making it
difficult to accurately simulate a complex system that involves
more than the processor.
VisualDSP++ includes two types of Blackfin simulators:
a cycle-accurate interpreted and a functional compiled one. A
cycle-accurate simulator is a completely accurate model of the
Blackfin processor and allows you to fully visualize the inner-workings of the processor. The compiled simulator sacrifices the
detailed view but allows you to simulate much more quickly, millions of cycles per second, depending on the speed of your PC.
•Emulator. This is a JTAG emulator, the ideal device for connect-
ing to hardware, giving the best performance and maximum
flexibility. A separate module from the PC and EZ-KIT Lite, an
emulator provides a high-bandwidth connection between the PC
and device being debugged. Currently, Analog Devices offers USBand PCI- based emulators. An emulator is required to connect to
any non-EZ-KIT Lite hardware.
•Legacy target. This is a target created in VisualDSP++ 4.0 or a
prior version.
1-8VisualDSP++ 4.5 Getting Started Guide
2BASIC TUTORIAL
This chapter contains the following topics.
•“Overview” on page 2-1
•“Exercise One: Building and Running a C Program” on page 2-3
•“Exercise Two: Modifying a C Program to Call an Assembly Rou-
tine” on page 2-16
•“Exercise Three: Plotting Data” on page 2-33
•“Exercise Four: Linear Profiling” on page 2-47
Overview
The Basic Tutorial demonstrates key features and capabilities of the
VisualDSP++ Integrated Development and Debugging Environment
(IDDE). The exercises use sample programs written in C and assembly for
Blackfin processors.
You can use different Blackfin processors with only minor changes to the
Linker Description Files (.LDFs) included with each project. VisualDSP++
includes basic Linker Description Files for each processor type in the
folder. For Blackfin processors, the folder’s default installation path is:
Program Files\Analog Devices\VisualDSP 4.5\Blackfin\ldf
The source files for these exercises are installed during the VisualDSP++
software installation.
VisualDSP++ 4.5 Getting Started Guide2-1
ldf
Overview
The tutorial contains four exercises:
•In Exercise One, you start up VisualDSP++, build a project
containing C source code, and profile the performance of a C
function.
•In Exercise Two, you create a new project, create a Linker
Description File to link with the assembly routine, rebuild the
project, and profile the performance of the assembly language
routine.
•In Exercise Three, you plot the various waveforms produced by a
Finite Impulse Response (FIR) algorithm.
•In Exercise Four, you use linear profiling to examine the efficiency
of the FIR algorithm used in Exercise Three. Using the collected
linear profile data, you pinpoint the most time-consuming areas of
the algorithm, which are likely to require hand tuning in the
assembly language.
The ADSP-BF5xx Family Simulator and ADSP-BF533 processor are used
for all exercises.
Tip: Become familiar with the VisualDSP++ toolbar buttons, shown in
Figure 2-1. They are shortcuts for menu commands such as Open a file
and Run a program. Toolbar buttons and menu commands that are not
available for tasks are disabled and displayed in gray.
Figure 2-1. VisualDSP++ Toolbar Buttons
2-2VisualDSP++ 4.5 Getting Started Guide
Basic Tutorial
L
VisualDSP++ is a licensed software product. To run the software,
you must have a valid license installed on your system. If you try to
run VisualDSP++ and a license is not installed, a message window
opens to let you add a license. For details about license management, see the VisualDSP++ 4.5 User’s Guide or VisualDSP++
online Help.
Exercise One: Building and Running a C
Program
In this exercise, you:
•Start up the VisualDSP++ environment
•Open and build an existing project
•Examine windows and dialog boxes
•Run the program
The sources for this exercise are in the dot_product_c folder. The default
installation path is:
Program Files\Analog Devices\VisualDSP 4.5\Blackfin\Examples\
Tutorial\dot_product_c
Step 1: Start VisualDSP++ and Open a Project
To start VisualDSP++ and open a project:
1. Click the Windows Start button and select Programs, Analog Devices, VisualDSP++ 4.5, and VisualDSP++ Environment.
If you are running VisualDSP++ for the first time, you will not be
connected to a debug target. In VisualDSP++ 4.5, it is possible to
edit and build your code without being connection to a debug tar-
VisualDSP++ 4.5 Getting Started Guide2-3
Exercise One: Building and Running a C Program
get through a debug session. When you are ready to run and debug
your program, you can quickly connect to a target and disconnect
when you are finished. Doing so eliminates the overhead associated
with the target connection, resulting in a smoother and more
responsive experience.
•When you need to connect to a debug session, click the Connect to
Target toolbar button or choose from the available sessions listed
under Select Session in the Session menu. To create a debug session, select New Session from the Session menu. This will launch
the Session Wizard, which is covered in more detail later. See
Figure 2-7.
If you have already run VisualDSP++ and the Reload last project at
startup option is selected on the Project page under Settings and
Preferences, VisualDSP++ opens the last project that you worked on. To close this project, choose Close and then Project from the
File menu, and then click No when prompted to save the project.
2. From the File menu, choose Open and then Project.
VisualDSP++ displays the Open Project dialog box.
3. In the Look in box, open the
folder and double-click the following subfolders in succession.