ANALOG DEVICES W3.5 User’s Guide

W3.5
Kernel (VDK) User’s Guide
for 16-Bit Processors
Analog Devices, Inc. Digital Signal Processor Division One Technology Way Norwood, Mass. 02062-9106
Revision 1.0, October 2003
Part Number
82-000035-03
a
Copyright Information
© 2003 Analog Devices, Inc., ALL RIGHTS RESERVED. This docu­ment may not be reproduced in any form without prior, express written consent from Analog Devices, Inc.
Printed in the USA.
Disclaimer
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 impli­cation or otherwise under the patent rights of Analog Devices, Inc.
Trademark and Service Mark Notice
The Analog Devices logo, VisualDSP, the VisualDSP logo, CROSS-CORE, the CROSSCORE logo, and EZ-KIT Lite are registered trademarks of Analog Devices, Inc.
VisualDSP++ and the VisualDSP++ logo are trademarks of Analog Devices, Inc.
Trademarks and registered trademarks are the property of their respective owners.

CONTENTS

PREFACE
Purpose of this Manual ................................................................. xvii
Intended Audience ....................................................................... xviii
Manual Contents ......................................................................... xviii
What’s New in this Manual ............................................................ xix
Technical or Customer Support ....................................................... xx
Supported Processors ....................................................................... xx
Product Information ...................................................................... xxi
MyAnalog.com ......................................................................... xxi
DSP Product Information ......................................................... xxi
Related Documents ................................................................. xxii
Online Documentation ......................................................... xxiii
From VisualDSP++ ........................................................... xxiii
From Windows .................................................................. xxiv
From the Web .................................................................... xxiv
Printed Manuals ..................................................................... xxiv
VisualDSP++ Documentation Set ........................................ xxv
Hardware Manuals .............................................................. xxv
Data Sheets ......................................................................... xxv
VisualDSP++ 3.5 Kernel (VDK) User’s Guide iii for 16-bit Processors
CONTENTS
Contacting DSP Publications ................................................. xxvi
Notation Conventions ................................................................. xxvi
INTRODUCTION TO VDK
Motivation ................................................................................... 1-1
Rapid Application Development .............................................. 1-2
Debugged Control Structures .................................................. 1-2
Code Reuse ............................................................................. 1-3
Hardware Abstraction ............................................................. 1-3
Partitioning an Application ........................................................... 1-4
Scheduling ................................................................................... 1-5
Priorities ................................................................................. 1-5
Preemption ............................................................................. 1-7
Protected Regions ......................................................................... 1-7
Disabling Scheduling .............................................................. 1-7
Disabling Interrupts ................................................................ 1-8
Thread and Hardware Interaction ................................................. 1-8
Thread Domain with Software Scheduling ............................... 1-9
Interrupt Domain with Hardware Scheduling ........................ 1-10
Device Drivers ...................................................................... 1-10
CONFIGURATION AND DEBUGGING OF VDK
PROJECTS
Configuring VDK Projects ............................................................ 2-1
Linker Description File ........................................................... 2-2
iv VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
CONTENTS
Thread Safe Libraries ............................................................... 2-2
Header Files for the VDK API ................................................. 2-2
Debugging VDK Projects .............................................................. 2-3
Instrumented Build Information .............................................. 2-3
VDK State History Window .................................................... 2-3
Target Load Graph Window .................................................... 2-4
VDK Status Window ............................................................... 2-4
General Tips ........................................................................... 2-5
Kernel Panic ............................................................................ 2-5
USING VDK
Threads ........................................................................................ 3-1
Thread Types .......................................................................... 3-2
Thread Parameters .............................................................. 3-2
Stack Size ........................................................................ 3-2
Priority ........................................................................... 3-3
Required Thread Functionality ............................................ 3-3
Run Function ................................................................. 3-3
Error Function ................................................................ 3-4
Create Function .............................................................. 3-4
Init Function/Constructor ............................................... 3-5
Destructor ...................................................................... 3-5
Writing Threads in Different Languages .............................. 3-6
C++ Threads ................................................................... 3-6
C and Assembly Threads ................................................. 3-7
VisualDSP++ 3.5 Kernel (VDK) User’s Guide v for 16-bit Processors
CONTENTS
Global Variables ................................................................. 3-8
Error Handling Facilities ..................................................... 3-8
Scheduling ................................................................................... 3-9
Ready Queue .......................................................................... 3-9
Scheduling Methodologies ..................................................... 3-10
Cooperative Scheduling .................................................... 3-10
Round-robin Scheduling ................................................... 3-11
Preemptive Scheduling ...................................................... 3-11
Disabling Scheduling ............................................................ 3-12
Entering the Scheduler From API Calls .................................. 3-13
Entering the Scheduler From Interrupts ................................. 3-13
Idle Thread ........................................................................... 3-14
Signals ........................................................................................ 3-15
Semaphores ........................................................................... 3-16
Behavior of Semaphores .................................................... 3-16
Thread’s Interaction With Semaphores .............................. 3-17
Pending on a Semaphore ............................................... 3-17
Posting a Semaphore ..................................................... 3-18
Periodic Semaphores ..................................................... 3-21
Messages ............................................................................... 3-21
Behavior of Messages ........................................................ 3-22
Thread’s Interaction With Messages .................................. 3-23
Pending on a Message ................................................... 3-23
Posting a Message ......................................................... 3-24
vi VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
CONTENTS
Multiprocessor Messaging ...................................................... 3-26
Routing Threads (RThreads) ............................................. 3-27
Data Transfer (Payload Marshalling) .................................. 3-33
Device Drivers for Messaging ............................................ 3-36
Routing Topology ............................................................. 3-37
Events and Event Bits ............................................................ 3-38
Behavior of Events ............................................................ 3-38
Global State of Event Bits .............................................. 3-39
Event Calculation .......................................................... 3-39
Effect of Unscheduled Regions on Event Calculation ..... 3-41
Thread’s Interaction With Events ...................................... 3-41
Pending on an Event ..................................................... 3-42
Setting or Clearing of Event Bits .................................... 3-42
Loading New Event Data into an Event ......................... 3-44
Device Flags .......................................................................... 3-45
Behavior of Device Flags ................................................... 3-45
Thread’s Interaction With Device Flags ............................. 3-45
Interrupt Service Routines ........................................................... 3-46
Enabling and Disabling Interrupts ......................................... 3-46
Interrupt Architecture ............................................................ 3-47
Vector Table ...................................................................... 3-47
Global Data ...................................................................... 3-48
Communication with the Thread Domain ......................... 3-49
Timer ISR ............................................................................. 3-50
VisualDSP++ 3.5 Kernel (VDK) User’s Guide vii for 16-bit Processors
CONTENTS
Reschedule ISR ..................................................................... 3-50
I/O Interface .............................................................................. 3-51
I/O Templates ....................................................................... 3-51
Device Drivers ...................................................................... 3-51
Execution ......................................................................... 3-52
Parallel Scheduling Domains ............................................. 3-53
Using Device Drivers ........................................................ 3-55
Dispatch Function ........................................................ 3-56
Device Flags ..................................................................... 3-64
Pending on a Device Flag .............................................. 3-65
Posting a Device Flag .................................................... 3-66
General Notes .................................................................. 3-67
Variables ....................................................................... 3-67
Critical/Unscheduled Regions ....................................... 3-67
Memory Pools ............................................................................ 3-68
Memory Pool Functionality ................................................... 3-68
Multiple Heaps ........................................................................... 3-69
Thread Local Storage .................................................................. 3-70
VDK DATA TYPES
Data Type Summary ..................................................................... 4-1
Bitfield ......................................................................................... 4-4
DeviceDescriptor .......................................................................... 4-5
DeviceFlagID ............................................................................... 4-6
DeviceInfoBlock ........................................................................... 4-7
viii VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
CONTENTS
DispatchID ................................................................................... 4-8
DispatchUnion ............................................................................. 4-9
DSP_Family ............................................................................... 4-11
DSP_Product .............................................................................. 4-12
EventBitID ................................................................................. 4-14
EventID ...................................................................................... 4-15
EventData ................................................................................... 4-16
HeapID ...................................................................................... 4-17
HistoryEnum .............................................................................. 4-18
IMASKStruct .............................................................................. 4-20
IOID .......................................................................................... 4-21
IOTemplateID ............................................................................ 4-22
MarshallingCode ......................................................................... 4-23
MarshallingEntry ........................................................................ 4-25
MessageDetails ............................................................................ 4-26
MessageID .................................................................................. 4-27
MsgChannel ............................................................................... 4-28
MsgWireFormat .......................................................................... 4-30
PanicCode .................................................................................. 4-32
PayloadDetails ............................................................................ 4-33
PFMarshaller .............................................................................. 4-34
PoolID ....................................................................................... 4-36
Priority ....................................................................................... 4-37
RoutingDirection ........................................................................ 4-38
VisualDSP++ 3.5 Kernel (VDK) User’s Guide ix for 16-bit Processors
CONTENTS
SemaphoreID ............................................................................. 4-39
SystemError ............................................................................... 4-40
ThreadCreationBlock ................................................................. 4-44
ThreadID ................................................................................... 4-46
ThreadStatus .............................................................................. 4-47
ThreadType ................................................................................ 4-49
Ticks .......................................................................................... 4-50
VersionStruct .............................................................................. 4-51
VDK API REFERENCE
Calling Library Functions ............................................................. 5-2
Linking Library Functions ............................................................ 5-2
Working With VDK Library Header ............................................. 5-3
Passing Function Parameters ......................................................... 5-3
Library Naming Conventions ........................................................ 5-3
API Summary ............................................................................... 5-5
API Functions ............................................................................ 5-10
AllocateThreadSlot() ............................................................. 5-11
AllocateThreadSlotEx() ......................................................... 5-13
ClearEventBit() ..................................................................... 5-15
ClearInterruptMaskBits() ...................................................... 5-17
ClearThreadError() ............................................................... 5-18
CloseDevice() ....................................................................... 5-19
CreateDeviceFlag() ................................................................ 5-21
CreateMessage() .................................................................... 5-22
x VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
CONTENTS
CreatePool() .......................................................................... 5-24
CreatePoolEx() ...................................................................... 5-26
CreateSemaphore() ................................................................ 5-28
CreateThread() ...................................................................... 5-30
CreateThreadEx() .................................................................. 5-32
DestroyDeviceFlag() .............................................................. 5-34
DestroyMessage() .................................................................. 5-35
DestroyMessageAndFreePayload() .......................................... 5-37
DestroyPool() ........................................................................ 5-39
DestroySemaphore() .............................................................. 5-41
DestroyThread() .................................................................... 5-43
DeviceIOCtl() ....................................................................... 5-45
DispatchThreadError() .......................................................... 5-47
ForwardMessage() .................................................................. 5-49
FreeBlock() ............................................................................ 5-52
FreeDestroyedThreads() ......................................................... 5-54
FreeMessagePayload () ........................................................... 5-55
FreeThreadSlot() ................................................................... 5-57
GetClockFrequency() ............................................................ 5-59
GetEventBitValue() ............................................................... 5-60
GetEventData() ..................................................................... 5-61
GetEventValue() .................................................................... 5-62
GetHeapIndex() .................................................................... 5-63
GetInterruptMask() ............................................................... 5-65
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xi for 16-bit Processors
CONTENTS
GetLastThreadError() ........................................................... 5-66
GetLastThreadErrorValue() ................................................... 5-67
GetMessageDetails () ............................................................ 5-68
GetMessagePayload() ............................................................ 5-70
GetMessageReceiveInfo() ...................................................... 5-72
GetNumAllocatedBlocks() ..................................................... 5-74
GetNumFreeBlocks() ............................................................ 5-75
GetPriority() ......................................................................... 5-76
GetSemaphoreValue() ........................................................... 5-77
GetThreadHandle() .............................................................. 5-78
GetThreadID() ..................................................................... 5-79
GetThreadSlotValue() ........................................................... 5-80
GetThreadStackUsage() ......................................................... 5-81
GetThreadStatus() ................................................................ 5-83
GetThreadType() .................................................................. 5-84
GetTickPeriod() .................................................................... 5-85
GetUptime() ......................................................................... 5-86
GetVersion() ......................................................................... 5-87
InstallMessageControlSemaphore () ....................................... 5-88
InstrumentStack() ................................................................. 5-90
LoadEvent() .......................................................................... 5-92
LocateAndFreeBlock() ........................................................... 5-94
LogHistoryEvent() ................................................................ 5-95
MakePeriodic() ..................................................................... 5-96
xii VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
CONTENTS
MallocBlock() ....................................................................... 5-98
MessageAvailable() ............................................................... 5-100
OpenDevice() ...................................................................... 5-102
PendDeviceFlag() ................................................................ 5-104
PendEvent() ........................................................................ 5-106
PendMessage() ..................................................................... 5-108
PendSemaphore() ................................................................ 5-111
PopCriticalRegion() ............................................................. 5-113
PopNestedCriticalRegions() ................................................. 5-115
PopNestedUnscheduledRegions() ......................................... 5-117
PopUnscheduledRegion() ..................................................... 5-118
PostDeviceFlag() .................................................................. 5-120
PostMessage() ...................................................................... 5-121
PostSemaphore() .................................................................. 5-124
PushCriticalRegion() ........................................................... 5-126
PushUnscheduledRegion() ................................................... 5-127
RemovePeriodic() ................................................................ 5-128
ResetPriority() ..................................................................... 5-130
SetClockFrequency() ........................................................... 5-132
SetEventBit() ....................................................................... 5-133
SetInterruptMaskBits() ........................................................ 5-135
SetMessagePayload() ............................................................ 5-136
SetPriority() ........................................................................ 5-138
SetThreadError() ................................................................. 5-140
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xiii for 16-bit Processors
CONTENTS
SetThreadSlotValue() .......................................................... 5-141
SetTickPeriod() ................................................................... 5-142
Sleep() ................................................................................ 5-143
SyncRead() ......................................................................... 5-145
SyncWrite() ........................................................................ 5-147
Yield() ................................................................................ 5-149
Assembly Macros ...................................................................... 5-151
VDK_ISR_ACTIVATE_DEVICE_() .................................. 5-152
VDK_ISR_CLEAR_EVENTBIT_() .................................... 5-153
VDK_ISR_LOG_HISTORY_EVENT_() ............................ 5-154
VDK_ISR_POST_SEMAPHORE_() .................................. 5-155
VDK_ISR_SET_EVENTBIT_() ......................................... 5-156
PROCESSOR-SPECIFIC NOTES
VDK for Blackfin Processors
(AD6532, ADSP-BF531, ADSP-BF532, ADSP-BF533, ADSP-BF535,
and ADSP-BF561) ..................................................................... A-1
User and Supervisor Modes ..................................................... A-1
Thread, Kernel, and Interrupt Execution Levels ....................... A-2
Critical and Unscheduled Regions ........................................... A-3
Exceptions .............................................................................. A-3
ISR APIs ................................................................................. A-3
Interrupts ............................................................................... A-4
Timer ..................................................................................... A-5
ADSP-BF531, ADSP-BF532 and ADSP-BF533 Processor Memory A-5
xiv VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
CONTENTS
ADSP-BF535 and AD6532 Processor Memory ........................ A-6
ADSP-BF561 Processor Memory ............................................ A-6
Interrupt Nesting ................................................................... A-7
Thread Stack Usage by Interrupts ........................................... A-7
Interrupt Latency ................................................................... A-8
Multiprocessor Messaging ....................................................... A-8
VDK for ADSP-219x DSPs
(ADSP-2191, ADSP-2192-12, ADSP-2195, and ADSP-2196) ... A-9
Thread, Kernel, and Interrupt Execution Levels ....................... A-9
Critical and Unscheduled Regions ......................................... A-10
Interrupts on ADSP-2192 DSPs ........................................... A-10
Interrupts on ADSP-2191 DSPs ........................................... A-11
Timer ................................................................................... A-11
Memory ............................................................................... A-12
Interrupt Nesting ................................................................. A-12
Interrupt Latency ................................................................. A-13
Multiprocessor Messaging ..................................................... A-13
MIGRATING DEVICE DRIVERS
Step 1: Saving Existing Sources ..................................................... B-1
Step 2: Revising Properties ........................................................... B-2
Step 3: Revising Sources ............................................................... B-3
Step 4: Creating Boot Objects ...................................................... B-4
INDEX
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xv for 16-bit Processors
CONTENTS
xvi VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors

PREFACE

Thank you for purchasing Analog Devices (ADI) development software for digital signal processor (DSP) applications.

Purpose of this Manual

The VisualDSP++ Kernel (VDK) User's Guide contains information about VisualDSP++™ Kernel, a Real Time Operating System kernel integrated with the rest of the VisualDSP++ 3.5 development tools. The VDK incor­porates state-of-art scheduling and resource allocation techniques tailored specially for the memory and timing constraints of DSP programming. The kernel facilitates development of fast performance structured applica­tions using frameworks of template files.
The kernel is specially designed for effective operations on Analog Devices DSP architectures: ADSP-219x, ADSP-BF53x Blackfin®, ADSP-21xxx SHARC®, and ADSP-TSxxx TigerSHARC® processors.
The majority of the information in this manual is generic. Information applicable to only a particular target processor, or to a particular processor family, is provided in Appendix A, “Processor-Specific Notes”.
This manual is designed so that you can quickly learn about the kernel internal structure and operation.
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xvii for 16-bit Processors

Intended Audience

Intended Audience
The primary audience for this manual is programmers who are familiar with Analog Devices DSPs. This manual assumes the audience has a work­ing knowledge of the appropriate processor architecture and instruction set. Programmers who are unfamiliar with Analog Devices DSPs can use this manual but should supplement it with other texts, such as Hardware Reference and Instruction Set Reference manuals, that describe your target architecture.

Manual Contents

The manual consists of:
Chapter 1, “Introduction to VDK”
Concentrates on concepts, motivation, and general architec­tural principles of the VDK software.
Chapter 2, “Configuration and Debugging of VDK Projects”
Describes the Integrated Development and Debugging Environment (IDDE) support for configuring and debug­ging a VDK enabled project. For specific procedures on how to create, modify, and manage the kernel’s compo­nents, refer to the VisualDSP++ online Help.
Chapter 3, “Using VDK”
Describes the kernel’s internal structure and components.
Chapter 4, “VDK Data Types”
Describes built-in data types supported in the current release of the VDK.
xviii VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
Chapter 5, “VDK API Reference”
Describes library functions and macros included in the cur­rent release of the VDK.
Appendix A, “Processor-Specific Notes”
Provides processor-specific information for Blackfin and ADSP-219x processor architectures.
Appendix B, “Migrating Device Drivers”
Describes how to convert the device driver components cre­ated with VisualDSP++ 2.0 for use in projects built with VisualDSP++ 3.5.

What’s New in this Manual

Preface
This first revision of the VisualDSP++ 3.5 Kernel (VDK) User’s Guide doc­uments VDK support for the new Blackfin processor ADSP-BF561 in addition to the existing processors in the Blackfin and ADSP-219x fami­lies that were supported in previous releases. This manual documents VDK functionality that is new for VisualDSP++ 3.5, including the follow­ing: multiprocessor messaging, kernel panic, the option not to throw errors on timeout, runtime access/setting of timing parameters, and increased configurability (choice of timer interrupt and use of multiple heaps to specify allocations for VDK components).
The Blackfin processors are embedded processors that sport a Media Instruction Set Computing (MISC) architecture. This architecture is the natural merging of RISC, media functions, and digital signal processing characteristics towards delivering signal processing performance in a microprocessor-like environment.
The manual documents VisualDSP++ Kernel version 3.5.00.
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xix for 16-bit Processors

Technical or Customer Support

Technical or Customer Support
You can reach DSP Tools Support in the following ways.
Visit the DSP Development Tools website at
www.analog.com/technology/dsp/developmentTools/index.html
Email questions to
dsptools.support@analog.com
Phone questions to 1-800-ANALOGD
Contact your ADI local sales office or authorized distributor
Send questions by mail to
Analog Devices, Inc. DSP Division One Technology Way P.O. Box 9106 Norwood, MA 02062-9106
USA

Supported Processors

VisualDSP++ 3.5 Kernel currently supports the following Analog Devices DSPs.
AD6532, ADSP-BF531, ADSP-BF532, ADSP-BF533, ADSP-BF535, and ADSP-BF561
ADSP-2191, ADSP-2192-12, ADSP-2195, and ADSP-2196
xx VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
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 at www.analog.com. Our website provides infor­mation 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.

DSP Product Information

For information on digital signal processors, visit our website at
www.analog.com/dsp, which provides access to technical publications, data
sheets, application notes, product overviews, and product announcements.
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xxi for 16-bit Processors
Product Information
You may also obtain additional information about Analog Devices and its products in any of the following ways.
Email questions or requests for information to
dsp.support@analog.com
Fax questions or requests for information to 1-781-461-3010 (North America) or +49 (0) 89 76903-157 (Europe)
Access the Digital Signal Processing Division’s FTP website at
ftp.analog.com or ftp 137.71.23.21 or ftp://ftp.analog.com

Related Documents

For information on product related development software, see the follow­ing publications for the appropriate processor family.
VisualDSP++ 3.5 Getting Started Guide
VisualDSP++ 3.5 User’s Guide
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
VisualDSP++ 3.5 Assembler and Preprocessor Manual
VisualDSP++ 3.5 Linker and Utilities Manual
VisualDSP++ 3.5 Kernel (VDK) User’s Guide
Quick Installation Reference Card
For hardware information, refer to your DSP Hardware Reference, Programming Reference, and data sheet.
All documentation is available online. Most documentation is available in printed form.
xxii VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors

Online Documentation

Online documentation comprises Microsoft HTML Help (.CHM), Adobe Portable Documentation Format (.PDF), and HTML (.HTM and .HTML) files. A description of each file type is as follows.
File Description
.CHM VisualDSP++ online Help system files and VisualDSP++ manuals are provided in
Microsoft HTML Help format. Installing VisualDSP++ automatically copies these files to the tools manual set. Invoke Help from the VisualDSP++ Help menu or via the Windows Start button.
.PDF Manuals and data sheets in Portable Documentation Format are located in the
installation CD’s reader, such as Adobe Acrobat Reader (4.0 or higher). Running setup.exe on the installation CD provides easy access to these documents. You can also copy .PDF files from the installation CD onto another disk.
VisualDSP\Help folder. Online Help is ideal for searching the entire
Docs folder. Viewing and printing a .PDF file requires a PDF
Preface
.HTM
or
.HTML
Dinkum Abridged C++ library and FlexLM network license manager software documentation is located on the installation CD in the Docs\Reference folder. Viewing or printing these files requires a browser, such as Internet Explorer 4.0 (or higher). You can copy these files from the installation CD onto another disk.
Access the online documentation from the VisualDSP++ environment, Windows Explorer, or Analog Devices website.
From VisualDSP++
VisualDSP++ provides access to online Help. It does not provide access to
.PDF files or the supplemental reference documentation (Dinkum
Abridged C++ library and FlexLM network licence). Access Help by:
Choosing Contents, Search, or Index from the VisualDSP++ Help
menu
Invoking context-sensitive Help on a user interface item (toolbar button, menu command, or window)
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xxiii for 16-bit Processors
Product Information
From Windows
In addition to shortcuts you may construct, Windows provides many ways to open VisualDSP++ online Help or the supplementary documentation.
Help system files (
.CHM) are located in the VisualDSP 3.5 16-Bit\Help
folder. Manuals and data sheets in PDF format are located in the Docs folder of the installation CD. The installation CD also contains the Din­kum Abridged C++ library and FlexLM network license manager software documentation in the \Reference folder.
Using Windows Explorer
Double-click any file that is part of the VisualDSP++ documenta­tion set.
Double-click vdsp-help.chm, the master Help system, to access all the other .CHM files.
From the Web
To download the tools manuals, point your browser at
www.analog.com/technology/dsp/developmentTools/gen_purpose.html.
Select a DSP 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.
xxiv VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
Preface
VisualDSP++ Documentation Set
Printed copies of VisualDSP++ manuals may be purchased through Ana­log Devices Customer Service at 1-781-329-4700; ask for a Customer Service representative. The manuals can be purchased only as a kit. For additional information, call 1-603-883-2430.
If you do not have an account with Analog Devices, you will be referred to Analog Devices distributors. To get information on our distributors, log onto
www.analog.com/salesdir/continent.asp.
Hardware Manuals
Printed copies of hardware reference and instruction set reference manuals can be ordered through the Literature Center or downloaded from the Analog Devices website. The phone number is 1-800-ANALOGD (1-800-262-5643). The manuals can be ordered by a title or by product number located on the back cover of each manual.
Data Sheets
All data sheets can be downloaded from the Analog Devices website. As a general rule, printed copies of data sheets with a letter suffix (L, M, N, S) can be obtained from the Literature Center at 1-800-ANALOGD (1-800-262-5643) or downloaded from the website. Data sheets without the suffix can be downloaded from the website only—no hard copies are available. You can ask for the data sheet by part name or by product number.
If you want to have a data sheet faxed to you, the phone number for that service is 1-800-446-6212. Follow the prompts and a list of data sheet code numbers will be faxed to you. Call the Literature Center first to find out if requested data sheets are available.
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xxv for 16-bit Processors

Notation Conventions

Contacting DSP Publications

Please send your comments and recommendations on how to improve our manuals and online Help. You can contact us by:
Emailing dsp.techpubs@analog.com
Filling in and returning the attached Reader’s Comments Card found in our manuals
Notation Conventions
The following table identifies and describes text conventions used in this manual.
L
Example Description
Close command (File menu) or OK
{this | that} Alternative required items in syntax descriptions appear within curly
[this | that] Optional items in syntax descriptions appear within brackets and sepa-
[this,…] Optional item lists in syntax descriptions appear within brackets
.SECTION Commands, directives, keywords, code examples, and feature names
filename Non-keyword placeholders appear in text with italic style format.
appear throughout this document.
Tex t in bold style indicates the location of an item within the VisualDSP++ environment’s menu system and user interface items.
brackets separated by vertical bars; read the example as this or that.
rated by vertical bars; read the example as an optional
delimited by commas and terminated with an ellipsis; read the example as an optional comma-separated list of
are in text with
letter gothic font.
this or that.
this.
Additional conventions, which apply only to specific chapters, may
xxvi VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
Example Description
A note providing information of special interest or identifying a related topic. In the online version of this book, the word Note appears instead of this symbol.
A caution providing information about critical design or programming issues that influence operation of a product. In the online version of this book, the word Caution appears instead of this symbol.
Preface
VisualDSP++ 3.5 Kernel (VDK) User’s Guide xxvii for 16-bit Processors
Notation Conventions
xxviii VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors

1 INTRODUCTION TO VDK

This chapter concentrates on concepts, motivation, and general architec­tural principles of the operating system kernel. It also provides information on how to partition a VDK application into independent, reusable functional units that are easy to maintain and debug.
The following sections provide information about the operating system kernel concepts.
“Motivation” on page 1-1
“Partitioning an Application” on page 1-4
“Scheduling” on page 1-5
“Protected Regions” on page 1-7
“Thread and Hardware Interaction” on page 1-8

Motivation

All applications require control code as support for the algorithms that are often thought of as the “real” program. The algorithms require data to be moved to and/or from peripherals, and many algorithms consist of more than one functional block. For some systems, this control code may be as simple as a “superloop” blindly processing data that arrives at a constant rate. However, as processors become more powerful, considerably more sophisticated control may be needed to realize the processor’s potential, to allow the DSP to absorb the required functionality of previously sup-
VisualDSP++ 3.5 Kernel (VDK) User’s Guide 1-1 for 16-bit Processors
Motivation
ported chips, and to allow a single DSP to do the work of many. The following sections provide an overview of some of the benefits of using a kernel on a DSP.

Rapid Application Development

The tight integration between the VisualDSP++ environment and the VDK allows rapid development of applications compared to creating all of the control code required by hand. The use of automatic code generation and file templates, as well as a standard programming interface to device drivers, allows you to concentrate on the algorithms and the desired con­trol flow rather than on the implementation details. VDK supports the use of C, C++, and assembly language. You are encouraged to develop code that is highly readable and maintainable, yet to retain the option of hand optimizing if necessary.

Debugged Control Structures

Debugging a traditional DSP application can be laborious because devel­opment tools (compiler, assembler, and linker among others) are not aware of the architecture of the target application and the flow of control that results. Debugging complex applications is much easier when instan­taneous snapshots of the system state and statistical run-time data are clearly presented by the tools. To help offset the difficulties in debugging software, VisualDSP++ includes three versions of the VDK libraries con­taining full instrumentation (including error checking), only error checking, and neither instrumentation nor error checking.
In the instrumented mode, the kernel maintains statistical information and logging of all significant events into a history buffer. When the execu­tion is paused, the debugger can traverse this buffer and present a graphical trace of the program’s execution including context switches, pending and posting of signals, changes in a thread’s status, and more. Statistics are presented for each thread in a tabular view and show the total
1-2 VisualDSP++ 3.5 Kernel (VDK) User’s Guide
for 16-bit Processors
Loading...
+ 324 hidden pages