Home
VisualDSP++ 5.0 User`s Guide
Contents
1. Add File s to Folder Delete Folder Allow Docking Hide Float In Main Window Properties Figure 2 7 Folder Icon Right Click Menu File Icon Right Click Menu The selected file icon or amp or E right click menu Figure 2 8 on page 2 13 provides a file context from which to e Open the selected file for editing e Build the file e Remove the file from a project 2 12 VisualDSP 5 0 User s Guide Environment e Specify options for the file e View the file s properties Open File Build File Remove File from Project File Options Allow Docking Hide Float In Main Window Properties Figure 2 8 File Icon Right Click Menu File icon commands apply to the selected file in the Project win dow not to a source file in an editor window Project Window Rules The Project window displays a project s files as shown in Figure 2 9 The following rules dictate how files and subfolders behave in the Project window s file tree e You can include any file in a project e Only one 1df file is permitted e You cannot add the same file into the same project more than once e Only one project project node is permitted VisualDSP 5 0 User s Guide 2 13 Project Window MyProject Asy source files E Asm1 asm Asm2 asm I C source files E Filel cpp B File2 cpp E Debug oj a D Project Figure 2 9 Exam
2. 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 Tools installation Access the online documentation from the VisualDSP environment Windows Explorer or the Analog Devices Web site VisualDSP 5 0 User s Guide xxxi Product Information Accessing Documentation From VisualDSP From the VisualDSP environment e Access VisualDSP online Help from the Help menu s Contents Search and Index commands e Open online Help from context sensitive user interface items tool bar buttons menu commands and windows Accessing Documentation From Windows In addition to any shortcuts you may have constructed there are many ways to open VisualDSP online Help or the supplementary documenta tion from Windows Help system files CHM are located in the VisualDSP software installa tion s Help folder and PDF files are located in the Docs folder of your VisualDSP installation CD ROM The Docs folder also contains the Dinkum Abridged C library and the FlexLM network license manager software documentation Using Windows Explorer e Double click the vdsp help chm file which is the master Help sys tem to access all the other CHM files e Double click any file that is part of the VisualDSP documenta tion set xxxii VisualDSP 5 0 User s Guide Preface Using the Windows Start Button e Acc
3. Searches are not case sensitive You may type search strings in uppercase or lowercase characters You can search for any combination of letters a z and numbers 0 9 Searches ignore punctuation marks such as the period colon semicolon comma and hyphen Group the elements of your search by using double quote characters or parentheses to set apart each element You cannot search for quotation marks When searching for a file name with an extension group the entire string in double quotes for example filename ext Otherwise the period breaks the file name into two separate terms The default operation between terms is AND which creates the logical equivalent to filename AND ext Advanced Search Techniques Use the following search techniques to narrow your searches for more precise results Wildcard expressions Boolean operators Nested expressions A 62 VisualDSP 5 0 User s Guide Reference Information Wildcard Expressions Wildcard expressions let you search for one or more characters by using a question mark or asterisk Table A 28 describes the results of these differ ent kinds of searches Table A 28 How to Use Wildcard Expressions to Define a Search Search Target Example Results A single word project Locates topics that contain the word project Other grammatical variations such as projects are located A phrase project window Locates topi
4. Support Information Choose the About VisualDSP command from the Help menu to open the About dialog box This dialog box provides access to the following types of support information gt About groogeeesesseseeeseesen General Licenses Components Versions Support gt VisualDSP 4 5 Copyright 1995 2005 Analog Devices Inc Registered User Author Arthur Company Analog Devices Inc Product Version 4 5 0 0 IDDE Version 7 0 0 0 Build Date Dec 25 2005 Installation Directory E 44 5 Heb Figure A 1 Example of the General Page e Software versions The General page Figure A 1 which displays version information about the VisualDSP software This information includes the name of the registered user and company the version of IDDE and its build date and the directory path in which VisualDSP is A 2 VisualDSP 5 0 User s Guide Reference Information installed e License management The Licenses page Figure A 2 provides a centralized view of your current licenses You can view license status and perform all neces sary licensing activities installing registering and validating gt About ADI 153 256 3434434 85 SHARC Validated Permanent ADI 160 256 3434434 117 Blackfin Validated Permanent Figure A 2 Example of the Licenses Page VisualDSP 5 0 User s Guide A 3 Support Information e Component versions The Components page Figur
5. Table D 5 summarizes peripheral support in the ADSP BF533 compiled simulator VisualDSP 5 0 User s Guide D 5 Peripheral Support in Simulators Table D 5 Peripheral Support in the ADSP BF533 Compiled Simulator Peripheral Support Modeled Streamable Bootable SPORT v Vv FR UART FR FR FR Flags NP NP NA System Timers v vd NA RTC v NA NA EBIU NP NA NA PPI FR FR NP SPI FR FR NP Watch Unit FR NA NA Trace Unit FR NA NA Core Timer v FR NA Watchdog Timer v NA NA GPIO FR FR NA PROM NP NA FR MEMDMA v NA FR DMA v v FR Table D 6 summarizes peripheral support in the ADSP BF561 simulator Table D 6 Peripheral Support in the ADSP BF561 Simulator Peripheral Support Modeled Streamable Bootable SPORT FR FR FR UART FR FR FR Flags FR FR NA System Timers v v NA D 6 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Table D 6 Peripheral Support in the ADSP BF561 Simulator Peripheral Support Modeled Streamable Bootable EBIU Vv NA NA PPI v v NP SPI FR FR NP Watch Unit v NA NA Trace Unit FR NA NA Core Timer v NA NA Watchdog Timer FR NA NA PROM FR NA FR MEMDMA v NA FR DMA v v FR 1 Not all configuration settings affect simulation Special Considerations for Peripherals This section describes the limitations of the simulation software
6. lt N cycle stall as the buffer is flushed gt R1 B PO D 40 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Store Data Not Ready The data portion of a store does not necessarily have to be ready when it is entered into the store buffer Store data coming from the DAG registers and pregs has no delay but all other store data is delayed by three instruc tions If a load access collides with a store whose data is not ready the Blackfin processor stalls for four cycles W PO RO PO P3 lt 3 cycles gt lt 0 cycles gt R1 W PO Rl PO Instruction Groups All instruction group members conform to naming conventions used in the Blackfin Processor Instruction Set Reference Instruction groups described are not necessarily mutually exclusive in that the same instruc tion can belong to multiple groups Table D 27 Math Ops Instruction Groups Math Ops Video Ops Mult Ops ALU Ops Video Pixel Ops Vector Multiply Logical Ops 32 bit Multiply Bit Ops Vector MAC Shift Rotate Ops Arithmetic Ops except Mult Vector Ops except Mult MAC VisualDSP 5 0 User s Guide D 41 Multicycle Instructions and Latencies Table D 28 Areg2Dreg Ops Instruction Groups Areg2Dreg Ops MAC to half reg MAC to data reg Vector Multiply RND12 RND20 Add on Sign Modify Increment only this case dreg dreg_hi dreg_lo A0 Al Register Group
7. 3 5 IDDE Properties alDSP 3 5 16 Bit System Idde ex f myseript is Script name M Runin separate mena space T Run as differ ereer Nomalwindow _Find Target _Chenge leon pK Cancel Ane Figure A 7 Example Loading a Script From a Shortcut VisualDSP 5 0 User s Guide A 11 File Types File Types Table A 2 describes processor project files Table A 2 Files Used With VisualDSP used by VisualDSP Extension Name Purpose asm Assembly source file Source file comprising assembly language instructions ac C source file Source file comprising ANSI standard C code and Analog Devices extensions cpp C source file Preprocessed compiler files that are CXX inputs to the C C compiler These hpp files comprise ANSI standard C code hxx dpj Project file Contains a description of how your source files combine to build an execut able program ldf Linker Description File Linker command source file is a text file that contains commands for the linker in the linker s scripting language sale Intermediate files Preprocessed assembly files generated by pp the preprocessor 48 doj Assembler object file Binary output of the assembler d1b Archiver file Archiver s binary output in ELF format h Header file Dependency file used by the preproces sor and a source file for the assembler and compiler dat Data file Depen
8. Crt CPP Header H Script Various extensions such as JS and VBS VisualDSP 5 0 User s Guide 2 19 Editor Windows Viewing Modes Source Mode vs Mixed Mode Specify an editor window to display in source mode or mixed mode Source Mode Source mode as shown in Figure 2 11 displays C code only B Convolution c OF x float index 0 0 Used for a float conversion 0 0 Conversic Ok first generate the Sine Table fori i 0 i lt 360 i Convert degrees to radians then calcu j i conversion RADIANS 5 Table i sin conversion Fst AY Figure 2 11 Example Editor Window in Source Mode Mixed Mode Mixed mode displays assembled code immediately after the corresponding C code The assembly code takes a specified color 2 20 VisualDSP 5 0 User s Guide Environment Observe these conventions e To be viewable in mixed mode the source file must be compiled with debugging information enabled e The display of pipeline symbols can be enabled or disabled in mixed mode e When optimized a program can re order the generated instruc tions so that they bear little resemblance to the order of the original source lines In mixed mode assembly instructions are re ordered again so that all the instructions for a given source line are gathered together under that source line Figure 2 12 shows an example of the mixed mode format Editor Tab Mode Ed
9. Figure A 25 Contents Page Online Manual Topics VisualDSP 5 0 User s Guide A 59 Online Help e An index entry on the Index page Figure A 26 Build settings lt Click an index entry custom 7 individual File to view the associated topics project wide Figure A 26 Index Entries on the Index Page e A topic name on the Search page The bottom portion of the Search page displays the located topics hits that include your search string Searching Help VisualDSP Help provides full text and advanced search capabilities for finding information Full Text Searches A full text search locates every occurrence of a text string within the Help system Specify a particular word or phrase to find only the topics that contain that word or phrase You can search previous results match similar words and search through the topic titles only A basic search consists of the word or phrase that you want to locate Use similar word matches a previous results list or topic titles to further define your search You can run an advanced search which uses Boolean operators and wild card expressions to further narrow the search criteria Figure A 27 shows an example of a Boolean search for new AND plot A 60 VisualDSP 5 0 User s Guide Contents Index Search Favorites Type in the word s to search for new AND plot aj List Topics Display Select topic Found 7 R 1
10. _function4 FFA110B0 LINK 0x28 FFA110B4 SP 7 R7 4 7 P5395 7G FFA110B6 I0 L 0x4 FFA110BA I0 H Oxff90 FFA110BE SP 12 FFA110C0 PO FP FFA110C2 P1 9 FFA110C4 NOP FFA110C6 NOP FFA110C8 RO I0 FFA110CA PO 40 FFA110CC LSETUP 4 0xFFA110D0 4 x FFA110D0 MNOP PO RO RO FFA110D8 PO RO z Figure 2 43 Application Built When Debug Information is Not Available 2 66 VisualDSP 5 0 User s Guide Environment Memory Windows Use Memory windows to e View and edit memory contents e Display the address of a value Move the mouse pointer over the value and hold down the keyboard s Ctrl key e Lock the number of columns currently displayed This action resizes the window horizontally without altering the display e Track one expression You open memory windows from the Memory menu Memory windows provide e Number format and edit features e Fill and dump capabilities e An optional address bar for fast navigation to recently used addresses symbols or expressions To display the address bar right click in a memory window and choose Address Bar A check mark next to this command on the right click menu indicates that this option is enabled Number Formats in Memory Windows The memory windows in the following figures show examples of different memory number formats VisualDSP
11. active project Figure 1 9 Project Box Showing the Active Project Though commands are sent to the active project they may also be carried out by a project on which the active project depends For example assume that project A is active and depends on project B Executing a Rebuild All command on project A builds project B first The same logic applies to the Clean command which deletes intermediate and target files Exporting a makefile exports one makefile for each open project In the makefile of a project depending on another project one sub target is cre ated for each project on which it depends Thus building a project builds all dependent projects first Project Group Files You can save project group information to a file so you can restore that project group and share it conveniently VisualDSP 5 0 User s Guide 1 49 Processor Projects The project group file dpg which is in XML format contains a list of project entries Each project entry corresponds to a project in the group and contains project information including the path to the project file dpj and its dependent projects Batch build specifications are saved in the dpg file for later use so you can load and execute them without re specifying the same build targets In the Project window the root node shows the project group s file name without an extension Source Code Control SCC VisualDSP includes Source Code Control SCC whi
12. functionl main _function4 Ha A FFA110FC IF CC RO R1 FFA110FE RTS function4 FFA11100 LINK 0x38 FFA11104 R325 FFA11106 FP 4 R3 FFA11108 P1 L Ox4 FFA1110C P1 H Oxff90 a FFA11110 P2 FP FFA11112 P2 44 FFA11114 PO 10 FFA11116 LSETUP 4 0xFFAL111A 6 FFA1111A R2 Pl FFA1111C P2 R2 FFA1111E RO L 184 Cee 9096 996 FE FE FE IEE FE IEE HEE HEE HE EE HE HE HE IEE oid function4 void E Tes long myarray 10 1 2 3 4 5 6 7 8 9 10 printf hi from function 4 j 6 for j 5 j lt 10 j printf i myarray j 10 printf n Figure 2 42 Application Built With Debug Information VisualDSP 5 0 User s Guide 2 65 Debugging Windows example in a Release configuration the call stack may be invalid around function boundaries or when programs do not adhere to compiler standards Frame pointers in the call stack that do not have debug symbols associated with them may appear in the Call Stack window as man gled assembly labels or memory addresses with an offset Function Rictmctiont 0 lt _function3 Ux6c gt lt _function2 0x70 gt lt _functionl 0x66 gt lt _main Ox8 gt Double clicking on a function Opens an editor window or the Disassembly window Disassembly ix _function4 ale zj FFA110AE RTS
13. j2 j2 0X1 xr939 r2 r4 yri 31 y y k QMIF nile JUMP loop j kl j E IF nile JUMP loop ki 0X1 yr5 32 My y y j0 0x1 zr0 r4 Wii j2 k j0 0X1 xr0 r4 r3 yrl r5 33 ky y ki 0X1 xr3 r2 iE IF j ki 0X1 xr3 r2 r4 yr5 r6 34 v kWv i2 i2 0X1 xr9 k o iwo Wr i2 i2 0X1 xr9 r2 r4 vrl Figure C 5 Branch Target Buffer Hits Pipeline Viewer and Disassembly Window Operations This section includes the following topics e Current Program Counter Value e Stepping VisualDSP 5 0 User s Guide C 7 ADSP TS101 Processors Current Program Counter Value The program counter value marked by gt in the Disassembly window is the address of the instruction at pipeline stage E1 When a breakpoint is set at a certain address the simulator halts after the instruction as this address is executed at stage E1 You can specify which instruction the simulator executes next by manually changing the program counter PC value in the PC Register window Note however that the current instruction indicated by gt in the Disas sembly window is executed prior to the user specified instruction When you change a PC value the simulator flushes the pipeline and aborts all its instructions After the pipeline is flushed normal execution resumes from a memory address indicated by the new PC value The simulator contin ues to run until an instruction at the new PC re
14. on page 2 19 e Syntax Coloring on page 2 19 e Viewing Modes Source Mode vs Mixed Mode on page 2 20 e Editor Tab Mode on page 2 21 e Context Sensitive Expression Evaluation on page 2 23 e Compiler Annotations on page 2 24 e Right Click Menu on page 2 39 2 16 VisualDSP 5 0 User s Guide Environment Editor Window Features Figure 2 10 shows items that can be customized in editor windows Control menu Specify colors for text objects amp shell asm coeff W J Cabratipa aa Toggle book marks Specify Specify comment start tab widths Specify font and end strings Figure 2 10 Customizable Items in Editor Windows Editor windows support e User defined color coded comments strings keywords and tab settings syntax coloring e Two viewing modes source mode and mixed mode e Printing print preview and user defined headers and footers e Bookmarking e Finding replacing with wrap around search and regular expression matching VisualDSP 5 0 User s Guide 2 17 Editor Windows Going to a line number and the display of line numbers Jumping to the next or previous syntax error Copying cutting pasting undoing and redoing functions Each open file has a deep stack 500 items Tabs for fast switching between source files Compiler annotations indications of optimizations Location of matching brace characters and auto positioning of brace characte
15. r2 4 r4 16 yvy ke Be AI IB ki OX1 zxr3 r2 r4 1 yvy y ke amp xE Al j2 j2 OX1 xr9 r2 18 y y y ya El Bee IF njle JUMP loop ki 19 yoy y y W E ES Es 20 n y yl Yy j ki 0x1 xr3 r2 BBE 21 j on y yl I j2 j2 0X1 xr9 xxix 22 eX lt lt a IF njle JUMP loop Be 23 y ke E Ba x 24 yy ke g Al kl 0X1 xr3 r2 r4 5 Figure C 11 Abort Due to an Unpredicted Change of Flow VisualDSP 5 0 User s Guide C 17 ADSP TS20x Processors Abort Due to Mispredicted Change of Flow In the following example an abort appears at stage E2 because of a mispredicted change of flow at the end of a loop predicated on a compute block condition Cycle FilF2 Fa ralpp p tTlalElE2 O i 100 E x x x EE H yr4 r4 r3 101 El x El x W I 5 i H IF nyaeq JUMP loop2 nop 102 BS Ba E E W 5 j10 0 103 x El E El y H J B yr3 r3 r2 104 Bx El Ea yt 7 B yr3 r3 r2 105 ive E Bo yr4 r4 r3 106 H y iff va WI y H IF nyaeq JUMP loop2 nop 107 oN A E EY BN 510 0 108 n ng x x Al fA Al yr3 r3 r2 109 j_n ng x x AA yx3 r3 r2 110 E j n ni x AA r r4 r3 111 n x j n re lA Al IF nyaeq JUMP loop2 nop 112 n n x j y x Al 113 y n n x X f x El 114 j y n n j bd y x x Figure C 12 Abort Due to Mispredicted Change of Flow C 18 VisualDSP 5 0 User s Guide Simulation of TigerSHARC Processors Branch
16. 3 26 types of 3 20 viewing statistics 2 112 waterfall 3 24 X Y 3 21 plot windows 2 109 See also plots BTC mode 2 110 configuring 2 114 features 2 110 operations in 2 114 presentation of 2 116 right click menu 2 111 status bar 2 110 streams 3 17 toolbar 2 111 types of 3 20 viewing statistics 2 112 INDEX positioning windows A 42 post build options 1 59 command syntax 1 60 power minimizing 3 31 power profiling setting up 3 31 pp files A 12 pragmas 2 35 pre build options 1 59 preferences load file and advance to main 1 26 VisualDSP and tool output color 2 29 Preferences dialog box 1 26 2 29 printing hardware manuals A 50 online Help A 57 VisualDSP manuals A 50 processor loading into simulator B 10 specifying 3 1 processor definition files 2 83 processor ID configuring B 10 product information A 3 profile guided optimization defined A 79 profiling about 3 8 assembly instructions 2 61 defined A 79 functions 2 60 profiling windows 2 55 Program Counter PC register setting 3 12 VisualDSP 5 0 User s Guide I 13 INDEX program development steps adding and editing project source files 1 23 building a debug version of the project 1 26 building a release version of project 1 27 creating a project 1 23 setting project options 1 23 program execution commands 3 11 halting 3 11 keyboard shortcuts A 35 program icons A 18 programming tips 1 12 p
17. 5 0 User s Guide Simulation of Blackfin Processors Table D 10 PushPopMultiple Instructions and Cycles Instruction ADSP BF532 ADSP BF535 SP R7 0 P5 0 14 cycles 14 cycles R7 0 P5 3 SP 11 cycles 11 cycles 32 Bit Multiply modulo 2 Table D 11 lists bit multiply instructions and cycles Table D 11 Bit Multiply Instruction and Cycles Instruction ADSP BF532 ADSP BF535 RO R1 3 cycles 5 cycles Call and Jump Table D 12 lists call and jump instructions and cycles Table D 12 Call and Jump Instructions and Cycles Instruction ADSP BF532 ADSP BF535 CALL 0x22 5 cycles 4 cycles CALL PC PO 5 cycles 4 cycles CALL P0 5 cycles 4 cycles JUMP 0x22 5 cycles 4 cycles JUMP PC PO 5 cycles 4 cycles JUMP P0 5 cycles 4 cycles Conditional Branch The number of cycles that a branch takes depends on the prediction as well as the actual outcome VisualDSP 5 0 User s Guide D 23 Multicycle Instructions and Latencies Table D 13 Conditional Branch Cycles Prediction taken not taken Outcome taken not taken taken not taken Cycle BF532 BF535 BF532 BF535 BF532 BF535 BF532 BF535 UNE 4 cycles 4 cycles 8 cycles 7 cycles 8 cycles 7 cycles 1 cycle 1 cycle Return Table D 14 lists return instructions and cycles Table
18. Action Key s Move the cursor to the left one character Left Arrow lt Move the cursor to the right one character Right Arrow gt Move the cursor to the beginning of the file Ctrl Home Move the cursor to the end of the file Ctrl End Move the cursor to the beginning of the line Home Move the cursor to the end of the line End Move the cursor down one line Down Arrow 1 Move the cursor up one line Up Arrow Move the cursor one page down Page Down Move the cursor one page up Page Up Move the cursor right one tab Shift Move the cursor left one tab Shift Tab Move the cursor left one word Ctrl Left Arrow lt Move the cursor right one word Ctrl Right Arrow gt Move to the matching brace character within a file Ctrl B Go to the next bookmark F2 A 32 VisualDSP 5 0 User s Guide Reference Information Table A 9 Keyboard Shortcuts for Moving Within a File Contd Action Key s Go to a line Ctrl G Find text Ctrl F Find the next occurrence of text F3 Cutting Copying Pasting Moving Text To edit text use the keyboard shortcuts listed in Table A 10 Table A 10 Keyboard Shortcuts for Editing Text Action Key s Copy text Ctrl C or Ctrl Insert Copy text Select with cursor and Ctrl drag Cut text Ctrl X or Shift Delete Delete text Delete selection or forw
19. PC samples 2 62 finding regular expressions in find replace operations A 44 tagged expressions A 47 find replace operations regular expressions A 44 Flag IO FIO peripheral Blackfin D 2 flash programming 3 29 programming at production 3 28 programming in production 3 28 flash algorithm loading 3 29 flash devices changing data 3 26 flash drivers loading 3 29 flash memory about 3 29 erasing 3 29 filling 3 29 programming 3 26 resetting 3 29 VisualDSP 5 0 User s Guide 1 7 INDEX Flash Programmer about 3 26 flash driver 3 30 functions 3 29 Stand Alone 3 27 user interface 3 30 Flash Programmer window 3 30 floating toolbars A 28 floating windows A 39 focus definition 3 6 multiprocessor debug session 2 84 folders automatic file placement 2 15 project 2 6 Project window 2 2 2 6 Project window rules 2 13 font color in Output window 2 29 FP Denorm B 4 functions displaying 2 59 displaying local variables 2 54 G global build options 1 25 glossary A 66 graphing processor memory 3 19 grouping processors 2 86 groups multiprocessor 2 85 H halting programs 3 12 hardware specifying 3 5 hardware breakpoints 3 3 about 3 16 latency 3 16 restrictions 3 16 use 3 16 Hardware Breakpoints dialog box 3 16 hardware conditions simulating 1 16 header files 1 30 heaps usage in Expert Linker 1 38 Help about 1 61 bookmarking A 58 categories A
20. Poo Column counto New Data Jenar st lt s s SCsY m Axis Selection Oe OSE ish OK Cancel Settings Figure 2 77 Plot Configuration Dialog Box Plot Window Presentation Customize the presentation of a plot window to fit your needs Configure presentation settings from the Plot Settings dialog box which you can invoke by e Right click from within a plot window e Click the Settings button in the Plot Configuration dialog box 2 116 VisualDSP 5 0 User s Guide Environment The Plot Settings dialog box provides the tabs shown in Figure 2 78 Plot Settings 2 x General 20 Axis Font Style Data Processing Figure 2 78 Tabs in the Plot Setting Dialog Box Options on the tab pages enable you to configure the plot window s presentation On the Style page for example you can easily specify sym bols for a data set as well as line type and width as shown in Figure 2 79 E Figure 2 79 Specifying Line Styles In addition to the many presentation options you can select a rectangular area as shown in Figure 2 80 and zoom in on it Plot Presentation Options Depending on the selected plot type many plot presentation options are available In the Plot Settings dialog box these options are grouped by function on tabbed pages as described in Table 2 28 You can specify a plot s presentation options before generating the plot while config
21. Sapport Era OT ioia n N T A A 2 IDDE Command Line Parameteis csassrsninrioraniargbunisrisii A 7 Extensive SCHUM cusinntounieeii ieee A A 8 a Ai ener aera ae nt E E A 12 Parts ot tie User Re onsin A 15 B ET E A EA PEE E IEA E E A er A 16 xiv VisualDSP 5 0 User s Guide CONTENTS Additional Information in Title Bars cs0sceeccescsnorseones A 17 yee Bat Bigot Cis Momi accensione A 17 CMU Memi 5 2 cesiotcstieacecanasiecapeiaa te cessesmonettemstaonmesmnnreeene A 18 Pia Ko aceite A 18 Editor WS secrete eteaenttniclradeccdeitas A 18 Debussme Window cciicnsinncenmnmnminunumnitenss A 19 Mena Barenn a ees A 19 Toolbars and User Tooli arasonar nnn A 19 Built in Toolbars scssrcseraraiii AA A A 20 Toolbar Customization ressesie nns A 21 Cser Tools pieainraanmnanainpane naa a A 21 Toolbar DUOT eesin ieeeeeeeeee A 22 Toolbar CPN denenen A 27 Toplbar Buton Appearance beers A 27 Toolbar S hapt ssas ces A 28 Toolbars Docked s Floating sessirensncacensronaintai A 28 Toolbar Rules epi cietsaadirvesealadotae inne i A 29 Ges Bo oons rr A 29 Keybgoard SNOT CUE irren S A 31 Working With PISF sses A 31 Mome Widon a File ssrsisseiuciirsaianna i a Per Renae rte A 32 Cutting Copying Pasting Moving Text secsrarisennsisere A 33 Selecting Text Within a File carssnisramssnnrniorenariari A 34 Working With Bookmarks in an Editor Window 06 A 34 VisualDSP 5 0 User s Guide xv CONTENTS Building Proje erenn A 35 Using
22. To view Help information about an error message that appears in the Output window s Build page 1 Select the error identifier for example cc0276 then press F1 Note that selection is sometimes easier from right to left SIPC cpp line 33 namespace nane const VDK ThreadIDkNog error n e wner static_c ine 3 Build Output Window RAE TP KOE Error Code Figure 2 21 Error Code in Output Window VisualDSP 5 0 User s Guide 2 33 Output Window 2 The Help window appears showing the descriptive text Descriptive text cc0276 Compiler Fatal Error name followed by must be a class or namespace name Description The identifier followed by a was not a class symbol Severity Fatal Error Recovery The compiler cannot recover from this error Example class Base public int Mum Figure 2 22 Viewing Details of an Error Message in Help 2 34 VisualDSP 5 0 User s Guide Environment Promoting Demoting and Suppressing Error Messages You can change the severity level of an error marked D discretionary Refer to the tools documentation for command line switches that override error message severity The Project Options dialog box provides options you can use to override severity A discretionary message can be promoted demoted or suppressed For example you might promote a remark or warning to an error or you might decide to de
23. e Code Development Tools on page 1 27 e Processor Projects on page 1 43 e VisualDSP Help System on page 1 61 VisualDSP Features VisualDSP includes all the tools needed to build and manage processor projects VisualDSP includes e Integrated Development and Debugging Environment IDDE with VisualDSP Kernel VDK integration e C C optimizing compiler with run time library VisualDSP 5 0 User s Guide 1 1 VisualDSP Features e Assembler and linker e Simulator software e Example programs This section briefly describes VisualDSP features Integrated Development and Debugging The VisualDSP IDDE provides complete graphical control of the edit build and debug process In this integrated environment you can move easily between editing building and debugging activities Code Development Tools Depending on the code development tools purchased VisualDSP includes one or more of the following components e C C compiler with run time library e Assembler linker preprocessor and archiver e Loader and splitter e Simulator e EZ KIT Lite o evaluation system must be purchased separately e Emulator must be purchased separately VisualDSP supports ELF DWARF 2 executable files VisualDSP supports all executable file formats produced by the linker If your system is configured with third party development tools you can select the compiler assembler linker or loader
24. platforms 1 17 simulation 1 16 target status messages Output window 2 30 tc8 files A 13 Tel interpreter 2 41 menu issuance A 9 running commands A 8 tcl files A 13 technical documentation locating xxxiii terms VisualDSP A 66 text locating using regular expressions A 44 text manipulation keyboard shortcuts A 33 text selection keyboard shortcuts A 34 VisualDSP 5 0 User s Guide I 17 INDEX third party tools 1 2 threads 2 103 defined A 86 idle 2 108 status 2 103 2 107 tracing 2 107 Timer TMR peripheral Blackfin D 8 title bar A 17 components A 16 indicating focus 3 6 TMR see Timer peripheral D 8 toggling breakpoints 3 13 toolbars A 20 built in A 20 button appearance A 27 customization A 21 docked vs floating A 28 Image Viewer window 2 120 list of buttons A 22 plot windows 2 111 shape A 28 tools code analysis 3 7 code development 1 2 command line invocation 1 47 context sensitive Help A 21 debugging 1 20 documentation A 50 file associations 2 14 options 1 26 third party 1 2 user configured A 21 Tools menu user tools A 21 traces 2 53 about 3 9 Trace windows 2 52 3 9 tracking expressions 2 69 txt files A 13 U UART peripheral in Blackfin D 7 unconditional breakpoints 3 14 updates VisualDSP 1 10 upgrades VisualDSP 1 10 user tools A 21 utilities ICE Test 1 18 A 87 V variables global vs local 2 52 vbs files A
25. the 5 0 is not shown XXX VisualDSP 5 0 User s Guide Preface For hardware information refer to your processors s hardware reference instruction set reference or programming reference and 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 man uals and data sheets http www analog com processors resources technicalLibrary Online Technical Documentation Online documentation comprises the VisualDSP Help system software tools manuals hardware tools manuals processor manuals the Dinkum Abridged C library and Flexible License Manager 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 of most manuals are also provided Each documentation file type is described as follows File Description CHM Help system files and manuals in Help format HTM Dinkum Abridged C library and FlexLM network license manager software doc or umentation Viewing and printing the HTML files requires a browser such as HTML Internet Explorer 6 0 or higher PDF VisualDSP and processor manuals in Portable Documentation Format PDF Viewing and printing the PDF files requires a PDF reader such as Adobe Acrobat Reader 4 0 or higher
26. the search mechanism scans for an exact character by character match of the search string which does not have to be an entire word Every character in the search string is examined If there are embedded spaces for instance the exact number is matched Regular expression matching provides much more flexibility and power than a normal search A regular expression can be a simple string which yields the same matches as normal searches Some characters in a regular expression string however have special interpretations which provide greater flexibility For example with regular expression matching you can find the following e All occurrences of either hot or cold e Occurrences of for followed by a left parenthesis with any number of intervening spaces e A semicolon only when it is the last character on a line e The string ADSP followed by a sequence of digits Using a regular expression as the search pattern for replacement provides ways to identify and recover the variable portions of the matched strings A 44 VisualDSP 5 0 User s Guide Reference Information Specific Special Characters Regular expressions assign special meaning to the following characters If you have to match on one of these characters you must escape it by preceding it with a backslash Thus matches the character yet matches the beginning of the line Table A 20 Special Search Characters
27. xr 5 x B j10 0 e IALU Dependency Stalls Due to Compute Block Dependency The following sequence of instructions causes a one cycle stall at the Integer pipeline stage YR3 YR4 R3 R27 R4 R3 This instruction is stalled in Integer for 1 cycle The source register R2 is a destination in the previous instruction 41 x j n yr4 0X5 nop nop j j0 0X1 xrl 42 n x j yr3 OX1 yr4 0X5 nop This j0 0X1 xr0 43 n n X yr2 0 yr3 0X1 yr n nop 44 Be j n n j10 0 yr2 0 yr Faia nop 45 BjBj n yr3 r3 j10 0 yr y yr4 0X5 46 BB BB yr r4 yr3 r3 r2 jl y yr3 OX1 47 i i j IF nyaeq E yr r4 r3 yr Bess yr2 0 48 y i i IF nyaeq yra4 r4 r3 B s L A y jid 0 49 n y j j0 0X1 IF nyaeq JUM yr B y yr3 r3 r2 50 j n y j10 0 j0 0X1 xr IE gt hos B yr3 r3 r2 51 x j n yr3 r3 j10 0 j0 Ts yr4 r4 r3 Figure C 2 Stall Due to Compute Block Dependency C 4 VisualDSP 5 0 User s Guide Simulation of TigerSHARC Processors Aborts The following examples show how the Pipeline Viewer displays different types of abort events for ADSP TS101 processors For a complete list of pipeline effects and memory transaction timing refer to the processor s hardware specification Aborts Due to an Unpredicted Change of Flow In the following example the abort at the Decode stage is
28. 1 address bit 23 is used as bank select If DCBS is 0 address bit 14 is used as bank select Note that these values are used for the 16 KB implementation of Blackfin processor data memory Refer to Cache Access 1 Cycle Stall on page D 36 for details about how to determine the minibank The follow ing table assumes that DCBS is 0 VisualDSP 5 0 User s Guide D 37 Multicycle Instructions and Latencies Table D 26 Superbank Minibank Selected When DCBS is 0 Addr 14 12 Superbank Minibank Selected 000 superbank A minibank 1 0x0000 0x1000 001 superbank A minibank 2 0x1000 0x2000 010 superbank A minibank 3 0x2000 0x3000 011 superbank A minibank 4 0x3000 0x4000 100 superbank B minibank 1 0x0000 0x1000 101 superbank B minibank 2 0x1000 0x2000 110 superbank B minibank 3 0x2000 0x3000 111 superbank B minibank 4 0x3000 0x4000 If the addresses in a dual memory access multi issue instruction is cached to the same superbank and minibank a 1 cycle stall is incurred IO is address 0x002348 I1 is address 0x002994 R1 R4 L R5 H IS R2 I0 I1 R3 lt 1 cycle stall gt due to a collision in minibank 3 A collision occurs regardless of whether the accesses are both loads or a load and a store If the first access is a load DAGO and the second is a store DAG1 the cycles incurred are seen by the store buffer see Store Buffer Ov
29. 1 lt 1 gt if CC RO PO math op using dreg as src 1 lt 1l 1 gt R2 R1 R0 1 lt 1 gt if CC R3 P1 1 lt 1 1 gt SAA R3 2 R1 0 dreg CC 1 lt 1 gt R0 CC math op using dreg as src 1 lt 1 2 gt R2 H R1 L RO H 1 lt 1 gt RI CC 1 lt 1 2 gt SAA R3 2 R1 0 dreg CC 1 lt 1 gt R0 CC CC dreg 1 lt l 2 gt CC R0 if CC preg dpreg 1 lt 1 gt if CC P0 RI any op using preg l 4 lt 1 3 gt R4 P0 if CC dreg dpreg 1 lt 1 gt if CC RO RI CC dreg 1 lt l 1 gt CC R0 D 30 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Loop Setup Latencies Table D 22 Loop Setup Latencies Description Example lt cycles stalls gt instruction BF532 BF535 loop setup 1 lt 1 gt LSETUP topl bottom1 LCO Po loop setup with same LC 1 6 lt 1 1 gt LSETUP top2 bottom2 LCO P1 modification of LT or LB 1 lt 1 gt LTO SP loop setup with same loop registers 1 9 lt 1 3 gt LSETUP top bottom LCO P0 loop setup with LCO and LC0 0 1 lt 1 gt LSETUP top bottom LCO P0 any processor op 1 lt 1 1 gt NOP loop setup with LC1 and LC1 0 1 lt 1 gt LSETUP top bottom LC1 P0 any processor op 1 lt 1 1 gt NOP LC0 LC1 reg written to 1 lt 1 gt LCO RO any processor op 1 9 lt l 4 gt NOP LT0 LBO written to and LCO 0 1 lt 1 gt LTO SP any processor op 1 9 lt l 4 gt NOP LT1
30. 1000000 Figure 1 5 Memory Map Example After Running a SHARC Program 1 40 VisualDSP 5 0 User s Guide Introduction to VisualDSP Archiver The VisualDSP archiver e1 far exe combines object doj files into library d1b files which serve as reusable resources for project develop ment The linker searches library files for routines library members referred to by other objects and links them in your executable program Run the archiver from within VisualDSP or from the command line From VisualDSP create a library file as your project s output To modify or list the contents of a library file or perform other operations on it you must run the archiver from a command line For details refer to the VisualDSP Linker and Utilities Manual Splitter The splitter e fsp121k exe processes executable files to prepare non bootable programmable read only memory PROM image files These files are executed from the processor s external memory The splitter s primary output is a PROM file with these extensions e s_ h_ t and stk SHARC processors e 1dr Blackfin and TigerSHARC processors For TigerSHARC processors output from the splitter is 32 bit For SHARC processors output from the splitter is 32 bit 40 bit 48 bit or 64 bit To specify splitter options choose Project gt Project Options and in the tree control click the Split page or the Splitter subpage Splitter terms are def
31. 101 WAW accumulator register Regmv hazard sysreg A register move of a system register to an accu AO w LCO to areg gt exu op using mulator register followed by any execution unit A0 A0 S areg RAW operation using that accumulator register as an operand VisualDSP 5 0 User s Guide D 15 Simulator Instruction Timing Analysis for ADSP BF535 Processors Table D 7 Stalls Detected Messages ADSP BF535 Processor Contd Message Explanation Example AQreg hazard move to AQ gt exu op using AQ RAW CCreg hazard move to CC gt exu op using CC RAW Kills Detected Messages Table D 8 shows the messages that occur when a kill is detected Table D 8 Kills Detected Messages ADSP BF535 Processor change of flow kill branches Message Explanation Example change of flow kill A branch CALL PO rti change of flow kill Return from interrupt kills RTI mispredicted Kills due to mispredicted RO 0 CC RO If CC JUMP next bp hardware loop bottom kill interrupt kill Instructions in the pipeline are killed due to an interrupt RAISE 1 sync kill SYNC instructions force all speculative transient in the core system to be completed before proceeding killing instructions in the pipe SSYNC D 16 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Multicycle Instructions M
32. 11 n on n na ji j3i j j0 ox40000 B B j jO Ox40000 nop nop 12 n n n nop nop nop jl j31 j0 B B B 5B j0 0X40000 nop nop 13 E xX n n nop nop nop nop nop n B B iB j0 0X 40000 nop nop 14 n x x n nop nop nop nop nop n B iB j0 OX40000 nop nop 15 n n x x nop nop nop nop nop n Y 3B j0 0X40000 nop nop 16 n n n xX nop nop nop nop nop n y ni jl j31 j0 nop nop n Figure C 8 Stall Due to IALU Dependency C 14 VisualDSP 5 0 User s Guide z Simulation of TigerSHARC Processors Stalls Due to Compute Block Dependency The following sequence of instructions causes a one cycle stall at the Decode stage XR2 RO R1 XR3 RO R2 This instruction is stalled in Decode for 1 cycle The source register R2 is a destination in the previous instruction xi Cycle FI LF2 LE3 _E4 PD D i E E2 j 20 n n n n X nop nop nop nop nop no 1 nop nop nop nopi 21 n n n n x xr2 r0 ri nop nop no 1 nop nop nop nopi 22 x n n n nw ur3 r0 r2 xr2 r ri 1 nop nop nop nopi 23 n x n nW n ur3 20 r B xr2 r0 ri 1 nop nop nop nopi 24 x n x n n nop nop nop xr3 r0 r2 B i nop nop nop nopi 25 x x n x n nop nop nop nop nop no 3 xr2 r0 ri nop nop 26 El x x n n nop nop nop nop nop
33. 1_dotprod doi orooram BE inden dih QP shared em 1sm Cpo QP Shared Mem 2 Fl Fe Figure 1 4 Expert Linker Window The Expert Linker window contains two main panes e The Input Sections pane displays a tree structure of the input sections e The Memory Map pane displays each memory map in a tree or graphical representation You can dock or float the Expert Linker window in the VisualDSP main window Memory Map Pane Right Click Menu Table 1 4 describes the commands on the Memory Map right click menu Table 1 4 Memory Map Pane Right Click Menu Command Purpose View Mode gt Memory Map Displays the memory map in tree mode Tree View Mode gt Graphical Displays the memory map in graphical blocks Memory Map 1 36 VisualDSP 5 0 User s Guide Introduction to VisualDSP Table 1 4 Memory Map Pane Right Click Menu Cont d Command Purpose View gt Mapping Strategy Pre Link Displays the memory map which shows where you intended to place object sections View gt Link Results Post Link Displays the memory map which shows where the object sec tions are actually placed New gt Memory Segment Opens the Memory Segment Properties dialog box from which you specify the name address range type width and so on of the memory segment that you want to add New gt Output Section Adds an output secti
34. 5 0 User s Guide 2 67 Debugging Windows Data DM Memory Binary 00D1085 00000000000000001000000111110000 00D109 00000000000000001000000111110000 O0D10A 01111111111111111111111111111111 Data DM Memory Octal 00D108 00000100760 00D109 00000100760 00D10 17777777777 O0D10B 00000100760 00D10C 00000100766 00D10D 37777777777 Data DM Memory Hexadecimal 00D188 00008509 OODIBA 000084E5 00D1BC 000084E5 00D1BE 000084E5 00D1C0 000084E5 00D1C2 000084E5 O0D10B 00000000000000001000000111110000 00D10C 00000000000000001000000111110110 00D10D 11111111111111111111111111111111 Op Figure 2 46 SHARC Memory Window in Hexadecimal Format 2 68 VisualDSP 5 0 User s Guide Environment Data DM Memory Unsigned Integer x 00D1B58 34057 34021 OOD1BA 34021 34021 OOD1BC 34021 34021 00D1BE 34021 34021 Ei 00D1C0 34021 34021 00D1C2 34021 34105 Ki Figure 2 47 SHARC Memory Window in Unsigned Integer Format Memory Window Right Click Menu Memory windows provide a right click menu Choosing the Select For mat command enables you to change the display s number format Figure 2 48 shows the formats available for SHARC processors Available formats depend on the processor Expression Tracking in a Memory Window While you are stepping through code a memory window configured for expression tracking shows the memory at the
35. 5 0 User s Guide v CONTENTS EE ee cerina O A N ON OE 1 34 Espat Linker T ndon sranna 1 35 Memory Map Pane Right Click Menu sscsseeerreerere 1 36 Sack add Tear Ua on buncrcainecenaee 1 38 Archiver ca eis taised esuslsetd ols taleinlehaclindbichnanleonltbaeaped wig iii 1 41 DEP E N EE E AE E A EA 1 41 LOGOS sarir A 1 42 Processor Prole sarrarraanns srn EEEE 1 43 Project T ri angai RA 1 44 T LD E T E E E E A A TA 1 45 LOF Kle siocapiiiakn keanan aeaa 1 46 Project PUR csseariss i n 1 47 Project Groups ocorecriseronott ninina 1 48 Project Group PES errs aar dee eeokelet 1 49 Source Code Control SCC sscicsvosteriecdendegdedensenahsewdeavdaredadeasenes 1 50 E E EEEE E EA E N AA EA ET 1 51 Rules sc sinsdedecadesuicaaacedeaauieiic simioiaasspuieaauntelabieaaeipeheaancenieaal 1 52 AEE OY aaun 1 53 Empi Mokai norii ee 1 53 Project Coni ONS eain 1 56 Project Boki etaa E 1 57 TEET T E eee eae anes ae 1 58 File AAG siais ustiiiiaiineis arteries baademesiabieiabaaieniouets 1 58 Bate Beit cic E eee een 1 59 vi VisualDSP 5 0 User s Guide CONTENTS Pre B ild and Post Build Options ccccasomssiiersasevsisieeerierense 1 59 COO SA SNN 1 60 Project Dependencies osssnusirimeni emrine 1 60 Visual DS Pee Help Systemi isueseipassareu e 1 61 ENVIRONMENT Piolet V AON gene ae SO Ie a 2 2 Prae V ON cere ate 2 3 Kerpel Tab sinransnerarseiesiermoinsna eaeou 2 4 Trojeet Dependeniciis a eee 2 4 Project POUES miiran 2 6 Pojet Foldet co
36. A 15 Table A 15 Keyboard Shortcuts for Breakpoints Action Key s Open the Breakpoints dialog box Alt F9 Enable disable a breakpoint Ctrl F9 Toggle between setting a software or hardware breakpoint Shift F9 Toggle add or remove a breakpoint F9 Obtaining VisualDSP Help To obtain VisualDSP Help use the keyboard shortcuts listed in Table A 16 Table A 16 Keyboard Shortcuts for Obtaining Online Help Action Key s View VisualDSP Help for the selected object F1 Obtain context sensitive Help for controls buttons fields Shift F1 menu items A 36 VisualDSP 5 0 User s Guide Reference Information Miscellaneous For windows and workspaces use the keyboard shortcuts listed in Table A 17 Table A 17 Miscellaneous Keyboard Shortcuts Action Key s Refresh all windows F12 Select workspace 1 through 10 Alt 1 Alt 0 Window Operations Similar to many Windows applications VisualDSP provides multiple ways to adjust the view of the user interface Window Manipulation The Window menu commands Figure A 16 enable you to manipulate your window display and update windows during program execution Refer to your Windows documentation for more information window B Tile Horizontally T Tile vertically E Cascade E Close all Refresh alee vv 1 dotprod_main c Figure A 16 Window Menu Commands Visual
37. A ee eee tee OAE A 53 Help Y dOn cee ecteeeciniea se ee tees A 53 Contest Sens nive PUP sedcciismipsicarecannciey atpuipicaaeedeiealeadcs A 54 Viewing Menu Toolbar or Window Help ou eee A 56 Viewing Dialog Box Help corinccnccnniiinn euna A 56 icine Sindor Hop enrera A 57 Copying Example Code From Help sssesararinsosraceniriss A 57 Penone HEIP oea E A 57 Bookmarking Frequently Used Help Topics n s A 58 Piavigatineg in Online Help concious A 59 BRAC TIENT rsson A 60 Pell leet Crete hee cuneate A 60 Rules for Full Text Searches to ccetenscrssecnientucenpenderedasads A 62 Adyanced Search Tet ite 5 c cionsaceaseasessaasonesmasaryuccaenss A 62 Wildcard Expressions ivcdacineasiienedaseeaaeaanes A 63 a COREE israse A 63 Wesred 2epreriOne piece ees A 64 Rules Tor Advanced Dea eae scerensncadascancssedeusadonleanctcay A 65 I ae E E E ce es A 66 SIMULATION OF SHARC PROCESSORS Psy ORs eran arene ese B 1 ADSP 21x6x Processor Anomalies cceeccsseeeccescecneececneeeens B 2 VisualDSP 5 0 User s Guide xvii CONTENTS Shadow Write FIFO Anomaly ADSP 2116x Only 0 B 2 SIMD Read from Internal Memory With Shadow Write FIFO Hit Anomaly ADSP 2116x Only tconndiniaiininnaiunke B 3 Event Oprions aciiiswicisinscidcriianeieaalaniabemeieiielinleetinieianiadalenelies B 4 FP Dorim cena oe eee B 4 Shor Ward Anomaly sorar srren a NS B 4 Access to ADSP 21065L Short Word Internal Memory 9th Column at Even Addresses orronisoriniorenkinnakiia a
38. Character Description 7 A caret matches the beginning of the line A dollar sign matches the end of the line A period matches any character abc A bracketed sequence of characters matches one character which may be any of the characters inside the brackets Thus abc matches an a b or c 0 9 This shorthand form is valid within the sequence brackets It specifies a range of characters from first through last exactly as if they had been written explicitly Ranges may be combined with explicit single characters and other ranges within the sequence Thus 0 9 matches any constituent character of a signed decimal number and a zA Z0 9_ matches a valid identi fier character either lowercase or uppercase Ranges follow the ordering of the ASCII character set Aabc A caret 4 that is the first character of a sequence matches all characters A0 9 except for the characters specified after the caret material The material inside the parentheses can be any regular expression It is treated as a unit which can be used in combination with other expres sions Parenthesized material is also assigned a numerical tag which may be referenced by a replace operation VisualDSP 5 0 User s Guide A 45 Text Operations Special Rules for Sequences The normal special character rules of regular expressions do not apply within a bracketed sequence Thus amp matches an asterisk or ampersand Certain cha
39. For example you can use a post build command to copy the final output file to another location on the hard drive or to invoke an application automatically VisualDSP 5 0 User s Guide 1 59 Processor Projects Automatically copying files and cleaning up intermediate files after a suc cessful build can be very useful Command Syntax Place c windows command com C at the beginning of each DOS command line For example to execute copy a txt b txt type c windows command com C copy a txt b txt The letter c after the slash character must be uppercase Project Dependencies Dependency data determines which files must be updated during a build The following are examples of dependency information de cplus cstddef de cplus exception de cplus new de cplus xstddef de def21060 h de limits h d d d d d d e cplus stddef e stdio h e string h e VDK_Internals h e VDK_Public h e yvals h PT EN ee eh E a ER NE ee ee EN es E E Nel me hae OO EO gE cg ae eae GOS Ge oR SE cpt ae OY OX O OY Oe OO OA EY HOP Os EY 1 60 VisualDSP 5 0 User s Guide Introduction to VisualDSP VisualDSP Help System The VisualDSP Help system is designed to help you obtain information quickly Use the Help system s table of contents index full text search function and extensive hyperlinks to jump to topics Bookmark topics that you plan to revisit VisualDSP Help is compris
40. Guide 2 81 Debugging Windows Custom Board Support VisualDSP 5 0 allows you to e Maintain custom board support files New versions upgrades of VisualDSP or software updates will not overwrite these files e Associate a custom board support file with a particular debug ses sion There is no need to rename files as there was with previous versions of VisualDSP This feature is available only when using Emulator and EZ KIT debug sessions As of VisualDSP 5 0 you no longer need to edit the xm1 files supplied by Analog Devices in the lt install_path gt System ArchDef directory Instead you can construct custom board support files that modify base specifications and add new content Custom Board Support Files Custom board support files are XML files created by end users A custom board support file may contain definitions for custom registers register resets and register windows A custom board support file which is parsed after a processor definition file is parsed may override definitions in the processor definition file Custom board support files enable you to e Customize the content and layout of register windows e Specify register reset values for your custom board 2 82 VisualDSP 5 0 User s Guide Environment View the content of any register on your custom board not just Analog Devices processor memory mapped registers MMRs e Display your custom register windows via the VisualDSP I
41. Guide xxiii Manual Contents Manual Contents The manual consists of Chapter 1 Introduction to VisualDSP Describes VisualDSP features license management project development code development tools and DSP projects Chapter 2 Environment Focuses on window features operations and customization for the main window and debugging windows Chapter 3 Debugging Describes debug sessions code analysis tools program execution operations simulation tools and utilities Appendix A Reference Information Describes file types keyboard shortcuts command line parameters scripting toolbar buttons and text operations also provides a glossary and describes online Help features and operations Appendix B Simulation of SHARC Processors Describes the simulator options available on the Anomalies Events Simulator Load Sim Loader and Select Processor ID submenus under Settings also explains how to record simulator anomalies and events and describes SPI simulation in slave mode Appendix C Simulation of TigerSHARC Processors Describes simulator instruction timing analysis pipeline stages the Pipeline Viewer stalls aborts the current program counter value stepping and the Select Loader Program command on the Simu lator submenu under Settings Appendix D Simulation of Blackfin Processors Provides an overview of peripheral support for Blackfin simulators and describes limita
42. IF njle JUMP loop ki 0X1 yrS r6 r7 yr8 r9 rlO 000011 nop 000012 nop 000013 yr4 0X5 000014 yr3 OX1 000015 yr2 0 loop2 a 000016 310 0 000017 fyed 3 27 OO 000018 yr4 r4 r3 000019 IF nyaeq JUMP loop nopi 000015 nop 00001C nop nop nop 00001F xr5 r5 r5 000020 j3 0X5 000021 j2 OX1 000022 k10 0X15 000023 j10 0 g E Dd Figure C 6 Using the Program Counter Value ADSP TS101 Processor Stepping When single stepping through a program the simulator performs an instruction line step and skips invalid instructions aborted bubbles or slots occupied by an invalid fetch VisualDSP 5 0 User s Guide C 9 ADSP TS101 Processors Sometimes a step takes more than one cycle and the Pipeline Viewer win dow advances by several lines while the yellow arrow which marks the current program counter location in the Disassembly window moves to the next instruction line While skipping invalid instructions aborted bubbles or an invalid fetch the simulator still processes memory transactions When the step is completed and the memory window is updated a surpris ingly large number of new values may appear When debugging DMA be aware that a single step may cause several DMA transac tions to be completed C 10 VisualDSP 5 0 User s Guide Simulation of TigerSHARC Processors Simulator Options The Simulator s
43. Keyboard Shortcuts for Program Execution 064 A 35 Working With Breakpoltits cacdicaneisncanaintncnienaarnnrenseanine A 36 btdiniag VisualDS Pss Help scscaseaccasresrcasnionionanenmseens A 36 Miscelaneos can ciscereiecrscansreeasineeautiidectnadpelbatentimiuend A 37 er GONE ict nicetetvi a pineearliarewienaeees A 37 1 oe AOE ce eed A 37 Righe Click Memu Opon serseri a A 38 Scroll Bars and Resize Palle Bae sinesine A 38 Windows Docked ys Floating ey cesiensceceaicccnsiasnennseaotanuinsiensand A 39 Doecked Windows cc asia tishiinsaddanrianaiatnareadidimierioneaein A 39 Fioatina WINOOWS 4 po A 39 Window PCS PEE cenccccorcmienceinericeewntamwesiaeetex A 42 Standard Windows Buttons sess csaminiecssaieiemnindtralnssananenneenls A 42 Tee CNG aae A A 44 Regular Expressions vs Normal Searches ccssccsnsscssnenssorsesexones A 44 Specific Special Chararters csseuedsumcdaieueiaipeaaneeuads A 45 Special Rules Tor Segue ntes ciciewccnimcnisieciinamnicennwu A 46 Repetition and Combination Characters ssssssceeessceeeee A 46 Matth RURE senri A 47 Tagged Expressions in Replace Operations asccsceccnecrentersnesnssinen A 47 Comment Start and Stop Doings seansni A 48 Onlige Documentati f aie ties bidietcadeninsaisiab ir iiaaadenenieiaboidviolaanaaneen A 49 Prinung Online Documentation sq nciccndoenecneeennen A 50 xvi VisualDSP 5 0 User s Guide CONTENTS evoking Onime Help siccnwinimnimiacinennunnmmnineaes A 51 Bele ies soko en A 52 ee
44. LB1 written to and LC1 0 1 lt 1 gt LB1 PO any processor op 1 9 lt 1 4 gt NOP kill while loop buffer is being 0 3 cycle stall written due to interrupt exception NMI emulation events VisualDSP 5 0 User s Guide D 31 Multicycle Instructions and Latencies Latencies Due to Instructions Within Hardware Loops The following stall conditions occur when the listed instruction or condi tion within a hardware loop results in a 3 cycle stall at the next iteration of the loop A move conditional or POP into any of the LC LB LT registers A loop setup through the use of the same loop count registers in the first three instructions of the loop A branch in the first three instructions of the loop JUMP CALL conditional branch An interrupt or exception in the first four instructions of the loop CSYNC or SSYNC The inner hardware loop s bottom is strictly within the outer hard ware loop s first four instructions If the inner hardware loop s bottom is equal to the outer hardware loop s bottom a 3 cycle stall applies to each iteration of the inner loop in addition to the 3 cycle stall of the outer loop RTS RIN RTE RIX RTI If the loop s top instruction is not executed in the first iteration of the loop a one time 3 cycle stall penalty is incurred at the begin ning of the second iteration for example a jump into the hardware loop to any instruction but the first D 32 V
45. Locate mechanism does not operate at all times It oper ates after using a search but does not operate after using the index VisualDSP 5 0 User s Guide A 55 Online Help Viewing Menu Toolbar or Window Help To view Help information for a menu toolbar or window 1 Click the toolbar s Help button R or press Shift F1 The mouse pointer becomes a Help pointer R 2 Move the Help pointer over a menu command toolbar button or window 3 Click the mouse The Help window opens if not already open to the object s description which appears in the right pane Viewing Dialog Box Help To view Help for a dialog box control button or field perform one of the following actions e Select a field or button in a dialog box and press F1 or Shift F1 e Click the question mark button in the top right corner of the dialog box The mouse pointer becomes a Help pointer hk Next move the Help pointer over a dialog box control button or field and click the mouse A description of the object appears in a yellow pop up window e Position the mouse pointer over a label or control button or field in a dialog box and right click A What s This button Whats This appears Move the mouse pointer over the What s This button and click What s This Help is not configured for all items A 56 VisualDSP 5 0 User s Guide Reference Information Viewing Window Hel
46. NATN xxviii MyApalogp com scsi cnichassncisaiesarmnGasciraneubaiiadieiaaies xxviii Processor Product Information sisisisiicsriacatnccusinvinctnansinsineinas xxix rie Documents cos eee eae XXX Online Technical D ocumentatioti cvesscvvcivassaxcicdvsavcevainadsansicaven Xxxi Accessing Documentation From VisualDSP oo xxxii Accessing Documentation From Windows n xxxii Accessing Documentation From the Web saec xxxiii Embedded Processing amp DSP Knowledge Base 04 xxxiii Printed Mamtals secsnnneccenronnenenrnen xxxiii VisualDSP 5 0 User s Guide ili CONTENTS Hardware Tool Manwali osrnenecemienmeneannsuosah xxxiii Procesor Nona i uprana XXXIV jC eo E E A E E A E E E XXXIV Horton Tee IA ace serenaded wee ees XXXV INTRODUCTION TO VISUALDSP Aa et aN AS 1 1 Integrated Development and Debugging cccnsesscconsensscsseenssirsurs 1 2 Code Development Tools siciicicteecseisnasiusciamecasdatioieaadengeeiins 1 2 Source Pile Editing Features scncouscnnienscenne ween 1 3 Project Management Features socnenuareiirenae nS 1 4 Ce Feithe enaa 1 5 SOR Pe a A 1 6 Visual eS SF woos retin nseni 1 7 Produet Updates and Upgrades seicjicccscsssstiorersieusrctaaunecdacceaantecs 1 10 ViswalDS Pre Product Upgrades sorneionreusureiorerenrensa 1 10 View DS Pes Producer Updates ccna 1 10 Poret ie pment srrarsininan na E 1 11 Overview of Programming With VisualDSP oo 1 12 Project Development Ue ics csexctesvssesscattinnniecsainscccasnmm
47. Plot values from processor memory Choose from multiple plot styles data processing options and presentation options VisualDSP 5 0 User s Guide 1 5 VisualDSP Features Trace program execution history Trace how your program arrives at a certain point and show reads writes and symbolic names View pipeline depth of assembly instructions Display the pipeline stage by querying the target processor s through the pipeline interface For details refer to the VisualDSP Getting Started Guide and VisualDSP Help VDK Features The VisualDSP Kernel VDK is a scalable software executive specially developed for effective operations on Analog Devices processors The VDK is tightly integrated with VisualDSP The kernel enables you to abstract the details of the hardware implemen tation from the software design As a result you can concentrate on the processing algorithms The kernel provides all the basic building blocks required for application development Properties of the kernel can be characterized as follows Automatic VisualDSP automatically generates source code framework for each user requested object in the user specified language Deterministic VisualDSP specifies whether the execution time of a VDK API is deterministic Multitasking Kernel tasks threads are independent of one another Each thread has its own stack Modular The kernel comprises various components Future releases may offe
48. Simulation Blackfin processors only You must configure the debug session for com piled simulation 1 From the VisualDSP Session menu choose New Session The New Session dialog box appears 2 In Debug target select Blackfin Family Compiled Simulator 3 In Platform select Blackfin Family Compiled Simulator 4 In Processor select ADSP BF535 ADSP BF531 ADSP BF532 or ADSP BF533 5 In Session name enter a name for this session 6 Click OK D 44 VisualDSP 5 0 User s Guide INDEX Numerics 3 D waterfall plots See waterfall plots A abbreviations Pipeline Viewer messages ADSP BF535 D 17 aborts Pipeline Viewer for ADSP TS101 C 5 Pipeline Viewer for ADSP TS20x C 15 About dialog box A 2 Access to ADSP 21065L 9th column Even Address event B 7 cach files A 13 ActiveX script support 2 40 address bar Disassembly windows 2 45 memory window 2 67 ADSP 21x6x processors reporting anomalies B 2 annotations editor window 2 24 anomalies ADSP 2116x processors B 10 ADSP 21x6x processors B 2 recording events B 7 shadow write FIFO B 2 short word B 4 SIMD FIFO B 3 Anomalies submenu SHARC B 1 Shadow Write B 2 SIMD FIFO B 3 API defined A 66 application estimated energy profile 3 31 archiver 1 41 asm files 2 14 A 12 assembler 1 30 file associations for tools 2 14 input files 2 14 options 1 30 terms 1 30 assembling language files into object files 1 30 ass
49. User s Guide Introduction to VisualDSP Expert Linker can e Locate stacks and heaps and fill them with a marker value This operation occurs after you load the program into a processor target The stacks and heaps are located by their memory segment names which may vary across processor families e Search the heap and stack for the highest memory locations written to by the processor program This operation occurs when the target halts after you run the pro gram Assume that these values are the start of the unused portion of the stack or heap Expert Linker updates the memory map to show how much of the stack and heap are unused Be aware of the following stack and heap restrictions e The heap stack and system stack must be defined in output sections named HEAP STACK and SYSSTACK respectively e The heap stack and system stack must be the only items in those output sections You cannot place other objects in those output sections For other processor families the restrictions on memory segment names differ according to what is used in the default 1df files If you do not heed these restrictions you cannot view stack and heap usage after run ning your program VisualDSP 5 0 User s Guide 1 39 Code Development Tools Figure 1 5 shows an example memory map after you run a SHARC C program Memory Map seq_tth seg_pmco seq_pmda ep bees Eee ee bey Be by seg_heap ffffff
50. address specified by the expression The title bar displays the tracking expression See Figure 2 49 When the target halts the tracking expression is evaluated and the mem ory window jumps to that address For example when the tracking expression is PC the memory window behaves like the Disassembly window Rules e Ina memory window several expressions for tracking can be configured e Ina memory window only one expression the active expression can be tracked at any time VisualDSP 5 0 User s Guide 2 69 Debugging Windows Go To Dump a ban Ctrl G Lock Columns v Address Bar Select Format New Tracking Allow Docking Close Float In Main Window Available formats depend gt on processor A v Hexadecimal Binary Octal Signed Integer Unsigned Integer Floating Point 32 bit Signed Fractional Unsigned Fractional Signed Integer 32 bit Signed Integer 16 bit Unsigned Integer 32 bit Unsigned Integer 16 bit Signed Fractional 32 bit Signed Fractional 16 bit Unsigned Fractional 32 bit Unsigned Fractional 16 bit Hex32 Hex16 Hex Binary 32 bit Binary 16 bit Binary 8 bit Character Assembly Figure 2 48 Example Memory Window Formats for SHARC Processors e The active expression appears in the memory window s title bar 2 70 VisualDSP 5 0 User s Guide Title bar 04006E 040073 040078 04007D 040082 0
51. aligned thus each minibank starts at 0xXXXXX000 it is easy to determine whether two addresses are going to collide in a minibank If addr1 gt gt 12 addr2 gt gt 12 a collision occurs VisualDSP 5 0 User s Guide D 35 Multicycle Instructions and Latencies Cache Access 1 Cycle Stall This stall can occur only when one or both banks are configured as cache Only One Bank is Configured as Cache In this case data memory accesses are cached to the same superbank so you have to determine only the cache minibank First you must find out how much data bank memory is modeled in the implementation of the Blackfin processor that you are using The standard Blackfin processor architecture model is 16KB thus four 4 KB minibanks In this case you have to look at bits 13 and 12 only of the address to see which minibank the data memory access is cached Table D 24 Minibanks Selected for 16KB of Data Bank Memory Addr 13 12 Minibank Selected 00 minibank 1 0x0000 0x1000 01 minibank 2 0x1000 0x2000 10 minibank 3 0x2000 0x3000 11 minibank 4 0x3000 0x4000 Every time the available bank memory is doubled another bit must be used For example if an implementation of Blackfin processor architec ture has 32KB of data bank memory eight 4 KB memory banks bits 14 13 and 12 must be used Table D 25 Minibanks Selected for 32KB of Data Bank Memory Addr 14 12 Minibank Sel
52. and configures the processor before the application program s main function is executed It sets the machine to a known state initializes selected features and enables the standard Blackfin run time model VisualDSP 5 0 User s Guide 1 45 Processor Projects Generate customized startup code for your project if you want to config ure the processor s cache the processor s clock and power settings run time initialization options or compiler instrumented profiling If you do use startup code your application is built with the default behavior LDF File The ability to add a customized 1df file to a project via the Project Wizard is available for Blackfin processor projects only 1df file generation options relate to the user heap system stack system heap external memory and so on At a later time you can modify the 1df file via the Project Options dialog box There are also special sections in the 1af file in which you can insert your own LDF commands comments and so on These sections are preserved each time the 1df is re generated the information is stored in the basiccrt s file 1 46 VisualDSP 5 0 User s Guide Project Options Introduction to VisualDSP Project options apply to the entire project Specify project options in the Project Options dialog box Figure 1 7 shows an example of this multi paged dialog box fy General El Compile fy General fey Source La
53. are Shadow Write or SIMD FIFO The events are FP Denorm Short Word Anomaly or Access to 21065L 9th column Even Address The Configure Simulator Event dialog box Figure B 1 appears displaying the selected anomaly or event for example FP Denorm in the title bar of the dialog box Configure Simulator Event FP Denorm Event Fire Options Severity Options Fire Unique x WARN x m Event Actions J Enabled M Verbose IV Print T Halt Cancel Figure B 1 Configure Simulator Event Dialog Box From this dialog box configure the simulator to handle the anomaly or event B 8 VisualDSP 5 0 User s Guide Simulation of SHARC Processors 3 Specify options described in Table B 1 Table B 1 Options in the Configure Simulator Event Dialog Box Item Purpose Event Fire These options specify the frequency of reporting an event Options Fire Once logs the event only the first time it occurs Fire Unique logs the event once for each unique event a unique set of occur rences which is specific to the event type Select this option to prevent the reporting of multiple messages for the same event Events for example FP Denorm If a PC has had this event before it is not unique and is not reported Anomalies for example Shadow Write SIMD FIFO or Short Word If the PC at the time of the memory write and the PC at the time of the mem ory read taken as a pair have had this event befor
54. doj proc ADSP 21062 L Debug flags link od Debug o Debug Mean dxe endif ifeq MAKECMDGOALS Debug_clean Debug_clean RM Debug Mean doj RM Debug benchmark doj 1 54 VisualDSP 5 0 User s Guide Introduction to VisualDSP RM Debug Mean dxe RM Debug ipa RM Debug opa RM Debug ti endif i Begin Release configuration ifeq MAKECMDGOALS Release Release release mean dxe release mean doj mean c VDSP cc21k c Mean c 01 proc ADSP 21062 o Release Mean doj release benchmark doj benchmark asm VDSP easm21k exe proc ADSP 21062 o Release benchmark doj benchmark asm release mean dxe release mean doj release benchmark doj VDSP cc21k exe Release Mean doj Release benchmark doj proc ADSP 21062 L Release flags link od Release o Release Mean dxe endif ifeq MAKECMDGOALS Release_clean Release_clean R Release Mean doj Release benchmark doj Release Mean dxe Release opa DDD D D Release ipa Release ti endif VisualDSP 5 0 User s Guide 1 55 Processor Projects Project Configurations By default a project includes two configurations Debug and Release described in Table 1 5 In previous software releases the term configura tion was called build type Table 1 5 Default Project Configurations Configuration Descrip
55. due to an unpredicted jump predicated upon an IALU condition Aborted stages in the fetch unit pipe are marked with an BM and aborted instructions in the execution pipe are marked with an q Cycle Fl F2 F3 DECODE INT ACCESS EX1 EX2 9 i n yi j2 j2 0x1 zr9 r Bk B ki k j2 0X6 rl3 r5 10 x j n j2 _ j2 0X1 xr9 r Blk Blki Bk kl 0X1 xr3 r2 _ 1 Bj x j IF njle JUMP 0x5 NP jB k1 B k B ki 0X1 xr3 r2 12 20 jA GEM nop I j2 Blk Blki OX1 ur3 r2 13 y j j0 0X1 xr0 r4 r Hn IF Tsien B ki 0X1 xr3 r2 14 y y n j0 0X1 xr0 r4 r i H nop I j2 j2 0X1 xr9 15 n y y nop k PES jo AR IF njle JUMP OxS NP 16 j n y yr4 0X5 ne j j H nop 1 x j n yr3 0X1 y nop j j0 0X1 xr0 r4 18 n j yr2 0 Yen yr n j0 0X1 xr0 r4 19 n on x ji0 0 y yr y nop Figure C 3 Abort Due to an Unpredicted Change of Flow VisualDSP 5 0 User s Guide C 5 ADSP TS101 Processors Abort Due to Mispredicted Change of Flow In the following example an abort appears at pipeline stage E1 because of a mispredicted change of flow at the end of a loop predicated on a com pute block condition Cycle F1 F2 F3 DECODE INT ACCESS EX1 EX2 a 72 E K Kj Eu ji WF y B yr3 r3 r2 73 iE Bj yr y ji Woi yr4 r4 r3 74 nb A
56. each manual 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 XXXIV VisualDSP 5 0 User s Guide Preface Notation Conventions Text conventions in this manual are identified and described as follows Example Description Close command File menu Titles in reference sections indicate the location of an item within the VisualDSP environment s menu system for example the Close command appears on the File menu this that Alternative required items in syntax descriptions appear within curly brackets and separated by vertical bars read the example as this or that One or the other is required this that Optional items in syntax descriptions appear within brackets and sepa rated by vertical bars read the example as an optional this or that this Optional item lists in syntax descriptions appear within brackets delimited by commas and terminated with an ellipse read the example as an option
57. five levels VisualDSP 5 0 User s Guide A 65 Glossary Glossary The following terms are important toward understanding VisualDSP Application Programming Interface API functions A set of functions available to an applications programmer These functions which are part of an application can be accessed by other applications For VDK API refers to a library of C C functions and assembly macros that define VDK services These services are essential for kernel based application programs The services include interrupt handling thread management and sema phore management archiver The VisualDSP archiver elfar exe combines object doj files into library DLB files which serve as reusable resources for project development The linker searches library files for routines library members that are referred to by other objects and links them in your executable program breakpoint User defined halt in an executable program Toggle breakpoints turn them on or off by double clicking on a location in a Disassembly window or editor window break condition Hardware condition under which the target breaks and returns control of the target back to the user For example a break condi tion could be set up to occur when address 0x8000 is read from or written to A 66 VisualDSP 5 0 User s Guide Reference Information build Performing a build or project build refers to the operations pre p
58. h to reflect the changes made on the Kernel view The example in Figure 2 3 shows an expanded view of the elements on the Kernel tab for a VDK enabled project For information about VDK refer to the VisualDSP Kernel VDK User s Guide Project Dependencies A project may depend on other projects The J icon indicates depen dency and identifies the dependency Building a project also builds the sub projects on which your project depends 2 4 VisualDSP 5 0 User s Guide Project Window System E Clock Frequency MHz i E Tick Period ms History Buffer Size E Instrumentation Level Threads H E Maximum Running Threa Thread Types 2 thread a thread2 El Priority 5 E Stack Size 1024 El Source File thread2 cpp i E Header File thread2 h E Boot Threads boot_threadt H boot_thread2 E Thread Type thread2 S amp S Round Robin Priorities amp Semaphores Maximum Active Semap fa Event Bits f Events Ep Interrupts fa 1 0 Interface Maximum 1 0 Objects El Device Drivers Els IPC Ee Source File El Header File 2 Boot 0 Objects Device Flags Maximum Active Device 0 amp Memory Pools Total Size 0 Maximum Active Memory 0 E Messages Maximum Messages 0 Figure 2 3 Expanded View of Elements on the Kernel Tab Environment VisualDSP 5 0 User s Guide 2 5 Project Window Figure 2 4 shows how project depende
59. hh dat This file not only records VisualDSP Help bookmarks but also the bookmarks placed in other application Help systems that use chm files Once a bookmark is placed onto a topic you can view a list of book marked topics and quickly open one To place a bookmark at a topic 1 Display the topic 2 On the left side of the Help window click the Favorites tab 3 Click Add Remove a bookmark by selecting the name and clicking Remove The Help system adds the topic and displays it in the alphabetized list To open a bookmarked topic 1 On the left side of the Help window click the Favorites tab 2 Perform one of these actions e Double click the topic e Select the topic and click Display A 58 VisualDSP 5 0 User s Guide Reference Information Navigating in Online Help To move around in the Help system click the following e A hyperlink within text The text is underlined and displayed in a color that is different from the regular black text e A topic listed under a See Also heading The text is underlined and displayed in a color that is different from the regular black text e A mini button or its associated text The button is a small gray square and the underlined text is in a different color e A topic name on the Contents page Figure A 25 D How To E A Reference Click a page icon cE Online Manuals gt to view the topic E Glossary E C Run Time Libraries DSP Project Files
60. it to the selected location You can dock hide or float the window The Output window s Console page interacts with script engines All script input and output is sent to the Console page as shown in Figure 2 24 Output Window x PO Loading C ConvolutionsSConvolution_06 02 PO Load complete dspsetbreak processor P3 020006 there is already a breakpoint at address LU Figure 2 24 Messages in the Output Window s Console Page These messages are saved to the log file Visua1DSP_Log txt which is located in the installation s Data directory Right Click Menu The Output window s right click menu is shown in Figure 2 25 This menu enables you to e Load a script or enable the debugger e Clear the text in the window or copy selected text e Toggle bookmarks e Select a scripting language VisualDSP 5 0 User s Guide 2 39 Output Window Load Script Enable Debugger Clear Copy Gite Toggle Bookmark Ctrl F2 Language ia Tcl VBScript JScript Print Find v Allow Docking Hide Float In Main Window Figure 2 25 Output Window s Right Click Menu e Print or find text in the window e Dock hide or float the window To display the hidden window choose Output Window from the View menu Script Command Output Scripts provide a powerful means of developing full blown test applica tions of processor systems VisualDSP includes a language independent scripting h
61. message is identified with a unique code such as pp0019 that is consistent between versions of VisualDSP Message descriptions include an explanation of the condition that caused the error warning message and a suggested remedy to fix the problem Where applicable messages include the source file s name and the line number of the offend ing code Message Severity Hierarchy Each message has one or more severity levels Table 2 8 Message Severity Levels Severity Level Description Fatal error Identifies errors so severe that further processing of the input is suspended Fatal errors are sometimes called catastrophic errors Error Identifies problems that cause the tool to report a failure An error might allow further processing of the input to permit the reporting of additional problems to be reported Warning Identifies situations that do not prevent the tool from processing the input but may indicate potential problems Remark Provides information of possible interest You can change the severity level of a message marked with a D which means discretionary The severity level of a message without a c D is non discretionary and cannot be changed VisualDSP 5 0 User s Guide 2 31 Output Window Syntax of Help for Error Messages In VisualDSP Help each error message can include several parts The available information depends on t
62. mode displays profiling statistics for individual assembly instructions VisualDSP 5 0 User s Guide 2 61 Debugging Windows Execution Unit A C TestLabNGeneric test te a maint main foofint barfint D a a i a 5 mi Total Samples 268 Elapsed Time 00 00 00 Enabled Figure 2 39 Profiling Data for Each Assembly Line Mixed Mode Filtering PC Samples With No Debug Information Since you spend most of your time building a debug version of your code eliminate non debug code such as C run time library initialization code The profiling results in Table 2 40 show where a lot of time is spent before filtering 0000022 00000b8 barf int foofint include lt stdlib h gt int foofint 1 filing Results return i void barfint i ii i Elapsed Time 00 00 00 Enabled 2 3 4 5 6 7 8 9 0 a ma Total Samples 268 Figure 2 40 Profiling Results Before Filtering The profiling results after filtering Table 2 41 reflect the difference 2 62 VisualDSP 5 0 User s Guide Environment x ET zy Execution Unit C TestLab Generic test a z 33 58 f 0000022 00000b8 1 m 1 87 bar int 2 include lt stdlib h gt 5 60 foof int 3 73 3 int foofint i cS 4d E 1 87 5 return i E e S 7 0 75 8 void bar int i S 9 0 75 10 i 4 Total Samples 268 Elapsed Tim
63. models Universal Asynchronous Receiver Transmitter Peripheral You can manipulate all the UART configuration bits Currently you can not simulate the data error Framing Error Parity Error Break Interrupt conditions or the Modem Status register status bits Data Carrier Detect Ring Indicator Data Set Ready Clear To Send You can specify Set Break in the Line Control register but this setting has no effect The cur rent simulator does not model the IRCR register VisualDSP 5 0 User s Guide D 7 Special Considerations for Peripherals Timer TMR Peripheral In Width Capture WDTH_CAP mode the timer counts the number of clocks in both the width and period The waveform that the timer reads is attached via the Streams dialog box in VisualDSP You can attach a file to the following device names e TIMERO_WDTH_CAP e TIMERI_WDTH_CAP e TIMER2_WDTH_CAP The format of the input file is as follows PERIOD_COUNT WIDTH_COUNT PERIOD_COUNT WIDTH_COUNT In WOTH_CAP mode the timer reads two 32 bit values from the input file The first value is the number of pulses clocks in the period The second value is the number of pulses in the width When PULSE_HI is set the timer delivers high widths and low periods When PULSE_HI is not set the timer delivers low widths and high periods D 8 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Simulator Instruction Timing Analysi
64. niankenti 2 83 Mulcprocessor Window ene enero 2 83 x VisualDSP 5 0 User s Guide CONTENTS Multiprocessor Window Papes cxsscicencimncrrnceseretnsiennnexnicence 2 84 Sros PATE Cee 2 84 OaE AE e 2 85 Operating on Multiprocessar Groups cccearasccsrsnccroarsaccines 2 86 Be E E E A E E E E 2 86 De ee ie enri 2 87 Pipeline Fee ee cee ee ee 2 88 Right Click Menu of Pipeline Viewer Window 00 2 89 Pipeline Viewer Properties Dialog Box cisiaicccsssnccnarsccnoe 2 90 Pipeline Viewer Window Event Icons ceccisccccsscscnsesessessccesss 2 91 Pipeline Instruction Event Details sccccccisicties isenianedesiaune 2 92 Cache Viewer Window nessre srann ron ete 2 93 CORA Pape saresnsenenreinin a 2 96 Derlei Vior TOES sonseras niente 2 97 LOE TPE niei ASTEA 2 98 Pee TUT arn R 2 99 PIG Page cise eaan 2 100 Address View Pare lt eioeniciatimitiemioiendiwn 2 102 YDK Status Window eee 2 103 VOR Strate Fistory WIndow suiran pok 2 105 Thread Status anid Event Colors cccsccccsscsesttonsniersneynasnecaens 2 106 Window Operations cso cererdicseeciteancaueasmemsatamonsecueieess 2 107 Right Click Ment scat tioia atc ecioh ith lviaenienenianicel saint sianiibptes 2 108 Target Load Window aisiegeticnmiana nes 2 108 VisualDSP 5 0 User s Guide xi CONTENTS Por OW cessnssnrenn ir roo T 2 109 Plot Window Fea poesiari in na 2 110 SeS BA a tad wacdoteinseaunacasusenadeacetenssacenaes 2 110 ToolBar penne ees A viene ev errr C
65. no 2B xr2 r0 ri nop nop 27 x x x x n nop nop nop nop nop no 1 xr3 r0 r2 nop nop 28 ng x x n nop nop nop nop nop no 1 nop nop nop nopi 29 n ng x n nop nop nop nop nop no 1 nop nop nop nopi 30 non nb n nop nop nop nop nop no 1 nop nop nop nopi 31 n n n on X nop nop nop nop nop no 1 nop nop nop nopi 32 non on n n xr0 70 73 nop nop no i nop nop nop nop bd aa a AE ay Figure C 9 Stall Due to Compute Block Dependency Stalls Due to a Cache Miss The following register load transaction causes a six cycle stall because of a cache miss XRO JO J31 Aborts The examples that follow illustrate how the Pipeline Viewer displays different types of abort events for ADSP TS20x processors For a com plete list of pipeline effects and memory transaction timing refer to the processor s hardware specification VisualDSP 5 0 User s Guide C 15 ADSP TS20x Processors xi Cycle Fi _F2 _F3 FA EDT D E E1 E2 4 33 n n n n n n x nop nop nop nop nop nop nopi 34 n n n n n n n nop nop nop nop nop nop nopi 35 x n n n n n n xr0 j0 j31 nop nop nop nopi 36 n x n nW n W nW nW B rd j0 331 xr0 j0 j31 sop nop nop 37 n n X nW n W nW nW B zr0 j0 j31 B zr0 j0 j31 nop nop nop 38 n n n xW n W nWin
66. operation A particular sequence of a core write followed by a read of the same internal memory address in conjunction with a certain type of IOP activity can cause the core read to return incorrect data Under the circumstances described below the read from Addr 1 incor rectly returns the data for Addr 2 This problem is caused by the shadow write FIFO erroneously returning data for a core read when data should have been returned from internal memory During write operations data is placed in the first stage of a two stage shadow write FIFO Data is moved from first to second stage B 2 VisualDSP 5 0 User s Guide Simulation of SHARC Processors when a second write is performed by processor core or IOP Similarly data is moved from the second stage of the FIFO to internal memory when neither the core nor the IOP accesses memory in a core cycle On read operations address compare logic allows data to be fetched from internal memory or from the FIFOs Note that each memory block has one shadow register FIFO which all core and IOP accesses to internal memory use The internal memory clock not visible to the user runs at twice the core clock frequency So each core cycle consists of two memory cycles with one memory cycle dedicated to the core and the other dedi cated to the IOP SIMD Read from Internal Memory With Shadow Write FIFO Hit Anomaly ADSP 2116x Only For examples and workarounds refer to anomaly 40 at the
67. pages facilitate the inclusion of startup code You can modify project options at a later time via the Project Options dialog box property pages Refers to pages of the Project Options dialog box real time operating system RTOS A software executive that handles processor algorithms peripherals and control logic The RTOS comprises these components kernel communication manager support library and device drivers An RTOS enables structured scalable and expandable processor application development while hiding OS complexity rebuild all See build registers For information on available registers see the corresponding pro cessor documentation or view the associated online Help release configuration You can accept the default set of options or you can specify the options you want and save them The configuration refers to the specified options for all the tools in the tool chain See also Configuration reset This command resets the processor to a known state and clears processor memory VisualDSP 5 0 User s Guide A 81 Glossary restart This command sets your program to the first address of the inter rupt vector table Unlike a reset a restart does not reload memory right click This action opens a right click menu sometimes called a context menu pop up menu or shortcut menu The commands that appear depend on the context what you are doing Right click menus provide access to many
68. perform script work for vbs test applications Scripting languages let you access the Automation API to inter act with the IDDE processor Assembly source file Source file comprising assembly language instructions VisualDSP 5 0 User s Guide A 13 File Types Table A 2 Files Used With VisualDSP Cont d Extension Name Purpose mak Makefiles The output make rule file is used for mk project builds dpg Project group An xm1 file containing information about projects A 14 VisualDSP 5 0 User s Guide Reference Information Parts of the User Interface When you open VisualDSP the application s main window appears Figure A 8 shows an example of the VisualDSP main window P Analog Devices VisualDSP Target ADSP T5101 TigerSHARC curate Simulator Platform Project dft_c dpj Ol x Project group 0 project s Figure A 8 VisualDSP Main Window This work area contains everything necessary to build manage and debug a project You can set up preferences that specify the appearance of appli cation objects fonts visibility and so on You can open project files by dragging and dropping them into the main window VisualDSP 5 0 User s Guide A 15 Parts of the User Interface The VisualDSP main window includes these parts e Title bar and control menu e Menu bar toolbars and status bar e Project window e Output window VisualDSP a
69. processor DSP An individual chip contained on a specific platform within a target system When you create the executable file the processor is specified in the Linker Description File 1af file and other source files profile guided optimization PGO A process that involves setting up and executing data sets to pro duce an optimized application A data set is the association of zero or more input streams with one PGO output file Refer to the Visu alDSP Getting Started Guide for a tutorial and to VisualDSP Help for how to information profiling A technique used during simulation to examine program execution within selected ranges of code Profiling helps you determine per centage of time spent executing instructions number of clock cycles spent executing instructions number of instructions exe cuted and the number of times memory is read or written The profiler is non intrusive It does not report on execution within a called function daughter function Use profiling to monitor program memory By watching one or more profile ranges you can find areas of code that may be optimized for better performance A profile session must include one memory range at a minimum For each range specify a start and end address You can use symbols or hexadecimal numbers to represent addresses VisualDSP 5 0 User s Guide A 79 Glossary project This term refers to the collection of source files and to
70. representation of a debug session s projects folders files and dependencies e The Kernel tab 2 Kernel appears when VDK is enabled for a project It displays VDK related information 2 2 VisualDSP 5 0 User s Guide Environment This section describes the following topics Project View on page 2 3 Kernel Tab on page 2 4 Project Dependencies on page 2 4 Project Nodes on page 2 6 Project Page Right Click Menus on page 2 10 File Associations on page 2 14 Automatic File Placement on page 2 15 Project View The Project view displays a project group which may contain any number of projects Only one project however is active at a time Nodes are arranged in a hierarchy similar to the file structure in Windows Explorer Figure 2 2 shows an example of information that displays in Project view Project Name of the group icon Number of projects in this project group active project s project file I tiger acadia Active project TS Project Figure 2 2 Project View VisualDSP 5 0 User s Guide 2 3 Project Window Kernel Tab The Kernel tab of the Project window is available only for VDK enabled projects From the Kernel view you can add modify and delete kernel elements such as thread types priorities semaphore and events VisualDSP automatically updates vdk_config cpp and vdk_config
71. system register to a dreg fol RO LCO to dreg gt dreg to sysreg lowed by another register move of that same dreg ASTAT RO RAW to a system register Regmv hazard sysreg A register move of a system register to an accu AO w LCO to areg gt dreg to areg mulator register followed by another register AO RO WAW move of a dreg to the same accumulator register Regmv hazard sysreg A register move of a system register to an accu AO w LCO to areg gt preg to areg mulator register followed by another register A0 P0 WAW move of a preg to that same accumulator register Regmv hazard sysreg A register move of a system register to an accu AO w LCO to areg gt areg to areg mulator register followed by another register A0 A1 WAW move of an accumulator register to that same accumulator register Regmv hazard sysreg A register move of a system register to an accu A0 w LCO to areg gt areg to dreg mulator register followed by another register RO A0 RAW move of that same accumulator register to a dreg Regmv hazard sysreg A register move of a system register to an accu AO w LCO to areg gt areg to sysreg mulator register followed by another register ASTAT AO w RAW move of that same accumulator register to a sys tem register Regmv hazard sysreg A register move of a system register to an accu AO w LCO to areg gt load to areg mulator register followed by a load to the same AO w
72. the Project window from view e Float in Main Window Project Group Icon Right Click Menu The project group icon ff right click menu Figure 2 5 provides a project group context from which to e Create a new project e Open a project and add it to the project group e View the project group s properties New Project Open Project Close All Projects Allow Docking Hide Float In Main Window Properties Figure 2 5 Project Group Icon s Right Click Menu 2 10 VisualDSP 5 0 User s Guide Environment Project Icon Right Click Menu The project icon I right click menu Figure 2 6 provides a project context from which to Build Project Clean New Folder Add File s to Project Set as Active Project Close Build the project Clean delete intermediate and target files Specify the active project Add folders and files View and specify project options View project properties Project Options v Allow Docking Hide Float In Main Window Properties Figure 2 6 Project Icon s Right Click Menu VisualDSP 5 0 User s Guide 2 11 Project Window Folder Icon Right Click Menu The selected folder icon I or right click menu Figure 2 7 pro vides a container context from which to perform these local operations e Add or delete a folder e Add files to the folder e View folder properties New Folder
73. the cache events log file The cache event displays on the Detailed View History and Histogram pages When stepping is configured a check mark appears next to the Step command on the right click menu By default this option is enabled when a cache events log file is opened for reading VisualDSP 5 0 User s Guide 2 95 Debugging Windows Configuration Page The Configuration page Figure 2 63 displays configuration information for configured cache Cache Views Ci Item Value Cache Name cache Number of Sets 128 Number of Ways 4 Cache Size 0 Kbytes Line Size 32 bytes Configuration History Performance Histogram Address Figure 2 63 Example Configuration Page The Cache Selection pull down box top of dialog box lists cache dis plays When multiple caches are configured use this list to change cache displays The Cache Configuration list box below the Cache Selection pull down box displays a list of items and their values The first three items Cache Name Number of Sets and Number of Ways are required The target may display additional items such as Cache Size and Line Size The list of items depends on the selection in the Cache Selection pull down box 2 96 VisualDSP 5 0 User s Guide Environment Detailed View Page The Detailed View page Figure 2 64 displays a grid depicting cache sets rows and cache ways columns Cache Views CO Set Way 0 11 W oxf000
74. to operations that can be performed from the state history plot Target Load Window Clicking the Target Load tab from the VDK State History window dis plays the Target Load window A target load plot Figure 2 71 shows the percentage of time that the target spent in the Idle thread DSP O b Target Load Target Load Target Load Figure 2 71 Target Load Window Plot A load of 0 indicates that VDK spent all of its time in the Idle thread A load of 100 indicates that the target did not spend any time in the Idle thread Load data is processed by means of a moving window average 2 108 VisualDSP 5 0 User s Guide Environment Plot Windows Use a plot window to display a memory plot which is a visualization of values obtained from processor memory You can display one or multiple plot windows by choosing View Debug Windows Plot and New In the Plot Configuration dialog box specify the contents of a plot In the Plot Settings dialog box specify the plot s presentation You can modify a plot s configuration and immediately view the revised plot Figure 2 72 shows an example of a plot window 3 Line Plot Example Line Plot Example Figure 2 72 Plot Window From a plot window you can zoom in on a potion of a plot or view the values of a data point VisualDSP 5 0 User s Guide 2 109 Debugging Windows You can print a plot save the plot image to a file or save the plot s da
75. to the specified location Displays the current source file Toggles the bookmark at selected line in the active editor window Goes to the next bookmarked line in the editor window Goes to the previous bookmarked line in the editor window Clears all bookmarks in the editor window Opens VisualDSP Help to the Search page Provides context sensitive Help for a button command or portion of VisualDSP Opens the About VisualDSP dialog box Adds a source file to the project Removes the selection from the project ERE EE ae ee eee Opens an existing project A 24 VisualDSP 5 0 User s Guide Reference Information Table A 4 Toolbar Buttons Cont d Button Purpose Saves the open project Opens the Project Options dialog box where you specify project options E E E Builds the selected source file Builds the project update outdated files Builds all files in the project Stops the current project build Arranges windows as tall non overlapping tiles Arranges windows as wide non overlapping tiles Arranges windows so they overlap Closes all open windows Refreshes all the debugging windows Runs starts or continues the current program e3 E e E LE Restarts the current program VisualDSP 5 0 User s Guide A 25 Parts of the User Interface Table A 4 Toolbar Buttons C
76. 0004b0 Oxf00004b0 Oxf0000488 Oxf00004a8 _init_argy OxfO0004d8 Oxf00004d8 Oxf00004d0 Oxf00004d0 OxfO0004e8 Oxf00004c8 OxfO0004c0 Oxf00004c0 Oxf00004d8 Oxf00004d8 OxfO0004d8 Oxf00004d8 OxfO0004d0 Oxf00004d0 Oxf00004e8 Oxf00004c8 OxfO0004c0 Oxf00004c0 OxfOO008F8 OxfO00088 NxFNNANNAMN NxANNNNAN Configuration Detailed History Histogram Address Figure 2 65 Example History Page 2 1 0 8 7 6 5 4 3 2 1 0 2 1 uN M Mm D N N AN p p t f f i f 8 i i k 2 98 VisualDSP 5 0 User s Guide Environment Select the set and way from the pull down control top of dialog box or by double clicking a cell on the Detailed View page You can specify the number of stored cache events Sort the rows by click ing on any column heading An up arrow in a column heading indicates an ascending sort order a down arrow indicates a decending sort order Table 2 25 describes cache event history information Table 2 25 History Information for Cache Events Item Description Index Shows the order in which the cache events were received The index starts at zero and increments each time a cache event is received Set Displays the set number where the cache event occurred Way Displays the way number where the cache event occurred Cycle Displays the cycle count when the cache event occurred PC Address Displays the PC address of the cache event Ref Address Displays the r
77. 01000AA 001000AB 1000AC 001000AC 001000AD 001000AE 001000AF 00100080 v gt ul Figure 2 50 Example Memory Window Sized to Display Five Columns The commands available via the menu bar s Memory menu and the memory window s right click menu depend on the processor that you are debugging 2 72 VisualDSP 5 0 User s Guide Environment Background Telemetry Channels BTCs Background telemetry channels BTCs enable VisualDSP and a pro cessor to exchange data via the JTAG interface while the processor is executing Before BTC all communication between VisualDSP and a processor took place while the processor was in a halted state Background telemetry channels are supported only in SHARC and Blackfin emulator sessions For information about using BTCs refer to the VisualDSP Getting Started Guide and online Help BTC Definitions in Your Program Background telemetry channels are defined on a per program DXE basis The channels are defined when a specific program is loaded onto a proces sor Define channels in your program by using simple macros The following example code shows channel definitions Finclude btc h section DM seg_dmda for ADSP 2126x processors BTC_MAP_BEGIN BTC_MAP_ENTRY Channel0 Oxf0001000 0x00100 BTC_MAP_ENTRY Channell Oxf0002000 0x01000 BTC_MAP_ENTRY Channel2 Oxf0003000 0x10000 BTC_MAP_END The first step in defining channels in a program is t
78. 0178 12 MM oxt0000198 oxfo000598 13 MM oxf00001b8 WW oxf00005b8 14 MB oxf00001as W oxfo0005a8 18 MM oxf0000a58 19 MM oxf0000a78 20 M Oxf0000a80 21 22 23 Configuration Detailed History Performance Histogram Address Figure 2 64 Example Detailed View Page Data received from a cache event is placed in the cell corresponding to the cache set and way The most recent cache events are highlighted Each cell has an icon and text entry The icon indicates the type of cache event hit miss and so on that occurred Depending on the selected objects details such as reference address PC address cycle count event type event description and so on can be shown VisualDSP 5 0 User s Guide 2 97 Debugging Windows Pressing down the keyboard s Ctrl key and moving the mouse over a cell displays a tooltip showing cache event and cache line information A lock icon in the column header indicates that the cache way is locked A reference map icon in the Set column indicates the results of the refer ence mapper function Double clicking on a cell switches the display to the history view History page for the selected cell History Page The History page Figure 2 65 displays detailed information for each cache event that occurred in the selected set and way Cache Views CO Set fal 7 Way Ja indes LSet wapt cycle PCAdtess RelAddtess Symbol vaa Oxf00004b8 Oxf00004b8 OxfO0
79. 10 Figure D 2 shows a fetch stall Cycle Decode Address Executel Execute2 Execute3 Writeback 12 NOP NOP NOP NOP 13 NOP NOP NOP NOP 14 NOP NOP NOP NOP 15 NOP NOP NOP NOP 16 R1 0 F NOP NOP NOP q NOP Figure D 2 Fetch Stall VisualDSP 5 0 User s Guide D 11 Simulator Instruction Timing Analysis for ADSP BF535 Processors Fetch stalls are detected in the Decode stage and are caused by memory latencies when an instruction is fetched In this example two fetch stalls appear in the Decode stage cycles 14 and 15 because of a memory latency when the R1 0 instruction is fetched These fetch latencies are then propagated in the pipeline Address stage cycles 15 and 16 Execute 1 stage cycles 16 and 17 and so on Pipeline Viewer Window Messages When you hold down the Ctrl key and pause the mouse over a pipeline viewer event icon indicating instructions the Pipeline Viewer window displays informational messages An example is shown in Figure D 4 on page D 20 These types of messages may appear e Stalls detected e Kills detected e Multicycle instruction messages Pipeline Viewer Detail View Stall Event Messages Table D 7 shows the messages that occur when a stall is detected Table D 7 Stalls Detected Messages ADSP BF535 Processor Message Explanation Example ICache miss Instruction cache miss IAU empty Instruction alignm
80. 11 Fo Fle x FL H ia eren r i I IHE 0x30 c 3 Bow nem i IE IHE 0x0 J owk nem T TIHE 0x30 I w nem For SHARC processors the Disassembly window displays symbols F D or E indicating an instruction s pipeline stage Column headings refer to pipeline stages for the processor s core registers Refer to your processor s hardware documentation for details 2 88 VisualDSP 5 0 User s Guide Environment Right Click Menu of Pipeline Viewer Window The Pipeline Viewer window s right click menu provides the commands described in Table 2 19 Table 2 19 Pipeline Viewer Right Click Menu Item Purpose Enabled Enables and disables collection of pipeline data while running or step ping Clear Empties the current sample buffer Display Format Controls the display format of data Address shows the hexadecimal formatted address of the pipeline stage for example 0x1234 Use this format to follow a particular address route through the pipeline Disassembly disassembles the instruction at that address and shows the opcode mnemonic similar to a Disassembly window Use this format to determine why a particular event is occurring Opcode format is the hexadecimal representation of the disassembly mnemonic Save Opens the Save As dialog box where you export the collected data to a text file Properties Opens the Pipeline Viewer Properties dialog box where you view and spe
81. 13 VDK about 1 22 defined A 87 features 1 6 Kernel tab 2 4 load 2 108 overview of 1 6 Project window 2 4 VDK State History window 2 105 VDK Status window 2 103 vdk_config cpp 2 4 vdk_config h 2 4 vdk files A 13 VDK State History window 2 105 right click menu 2 108 VDK Status window 2 103 Visual Basic scripting with 2 41 VisualDSP 5 0 User s Guide VisualDSP Automation API 2 41 Configurator 1 17 control menu A 18 debugging facilities 1 20 debugging features 1 5 editing features 1 3 editor windows 2 16 environment 1 2 features 1 1 file association for tools 2 14 files A 12 glossary A 66 Help system 1 61 A 53 IDDE 1 2 kernel 1 22 keyboard shortcuts A 31 licenses A 3 log file 2 30 2 38 main window parts A 16 menu bar A 19 new features 1 7 Output window 2 28 overview of 1 1 printing documentation A 50 product updates 1 10 product upgrades 1 10 programming overview 1 12 project development 1 14 projects 1 43 Project window 2 2 software versions A 5 source code control 1 50 source file editing features 1 3 support A 6 system components A 4 toolbar buttons A 22 user interface A 15 INDEX VisualDSP Configurator about 1 17 multiprocessor debug sessions 3 4 VisualDSP_Log txt 2 39 script output 2 41 vps files 2 115 W warnings 2 31 watchpoints about 3 4 3 15 MP sessions 3 11 used with interrupts 3 17 using 3 15 waterfall plots
82. 33 Multicycle Instructions and Latencies L1 Table D 23 Instruction Alignment Unit Empty Latencies Contd Description Example s lt cycles stalls gt instruction BF532 BF535 Write to return register RT S N E X I 1 lt 1 gt RETI P0 return op l 4 lt 1 4 gt RTI 1 lt 1 gt RETS P3 1 4 lt 1 4 gt RTS math op 1 lt 1 gt R3 R2 R4 video op with RAW data dependency l 1 lt 1 1 gt SAA R3 2 R1 0 dreg search 1 lt 1 gt R3 RO SEARCH R1 LE math op using dreg 1 2 lt 1 2 gt R2 H R1 L RO H core and system MMR access lt 1 2 gt RO PO PO MMR address L0 BO0 dreg l 4 lt 1 gt LO RO I0 modulo update l 4 lt 1 3 gt R1 I0 1 4 lt 1 gt B1 R2 In general any length and base dagreg 1 4 lt 1 3 gt Il 4 assignment to a dreg followed by the 1 4 lt 1 gt L2 R3 corresponding index dagreg modulo 1 4 lt 1 3 gt R4 I2 M2 update 1 4 lt 1 gt B3 R5 1 4 lt 1 3 gt 13 M2 Data Memory Stalls L1 data memory DM stalls are incurred through reading from or writing to L1 data memory Accesses can be direct to or from DM SRAM or indirect to or from DM cache Some of these stalls are multicycle instruction conditions they occur as a result of a specific instruction Some stalls are latency conditions they occur only when the two offend ing instructions are too close The specifics are described in each entry T
83. 40087 04008C 040091 040096 040098 a Select the expression you want to track Data DM Short Word Memory He c 0000 SFFE 0402 OFOO 8000 142B 0002 063E 0000 SFFE OFOO 8000 142B 0002 063E 0000 SFFE 0402 OFOO 8000 Select Tracking Figure 2 49 Expression Tracking in a Memory Window Environment VisualDSP 5 0 User s Guide 2 71 Debugging Windows e The memory window s right click menu displays a list of config ured expressions from which to select only one expression for tracking e To track multiple expressions open multiple memory windows and track one expression per window Memory Window Display Customization You can specify the colors used for symbols data address values modified values and undefined memory regions You can also adjust the width of the window to display a particular number of data columns For example the memory window in Figure 2 50 is sized to display five columns TigerSharc Memory Hexadecimal ___data2_buf_hi 100084 00000000 00000000 0ooo0oo0 00000000 00100088 100089 00100089 0010008A 0010008B 0010008C 0010008D 10008E 0010008E 0010008F 00100090 00100091 00100092 100093 00100093 00100094 00100095 00100096 00100097 100098 00100098 00100099 0010009A 00100098 00100039C 10009D 0010009D 0010009E 0010009F 001000A0 00100041 100042 00100042 001000A3 001000A4 00100045 00100046 1000A7 001000A7 00100048 00100049 0
84. 42 Embedded Processing amp DSP Knowledgebase xxxiii emulation available tools 1 20 debug session management 3 3 restarting programs 3 12 targets 1 17 vs simulation 3 3 emulator defined A 71 when to use 1 15 emulator targets statistical profiling 3 8 energy calculating for functions 3 33 energy aware programming 3 31 error messages 2 43 demoting 2 35 displaying offending code 2 29 log file 2 38 2 39 Output window 2 28 2 31 promoting 2 35 scrolling in Output window 2 29 severity hierarchy 2 31 suppressing 2 35 syntax 2 32 errors discretionary 2 31 estimated energy profile 3 31 evaluating expressions in editor windows 2 23 evaluation available tools 1 20 event bit defined A 72 VisualDSP 5 0 User s Guide 1 5 INDEX events cache 2 93 defined A 71 Pipeline Viewer 2 91 thread 2 107 using data cursor 2 107 events log cache 2 95 Events submenu SHARC B 4 Access to ADSP 21065L 9th column Even Address B 7 FP Denorm B 4 Short Word Anomaly B 4 Excel data files 3 17 plot window data 3 17 executables automatic loading 1 26 loading 3 11 execution traces 2 52 3 9 exe files A 13 Expert Linker about 1 34 overview 1 34 stack and heap usage 1 38 window 1 35 expressions C expressions 2 52 context sensitive evaluation 2 23 evaluating in editor windows 2 23 Expressions window 2 52 memory windows 2 69 nested searching Help A 64 register 2 52 regul
85. 5 0 User s Guide Environment enable interrupts ustatl model BIT SET ustatl IRPTEN model ustatl In C C the vector can be installed with the interrupt function as follows interrupt SIG_EMUL btc_isr In C C the interrupt function enables the interrupt for you After adding code to initialize BTC and enable the BTC interrupt you must link with the BTC library 1ibbtc26x d1b for assembly applications or libcbtc26x d1b for C C applications This library contains the ini tialization function interrupt service routine and other functions that permit data transfer over the BTC BTC Priority On ADSP 2126x and ADSP BFBF36x SHARC processors BTC data transfer is handled through the low priority emulator interrupt EMULI Since the priority of this interrupt is fixed the priority of BTC is also fixed The priority of the BTC can impact the response time from when the host requests data and the processor responds Once the processor begins to service the request interrupts can still be serviced by the processor BTC performance can be affected by the frequency of system interrupts BTC Memory Window The BTC Memory window lets you view background telemetry channel contents in real time The window displays the contents of the address that you want to see Change the window s view to meet your needs VisualDSP 5 0 User s Guide 2 75 Debugging Windows Open this window by choosing View Debug Windo
86. 5 0 User s Guide A 47 Text Operations be expressed as xyz 0xyz where the 0 indicates a tagged expression representing the entire matched substring Similarly you can have another tagged expression represented by 1 2 Although the tagged expression 0 is always defined the tagged expressions 1 2 and so on are defined only when the regular expression used in the search has enough sets of parenthesis Some examples are shown in Table A 23 Table A 23 Examples of Replace Operations String Search Replace Result Mr Mr 1s 2 Mrs abc a b c amp 1 2 abc a c bed alb c d amp 1 bcd b abcde Jec amp 1 2 abcde ab de cde ab cd e amp 1 cde cd Comment Start and Stop Strings Use start comment strings and stop comment strings for comment highlighting colors Table A 24 describes the two types of comment strings that you can set for each file type Table A 24 Start and Stop Comment Strings String Purpose Starts an assembly style single line comment as Starts a C C style multiline comment Starts a C C style single line comment Carriage return Ends a single line comment C and assembly A 48 VisualDSP 5 0 User s Guide Reference Information Table A 24 Start and Stop Comment Strings Contd String Purpose Ends a C C style multiline comment blank Ends a C C st
87. 52 context sensitive A 54 copying example code A 57 features and operations A 53 invoking A 51 A 52 keyboard shortcuts A 36 navigating A 54 A 59 printing A 57 searching A 60 window A 53 h files A 12 A 13 h_ files A 13 hpp files A 12 hxx files A 12 I ICEs defined A 73 specifying as platform 3 2 ICE Test 1 18 A 87 icons editor windows 2 18 Pipeline Viewer events 2 91 Project window 2 6 ID processor B 10 1 8 VisualDSP 5 0 User s Guide IDDE 1 2 command line parameters A 7 invoking with command line parameters A 7 source code control 1 50 version A 3 idde exe command line parameters A 7 Idle thread time spent in 2 108 ILEE 3 31 images displaying 2 119 Image Viewer window automation interface 2 120 features 2 119 right click menu 2 121 status bar 2 121 toolbar 2 120 instruction groups Blackfin processors D 41 instruction latencies Blackfin processors D 26 accumulator to data register D 27 instruction alignment unit empty D 33 instructions within hardware loops D 32 loop setup D 31 move conditional and move CC D 30 register move D 28 instruction timing analysis ADSP TS101 processors C 2 ADSP TS20x processors C 12 interrupts about 3 17 defined A 73 simulating 1 16 INDEX interrupt service routines defined A 73 I O simulating data transfer 1 16 Jis files A 12 ISRs exercising 1 16 J JScript scripting with 2 41 js f
88. Analog Devices Inc One Technology Way Norwood Mass 02062 9106 WISUA DSP 5 0 User s Guide Revision 3 0 August 2007 Part Number 82 000420 02 Copyright Information 2007 Analog Devices Inc ALL RIGHTS RESERVED This document 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 the CROSSCORE logo VisualDSP SHARC TigerSHARC Blackfin and EZ KIT Lite are registered trade marks of Analog Devices Inc All other brand and product names are trademarks or service marks of their respective owners CONTENTS PREFACE Purpose tee This Mantal cerises iia eanna xxiii Dee Audiente sonsaina xxiii Mama Conen arna xxiv Whars New im This Mist cccrcicisitettevcissiirecimnmaeds XXV Technical ot Customer SUP pel scceiponi iiaa a xxvi Supported GAG as arcecarcannsnaitnsadnslaasarnanecacseormmameusatanssanainances xxvii Product Wi EN sunrise ann A
89. Analog Devices Web site This anomaly has been identified in the shadow write FIFOs that exist between the internal memory array of the ADSP 21160M and core IOP buses that access the memory Refer to the hardware documentation for details on shadow register operation When SIMD reads cross long word address boundaries that is odd normal word addresses or non long word boundary aligned short word addresses and the data for the read is in the shadow write FIFO the result is Revision 0 0 behavior for the read VisualDSP 5 0 User s Guide B 3 Event Options Event Options The Events submenu provides the following options e FP Denorm This command opens the Configure Simulator Event dialog box from which to configure the reporting of the generation of a floating point denormal result By default this option is OFF disabled e Short Word Anomaly all ADSP 2106x processors except the ADSP 21065L This command opens the Configure Simulator Event dialog box from which to configure reporting for short word accesses that fail By default this option is OFF disabled e Access to 21065L 9th column Even Address ADSP 21065L processors only This command opens the Configure Simulator Event dialog box from which to configure reporting for invalid memory access By default this option is ON enabled FP Denorm You can configure what happens when an FP Denorm event occurs Denormal operands flush to zero w
90. Ar Mr Myr BG WIF nyaeq JUMP loop2 75 n Wij 30 Mr Myr Bly Mjo o0 76 j n n jo j B iF By By yr3 r r2 77 x j n nopi j j0 W1 H yr4 r4 r3 78 n x j to Dies 30 Jes E IF nyaeq JUMP loop2 79 n n 8 xr n nop Jis j0 OX1 xrl r4 80 y a a J3 Xie no Mii j0 OX1 xrO r4 81 3 youn Js ee Xt His nop 82 j j a Rls Jea 33 is nop nop nopi Figure C 4 Abort Due to Mispredicted Change of Flow C 6 VisualDSP 5 0 User s Guide Simulation of TigerSHARC Processors Branch Target Buffer Hits In the following example the jump instruction was found in the Branch Target Buffer and is marked with Ml The branch is predicted and taken and no penalty is exacted for the change of flow x Cycle F1 F2 F3 DECODE INT ACCESS EX1 EX2 23 y y LE IF njle JUMP loop j ki j j0 0X1 xr0 r4 r3 yrO r5 24 My y y j0 0X1 xr0 r4 Wi j2 k j0 0X1 xr0 r4 r3 yrl r5 25 ky y ki 0X1 xr3 r2 iMi j kl 0X1 xr3 r2 r4 yr5 r6 26 y LE y j2 j2 0X1 xr9 k j0 Er j2 j2 0X1 xr9 r2 r yrl 27 y y LE IF njle JUMP loop hip ki j IF njle JUMP loop ki 0X1 yr5 28 My y y j0 0X1 xr0 r4 WI j2 k j0 0X1 xr0 r4 r3 yrl r5 29 a E y ki 0X1 xr3 r2 iE TE oaii EPA ki 0X1 xr3 r2 r4 yr5 r6 30 y kMy j2 j2 0X1 xr9 k j0 W
91. BF532 ADSP BF533 and ADSP BF561 Processors The simulator for the ADSP BF531 ADSP BF532 ADSP BF533 and ADSP BF561 processors is a core cycle accurate simulator with a ten stage pipeline The simulator models all sequencer and memory events The Pipeline Viewer shows the flow of instructions through the pipeline and any stalls due to sequencer or memory events It enables you to under stand the execution timing of your program For information about configuring and using the Pipeline Viewer see Pipeline Viewer Window on page 2 88 or VisualDSP online Help Stall Reasons The stall reasons are as follows Data address generator DAG read after write RAW hazard Memory stall Memory mapped register MMR stall Unidentified stall Data register dreg hazard two cycle Dreg hazard one cycle CSYNC stall SSYNC or IDLE SYNC stall LSETUPO and not LPO_ALLOWED VisualDSP 5 0 User s Guide D 19 Simulator Instruction Timing Analysis for ADSP BF531 ADSP BF532 ADSP BF533 and ADSP BF561 Processors e Awkward loop e Raise stall e SS mode e RET read after write Kill Reasons The kill reasons are as follows e Branch Kill change of flow e Mispredict mispredict conditional change of flow e Interrupt interrupt exception e Refetch refetch such as following an IDLE instruction Pipeline Viewer Window Examples Figure D 4 shows a RAW hazard stall Cycle De
92. BF535 D 17 call and jump D 23 conditional branch D 23 core and system synchronization D 24 interrupts and emulation D 25 linkage D 25 push or pop multiple D 22 return D 24 TESTSET D 25 multiprocessor debug sessions 3 4 debugging 3 5 focus and pinning 2 86 3 6 managing 2 84 program execution 3 11 setting up 3 4 multiprocessor groups 2 86 multiprocessor systems See multiprocessor debug sessions Multiprocessor window 2 83 debugging with 3 5 Groups page 2 85 Status page 2 84 N nested expressions defining Help searches A 64 nested folders 2 6 No Boot Mode command B 10 nodes Project window 2 2 O object files See obj files obj files 1 30 A 13 online Help See Help operations program execution 3 11 program execution commands 3 11 VisualDSP 5 0 User s Guide INDEX optimizing programs 2 94 Output window 2 28 2 43 bookmarks 2 30 Build page 2 29 capturing messages to log file 2 38 Console page 2 30 scripting 2 41 customization 2 38 error messages 2 31 loading scripts 2 39 makefile errors 1 53 parts of 2 29 printing 2 40 right click menu 2 39 scripts 2 39 scrolling previous commands 2 30 overlays 1 13 1 32 overriding project wide options 1 58 ovl files 1 31 A 12 P PC samples filtering 2 62 performance measuring 3 8 optimizing 2 94 peripherals Blackfin simulating D 1 limitations in simulation for Blackfin D 7 support in simulators
93. BF549 Product Information You can obtain product information from the Analog Devices Web site from the product CD ROM or from the printed publications manuals Analog Devices is online at www analog com This Web site 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 Web site that allows customization of a Web page to display only the latest information on products you are interested in You can also choose to receive e mail notifications containing updates to the Web pages that meet your inter ests including documentation errata against all manuals MyAnalog com provides access to books application notes data sheets code examples and more xxviii VisualDSP 5 0 User s Guide Preface Registration Visit www myanalog com to sign up Click Register to use MyAnalog com Registration takes about five minutes and serves as a means to select the information you want to receive If you are already a registered user just log on Your user name is your e mail 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 You may also obtain additional information abo
94. CAP The keyboard s Caps Lock key is latched down NUM The keyboard s Num Lock key is latched down SCRL The keyboard s Scroll Lock key is latched down A 30 VisualDSP 5 0 User s Guide Reference Information Keyboard Shortcuts VisualDSP includes keyboard shortcuts also called shortcut keys for commonly used operations These keyboard shortcuts appear in the tables below You can also access and run commands by Clicking on menu items and commands in the menu bar Clicking toolbar buttons Right clicking from a particular context such as from the Project window Clicking configured user tools for example Al Clicking buttons in dialog boxes Running scripts via the File menu Output window or editor window Choosing a command from a control menu Working With Files When working with files use the keyboard shortcuts listed in Table A 8 Table A 8 Keyboard Shortcuts for Working With Files Action Key s Open a new file Ctrl N Open an existing file Ctrl O Save a file Ctrl S Print a file Ctrl P VisualDSP 5 0 User s Guide A 31 Keyboard Shortcuts Table A 8 Keyboard Shortcuts for Working With Files Contd Action Key s Go to the next window F6 Go to the previous window Shift F6 Moving Within a File To move within a file use the keyboard shortcuts listed in Table A 9 Table A 9 Keyboard Shortcuts for Moving Within a File
95. D 14 Return Instructions and Cycles Instruction ADSP BF532 ADSP BF535 RTX 5 cycles 7 cycles RTE 5 cycles 7 cycles RTN 5 cycles 7 cycles RTI 5 cycles 7 cycles RTS 5 cycles 4 cycles 1 Best case Core and System Synchronization Table D 15 lists core and system synchronization instructions and cycles Table D 15 Core and System Synchronization Instructions and Cycles Instruction ADSP BF532 ADSP BF535 CSYNC 10 cycles 7 cycles SSYNC 10 cycles 7 cycles D 24 VisualDSP 5 0 User s Guide Linkage Table D 16 lists linkage instructions and cycles Table D 16 Linkage Instructions and Cycles Simulation of Blackfin Processors Instruction ADSP BF532 ADSP BF535 LINK 8 3 cycles 4 cycles UNLINK 2 cycles 3 cycles Interrupts and Emulation Table D 17 lists interrupts and emulation instructions and cycles Table D 17 Interrupts and Emulation Instructions and Cycles Instruction ADSP BF532 ADSP BF535 RAISE 10 3 cycles 3 cycles EXCPT 3 3 cycles 7 cycles EMUEXCPT 3 cycles 3 cycles STI R4 3 cycles 3 cycles 1 Best case as determined by physical characteristics of external memory TESTSET The TESTSET instruction is a multicycle instruction that is executed in a variable number of cycles It depends on the cycles needed for a read acknowledge from off core L2 memory and whether the address being te
96. DDE s Register menu you configure menu items that open the customized register windows For detailed information and examples on using custom board support refer to online Help Processor Definition Files Processor definition files are shipped with VisualDSP and are installed into the lt install_path gt isualDSP System ArchDef directory These XML files contain definitions for a processor s registers register resets register windows and memory types Analog Devices recommends that you do not modify the standard processor definition files because they and any changes you might make to them may be overwritten when a VisualDSP update is installed Instead place your customizations in custom board sup port files which will not be overwritten by VisualDSP updates The processor definition file is parsed before the custom board support file if used is parsed Specifications in the custom board support file will augment and or override the specifications in the processor definition file Multiprocessor Window The SHARC and TigerSHARC simulators do not support multiprocessor MP debugging multiprocessing for these proces sors is available in emulator sessions only Multiprocessing support for Blackfin ADSP BF561 and ADSP BF566 processors is available in simulation VisualDSP 5 0 User s Guide 2 83 Debugging Windows Use the Multiprocessor window Figure 2 56 to select and control the different processors i
97. DSP 5 0 User s Guide A 37 Window Operations Right Click Menu Options A menu appears when you right click in a window or on its title bar The menu options in Table A 18 affect window behavior Table A 18 Window Right Click Menu Commands Option Description Allow Docking Enables or disables docking Close Closes the window Float in Main Window Causes the window to become a normal MDI child window like an editor window and disables its docking ability Scroll Bars and Resize Pull Tab Scroll bars appear along the right and bottom edges of the application or document window as shown in Figure A 17 Scroll bar Scroll box Pull tab Figure A 17 Scrolling the View Area The scroll boxes inside the scroll bars indicate the vertical and horizontal location in the document Use the mouse to scroll to other parts of the document A 38 VisualDSP 5 0 User s Guide Reference Information When the application window is not maximized the resize pull tab appears in the lower right corner of the window Click and drag the pull tab to resize the application window Windows Docked vs Floating A window attached to the application s frame is referred to as a docked window You can detach a window from the main window and move it to another location anywhere on the desktop A floating window stands alone because it is not docked Depending on your needs you can e Dock a window to
98. DSP BF535 accreg sysreg 1 lt 1 gt A0 w LCO accreg accreg 1 lt 1l 1 gt Al A0 accreg sysreg 1 lt 1 gt A0 w LCO dreg accreg 1 lt l 1 gt RO L A0 x accreg sysreg 1 lt 1 gt A0 w LCO sysreg accreg 1 lt 1 1 gt ASTAT A0 w accreg sysreg 1 lt 1 gt Al x LCO math op using accreg as src 1 lt 1 1 gt R1 H A0 Al1 accreg sysreg 1 lt 1 gt A0 w LCO POP to accreg 1 lt 1 1 gt A0 w SP POP to dagreg 1 lt 1 gt I3 SP any processor op using dagreg 1 3 lt 1 3 gt R0 I3 LOAD POP to preg 1 lt 1 gt P3 SP any processor op using preg 1 3 lt 1 3 gt R0 P3 RO L R1 L R2 L The 10x core considers register halves to be independent so R3 RO H R4 L this condition is not a register hazard VisualDSP 5 0 User s Guide D 29 Multicycle Instructions and Latencies Move Conditional and Move CC Latencies In each of the following cases the stall condition occurs when the same register is used in both instructions Table D 21 Move Conditional and Move CC Latencies Description Example s lt cycles stalls gt instruction ADSP BF532 ADSP BF535 dreg CC 1 lt 1 gt R0 CCG if CC dreg dreg 1 lt l 1 gt ifCCRI1 R0 if CC dreg dreg 1 lt 1 gt if CC RO RI multiply video op using dreg as src 1 1 lt 1 1 gt R2 H R1 L RO H 1 lt 1 gt if CC RI R3 l 1 lt 1 1 gt SAA R3 2 R1 0 if CC dreg preg
99. ENE AZ 74 0 EL 22 0 Aiaterfall Plot FFT Figure 3 7 Waterfall Plot A time based signal is sampled at a predefined sampling rate and stored as a slice in the grid row 0 columns 0 J Figure 3 8 shows a grid of sampled data In the drawing the sampled points labelled 1 and 2 are stored in the first two cells of Slice 1 The next time a signal is sampled it is stored in row 1 columns 0 N slice 1 This process continues until all the rows are filled By default an FFT performed on each slice results in a frequency output display Use a color map on the 3 D Axis page of Color Settings dialog box to enhance the display Each color corresponds to a range of ampli tude values VisualDSP 5 0 User s Guide 3 25 Flash Programmer Slice 1 shaded row 2 My Time gt M i Gc Time gt Sampled points Figure 3 8 Grid of Sampled Data The plot output displays a legend showing each color and associated range of values You can rotate the waterfall plot to any desired azimuth and elevation by using the keyboard s arrow keys Spectrogram Plots A spectrogram plot Figure 3 9 displays the same data as a waterfall plot except in a two dimensional 2 D format Each X Y location displays as a color representing the amplitude of the data By default an FFT performed on each slice results in a frequency output display A legend displays the colors and asso
100. Executable After successfully building an executable file set up a debug session You run projects that you develop as hardware or software sessions After specifying the processor connection type and platform load your project s executable file From the General page of the Preferences dialog box you can configure VisualDSP to load the file automatically and advance to the main function of your code Step 7 Run and Debug the Program After successfully creating a debug session and building and loading your executable program run and debug the program If the project is not current has outdated source files or dependency information VisualDSP prompts you to build the project before loading and debugging the executable file 1 26 VisualDSP 5 0 User s Guide Introduction to VisualDSP Step 8 Build a Release Version of the Project After you finish debugging your application build a Release version of your project to run on the product s processor Code Development Tools This section describes the following development tools e Compiler on page 1 28 e C Run Time Libraries on page 1 29 e Assembler on page 1 30 e Linker on page 1 31 e Expert Linker on page 1 34 e Archiver on page 1 41 e Splitter on page 1 41 e Loader on page 1 42 Available code development tools differ depending on the processor The options available on the pages of the Project Options di
101. Menu A menu like the one in Figure A 10 appears when you right click within the VisualDSP title bar or within the title bar of a child sub window Restore Move Size Minimize Maximize Close Alt F4 Figure A 10 Right Clicking in the VisualDSP Window s Title Bar VisualDSP 5 0 User s Guide A 17 Parts of the User Interface From the VisualDSP title bar s right click menu you can e Resize or move the application window e Close VisualDSP Control Menu Control menu system menu commands move size or close a window Restore Move Size Minimize Maximize Close Alt F4 Figure A 11 VisualDSP Control Menu Program Icons Click one of the following program icon to open a control menu Program icon for the application and debugging windows Program icon for editor windows Placing the mouse pointer over a control menu command displays a brief description of the command in the status bar at the bottom of the applica tion window Editor Windows A floating editor window s control menu includes the Next command which moves the focus to another window A 18 VisualDSP 5 0 User s Guide Reference Information When an editor window floats in the main application window its pro gram icon resides at the left side of its title bar When an editor window is maximized the program icon resides at the left end of the menu bar Editor windows are described on page 2 16 Debuggi
102. P 5 0 User s Guide 2 51 Debugging Windows As you step through your program the Expressions window displays the current value of each listed expression Expressions evaluation is based on the current debug context For example if you enter expression a and a global variable a exists you see its value If you then step into a function that has local variable a the local value displays until the debug context leaves the function When a variable goes out of context a string displays next to the variable informing you that the variable is out of context The expressions described above are C expressions The current syntax also allows the use of registers in expressions For example the following expression is valid RO 10 Register expressions and C expressions can be mixed in an expression Register expressions follow these rules e A dollar sign character must precede register names e Register names can be in uppercase or lowercase characters e Registers have no context A register expression always evaluates to the current value of the register Trace Windows Perform a trace also called an execution trace or a program trace to analyze the run time behavior of a processor program to enable I O capabilities and to simulate source to target data streaming Figure 2 32 shows an example of data in a Trace window 2 52 VisualDSP 5 0 User s Guide Environment Clock cycle Address Bu
103. Specifying Data VisualD Plot Window Fe VisualD Configuring a Plot isualD Plot Window Pre VisualD Viewing a Plot VisualD New Features in VisualD 2 3 4 5 6 Reference Information Specifying Data Processing for a Data Set For each data set in a fi you can specify data processing options that determine sampling rate triggering and the data processing algorithm you want The following procedure assumes that the Settings dialog box is open To specify data processing for a data set 1 Click the Data Processing tab Figure A 27 Example Boolean Search To find information with a full text search 1 Click the Help viewer s Search tab 2 In Type in the word s to search for type the word or phrase you want to find 3 Select Search previous results to narrow the search 4 Select Match similar words to find words that are similar to the search string 5 Select Search titles only to search for words in topic titles only 6 Click the Options button E at the top of the Help Viewer window to highlight all instances of search terms found in topic files Then choose Search Highlight On 7 Click List Topics select the topic you want and then click Display Sort the list by clicking the Title Location or Rank column heading VisualDSP 5 0 User s Guide A 61 Online Help Rules for Full Text Searches Observe these rules when formulating queries
104. Target Buffer Hits In the following example the first iteration of the loop causes a four cycle penalty because of the unpredicted change of flow On the second itera tion the change of flow instruction was found in the branch target buffer and is marked with an Ml The branch is predicted and taken and no penalty is exacted for the change of flow xi Cycle F1 F2 F3 F4 PD D TANE 2 j 76 ji ji yl n W yri r4 r3 x yr3 OX1 77 H E B spt v4 33 Bi yr2 0 78 Bee A IF nyaeq JUMP loop2 B j10 0 79 E amp amp BA 1 B yr3 r3 r2 80 Wy j E x A B yr3 r3 r2 81 H iM y jE ow x A yra r4 r3 82 W jH H HHA IF nyaeq JUMP loop2 nop 83 My Gy j y 510 0 BS Ed Ea ey 84 Wy jM y y yr3 r3 r2 El E E 85 By ily iM OW yri r4 r3 BB 86 Wy GMyW1soyra r4 r3 Bi El 87 My jJ j MIF nyaeq JUMP loop2 B j10 0 88 Wy iMly y jio a W B yr3 r3 r2 89 y j y j y yr3 r3 r2 Eo B yr3 r3 r2 90 Wor 5 MyM WM yrs v4 r3 3 Mi yri r4 r3 xj Figure C 13 Branch Target Buffer Hits e e e e e Pipeline Viewer and Disassembly Window e Operations This section includes the following topics e Current Program Counter Value e Stepping VisualDSP 5 0 User s Guide C 19 ADSP TS20x Processors Current Program Counter Value The program counter PC value marked by gt in the Disassembly wi
105. W B zr0 j0 j31 B zr0 j0 j31 nop nop nop 39 non n nW nW ni nW B xr0 j0 j31 B xr0 j0 331 nop nop nop 40 x n n nW nW ni nW B xr0 j0 j31 B xr0 j0 j31 nop nop nop 41 x x n nW n W nWinW B zr0 j0 j31 B zr0 j0 j31 nop nop nopi 42 x x x n n n n nop nop nop B xr0 j0 j31 nop nop nop 43 x x x x n on n nop nop nop nop nop nop nopi 44 x x Xx x n n n nop nop nop nop nop nop nopi X ee Figure C 10 Stall Due to a Cache Miss Aborts Due to an Unpredicted Change of Flow In the following example the abort at the PreDecode stage is due to an unpredicted jump predicated upon an IALU condition The jump is unpredicted because the branch target buffer is disabled in this particular example C 16 VisualDSP 5 0 User s Guide Aborted stages in the fetch pipe are marked with an BM and aborted Simulation of TigerSHARC Processors instructions in the execution pipe are marked with an fq EJ Cycle F1 F2 F3 F4 PD D I A E E2 4 10 j ny yi j ki 0x1 xr3 r2 l x 11 z j n yi jB ki 0X1 xr3 r2 Bi j0 0X1 xr0 r4 r3 12 n x j n jB ki 0X1 xr3 r2 B JBI j2 0X6 r13 r5 r3 13 non x j I j2 _ j2 0X1 xr9 B B B ki 0X1 xr3 r2 r4 14 D gt Oy IF njle JUMP loop B B ki 0X1 zr3 r2 r4 15 y ke BEA 1 B B ki 0X1 ur3
106. You can change the shape of a floating toolbar Table A 6 shows two tool bar shapes Table A 6 Toolbars in Two Orientations Horizontal Vertical Coa H E3 R R Depending on the number of tools in the toolbar you can create other length and width arrangements Toolbars Docked vs Floating By default toolbars are located under the application s menu bar but you can move them to these locations e Over a docked window e On the main window e Anywhere on the desktop A toolbar attached to a window is called a docked toolbar You can tell when a toolbar is going to dock by the size and shape of its moving outline as you drag it Its outline becomes slightly smaller than its floating outline To prevent a toolbar from docking press and hold the Ctrl key while dragging the toolbar to a new location A 28 VisualDSP 5 0 User s Guide Reference Information A toolbar can be detached from a window and moved to another location anywhere on the desktop A floating toolbar is a stand alone window as it is not docked A docked toolbar does not show its name however a float ing toolbar displays its title Figure A 14 shows a floating Help toolbar Help E3 RIR Figure A 14 Floating Help Toolbar Toolbar Rules When working with toolbars be aware of these rules e You can customize a built in toolbar for example by removing a button from the File toolbar but you cannot delete a bui
107. about 3 24 grid of sampled data 3 25 rotating 3 24 ways cache 2 94 Windows standard buttons A 42 VisualDSP 5 0 User s Guide I 19 INDEX windows BTC Memory 2 75 buttons A 42 Call Stack 2 63 2 64 custom register 2 81 debugging 2 43 Disassembly 2 45 2 47 docked A 39 Expert Linker 1 35 Expressions 2 50 Flash Programmer 3 30 floating A 39 focus in an MP debug session 3 6 Help A 53 Image Viewer 2 119 keyboard shortcuts A 37 Linear Profiling 2 55 3 8 Locals 2 54 MDI A 38 Multiprocessor 2 84 operating on A 37 Output 2 28 Pipeline Viewer See Pipeline Viewer window plot 2 109 positions A 42 profiling 2 55 Project 2 2 pull tabs A 38 register 2 78 right click menus A 38 scroll bars A 38 stack 2 80 Statistical Profiling 2 55 3 8 Target Load 2 108 Trace 2 52 3 9 VDK State History 2 105 VDK Status 2 103 VisualDSP A 15 wizards Project 1 23 A 81 workspaces keyboard shortcuts A 37 X xml files 2 82 X Y plots 3 21 1 20 VisualDSP 5 0 User s Guide
108. abs A 38 R ranking 3 31 register expressions 2 52 register groups Blackfin processors D 42 register windows about 2 78 custom 2 81 regression tests 1 14 regular expressions A 44 reference texts A 47 special characters A 45 Release configuration 1 56 remarks 2 31 replace operations tagged expressions A 47 replacing tagged expressions A 47 restarting programs 3 12 running programs 1 26 3 12 running to cursor 3 12 S SCC See source code control SCC scripting about 2 40 specifying the language 2 42 INDEX scripts auto completion 2 42 examples 2 42 issuing 2 30 loading 2 42 loading from a shortcut A 11 loading from Output window 2 39 running A 7 viewing script command status A 9 scroll bars using A 38 searches normal A 44 regular expressions vs normal A 44 special character rules A 46 searching Help A 60 Select Processor ID submenu options B 10 semaphores defined A 82 sequences special characters A 46 sessions configuring 3 5 sessions See debug sessions Session Wizard 3 5 3 10 s files 2 14 A 12 s_ files A 13 shadow write FIFO anomaly B 2 shortcut keys See keyboard shortcuts short word anomaly B 4 SIMD FIFO B 3 VisualDSP 5 0 User s Guide I 15 INDEX simulating See also simulation booting 1 16 data transfers 1 16 external interrupts 1 16 hardware 1 16 input output data 3 17 random interrupts 1 16 SHARC processors B 1 T
109. aches stage E1 of the pipeline M Manually changing the PC value during simulation can result in unpredictable program behavior VisualDSP does not safeguard against invalid PC values Ensure that the specified PC indicates a valid instruction within program address space An example of an invalid PC is a data memory address whose con tents is not recognized as an instruction by the simulator In this case the simulator generates an unhandled software exception Another example of an erroneous PC is the middle of an instruc tion line Only part of the instruction line is executed while instructions in the beginning of the line are ignored C 8 VisualDSP 5 0 User s Guide ai j a a cits g ris j10 0 y 48 y iH j WIF yB y yr3 r3 r2 Ah 49 n y j gO I y yr3 r3 r2 y 50 j ny 310 j I yr4 r4 r3 B y 5 51 x j n yr3 ae j IF nyaeq JUMP loop2 n Tas 52 n x j vet y Teas jO OX1 xr0 r4 r3 I gt a iE j E j yoy j10 0 j 3 54 Hy iB i iF y BI y yr3 r3 r2 ices Simulation of TigerSHARC Processors Figure C 6 shows how the program counter value is used for the ADSP TS101 processor g 1 program a 000000 j0 0X1 xr0 r4 r3 yrO r5 r6 000003 j2 0X6 r13 r5 r3 loop 000005 ki 0X1 xr3 r2 r4 yr5 r6 r7 yr8 r9 ril 000009 j2 j2 0X1 ur9 r2 r4 yrl2 r6 r7 yrl3 r9 r10 00000D
110. adID and the name of the thread type appear to the left of the bar When a thread is destroyed the name of the thread type is no longer displayed Each thread event appears as an arrow above a thread VisualDSP 5 0 User s Guide 2 105 Debugging Windows Bar Cursor Thread Thread Cursor representing position switch event thread line arrow DK State History EE EE EE Idle Thread gt a ot oe oe re at ot ot a eee Tide ThreadStatusChange Tick 4 Value 0 Status From Ready State History A Target Load ee ci Status bar Active thread Thread status Active thread indication duration Figure 2 70 VDK State History Window Thread Status and Event Colors Threads and events are coded by color based on thread status and event type The colors appear in the horizontal bars threads and colored arrows events used throughout the plot Events of the same type are drawn in the same color Right click on the plot and choose Legend to display legends that define each color in the VDK State History window To customize colors right click on the plot and choose Properties 2 106 VisualDSP 5 0 User s Guide Environment Trace thread switched history by following the thin green line which winds through the display passing under threads to indicate the running thread at any particular time When a context switch occurs and changes the running thread a vertical green line is drawn from the previousl
111. age about 2 29 build status viewing 2 29 build type See configuration buttons appearance on toolbars A 27 built in toolbars A 20 standard Windows functions A 42 C cache events 2 93 log 2 95 cache hits 2 94 cache misses 2 94 cache thrashing 2 94 2 VisualDSP 5 0 User s Guide Cache Viewer about 2 93 Address View page 2 102 cache events log file 2 95 Configuration page 2 96 Detailed View page 2 97 Histogram page 2 100 History page 2 98 Performance page 2 99 right click menu 2 95 cache ways 2 94 Call Stack window 2 63 categories in Help A 52 c files 2 14 A 12 channels BTC 2 73 definition A 67 CLKOUT pin configuring B 10 clock doubling ADSP 21161 processors B 10 code analysis tools 3 7 code development tools about 1 2 batch processing messages 2 31 list of 1 27 COFF defined A 67 colors Output window 2 29 plots 3 26 command line parameters idde exe A 7 commands control menu A 18 DOS 1 60 program execution 3 11 single stepping 3 11 stepping 3 11 user tools A 21 INDEX comments rules for A 48 start and stop strings A 48 compiled simulation D 44 preparing a program from a dxe file D 44 compiler 1 28 annotations in editor windows 2 24 file associations for tools 2 14 input files 2 14 options 1 28 1 31 suppressing warnings and remarks 2 37 compiling C programs 1 28 C programs 1 28 conditional breakpoints 3 14 configurations cust
112. al comma separated list of this SECTION Commands directives keywords and feature names are in text with letter gothic font filename Non keyword placeholders appear in text with italic style format Note For correct operation A Note provides supplementary infor mation on a related topic In the 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 Warning 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 Warning appears instead of this symbol VisualDSP 5 0 User s Guide XXXV Notation Conventions XXXVI VisualDSP 5 0 User s Guide 1 INTRODUCTION TO VISUALDSP This manual describes VisualDSP a flexible management system that provides a suite of tools for developing processor applications and projects This chapter contains the following topics e VisualDSP Features on page 1 1 e Product Updates and Upgrades on page 1 10 e Project Development on page 1 11
113. all SSYNC or IDLE SYNC stall Raise stall Single step SS mode RET read after write Unidentified stall Kill Reasons The kill reasons are as follows Branch Kill change of flow Mispredict mispredicted conditional change of flow Refetch refetch such as following an IDLE instruction Interrupt interrupt exception VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Pipeline Viewer Window Examples Figure D 1 shows a RAW hazard stall fea ears Address Executel Execute2 Execute3 Writeback al 14 I0 RO R0 4 NOP NOP NOP 15 R4 I0 I0 R0 R0 4 NOP NOP 16 S R4 10 B I0 RO RO 4 NOP F 17 S R4 I0 B B I0 RO RO 4 NOP 18 S r4 10 B B B I0 RO R0 4 19 R5 I0 R4 I0 B B B 10 RO Figure D 1 RAW Hazard Stall These stalls are detected in the Decode stage The instruction stalls there until all DAG registers required and updated in later pipeline stages are available In this example the instruction 10 R0 in the Executel stage cycle 16 Execute2 stage cycle 17 and Execute3 stage cycle 18 is stalling the R4 10 instruction in the Decode stage This stall is caused by the first instruction because it updates the value of 10 in the Writeback stage while the second instruction needs the value of 10 in the Address stage to increment
114. alog box enable you to specify tool preference VisualDSP supports ELF DWARF 2 Executable Linkable Format Debug With Arbitrary Records Format executable files VisualDSP supports all executable file formats produced by the linker If your system is configured with third party development tools you can select the compiler assembler or linker to be used for a particular target build VisualDSP 5 0 User s Guide 1 27 Code Development Tools Compiler The compiler processes C C programs into assembly code The term compiler refers to the compiler utility shipped with the VisualDSP software The compiler generates a linkable object file by compiling one or more C C source files The compiler s primary output is a linkable object file with a DOJ extension To specify compiler options for your build choose Project gt Project Options From the tree control of the ensuing Project Options dialog box expand Compile and click a subpage Compiler options are grouped into the subpages described in Table 1 3 Table 1 3 Compiler Option Subpages Category Provides General Optimization compilation and termination options Source Language Settings related to the dialect of C or C accepted by the compiler Settings Preprocessor Macro and directory search options Processor Processor specific options Profile guided Options used while performing profile guided optimization PGO Optimi
115. amples 2368803 Figure 3 12 Power Savings Off PDDDYN V PDDDYN V0 V V0 2 F FO The voltage and frequency power scaling ratio derived via this calculation is very close to the power savings ratio obtained via the values displayed in Energy Units columns of Figure 3 11 and Figure 3 12 85 1 2 2 250 250 0 501736 In an application where voltage and frequency are manipulated dynami cally during different functions to achieve a more efficient energy profile proper tallying of energy at changing voltage and frequency settings is handled correctly so overall energy profile improvements can be seen by comparing different profiles of an application at different settings 3 34 VisualDSP 5 0 User s Guide A REFERENCE INFORMATION This appendix includes a glossary on page A 66 and collection of other reference material Take advantage of the many features in VisualDSP so you can speed up program development Sections include e Support Information on page A 2 e IDDE Command Line Parameters on page A 7 e Extensive Scripting on page A 8 e File Types on page A 12 e Parts of the User Interface on page A 15 e Keyboard Shortcuts on page A 31 e Window Operations on page A 37 e Text Operations on page A 44 e Online Documentation on page A 49 e Online Help on page A 53 e Glossary on page A 66 VisualDSP 5 0 User s Guide Support Information
116. apply to window positions e Unless Allow Docking is disabled a window must reside within the main window e An editor window cannot be docked to the main window e A window specified as an MDI child cannot be positioned over a docked window e Unless the Output window is floating in the main window a window specified as an MDI child cannot be positioned over the Output window Standard Windows Buttons The standard Windows buttons are located on the right side of the title bar as shown in Figure A 22 Project MyProject dpj fir_fr16 asm MIEJ Eg Figure A 22 Example Title Bar Showing Standard Window Buttons These buttons resize and close the window as described in Table A 19 A 42 VisualDSP 5 0 User s Guide Reference Information Table A 19 Standard Windows Buttons Button Name Purpose Minimize reduces the window to its Windows icon Maximize enlarges the window to fill the screen Restore returns the window to its last non minimized non maximized nat position after you maximize the window Close closes the application window and exits the program m x xX VisualDSP 5 0 User s Guide A 43 Text Operations Text Operations VisualDSP allows the use of regular expressions and tagged expressions in find replace operations and comments in your code Regular Expressions vs Normal Searches Normally when you search for text
117. ar A 44 tagged A 47 tracking 2 69 tracking in memory windows 2 67 viewing value of 2 24 Expressions window about 2 50 valid expressions 2 51 external interrupts generating 3 17 simulating 1 16 eye diagrams about 3 23 example of 3 23 EZ KIT Lite evaluation systems as targets 1 16 flash drivers 3 30 planning 1 15 specifying as platform 3 2 F fatal errors 2 31 features new in VisualDSP 5 0 1 7 project management 1 4 VDK 1 6 VisualDSP 1 1 file building options 1 25 1 6 VisualDSP 5 0 User s Guide files asm 2 14 assembly 1 30 association with tools 2 14 automatic placement 2 15 building 1 58 1 59 c 2 14 cache events log 2 95 compiler 1 28 cpp 2 14 cxx 2 14 data 1 30 dlb 2 14 doj 1 31 2 14 dpg 1 49 dpj 1 43 dsp 2 14 DSP project A 12 executable 1 32 extensions in VisualDSP A 12 keyboard shortcuts A 31 A 32 A 36 language 1 30 df 1 30 1 32 1 33 2 14 linker 1 31 1 32 list of A 12 log 2 38 2 39 mak 1 51 mk 1 51 nested folders in Project window 2 6 object 1 31 options 1 26 overlay 1 31 placing into folders automatically 2 6 processor definition files 2 83 project 2 8 project group 1 49 Project window rules 2 13 PROM 1 41 1 42 s 2 14 vdk_config cpp 2 4 INDEX vdk_config h 2 4 VisualDSP_log txt 2 39 vps 2 110 2 115 xml 2 82 file tree 2 2 icons 2 2 Project window 2 2 filling memory 2 67 filtering
118. ard Delete text Backspace selection or backward Move text Select with cursor and drag Move selected text right one tab Tab Move selected text left one tab Shift Tab Paste text Ctrl V or Shift Insert Undo the last edit Ctrl Z or Alt Backspace Redo an edit command Shift Ctrl Z Replace text Ctrl H or Ctrl R VisualDSP 5 0 User s Guide A 33 Keyboard Shortcuts Selecting Text Within a File To select text within a file use the keyboard shortcuts listed in Table A 11 Table A 11 Keyboard Shortcuts for Selecting Text Within a File Action Key s Select all text in a file Crrl A Select the character on the left Shift Left Arrow lt Select the character on the right Shift Right Arrow gt Select all text to the beginning of the file Shift Ctrl Home Select all text to the end of the file Shift Ctrl End Select all text to the beginning of the line Shift Home Select all text to the end of the line Shift End Select all text to the line below Shift Down Arrow 4 Select all text to the line above Shift Up Arrow Select all text to the next page Shift PgDn Select all text to the above page Shift PgUp Select the word on the left Shift Ctrl Left Arrow lt Select the word on the right Shift Ctrl Right Arrow gt Select by column Place cursor pres
119. ared memory sm executable files contain sections of code that other processor VisualDSP 5 0 User s Guide 1 31 Code Development Tools executable dxe files link against Through this process a shared item is available to multiple executable files without being duplicated link objects Object files doj that become linked and other items such as executable dxe sm ov1 files that are linked against LDF file File that contains the commands macros and expressions that control how the linker arranges your program in memory memory Definitions that provide a description of your target processor sys tem to the linker overlays Files that your overlay manager swaps in and out of run time memory depending on code operations The linker produces overlay ov1 files sections Declarations that identify the content for each executable file that the linker produces For detailed information refer to the VisualDSP Linker and Utilities Manual or VisualDSP Help Linker Description File ldf A Linker Description File 1df describes the target system and maps your program code with the system memory and processors 1 32 VisualDSP 5 0 User s Guide Introduction to VisualDSP The 1df file creates an executable file by using e The target system memory map e Defined segments in your source files The parts of an 1df file from the beginning to the end of the file are described as f
120. as been done Warnings and error messages may also appear in the Output window SCC applications provide dialog boxes and GUI displays for some file operations such as show history show difference and show properties These operations can be run from VisualDSP For complete details refer to VisualDSP Help Makefiles Use a makefile mak or mk to automate builds within VisualDSP The output make rule is compatible with the gnumake utility GNU Make V3 77 or higher or other make utilities VisualDSP generates a project makefile that controls the orderly sequence of code generation in the target You can also export a makefile for use outside of VisualDSP For more information about makefiles go to http www gnu org manual make A project can have multiple makefiles but only one makefile can be enabled active The project in Figure 1 10 includes an active makefile indicated by Er The active makefile with its explicit gmake command line builds the project When no makefile is enabled for a project VisualDSP uses specifications configured in the Project Options dialog box VisualDSP 5 0 User s Guide 1 51 Processor Projects Project 21060 9 5 dpj BEJ Source Files Header Files E Linker Files En dot_product_asm mak a TS Project Figure 1 10 Makefile in Project Window You can view a makefile s command line To change the makefile s target use the Configurat
121. asteidais ascesvinaantdodiasuiadacainvaess 2 31 Syntax of Help for Error Messages sesnuseainissnsens 2 32 Viewing Error Message Details penuccccssioreeronsrana 2 33 Promoting Demoting and Suppressing Error Messages 2 35 Example 1 Compiling from the Command Line Interface 2 36 Example 2 Promoting Warnings to Errors 0 0 2 36 Example 3 Demoting Messages to Remarks 004 2 37 Example 4 Suppressing Messages yeisccicossnniisncserecensersnns 2 37 viii VisualDSP 5 0 User s Guide CONTENTS Suppressing Compiler Warnings and Remarks 2 37 Ei alg See nT eer mee E eer en ee 2 38 Output Window Customization gags cscs cstv ca stecnsd eau anscdacacuece 2 38 i Meni srcani R 2 39 Senpi Command Outpt sccssrcaisreridrieiaka tiennie 2 40 Debugging Windowterisesennononaaea 2 43 Terence N RA 2 45 Other Disassembly Window Features scccscseneissscscerarcarcissis 2 47 ae Menu etc eed R eeeemned 2 48 Disassembly Window Symbols lt ccccsuscasossasneseeensercenceeeesns 2 49 Expressions WINdOW ans ated ns cine caaceieisanserrrniiereananiamneeniae 2 50 Expressions Permitted in an Expression Window 0 2 51 NB Fe oir eric 2 52 Locle Oe sosar 2 54 Sracistical Linear Profiling Window siete ss ssuteninnserendsnsecensswsuner 2 55 Window Components ssosdudarsasenai dninn a E 2 55 Leit Pane norcripornkitenkinr ia airina 2 56 Righe Tais srsprnanr ir 2 56 Statis Bar sirara ki eerie ons 2 57 Rie kecik Memi se
122. at A 2 6 Trojet PRE sarni EE 2 8 Project Window Icons for Source Code Control SCC 2 9 Project Page Right Click Menus acrinicsnimcrgniniensinians 2 10 Project Group loon Right Click Ment acscacscssecnserecssnceenees 2 10 Project loon Righe Click Meni ancicuscnminmuniemencians 2 11 Polder loom Righe Click Meni scissiscvsavcatsixancesanicssdnatsansesivs 2 12 Fil Icon ge Menu sectioreenonerinernomatemones 2 12 Projecte Window Rules seca oan ieddcedestereencomesnaence 2 13 Pile Ass ciatoni xcaicarieiiciniccaianmmnrcthnbGadaun a kaine 2 14 Auconiatic Pile Placement sccniscenincmnnnienaarmiinss 2 15 Pile Veet Kiei cece ei 2 15 Pete sa eee E E T T 2 16 Paot IE an cdedensiaae nates sels naeamnsnonnitantaleadeesipenolametane 2 16 VisualDSP 5 0 User s Guide vil CONTENTS Editor SRC BAO pains eee a 2 17 Editor Window Symbols ascidian 2 18 Donki o ensia 2 19 oynar o OTNES sors eee 2 19 Viewing Modes Source Mode vs Mixed Mode nnssscseesecnes 2 20 BOWIE MOTE cosir E 2 20 De Node eee ra 2 20 Editor Tab Mode srereonrii re rara E EEEE 2 21 Context Sensitive Expression Evaluation iesssrserssrressrecnss 2 23 Kene a Expro iON aoe A 2 24 Highlighting an Expression siisisisiidaridsccrbiaeciieiudd aeeamiesacis 2 24 Coop dor SANG eee N 2 24 Pent kor Meni osrin i 2 27 danai ew ian a 2 28 Bwild Page and Console Pape scrnosnonivniiaiea 2 29 Code Development Tools Batch Processing Messages 2 31 Message Severity Hierarchy scic
123. ating on Multiprocessor Groups For example if a session contains three processors A B and C and a group is created that contains A and C Running the MP Run command runs A and C only and B remains unaffected Focus Processor focus changes depending on the window currently selected To move focus among the processors click on a processor listed in the Multiprocessor window Figure 2 56 You can pin a register window a memory window or Disassembly win dow to a specific processor Select the processor in the Multiprocessor window and right click in the window that you want to pin Then choose Pin to Processor to lock the window to the selected processor A window pinned to a processor always displays that processor s data regardless of the currently focused processor For example if a register window is pinned to Processor 1 and a memory window is pinned to Processor 2 selecting the register window moves the focus to Processor 1 Selecting the memory window moves the focus to Processor 2 The Multiprocessor window s Status page reflects the change in focus 2 86 VisualDSP 5 0 User s Guide Environment Right Click Menu The Multiprocessor window s right click menu Figure 2 59 offers these commands Add New Group Rename Group Delete Group Select All Processors Unselect All Processors Allow Docking Hide Float in Main Window Add New Group Rename Group Delete Group Select All Processors Uns
124. attach to and control the operation of any Analog Devices processors or simulator Download your application code to the processor and use VisualDSP s debugging facilities to ensure that your application functions as desired 1 20 VisualDSP 5 0 User s Guide Introduction to VisualDSP VisualDSP is a window into the inner workings of the target processor or simulator From this user interface you can e Run step and halt the program and set breakpoints and watchpoints e View the state of the processors memory registers and stacks e Perform a cycle accurate statistical profile or linear profile e Perform integrated multiprocessor debugging emulator sessions only VisualDSP 5 0 User s Guide 1 21 Project Development VisualDSP Kernel A project can optionally include the VisualDSP Kernel VDK which is a software executive between algorithms peripherals and control logic The Project window s Kernel tab accesses a tree control for structuring and scaling application development From this tree control you can add modify and delete Kernel elements such as thread types boot threads round robin priorities semaphores events event bits interrupts and device drivers Two VDk specific windows VDK State History and Target Load pro vide views of VDK information Another VDK window VDK Status provides thread status data when a VDK enabled program is halted Refer to the VisualDSP K
125. be downloaded and debugged from within the VisualDSP environment Emulator software performs the communications that enable you to see how your code affects processor performance event A signal similar to a semaphore or message used to synchronize multiple threads in a system An event is a logical switch having two binary states available true and unavailable false that control thread execution When an event becomes available all pending waiting threads in the wait list are set to a ready to run state When an event is available and a thread pends on it the thread continues running and the event remains available To facilitate error handling threads can specify a timeout period when pending on an event VisualDSP 5 0 User s Guide A 71 Glossary An event is a code object of global scope so any thread can pend on any event Event properties include the Event8it mask EventBit value and combination type Events are statically allo cated and enumerated at run time An event cannot be destroyed but its properties can be changed event bit A flag set or cleared to post the event The event is posted available when the current values of the system Event Bits match the event bit s mask and event bits values defined by the event s combination type A system has only one Event Bits word the size of a data word minus one For ADSP TSxxx processors the size is 31 bits executable file A file or program w
126. by mail to Analog Devices Inc One Technology Way P O Box 9106 Norwood MA 02062 9106 USA xxvi VisualDSP 5 0 User s Guide Preface Supported Processors The following is the list of Analog Devices Inc processors supported in VisualDSP 5 0 TigerSHARC ADSP TSxxx Processors The name TigerSHARC refers to a family of floating point and fixed point 8 bit 16 bit and 32 bit processors VisualDSP currently supports the following TigerS HARC processors ADSP TS101 ADSP TS201 ADSP TS202 ADSP TS203 SHARC ADSP 21xxx Processors The name SHARC refers to a family of high performance 32 bit floating point processors that can be used in speech sound graphics and imaging applications VisualDSP currently supports the following SHARC processors ADSP 21020 ADSP 21060 ADSP 21061 ADSP 21062 ADSP 21065L ADSP 21160 ADSP 21161 ADSP 21261 ADSP 21262 ADSP 21266 ADSP 21267 ADSP 21362 ADSP 21363 ADSP 21364 ADSP 21365 ADSP 21366 ADSP 21367 ADSP 21368 ADSP 21369 ADSP 21371 ADSP 21375 Blackfin ADSP BFxxx Processors The name Blackfin refers to a family of 16 bit embedded processors VisualDSP currently supports the following Blackfin processors VisualDSP 5 0 User s Guide xxvii Product Information ADSP BF531 ADSP BF532 ADSP BF533 ADSP BF535 ADSP BF561 ADSP BF534 ADSP BF536 ADSP BF537 ADSP BF538 ADSP BF539 ADSP BF522 ADSP BF525 ADSP BF527 ADSP BF542 ADSP BF544 ADSP BF548 ADSP
127. ces similar to those found on EZ KIT Lite boards You may write your own flash drivers by following this API specification This allows you to implement new algorithms modify existing ones or add support for a new flash device processor combination with the current Flash Programmer Flash drivers may be implemented in C or assembly language To provide a completely generic flash loader interface the VisualDSP Flash Programmer API uses a set of named symbols their associated addresses and a few numbered commands Stand Alone Flash Programmer The Stand Alone Flash Programmer provides flash programming support between the development prototype stage and early pre production runs Because of shortened development cycles and component lead times it is often necessary and desirable to build a large quantity of boards for early evaluation Typically these builds are on the order of a hundred or fewer units Programming each unit with the beta production image via VisualDSP is typically performed by a manufacturing technician worker rather than the development engineer The Stand Alone Flash Programmer enables the development engineer to script or automate this process with a license free tool allowing the manufacturing technician to repeatedly program any number of boards prior to major production Refer to online Help for details 3 28 VisualDSP 5 0 User s Guide Debugging Flash Devices Flash memory parts are non vola
128. ch enables you to use the Microsoft Common Source Code Control MCSCC interface to connect the VisualDSP IDDE to SCC applications installed on your machine Various SCC products such as Microsoft Visual SourceSafe or PVCS Version Manager support the MCSCC interface From VisualDSP interface you can access the commonly used features of these applications without leaving the IDDE You can launch the SCC application from the plug in menu to use non supported features When you create a project you are prompted to add the project to SCC When you open a project in the IDDE the SCC plug in connects to the selected SCC application and locates a controlled copy of the project and its source files If a controlled copy is not located the SCC application must locate it Typically you are queried to browse for it If the controlled copy is successfully found or added the plug in keeps its application spe cific path in the project file and reconnects with this path in the future You can subsequently reconnect to the controlled copy without having to browse for it Operations executed on large numbers of files tend to take longer to fin ish A message box provides status information by displaying the operation currently executing A button on the message box cancels the operation 1 50 VisualDSP 5 0 User s Guide Introduction to VisualDSP The Output window s Console view displays finished operations Mes sages indicate what h
129. ciated range of values Flash Programmer The VisualDSP Flash Programmer provides a convenient generic inter face to numerous processors and flash memory devices This utility simplifies the process of changing data values on a flash device and modi fying its memory You no longer have to remove the flash memory from the board use a separate Flash Programmer and then replace the flash 3 26 VisualDSP 5 0 User s Guide Debugging 3 Spectrogram Example Spectrogram Example pE U E D4 e 10 15 Frequency kHz Spectrogram Plot FFT Figure 3 9 Spectrogram Plot For complete details on using the Flash Programmer utility refer to VisualDSP Help Beginning with VisualDSP 5 0 the Stand Alone Flash Programmer provides flash programming support between the development prototype stage and early pre production runs Refer to VisualDSP Help for details Flash Programmer API The VisualDSP Flash Programmer API provides a generic interface between the VisualDSP Flash Programmer and the flash driver To use this tool you must load an accompanying flash driver into the processor The flash driver is the processor executable code that handles commands from the Flash Programmer and actually manipulates the flash VisualDSP 5 0 User s Guide 3 27 Flash Programmer Analog Devices supplies sample flash drivers for use with EZ KIT Lite evaluation systems or custom hardware that uses flash devi
130. cify and activate a debug session When launching VisualDSP in stand alone mode ensure that the session is configured correctly before loading the program 3 10 VisualDSP 5 0 User s Guide Debugging Loading the Executable Program Once you have specified the debug session begin the session by loading the executable program After a successful build of the target executable program VisualDSP if configured loads the program automatically to the current session when the session processor type matches the project s processor If the cur rent session processor does not match the project s processor type you are prompted to choose another session If automatic load is not configured VisualDSP does not try to load the executable program automatically after a successful build The target must be an executable DXE file This debugging feature saves time because you do not have to load the executable target manually You can start to debug immediately after successfully building the project Program Execution Commands Run program execution commands from the Debug menu or from the toolbar Executable files run until an event such as a breakpoint watchpoint or user issued Halt command stops execution When program execution halts all windows are updated to current addresses and values Multiprocessor MP commands operate like single processor commands with one exception they perform an action on all
131. cify properties buffer and display depth display format column widths grid lines and the appearance of stages for the Pipeline Viewer window You can also modify window colors VisualDSP 5 0 User s Guide 2 89 Debugging Windows Pipeline Viewer Properties Dialog Box From the Pipeline Viewer Properties dialog box you can specify how the Pipeline Viewer window displays pipeline events Display is specified in depth and format Table 2 20 describes the Pipeline Viewer properties Table 2 20 Pipeline Viewer Properties Property Item Purpose Buffer depth Specifies the total number of pipeline samples to retain at any time When this buffer overflows the oldest data shifts out to make room for new samples The default is 100 Display depth Specifies the number of samples to display Adjust this number to meet your performance needs The lower the depth the faster the target can run This option cannot be set greater than the Buffer depth The default is 20 Display format Specifies the data s format Address includes the hexadecimal formatted address of the pipe line stage for example 0x1234 Disassembly includes the opcode mnemonic similar to the for mat displayed in a Disassembly window Opcode format is the hexadecimal representation of the disassem bly mnemonic Show gridlines Toggles the display of gridlines in the window The default is On Auto size columns Automatically s
132. code Address E _E Execute2 Execute3 Writeback aj 149 R4 Pl I0 RS FE Pi H Ox E 150 BO R4 R4 P1 P1 L Ox P1 H Ox K 151 LO start_memdmaqu BO R4 F RS hifi Pilze P1 L Ox P1 H Oxff80 152 0 8 X L0 star EF Io RS RS f Pi P1 L 0x400 153 R4 L W I0 MO 8 R4 Pl I0 R5 R5 Pl 154 S R4 L W I0 ho B0 R4 R4 P1 I0 RS 155 Details for stage Decode cycle 154 B L0 star B0 R4 R4 Pi 156 e aL iiei v BHE mo 38 LO star BO R4 157 Event 0 FB B M0o 8 LO start_mendn Type Stall i FB B MO 8 X Cause Sequencer or Memory stalls 26 i t R4 L W B B xl Details DAG Read After Write Hazard Figure D 4 RAW Hazard Stall D 20 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors These stalls are detected in the Decode stage The instruction stalls until all the required DAG registers which are updated in later pipeline stages are available In the example 10 R5 in the Execute3 stage is stalling the instruction in decode which wants to increment 10 Figure D 5 shows an MMR stall p ewe mile Es Cycle Decode Address Executel Execute2 Execute3 Writeback a 53 PO RO H 96 RO L 228 RO H 96 RO L 226 54 RO L 230 PO RO H 96 Details for stage Executel cycle 53 RO H 96 e z a Address Oxf
133. commonly used commands round robin scheduling For VDK a scheduling scheme whereby all threads at a given pri ority are given processor time automatically in fixed duration intervals Round robin priorities are specified at build time scheduler For VDK a kernel component responsible for scheduling system threads and interrupt service routines VDK is a priority based kernel in which the highest priority thread is executed first scripting You can interact with the IDDE by using a single command or a script file Scripting languages include VBScript JavaScript and Tcl Output displays in the Console view of the Output window The output is also logged to the VisualDSP_log txt file semaphore For VDK a signal similar to an event or message used to synchro nize multiple threads in a system A semaphore is a data object whose value is zero or a positive integer limited by the maximum setup at creation time The two states available greater than zero and unavailable zero control thread execution Unlike an event A 82 VisualDSP 5 0 User s Guide Reference Information whose state is automatically calculated a semaphore is directly manipulated Posting a semaphore takes a deterministic amount of time and may incur a context switch serial port data You can automatically transfer serial port SPORT data to and from on chip memory by using DMA block transfers Each serial port offers a time division multip
134. cs that contain the literal phrase note the quotation project window and all its grammatical varia characters tions project window Without the quotation characters the query is equivalent to specifying project AND window which finds topics containing both of the individ ual words instead of the phrase Wildcard link Locates topics that contain the terms linker expressions linking links and so on The asterisk cannot or be the only character in the term C2 Locates topics that contain the terms cpp or cxx The question mark cannot be the only character in the term Boolean Operators Use the Boolean AND OR NOT and NEAR operators to precisely define your search by creating a relationship between search terms Insert a Boolean operator by typing the operator AND OR NOT or NEAR or by clicking the arrow button When no operator is specified AND is used For example the query call stack is equivalent to call AND stack VisualDSP 5 0 User s Guide A 63 Online Help Table A 29 describes the results of using Boolean operators to define a search Table A 29 Examples Boolean Operators Used to Define a Search Search Target Example Results Both terms in the same new AND plot Locates topics that contain both the words topic new and plot Either term in a topic new OR plot Locates topics that contain either the wo
135. csccesnisasonerrnien 3 10 Loading the Execurable Program scien cascnsedsiosancnaicdanddndieasensiyensve 3 11 Progtam Execution Commands asrcesssnsnriiorsnsneniiik 3 11 Restarting the PIOGEN ccc neice nme 3 12 Performing a Restart During Simulation ccccecxsssecererenncesees 3 12 Performing a Restart During Emulation iscsccisiciisarsavaivars 3 13 Preap eean EA NEAN 3 13 Unconditional and Conditional Breakpoints esee 3 14 Automate Brea bots scicieriecasctancicenichaneeuaciminaesicg 3 14 Oh ese oie deen 3 15 Hardware Tie oie 3 16 A rS 3 16 ROOTS T E E E E E einen 3 16 Smo ita aa A 3 16 RERUNS cistenia oi ai 3 17 lapur Ourpart Simulation Data Streams onersinirnrioineine 3 17 VisualDSP 5 0 User s Guide xiii CONTENTS PO EE A E E eee 3 19 L E E E A TE NE A EE R R EN 3 20 Line TIE ame mv nnan a AAA A 3 21 pS DO aan A ee emer rere Sr 3 21 Constellation Plots sci cirncutieunuiinsiersiiialencensntiecueicane 3 22 Eye Diagram soit ctcstsstcneeeiereeeeenene 3 23 1 tear PGE gni R ea ee 3 24 Spectrogram FS sereins norin 3 26 Flashi Propran nei arna R S 3 26 Stand Alone Flash Programmer siisicecsscecsnssiensnesinendensuanencouier 3 28 Flash Devices doranner a aaia 3 29 Flash Progtanimer Fonerions sersnciiecnn i renn 3 29 Fash Dror nenene 3 30 Flek Programmer Window osorciaaenidnon a 3 30 Enere p Anrare RN einan 3 31 Pan kE eo E TRR 3 31 Erap cainiabdiascasuinaaiadeceiaeapead inmiaoaraacanuiatanddets a eiii 3 31 REFERENCE INFORMATION
136. ctives that tell the assembler how to process source code and set up processor features Use directives to structure your program into logical segments or sections that support the use of a Linker Description File 1df to construct an image suited to the target system For detailed information refer to the VisualDSP Assembler and Preprocessor Manual or VisualDSP Help 1 30 VisualDSP 5 0 User s Guide Introduction to VisualDSP Linker The linker links separately assembled files object files and library files to produce executable dxe files shared memory sm files and overlay ov1 files which can be loaded onto the target The linker s output files dxe sm ov1 are binary executable and link able files ELF To make an executable file the linker processes data from a Linker Description File 1df and one or more object doj files The executable files contain program code and debugging information The linker fully resolves addresses in executable files To specify linker options choose Project gt Project Options and click Link tab on the Project Options dialog box From the Link page select a Category of options Linker options are grouped into the following subpages e General e LDF Preprocessing e Elimination e Processor Linker terms are defined as follows link against Functionality that enables the linker to resolve symbols to which multiple executables refer For instance sh
137. d as a percent The order of the items in the display is determined by the percentage of global execution time for each item The left pane includes the information described in Table 2 14 Table 2 14 Left Pane Information Column Displays Purpose Histogram Horizontal bars Graphically represents the execution percentage A percent with two decimal Displays execution in percent or as a or places for example count Right click and choose View Count Execution Percent to view execution 15 01 as a percent or choose View Sample or Count to view the PC sample count a number Execution Unit Functions assembly source lines These items are sorted by the percent and PCs for which no debug age of global execution time that each information exists item took to execute The highest per centage items appear at the top of the list Double clicking on a line with a function or assembly source line in the left pane displays the corresponding source file in the right pane The top of the function or assembly source line is shown in the source file If you double click on a PC address with no debug information the Disassembly window opens to that address Right Pane The right pane includes the information described in Figure 2 15 2 56 VisualDSP 5 0 User s Guide Environment Table 2 15 Information in the Right Pane Column Displays Execution percent in text format wit
138. de and rebuild the project Disassembly windows provide e Number format and edit features similar to register windows e Dump and fill capabilities e Symbols at the far left of the window denoting program execution stages and pipeline stages 2 46 VisualDSP 5 0 User s Guide Environment You can enable and disable the display of pipeline symbols in mixed mode C C and assembly e An optional address bar that enables you to navigate to an address symbol or expression The address bar maintains a most recently used history of visited locations To display the address bar right click in a Disassembly window and choose Address Bar A check mark next to this option on the right click menu indicates that this feature is enabled By default the current source line to be executed is highlighted by a light blue horizontal bar as shown in Figure 2 29 gt 003005 jump fftrad2 db Figure 2 29 Example Current Source Line in the Disassembly Window The color of the current source line and other window items are user con figurable Refer to VisualDSP Help for detail Other Disassembly Window Features From the Disassembly window you can perform the operations described in Figure 2 11 Table 2 11 Disassembly Window Operations To Place the mouse pointer over Move to a different address Insert or remove a break point An address field and double click Then select the address fr
139. dency file used by the assembler for data initialization dlo Debugging files Binary output files from the linker in dxe ELF DWARE format ovl sm A 12 VisualDSP 5 0 User s Guide Reference Information Table A 2 Files Used With VisualDSP Cont d Extension Name Purpose map Linker memory map file Optional output for the linker This text file contains memory and symbol infor mation for executable files tcl Tool Command Language Tcl scripting language files used to script tc8 files work obj Assembled object file Previous releases only replaced by doj Output of the assembler lst Listing file Optional file output by the assembler bnm Loader format files The loader s output in ASCII format wh Different varieties exist Used to create ldr boot PROMS h_ PROM format files The loader s output in ASCII format S_it Different varieties exist Used to create Stk boot PROMs ach Architecture file Used in previous releases only replaced by 1df txt Linker command line file Used in previous releases only replaced by 1df ASCII text file that contains command line input for the linker exe Debugging file Used in previous releases only replaced by DXE exe Compiled simulation file Enables faster execution speed compared to a standard dxe program vdk VisualDSP kernel Enables VDK support support file js Script files Enable you to
140. determine the build order VisualDSP maintains a makefile which stores dependency information for each file in the project VisualDSP updates dependency information when you change the project s build options add a file to the project or choose Update Dependencies from the Project menu Step 4 Specifying Project Build Options After creating a project setting the target processor and adding or editing the project s source files configure your project s build options Specify options or accept the default options in VisualDSP before using the 1 24 VisualDSP 5 0 User s Guide Introduction to VisualDSP development tools that create your executable file You can specify options for a whole project or for individual files or you can specify a custom build VisualDSP retains your changes to the build options Settings reflect your last changes not necessarily the original defaults Configuration A project s configuration setting controls its build By default the choices are Debug or Release e Selecting Debug and leaving all other options at their default set tings builds a project that can be debugged The compiler generates debug information e Selecting Release and leaving all other options at their default set tings builds a project with limited or no debug capabilities Release builds are usually optimized for performance Your test suite should verify that the Release build operates correctly w
141. dialog box also called property pages provides access to project options which enable the corresponding build tools to process the project s files correctly Step 3 Add and Edit Project Source Files A project normally contains one or more C C or assembly language source files After creating a project and defining its target processor add new or existing files to the project by importing or writing them Use the VisualDSP editor to create new files or edit any existing text files VisualDSP 5 0 User s Guide 1 23 Project Development Adding Files to Your Project You can add any type of file to the project The development tools selec tively process only recognized file types when you build the project Creating Files to Add to Your Project You can create new text files The editor can read or write text files with arbitrary names Adding files to your project updates the project s file tree in the Project window Editing Files You can edit the file s that you add to the project To open a file for editing double click on the file icon in the Project window The editor has a standard Windows style user interface and supports normal editing operations and multiple open windows You can customize language and processor specific syntax coloring and create and search for bookmarks Managing Project Dependencies Project dependencies control how source files use information in other files and consequently
142. dniniirsirisiikeriininerii D 20 Maulticycle Instructions and Latencies serintsaserisintioiainire D 22 TCC losticions errea eens D 22 Push Multiple or Pop Multiple sisisersrisiniisnrerapanena D 22 32 Bit Mul ply modulo 232 scoruri D 23 Caland TO cser REA D 23 Conditional Branch sarioroaroriorokanrariaravieaiavieni D 23 ea a E aa E N S D 24 Core and System Synchronization sssscssercecawisneniss D 24 LE T EN E E E D 25 Tarerupie and FI sscis censeasncetnrsieodarenionsaercensens D 25 xx VisualDSP 5 0 User s Guide CONTENTS TE ISET orron a D 25 RiGee i Laienes cesses sree nanan aa D 26 Accumulator to Data Register Latencies oi cccccccnsresscowsivecsntes D 27 Recieter Noye Larendies seratina OREA D 28 Move Conditional and Move CC Latencies c cceeeeeee D 30 Loop Senip latencies csrinasssssronisarenin D 31 Latencies Due to Instructions Within Hardware Loops D 32 Instruction Alignment Unit Empty Latencies 064 D 33 LI Dats Memory Stills ee ee D 34 Minibank Access Collision ssssrireiersnnnrreniiiirei D 35 SRAM Access cle Stall ies startineinsiiioaancsabicateneis D 35 Cache Access 1 Cycle Stall scccivcm nicest D 36 Memory Mapped Register MMR Access ossessi D 39 System Minibank Access Collision irusriricisrirersiisiisiis D 39 Store Buffer Oyerflow ss ss cs ecsnssncenindentncaeestunodontbedonsuncmaedes D 39 Store Buffer Load Collision cccsanicsroaccccepanmrmsennens D 40 Load Score Size Mismatch sunisnicsnesi
143. dxe program has been loaded for debugging you can evaluate expressions in an editor window As you move the mouse pointer over a variable with the pointer still on top of the variable VisualDSP evaluates the variable If the variable is in scope the value appears in a tool tip window VisualDSP 5 0 User s Guide 2 23 Editor Windows Viewing an Expression Expressions can be viewed in different ways When the editor window is in mixed mode view an expression by moving the pointer over a register in an assembly instruction The register contents are displayed in a tool tip Highlighting an Expression Highlight an expression in the editor window and then move the pointer on top of the highlighted expression to display its value in a tool tip Compiler Annotations When enabled the compiler can perform a large number of optimizations in order to generate the assembly code The decisions taken by the com piler as to whether certain optimizations are safe or worthwhile may be viewed This information can help you understand how close to optimal a program is and what can be done to improve the generated code For more information about optimizing code refer to your processor s VisualDSP C C Compiler and Library Manual The compiler optimizer s feedback is provided as annotations made to the assembly file generated by the compiler You can view compiler annota tions in C C files in editor windows The annota
144. e 00 00 00 Enabled Figure 2 41 Profiling Results After Filtering Call Stack Window The Call Stack window enables you to double click on a stack location to move the call stack back to a previous debug context Open this window by choosing View Debug Windows and Call Stack The Call Stack window cannot be guaranteed to provide correct information when code does not adhere to compiler standards Two such instances are when main is not used or when _lib_prog_term or exit is not used The unrolling of the stack depends on the existence of these points if they do not exist the stack may unroll beyond the valid frames Use the Call Stack window to analyze the state of parent functions when erroneous data is being passed to the currently executing function and to see the context from which the current function is being called Double clicking on an item in the Call Stack window opens an editor window if the source is known or the Disassembly window if it is not already open and jumps to the specific item in the Call Stack window VisualDSP 5 0 User s Guide 2 63 Debugging Windows Use this debugging feature by walking up the call stack and viewing local variables in different scopes Use this window to analyze the state of par ent functions when erroneous data is being passed to the currently executing function and to see the context from which the current function is being called The Call Stack window provides call s
145. e it is not unique and is not reported Fire All logs every occurrence of the event Severity This option specifies the degree of the event INFO writes a message in black typeface to the Output window WARN writes a message in black typeface to the Output window ERROR writes a message in red typeface to the Output window and rings a bell FATAL writes a message in red typeface to the Output window and rings a bell Event Actions Print writes messages to the Output window Halt stops processing after the event has occurred This option is similar to using a watchpoint Enabled Enables this event check Verbose Specifies that multi line messages are written to the Output window When this option is not selected messages are one line long 4 Click OK VisualDSP 5 0 User s Guide B 9 Select Processor ID Options Select Processor ID Options For ADSP 2106x or ADSP 2116x processors only you can configure the simulator processor ID Select Single Processor or a particular processor in a multiprocessor group for example Processor 1 Processor 2 and so on Simulator Options The Simulator submenu under the Settings menu provides the CLKDBL command for ADSP 21161 processors only Use this command to double the clock speed circuitry Clock doubling lets you set control bits but it does not affect how the simulator runs You can configure the processor s CLKOUT pin to be 1x or 2x t
146. e A 3 displays a list of your system s components and provides information name version provider about your debug target symbol manager and processor library Figure A 3 Example of the Components Page A 4 VisualDSP 5 0 User s Guide e Software Versions The Versions page Figure A 4 displays a list of your system s tools Each tool includes a description version number and a timestamp day and time Reference Information Acc21k exe Accblkfn exe ccts exe coff2elf exe commentconyerter exe danube exe easm21k exe easmBLKFN exe easmT S exe 12 20 2005 06 18 12 20 2005 06 18 12 20 2005 06 18 12 20 2005 06 18 12 20 2005 06 18 12 20 2005 06 18 12 20 2005 06 18 12 20 2005 06 18 12 20 2005 06 18 Figure A 4 Example of the Versions Page VisualDSP 5 0 User s Guide A 5 Support Information e Links to support on the Web The Support page Figure A 5 provides direct links to various Web pages that contain support information such as application notes code examples the DSP Knowledgebase processor and tools anomalies and workarounds manuals and data sheets product comparisons tools updates and more You can also generate the body of an e mail that automatically contains your system s description gt About Figure A 5 Example of the Support Page A 6 VisualDSP 5 0 User s Guide Reference Information IDDE Command Line Parameter
147. e Using ActiveX and COM Automation to create regression test environments and taking advantage of interoperability with other applications Project Development Stages The typical project includes three phases simulation evaluation and emulation These phases are shown in Figure 1 1 Simulation No hardware is required EZ KIT Lite Board STATIN A Emulation rog nh Figure 1 1 Project Development Stages VisualDSP provides debugging tools for each of these phases refer to Table 1 2 on page 1 20 1 14 VisualDSP 5 0 User s Guide Introduction to VisualDSP Simulation Project development typically begins in a simulation environment while hardware engineers are developing the new hardware cell phone com puter and so on Simulation mimics system memory and I O which allows portions of the target system hardware behavior to be viewed A simulator is software that mimics the behavior of a processor Running VisualDSP with a simulation target without a physical processor enables you to build edit and debug your program even before a proces sor is manufactured Evaluation Use an EZ KIT Lite evaluation system in your project s early planning stage to determine the processor that best fits your needs Your PC con nects to the EZ KIT Lite board via a cable enabling you to monitor processor behavior Emulation Once the hardware is ready move directly to a JTAG emulator which connects
148. e development tools to process your project and to produce a processor program It also provides a source code control SCC interface which enables you to access SCC applications without leaving the IDDE 1 4 VisualDSP 5 0 User s Guide Introduction to VisualDSP Debugging Features While debugging your project you can View and debug mixed C C and assembly code View C C source code interspersed with assembly code Line number and symbol information help you to source level debug assembly files Run command line scripts Use scripts to customize key debug ging features Use memory expressions Use expressions that refer to memory Use breakpoints to view registers and memory Quickly add and remove and enable and disable breakpoints Set simulated watchpoints Set watchpoints on stacks registers memory or symbols to halt program execution Statistically profile the target processor s PC JTAG emulator debug targets only Take random samples and display them graph ically to see where the program uses most of its time Linearly profile the target processor s PC Simulation only Sample every executed PC and provide an accurate and complete graphical display of what was executed in your program Generate interrupts using streaming I O Set up serial port SPORT or memory mapped I O Create customized register windows Configure a custom register window to display a specified set of registers
149. e file can also be used to migrate a running dxe from an ICE to a simulator session to study a sequence in greater detail You can set a breakpoint just before the sequence of interest then export the core file and load it to the VisualDSP 5 0 User s Guide 1 7 VisualDSP Features simulator This assumes that the simulator shares the same set of registers with the ICE and can access all the memory blocks rele vant to the program as the ICE does Another benefit of this capability is in understanding the effects of a program sequence You can generate a core file step over a subroutine and then gen erate a second core file Then convert both core files to text file format and diff the files to show all the effects of the subroutine Categories in Help You can filter VisualDSP Help by setting a preference or by launching a particular category of Help via the Windows Start menu Now there are three processor specific Help categories one for each processor family and a complete Help that contains information about all processor families an automatic options displays Help for currently selected debug session Each Help category for example Blackfin processor family Help dis plays information pertinent to that specific family of processors By selecting a Help category in effect you remove information about other families of processors from Help this improves your ability to quickly locate information in He
150. e only in an editor window Performs multiple steps until the cur rent function returns to its caller and stops at the instruction immediately fol lowing the call to the function Restarting the Program You can set the Program Counter PC to the first address of the interrupt vector table Performing a Restart During Simulation In the simulator restart works like a reset however the target s memory does not change All registers are reset to their initial values Memory is not reset Thus C and assembly global variables are not reset to their original values Your program may behave differently after a restart To re initialize these values reload your DXE file 3 12 VisualDSP 5 0 User s Guide Debugging Performing a Restart During Emulation In the emulator a restart works exactly like a reset Only registers with default reset values are affected All other registers remain unchanged Breakpoints An enabled breakpoint halts program execution at a specific instruction or address You can enable and disable breakpoints as well as add and delete breakpoints A disabled breakpoint is set up but not turned on A disabled breakpoint does not stop program execution It is dormant and may be used later A break occurs when the conditions that you specify are met You can quickly place an unconditional breakpoint at an address in a Disassembly window or editor window by e Selecting an address a
151. e your code for optimal performance For TigerSHARC processors and Blackfin processors VisualDSP provides a simulation only debugging window Pipeline Viewer to help visualize the pipeline by displaying pipe line stalls and aborts For SHARC processors the Disassembly window displays symbols F D or E to indicate an instruction s pipeline stage platform The device with which a target communicates For simulation a platform is typically one or more processors of the same type For emulation you specify the platform with the VisualDSP config urator and the platform can be any combination of devices The platform represents the hardware upon which one or more devices reside You typically define a platform for a particular tar get For example if three emulators are installed on your system a platform selection might be emulator two Several platforms may exist for a given debug target For a simula tor the platform defaults to the identical processor simulator When the debug target is a JTAG emulator the platforms are the individual JTAG chains When the debug target is an EZ KIT Lite board the platform is the board in the system on which you wish to focus pre emptive kernel A priority based kernel in which the currently running thread of the highest priority is pre empted or suspended to give system resources to the new highest priority thread A 78 VisualDSP 5 0 User s Guide Reference Information
152. eading the CC register into a dreg and then RO CC reading that register CC RO Mac video after regmv Register move of a system register to a dreg fol RO LCO sysreg to dreg raw haz lowed by a MAC or video instruction R2 H R1 L RO H ard Regmvy sysreg to dreg Writing a system register to a dreg followed by RO LCO followed by ALU op an ALU operation using that dreg as an operand R2 R1 RO dreg raw hazard Video after extracted 3 input add dreg raw hazard Extracted 3 input add followed by special dsp32 instruction Search followed by exu operation dreg raw haz ard A search instruction followed by any execution instruction with an operand of a dreg used in the search instruction R3 R0 search R1 LE R2 H R1 L ROSH D 14 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Table D 7 Stalls Detected Messages ADSP BF535 Processor Cont d Message Explanation Example Regmv hazard preg to A register move of a preg to a dreg followed by RO PO dreg gt dreg to sys preg another register move of that same dreg to a sys ASTAT RO RAW tem register or preg Regmv hazard sysreg A register move of a system register to a dreg fol RO ASTAT to dreg gt dreg to dreg lowed by another register move of that same dreg R1 RO RAW to a dreg Regmv hazard sysreg A register move of a
153. ebug E Window smse Debug S e Debug Session Multiprocessor EEE A 20 VisualDSP 5 0 User s Guide Reference Information Table A 3 Built In Toolbars Name Toolbar User Tools PIPIAIAIAIAIAILAILALA Workspaces MIRE EEE EE To obtain information about a tool move the mouse pointer over the tool and press the keyboard s F1 key Toolbar Customization By default nine standard toolbars Table A 3 appear near the top of the application window below the menu bar You can change the appearance of toolbars by e Moving docking or floating the toolbars e Adding buttons to or removing from toolbars e Displaying large buttons You can also e Hide toolbars from view e Add and delete custom built toolbars User Tools Save time running commands by configuring user tools A maximum of ten user tools may be configured VisualDSP 5 0 User s Guide A 21 Parts of the User Interface A user tool runs a command which can e Contain parameters to launch an application e Bea script command Access configured user tools from the Tools menu or from the User Tools toolbar as shown in Figure A 13 Figure A 13 Default User Tools When a user tool is configured its menu name label appears in the Tools menu The label also appears when you move the mouse pointer over a user tool button Toolbar Buttons The toolbar comprises separate tool buttons and provides quick m
154. ected 000 minibank 1 0x0000 0x1000 001 minibank 2 0x1000 0x2000 010 minibank 3 0x2000 0x3000 D 36 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Table D 25 Minibanks Selected for 32KB of Data Bank Memory Addr 14 12 Minibank Selected 011 minibank 4 0x3000 0x4000 100 minibank 5 0x4000 0x5000 101 minibank 6 0x5000 0x6000 110 minibank 7 0x6000 0x7000 111 minibank 8 0x7000 0x8000 For simplicity this document assumes the standard 16 KB data memory model If the addresses in a dual memory access multi issue instruction is cached to the same minibank a 1 cycle stall is incurred IO is address 0x002348 I1 is address 0x002994 R1 R4 L R5 H IS R2 I0 I1 R3 lt 1 cycle stall gt due to a collision in minibank 3 A collision occurs regardless of whether the accesses are both loads or a load and a store If the first access is a load DAGO and the second is a store DAG1 the cycles incurred are seen by the store buffer see Store Buffer Overflow on page D 39 If Addr1 13 12 Addr2 13 12 a collision occurs Both Banks Are Configured as Cache If both banks are cacheable you must determine which superbank the accesses are cached to in addition to the minibank to determine whether a stall exists This information depends on the value of the DCBS bit of the DMEM_CONTROL memory mapped register If DCBS is
155. ed in all hardware pages If memory segments are located you are queried about whether to delete those segments b Creating a memory segment containing an overlay live space in each hardware page c Creating a memory segment containing all overlay run spaces in hardware page 0 d Creating a default mapping for each overlay The default mapping maps objects containing the section pmpage0 to the hardware overlay on PM page 0 pmpage1 to PM page 1 dmpage0 to DM page 0 and so on View Symbols Opens the View Symbols dialog box and displays the symbols for the project overlay or input section This command is available after you link the project and then right click on the Memory Map pane for a processor memory segment output section or input section Expand All Expands all items in the memory map tree to make their con tents visible View Legend Opens the Legend dialog box which shows all possible icons in the tree window with a brief description of each icon The Colors page displays a list of colors used in the graphical memory map You can specify each object s color View Global Properties Opens the Global Properties dialog box for the selected object The dialog box s title and content depend on the selected object Stack and Heap Usage Expert Linker enables you to adjust the size of the stack and heap and make better use of memory 1 38 VisualDSP 5 0
156. ed of multiple Help systems chm files Each file is identified with a book icon 2 in the software installation s Help folder The majority of the Help system files are VisualDSP manuals and hardware documentation These manuals are also available in PDF format on the installation disk for printing Manuals are also available from Analog Devices as printed books Each window toolbar button and menu bar command in VisualDSP is linked to a topic in Help Other portions of the VisualDSP Help system provide procedures for configuring and using tools Some chm files support pop up messages for dialog box controls buttons fields and so on These messages which appear in little yellow boxes comprise part of the context sensitive Help in VisualDSP For more information about the Help system refer to Online Help on page A 53 and to Using this Help System in VisualDSP Help VisualDSP 5 0 User s Guide 1 61 VisualDSP Help System 1 62 VisualDSP 5 0 User s Guide 2 ENVIRONMENT VisualDSP is an intuitive easy to use user interface for programming Analog Devices processors This chapter introduces the VisualDSP work environment including the main window and debugging windows Graphics are used to illustrate concepts and available window options From the application s main window you can open the Project window editor windows the Output window and various debugging windows Custo
157. eference address of the cache event Symbol Lookup Displays the symbol name when the reference address resolves to a symbol in memory Valid Displays the cache line valid flag The values are Yes or No Event Type Displays the cache event type such as Hit or Miss Description Displays the cache event s description Performance Page The Performance page Figure 2 66 shows a list of performance metrics items and values which are determined by the target The target updates this list The update rate however is not predetermined VisualDSP 5 0 User s Guide 2 99 Debugging Windows Cache Viewer CO Miss Count Capacity Miss Count Compulsory Miss Count Conflict Miss Count Hit Count Data Prefetch Count Penalty Count Configuration Detailed _ Figure 2 66 Example Performance Page Histogram Page The Histogram page Figure 2 67 shows a plot of the total number of cache events that occurred in each cache set A vertical line displays for each cache set The line starts at zero and ends at the total number of cache events Use this plot to identify the most active cache sets 2 100 VisualDSP 5 0 User s Guide Environment ix Iicache Histogram 5 100 et Number Configuration Detailed History Performance Histogram Address Figure 2 67 Example Histogram Page VisualDSP 5 0 User s Guide 2 101 Debugging Windows Addres
158. efiles on page 1 51 e Project Configurations on page 1 56 e Project Build on page 1 57 Project Wizard VisualDSP provides a Project Wizard Figure 1 6 to simplify the creation of a new project The Project Wizard provides pages of options to configure your new project Depending on selections various page and options are available 1 44 VisualDSP 5 0 User s Guide Introduction to VisualDSP First the wizard queries you as to what you want configured Then it generates a custom startup code file based on your choices adds it to the project and modifies the linker settings to link in the customized 1df file After defining the project you can project changes later via the Project Options dialog box Project Wizard 24 xi Project Information Choose the type name and location of the project that you would like to create Project Select Type Project 7 Si ype elec GN Select Processor Project types fe Application Settinas S Standard application Eh Finish Library D LwlP Ethernet application F YDK application Name NewProject Directory c Documents and Settings LLLLLLL My Documents VisualD B lt Back Next gt Finish Cancel Figure 1 6 Example Project Wizard Upon Opening Startup Code The ability to add startup code is available for Blackfin processor projects only Startup code is a procedure that initializes
159. elect All Processors Allow Docking Hide Float In Main Window Figure 2 59 Multiprocessor Window s Right Click Menu VisualDSP 5 0 User s Guide 2 87 Debugging Windows Pipeline Viewer Window TigerSHARC and Blackfin processors in simulation only The Pipeline Viewer window Figure 2 60 displays instructions in the pipeline and allows you to view event details Open this window by choosing View Debug Windows and Pipeline Viewer LINK 0x44 LINK 0x44 LINK 0x44 LINK 0x44 K Ss YJ LINK 0x44 M M Liss Tes 6363 EF 1 Ox Li TIHE Oxes Lisx_ wiin Ii lix I t J we cs 6370 EF 1 Ox iP ia Stii LivX_ Ia wed it Ix I t e v INK xe e se 6372 EF 1 Ox L ZIHE Oxes we 11 ent I t e Ii lix 637s Fl H 0 RI LEE I Ox ot I e 17 i 11 i 637 F Fli x z FLH 0 re ta ren d II 17 6373 Call ua Fo Fli wee oO ren 6330 U U wn INK nxi gt a i ad 7 K INK nxit 6382 EF 1 Ox LisX i032 Wi IHE 0x30 ot it Ix I t e INK nxiti ED FE 1 Ox iP ce LIHE 0x30 welts it ix I t e INK nxiti 6336 FE I Ox i gt ce LIHE 0x30 we aoe We 1ft tt Ux Figure 2 60 Pipeline Viewer Window W IHE Oras K a E I k ne g TJ IHE Oxss Livx Iadi Y w ne a Loss wad Mk ZIHE Oxes IIX Iadi T IHE 1i iix ve y iw a u Ia ZIHE i e i Ie FIH 0 x IL 3 mtd Lis 17 r o
160. em level timing mechanism Every system tick is a timer interrupt tool chain trace The collection of tools utilities used to build a project configuration Provides a history of program execution A trace is sometimes called an execution trace or a program trace Trace results show how the program arrived at a certain point and show program reads writes and memory fetches Blackfin and TigerSsHARC processors do not support traces A 86 VisualDSP 5 0 User s Guide Reference Information unscheduled regions For VDK a sequence of instructions whose execution can be inter rupted but cannot be swapped out The kernel acknowledges and services interrupts when an unscheduled region routine is running VDK See VisualDSP Kernel VDK VisualDSP An Integrated Development and Debugging Environment IDDE for Analog Devices processor development tools VisualDSP Configurator Previously called JTAG ICE Configurator or ICE Configurator use this utility to describe the hardware to VisualDSP when con necting to a JTAG emulator session VisualDSP requires this description to set up the debug session The VisualDSP Configurator also provides access to ICE Test a utility for testing the target VisualDSP Kernel VDK The RTOS kernel from Analog Devices a software executive between processor algorithms peripherals and control logic The kernel is integrated with the Integrated Development and Debu
161. embly instructions profiling statistics 2 61 auto completion scripts 2 42 automatic breakpoints 3 15 automatic file loading 1 26 automatic file placement 2 15 automation Image Viewer 2 120 Automation API 2 41 B background telemetry channels See BTCs batches building 1 59 VisualDSP 5 0 User s Guide I 1 INDEX Blackfin processors peripherals supported in simulators D 2 bnm files A 13 bookmarks editor windows 2 17 2 19 Help A 58 keyboard shortcuts A 34 Output window 2 30 Boolean operators searching Help A 63 boot kernel 1 43 loading or booting B 12 options B 11 booting 1 43 simulating 1 16 boot loadable files B 12 boot loading 1 43 break condition defined A 66 breakpoints about 3 13 automatic 3 15 conditional 3 14 Disassembly windows 2 47 hardware 3 3 icons 3 13 keyboard shortcuts A 36 MP sessions 3 11 simulation vs emulation 3 3 symbols 3 13 unconditional 3 14 using 3 13 BTC_MAP_ENTRY_ASM macro 2 74 BTC_MAP_ENTRY macro 2 74 BTC Memory window about 2 75 right click menu 2 78 BTCs about background telemetry channels 2 73 BTC Memory window 2 75 changing BTC priority 2 75 channel definitions 2 73 defining channels 2 73 list of defined channels 2 77 streams 3 17 build date A 3 building projects See projects build options about 1 58 custom 1 59 files 1 25 individual file 1 59 projects 1 25 project wide 1 58 specifying 1 24 Build p
162. emee rte Se 2 111 Right Click Ment crcnioricigroninisisieratsiianri 2 111 Plot Windaw SiC oossssssenamnmennnienrs osa 2 112 Plor Coniiguralioi ccna 2 114 Plot Window Piesontation ssrssnrossnsnunninnnoris 2 116 Plot Presentation Options 2 stecsescaccionteshecsugseeeoesnasuaes 2 117 PTE ENE a AAA A 2 119 PAG Tatre siciicikhid dentate nn naa 2 120 Toolbar osaa cia Saeco eieanenenemaciaosaewn 2 120 DR DAG eaa 2 12 Righe Clic Me eurre aS 2 121 DEBUGGING Dibus Sessions siririn een 3 1 Debug Sesion Management se aercedrmaraseatirendermieemseetets 3 3 Simulation vs Emulation sersnnncnarnes ensa 3 3 e L E eee E E AE EA T E T 3 3 Mate hpo kobsannnisiskansaki akiki okne 3 4 Multiprocessor MP System Debugging serrnriraronnnsnss 3 4 Setting Up a Multiprocessor Debug Session ceceeeeees 3 4 Debugging a Multiprocessor System sceissisnsssraatesuanscondivaras 3 5 Fogus and PUn soari aA 3 6 xii VisualDSP 5 0 User s Guide CONTENTS Window Title Bar Ipiormati n cccigeenersatsencisewiesrwies 3 6 Additional Focus Indicato erscortccsrecuseseestaccsnsssarsssoeeiane 3 7 Code Analysis Tools cciowtccicdarccnceranmciteseannemeedeomonnaeon 3 7 Statistical Profiles and Linear Protes coarasicisecisnria 3 8 Simulation Linear Profiling anisiiucsiniatsiiunerniibalani 3 8 Emulation Statistical Prone crsscseeasncrirorane 3 8 TC ieee ee ee 3 9 Progiait Execution Operaio sncuimiinenncomniprencnasauney 3 10 Selecting a New Debug Session at Startup sicccc
163. emory allocated for the heap and stack Freeing up memory in this way enables it to be used for storing other things like processor code or data You can launch the Expert Linker see Figure 1 4 from VisualDSP in three ways e Double click the 1df file in the Project window e Right click the 1df file in the Project window to display a menu and then choose Open in Expert Linker e From the VisualDSP main menu choose Tools Expert Linker and Create LDF Expert Linker Window The Expert Linker window Figure 1 4 enables you to modify the mem ory map or the object mappings You can specify a color for each type of object internal memory external memory unused memory reserved memory output sections object sections overlays in live space and over lays in run space The objects are displayed in color when you view the Memory Map pane in graphical memory map mode When the project is ready to be built Expert Linker saves the changes to the 1df file VisualDSP 5 0 User s Guide 1 35 Code Development Tools gt Expert Linker OO x Input Sections Memory Map constdata S Ji LIBRARIES w PROGRAM 0xf000000O OxfO026ffF E libe db HEAP Of0030000 Oxf0037 fff em z libevent dlb HEAP exception doj E libepp_blkfn dlb ctor raiseint doj STACK Oxf0038000 OxfOOZdiff ibsfttit db STACK E libepp_blkfn dlb E crt doj program W libcpprt_bikin dib
164. emula tors are installed and are connected to multiple target boards one debug session may be connected to each individual emulator In a JTAG emulator session only one debug session may be con nected to each physical target emulator combination Otherwise contention issues may arise Upon switching to a different session VisualDSP detaches from the old session before attaching to the new session Breakpoints In a simulator session a breakpoint can be set at any address in your executable program s memory Program execution halts at the address where the breakpoint is located Hardware breakpoints can be used in emulator debug sessions only see Hardware Breakpoints on page 3 16 VisualDSP 5 0 User s Guide 3 3 Debug Sessions Watchpoints Watchpoints are like breakpoints that trap on a specified condition You can set watchpoints on registers stacks and memory ranges Reaching the condition halts program execution and updates all windows Watchpoints are available only during simulation Multiprocessor MP System Debugging Often performance based products require two or more processors A system built with multiple processors is called a multiprocessor system MP system A system built with a single processor is called a single pro cessor system The SHARC and TigerSHARC simulators do not support multiprocessor MP debugging multiprocessing for these proces sors is available in emulator se
165. ent unit empty DCache miss Data cache miss DCache store buffer Data cache buffer overflow The processor stalls full until the FIFO moves forward and a space is free D 12 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Table D 7 Stalls Detected Messages ADSP BF535 Processor Cont d Message Explanation Example DCache load while A load access collides with a pending store access store pending in the store buffer They are tying to access the same address DCache load while Load access size is different from that of the store store pending w size access The buffer must be flushed before the mismatch load can be carried out DCache bank collision The addresses in a dual memory access com mand are accessing the same minibank It does not matter whether both are loads or load and store SYNC with store pend SYNC instructions force all speculative transient SSYNC ing in the core system to be completed before pro ceeding EU gt MUL MAC RAW Execution unit Multiply or Multiply accumulate RO R1 RO hazard with a read after write hazard PO RO RETx RAW hazard Writing to one of the RETx RETS RETI RETX RO RETX RETN or RETE registers immediately RTX followed by the corresponding return instruc tions Dagreg WAW hazard Writing to one of the DAG registers and imme 13 R3 diately writing to it again 13 MO Dagreg RAW hazard Writi
166. er hot or cold Spaces are characters Thus hot cold matches hot or cold A 46 VisualDSP 5 0 User s Guide Reference Information Match Rules If multiple matches are possible the and characters match the long est candidates The character matches the left hand alternative first For more information see the many reference texts available on this topic such as Mastering Regular Expressions Powerful Techniques for Perl and Other Tools by Jeffrey E F Friedl c 1997 O Reilly amp Associates Inc Tagged Expressions in Replace Operations Use a tagged expression as part of the string in the Replace field for a replace operation A tagged expression must be enclosed between parentheses characters In the Replace field the operators in Table A 22 represent tagged expres sions from the Find field Table A 22 Using Tagged Expressions in Replace Operations Find Field Replace Field Entire matched substring 0 Tagged expressions within parentheses from left to right 1l 2 3 4 5 6 7 8 9 Entire match expression amp The replace expression can specify an ampersand amp character meaning that the amp represents the substring that was found For example if the sub string that matched the regular expression is abcd a replace expression of xyz amp xyz changes it to xyzabcdxyz The replace expression can also VisualDSP
167. erflow on page D 39 When DCBS is 0 and Addr1 14 12 Addr2 14 12 a collision occurs When DCBS is 1 and Addr1 23 13 12 Addr2 23 13 121 a collision occurs D 38 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Memory Mapped Register MMR Access A read from any MMR space on core and off core results in a 2 cycle stall because the Blackfin processor architecture must wait for acknowl edgement from the peripherals mapped to the MMRs being accessed IO contains an address between OxFFCO0000 and OxFFE00000 R2 I0 In Supervisor Mode lt 2 cycle stall gt System Minibank Access Collision A system access occurs when an external device such as another processor in a multiple core system accesses the Blackfin processor s L1 memory Whenever the system accesses a minibank currently being accessed by the core a lt 1 cycle stall gt is incurred because system memory accesses have higher priority than core accesses Store Buffer Overflow The store buffer is a 5 entry FIFO that manages Blackfin processor instruction stores to L1 and L2 memory All instruction stores must go through the store buffer Thus if the buffer is full the Blackfin processor stalls until the FIFO moves forward and a space is freed The earliest time that a store can leave the buffer is four instructions not cycles necessarily after it was entered Consequently under ideal circum stances a continuous series o
168. ernel VDK User s Guide for details Program Development Steps In the VisualDSP environment program development consists of the following steps 1 Create a project Configure project options Add and edit project source files Specify project build options Create a debug session and load the executable 2 3 4 5 Build a debug version executable file of the project 6 7 Run and debug the program 8 Build a release version of the project 1 22 VisualDSP 5 0 User s Guide Introduction to VisualDSP By following these steps you can build projects consistently and accu rately with minimal project management This process reduces development time and lets you concentrate on code development These steps described below are covered in detail in VisualDSP Help and in the Basic Tutorial chapter of the VisualDSP Getting Started Guide Step 1 Create a Project All development in VisualDSP occurs within a project The project dpj file stores your program s build information source files list and development tools option settings VisualDSP includes a Project wizard that simplifies the creation of a new project Refer to the VisualDSP Getting Started Guide for a tutorial or to VisualDSP Help Step 2 Configure Project Options Define the target processor and set up your project options or accept default settings before adding files to the project The Project Options
169. es PD through EX2 represent the execution pipe Fetch unit pipe stages contain raw quads of 32 bit words fetched from memory not valid instruction lines When you view the Pipeline Viewer window in disassembly format by means of the right click menu instructions that appear in the fetch unit pipe are not valid instruction lines but merely bits and pieces Valid instruction lines appear in the execution pipe stages VisualDSP 5 0 User s Guide C 13 ADSP TS20x Processors Stalls The examples that follow illustrate the way that the Pipeline Viewer dis plays different types of stall events for ADSP TS20x processors For a complete list of pipeline effects and memory transaction timing refer to the processor s hardware specification Stalls Due to IALU Dependency The following sequence of instructions causes a 4 cycle stall at the PreDecode stage JO 0x40000 J1 J31 J0 This instruction is stalled in PreDecode until the previous instruction reaches E2 Cycle F1 F2 F3 F4 PD D t _a 1 2 1 lt lt XX x E E E E E 2 W a B E x E E E E 3 i i E E EJ E E E E 4 n j 3 E Ej El E E E 5 n on j 388 E E E E E 6 n n n j jO OxX40000 B Bee 7 n n n nil j31 j0 jo 0x40000 HE K D 8 n on n nf ji j31 j0 B jo ox4oo00 Be amp 3 n n n n ji j31 j0 B jo ox4o000 B B 10 n n n nf ji j31 jo B jo ox4o000 B B jE
170. ess VisualDSP online Help by clicking the Start button and choosing Programs Analog Devices VisualDSP and VisualDSP Documentation Accessing Documentation From the Web Download manuals at the following Web site http www analog com processors manuals Select a processor family and book title Download archive Z1P files one for each manual Use any archive management software such as WinZip to decompress downloaded files Embedded Processing amp DSP Knowledge Base Search all our technical documents everything from application notes data sheets questions and answers to code examples manuals and more Point your browser to the following Analog Devices Web site http search analog com DSPKB home aspx Printed Manuals For general questions regarding literature ordering call the Literature Center at 1 800 ANALOGD 1 800 262 5643 and follow the prompts 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 VisualDSP 5 0 User s Guide xxxiii Product Information 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
171. essor Clock and Power Settings Select Configure clock and power settings Then click Finish In the Project window add application source file s to the new project Build and run your application The numbers in the Energy Units column of the Linear Profiling window are an accumulation of the ranking of every instruction after it has been converted to Energy This display allows you to view the relationship between power settings in different parts of your code Use these numbers to verify your power savings Figure 3 11 shows the profiling results when the Configure clock and power settings option is enabled Figure 3 12 shows the results when Configure clock and power settings is disabled Note that both of these illustrations show only the left side of the Linear Profiling window 3 32 VisualDSP 5 0 User s Guide Debugging Using the profiled numbers in the Count and Energy Units columns of both displays and referring to ___f1oat32_mul we can calculate a power savings of approximately 50 gt Linear Profiling ADSP BF537 Blackfin Memory Instruction Samples 1 Histogram Count Execution Unit Energy Units 563948 float32_mul 216047368 480000 sinf 186062000 307970 int32_to_float32 122235457 306000 float32_add 116292000 126039 PowerProfile Mem 49527032 112038 PowerProfile Mat 43848596 106042 PowerProfile Cal 41471746 96000 float32_adi_lt 38028000 84000 float32_t
172. essors support compiled simulation refer to Compiled Simulation on page D 44 Evaluation An EZ KIT Lite evaluation system Emulation Any combination of devices You configure the platform for a particular target with the VisualDSP Configurator When the debug target is a JTAG emulator platform refers to a JTAG chain of specific device types VisualDSP Configurator Use the VisualDSP Configurator Figure 1 2 to align the external hardware target with an emulator so that the appropriate IDDE debug ses sion can be established VisualDSP 5 0 User s Guide 1 17 Project Development gt isualDSP Configurator 21x Platform Templates Platforms H9 ADSP 21065L EZ KIT Lite HF ADSP 21160 EZ KIT Lite BP ADSP 21161 EZ KIT Lite Hie ADSP 21262 EZ KIT Lite HF ADSP 21364 EZ KIT Lite H3 ADSP 21369 EZ KIT Lite H9 ADSP 21375 EZ KIT Lite fia HPUSB ICE Hi ADSP BF533 EZ KIT Lite BP ADSP BF535 EZ KIT Lite H3 ADSP BF537 EZ KIT Lite H3 ADSP BFS38F EZ KIT Lite H ADSP BF561 EZ KIT Lite Copy New Modify Delete Delete Al Save Cancel Tet Hep Figure 1 2 VisualDSP Configurator After the EZ KIT Lite evaluation system or emulator has been connected powered up and recognized in the Windows Device Manager you can select or create the appropriate platform needed for configuring a debug session If the appropriate platform is not shown yo
173. ew instructions of a D0 LOOP or in the delay slots of a delayed branch For more information on these illegal loca tions refer to your processor s hardware documentation Simulation Tools Before you have the processor you can use interrupts and data streams within VisualDSP to simulate the processor s behavior 3 16 VisualDSP 5 0 User s Guide Debugging Interrupts Use interrupts to simulate external interrupts in your program When you use interrupts with watchpoints and streams your program simulates real world operation of your processor system Input Output Simulation Data Streams In many products processors exist as part of a larger system where they can act as a host or a slave They can drive other devices or take part in processing a subset of data Because of their extensive I O capabilities Analog Devices processors excel in these roles Use data streams to transmit data between e A device and a file e A device and a device e A device in one processor and a device in another processor in a multiprocessor system Using background telemetry channel BTC technology VisualDSP permits the streaming of data from a target processor without halting the processor This capability applies to emulation targets only The plot window receives and displays a stream of data from processor memory If the target supports background telemetry the plot window reads memory and updates the display without ha
174. expands the view The possible thread states are as follows e Running e Ready e SemaphoreBlocked EventBlocked e DeviceFlagBlocked e MessageBlocked e SemaphoreBlockedWithTimeout e EventBlockedWithTimeout e DeviceFlagBlockedWithTimeout e MessageBlockedWithTimeout e Sleeping e Unknown See the VisualDSP Kernel VDK User s Guide for details 2 104 VisualDSP 5 0 User s Guide Environment VDK State History Window VDK state history is available only for executable files with VDK support During execution of a VDK enabled program if Full Instrumentation is specified for the project thread and event data are collected in a history buffer When a running program is halted the history buffer data is plot ted in the VDK State History window described in Figure 2 70 Some features become available only when the data cursor is enabled Open this window by choosing View VDK Windows and History The VDK State History window has the following components e A cursor e Horizontal bars representing threads The bar color indicates the thread state e A green vertical line indicating a thread switch e Arrows representing thread events The arrow color indicates the event type e Status bar showing event details e A green line indicating an active thread The length of the line indicates the time the thread was active e A thread status bar Each thread appears as a horizontal bar thread status bar The Thre
175. f stores will take up four out of the five slots in the store buffer If only one of the stores is delayed by an extra cycle no penalty is imposed as the store buffer has five slots Many scenarios can cause the store buffer to become full To account for them you must keep track of the proximity of stores and how many cycles they each take VisualDSP 5 0 User s Guide D 39 Multicycle Instructions and Latencies If a multicycle store is required you must ensure that it is not followed too closely by other stores as they may become backed up Multicycle stores include e Stores to non cacheable memory for example MMR space e Stores to external L2 memory memory addressed beyond L1 SRAM e Minibank conflict where the store is from DAG1 the second access in a load store multi issue instruction see Minibank Access Collision on page D 35 Store Buffer Load Collision This section describes cases in which a load access collides with a pending store access in the store buffer because they have the same address refer to section Store Buffer Overflow on page D 39 for a description of the store buffer Load Store Size Mismatch If the load access s size 8 bit 16 bit 32 bit is different from that of the store access the store buffer must be flushed before the load can be carried out The stall time depends on how many stores are currently in the buffer and how long they each take to complete W LPO RO
176. fa00070 55 RO H 96 RO L 230 PO uoin PD RO PO Bl 56 PO RO H 96 RO L 230 Event 0 RO L 228 PO xl Type Stall Cause Sequencer or Memory stalls Details MMR Stall Figure D 5 MMR Stall MMR stalls occur in E1 while the MMR value is being returned Figure D 6 shows a branch kill peline Viewe olx Cycle Decode Address Executed Executel Execute2 Execute3 Writeback 140 CALL mend R3 L 256 R3 H 1 R1L H 4 R1 L 64 RO L 0 RO H 128 141 E CALL nend R3 L 256 R3 H 1 RL H 4 R1 L 64 RO L 0 142 Details for stage Decode cycle 141 mend R3 L 256 R3 H 1 R1 H 4 R1 L 64 143 Aer CALL mend R3 L 256 R3 H 1 RL H 4 144 Event K CALL nend R3 L 256 R3 H 128 145 Type Kal PT E a K CALL nend R3 L 256 ause Mispredict Interrupt hetel ue Detais Branch Kil r K CALL nendn 148 Ox P1 H Ox W K K 149 Pl P1 L Ox P1 H Ox M _ 150 R5 R5 P1 PLL Ox P1H ox W E Figure D 6 Branch Kill In this example an unconditional control transfer kills several stages that were behind it Fetching begins at the destination of the control transfer instruction after the killed stages VisualDSP 5 0 User s Guide D 21 Multicycle Instructions and Latencies Multicycle Instructions and Latencies This section contains a descripti
177. ffer when the of the Disassembled h instruction executed instruction dept occurred instruction SS ee S E 00000000 Cycle 00006q471 PM 0002023c r12 r1l r12 r1ll r11 r12 000006002 RD PM 0002023e 4dfe e0000oo 00000003 Cycle 9006d72 PM 0002023d if eq rO re tr2 000006005 RD PM 0002023f ae0b00000001 00000006 Cycle 00006473 PM 0002023e i12 dm m7 i6 00000007 RD DM 9003fTT3 9002013d 000006009 RD PM 00020240 ae0700000002 0000000a Cycle 9006d74 PM 0002023f r11l dm Ox1 i7 0000000b RD DM 9003fTT1 00000000 0000060d RD PM 00020241 083f34000000 Access Memory Address Data value Memory results type type written or read RD WR PM DM Figure 2 32 Example of Data in a Trace Window The Trace window displays e Buffer depth Custom in the Trace Buffer Depth dialog box e The clock cycle when the instruction occurred e The address of the instruction executed e The disassembled instruction Note the following e For SHARC and TigerSHARC processors depth is limited by your system s virtual memory e Trace is not supported in Blackfin simulator sessions but is sup ported in Blackfin emulator sessions The depth is limited by on board physical memory reserved for this feature VisualDSP 5 0 User s Guide 2 53 Debugging Windows Memory results have the following fields e Access type RD or WR e Memory type PM or DM e The address in brackets 1 e The data value wri
178. files When you drag and drop a file onto the Project page the file is added to the first folder associated with the file s extension The Project page accepts dragged files only when a project is opened e Using menu commands to add files Files are added to the folders that you select on the Project page If you add a file to a project that has no folders the file is added at the project level root level If you select the project node or a file node the file is added to the first folder associated with the file s extension VisualDSP 5 0 User s Guide 2 15 Editor Windows Example You create a folder labeled C Source Files and specify it with c cpp and cxx file extensions You create a second folder labeled Asm Files and associate it with asm files If you drag three files filel cpp filel asm and file2 c into the Project window filel cpp and file2 c go into the C Source Files folder and filel asm goes into the Asm Files folder After automatic file placement you can manually move a file anywhere by selecting and dragging the file Editor Windows Use editor windows to view and edit files Open as many editor windows as you like from the Project window by double clicking on a file or by choosing Open File from a file s right click menu This section describes the following topics e Editor Window Features on page 2 17 e Editor Window Symbols on page 2 18 e Bookmarks
179. fixed with info advice or failure to indicate its type Right clicking on the icon or the line of code provides commands to view the annotations at that line or all annotations This menu also allows you to select the annotation types failure information or advice that appear The compiler annotations toolbar provides a quick way to view hide annotations and to navigate the editor window to locate previous next compiler annotations DW Gi G o Figure 2 17 Compiler Annotations Toolbar 2 26 VisualDSP 5 0 User s Guide Environment Right Click Menu The editor window s right click menu provides the commands shown in Figure 2 18 U gi d O Redo Cut Copy Paste Toggle Bookmark Next Bookmark F2 Insert Breakpoint F9 Line Numbers Run to Cursor Ctrl F10 Match Brace Ctrl B Go To Ctrl G Find Ctrl F Source Mixed Select Format A v Hexadecimal Float Unsigned Integer Integer Octal Figure 2 18 Example Editor Window Right Click Menu The available formats under Select Format depend on the target processor An additional command Source Script is available when you are editing a script VisualDSP 5 0 User s Guide 2 27 Output Window Output Window The Output window displays e Standard I O text messages such as file load status e Build status information for the current project build e Code development tools messages and provides access t
180. for Blackfin D 2 Timer TMR Blackfin D 8 UART for Blackfin D 7 PGO defined A 79 physical memory defining 1 33 pinning definition 3 6 pipeline kill reasons ADSP BF531 ADSP BF532 ADSP BF533 ADSP BF561 D 20 kill reasons ADSP BF535 D 10 stage event icons in Pipeline Viewer 2 91 stall reasons ADSP BF531 ADSP BF532 ADSP BF533 ADSP BF561 D 19 stall reasons ADSP BF535 D 9 pipeline stages ADSP TS101 processors C 2 ADSP TS20x processors C 13 Disassembly windows 2 50 pipeline symbols mixed mode 2 21 Pipeline Viewer aborts ADSP TS101 C 5 aborts ADSP TS20x C 15 current program counter value ADSP TS101 C 8 current program counter value ADSP TS20x C 20 event details 2 92 event icons 2 91 message abbreviations ADSP BF535 D 17 pipeline stages ADSP TS101 C 2 pipeline stages ADSP TS20x C 13 specifying properties 2 90 stalls ADSP TS101 C 3 stalls ADSP TS20x C 14 stepping ADSP TS101 C 9 stepping ADSP TS20x C 21 window 2 88 C 20 window messages ADSP BF535 D 12 Pipeline Viewer window 2 88 C 2 VisualDSP 5 0 User s Guide pipelining defined A 78 platforms about A 78 definition 1 17 specifying 3 2 plots See also plot windows buffer capacity 2 111 colors 3 26 configuring 2 109 2 115 constellation 3 22 data logging status 2 111 data sets 2 115 DSP memory 3 19 eye diagram 3 23 legends 3 26 line 3 21 presentation options 2 117 spectrogram
181. for that execution unit divided by the total number of samples View Sample Count Displays the sample count for that execution unit Mixed Sets the display mode for C C source lines from the right pane or only Choose Mixed to display both C C source lines and assem Source bly lines C C source lines appear in black type and assembly lines appear in gray Profiling data appears for each assembly line Choose Source to display only the C C source lines Properties Opens the Profile Window Properties dialog box where you can view or change window settings When performing linear profiling you can select display options such as cache hits cache misses exe cution count reads and writes Window Operations You can select various options for the Statistical Linear Profiling window and perform various window operations For power estimation this window displays two additional columns Refer to Energy Aware Programming on page 3 31 for more information 2 58 VisualDSP 5 0 User s Guide Environment Changing the Window View After you specify window properties for the Statistical Linear Profiling and enable profiling the profiler collects data when you run a program Depending on the filtering options selected the window s Execution Unit column displays e Function names such as main e Single addresses for example PC 0x2000 e Address ranges for example 2000 2050 Single addre
182. formation refer to the related build tool documentation system configurator For VDK the system configuration control is accessible from the Kernel page of the Project window The Kernel page provides a graphical representation of the data contained in the vdk h and vdk cpp files target also called debug target The communication channel between VisualDSP and a processor or group of processors Targets include simulators emulators and EZ KIT Lite evaluation sys VisualDSP 5 0 User s Guide A 85 Glossary tems Several targets may be installed on your system Simulator targets such as the ADSP TS101 cycle accurate simulator differ from emulator targets in that the processor exists only in software The Summit ICE emulator communicates with one or more physi cal devices over the host PC s PCI bus The USB ICE emulator communicates with a device through the PC s USB port threads ticks For VDK a kernel system component that performs a predeter mined function and has its own share of system resources VDK supports multithreading a run time environment with concur rently executed independent threads Threads are dynamic objects that can be created and destroyed at runtime Thread objects can be implemented in C C or assem bly language A thread s properties include an ID priority and current state wait ready run or interrupted Each thread main tains its own C C stack The syst
183. g ging Environment IDDE assembler compiler and linker programs into the development tool chain Refer to the VisualDSP Kernel VDK Users Guide for details watchpoints For simulation only Similar to breakpoints watchpoints stop program execution Unlike breakpoints which are attached to specific addresses watchpoints are attached to user defined VisualDSP 5 0 User s Guide A 87 Glossary conditions such as memory reads or stack pops The program halts when the conditions are met SHARC processors do not support watchpoints workspace You can open multiple windows arrange them in any configura tion and save the layout as a workspace setting that can be recalled loaded at a later time Each debug session s default workspace is automatically saved when you close the session and is automatically restored when you load that session By default each session includes two workspaces You can create any number of workspaces and switch among them Suggested workspaces include an edit workspace a debug workspace and a plot workspace A 88 VisualDSP 5 0 User s Guide B SIMULATION OF SHARC PROCESSORS Depending on your selected target processor several simulator options are available on submenus under the Settings menu This appendix describes the options that help you simulate SHARC processors The information is organized as follows e Anomaly Options on page B 1 e Event Options o
184. h two decimal places for example 1 03 or the PC sample count for each source line Line Line numbers of the source file File Entire source file Each source line occupies one line in the grid control Status Bar The status bar at the bottom of the window indicates the total number of collected PC samples the total elapsed time and indicates whether statis tical profiling is enabled Right Click Menu The Statistical Profiling and Linear Profiling windows provide a right click menu The menu commands depend on the context whether you right click in the left pane or right pane and the current settings Table 2 16 describes the right click menu commands Table 2 16 Right Click Menu Commands in Profiling Windows Command Description Enable Enables or disables profiling Load Profile Opens the Select a Statistical Linear Profile to Load dialog box from which you can load profile data saved from a previous run Save Profile Saves the current run s data to a file Concatenate Profile Merges profiling data stored from a previous run with current data Clear Profile Clears statistics saved from a previous run VisualDSP 5 0 User s Guide 2 57 Debugging Windows Table 2 16 Right Click Menu Commands in Profiling Windows Cont d Command Description View Execution Percent Displays the execution percent in each execution unit or source line This value is the sample count
185. hains The processor connection type and platform specify the debug session By default a session name is generated automatically You can further identify the session by modifying the default name choosing a more meaningful name A well chosen name can prevent confusion later This section describes the following topics e Debug Session Management on page 3 3 e Simulation vs Emulation on page 3 3 e Multiprocessor MP System Debugging on page 3 4 The processor connection type and platform specify the debug session By default a session name is generated automatically You can further identify the session by modifying the default name choosing a more meaningful name A well chosen name can prevent confusion later 3 2 VisualDSP 5 0 User s Guide Debugging Debug Session Management You can run several debug sessions at once and can switch dynamically between sessions The typical reasons for running multiple debug sessions are e To write different versions of your program to compare their operating efficiencies e To debug completely different programs without having to run multiple instances of VisualDSP Simulation vs Emulation While connected to a simulator session you may open as many sessions as your system s memory can handle While connected to actual hardware through an emulator only one debug session may be connected to one emulator at any time If multiple
186. he address bar shows recently used addresses symbols and expressions Address bar 926119 r2 m3 02011A dm Oxfttfttt9 i6 r2 920118 r2 0 02011C dm Oxfttftttd i6 r2 92011D dm Oxfttfttfc i6 r2 gt gt 02011E 02011F dm Oxfftftttb i6 r1 020120 dm oxfttfttfa i6 r1 920121 Fe Figure 2 27 Example Disassembly Window Showing Address Bar VisualDSP 5 0 User s Guide 2 45 Debugging Windows Disassembly x 020119 r2 m3 4 02011A dm oxttttttt9 i6 r2 926118 r2 0 2 11C dm oxtttttttd is r2 02011D dm Oxfttttffc i6 r2 gt 02011E peers D 02011F dm extttttt fb i6 r1 020120 dm xfffffffa i6 rl1 020121 FO 0 Figure 2 28 Example Disassembly Window Without Address Bar Disassembly windows display code in disassembled form which is useful for temporarily modifying the code to test a change or to view code when no source is available The Disassembly window enables you to examine the assembly code generated by the C C compiler Choosing View Source from the Disassembly window s right click menu enables you to view the C C source code for the loaded file A single processor debug session provides one Disassembly window only but multiple instances of the window may be opened for different views In a multiprocessor debug session multiple Disassembly windows are available To make changes permanent modify the co
187. he event if applicable 2 92 VisualDSP 5 0 User s Guide Environment Cache Viewer Window Simulation only The VisualDSP Cache Viewer window provides a means to visualize a processor s cache and locate problem areas The tool shows how instructions are being executed Use this information to boost your application s performance The Cache Viewer window Figure 2 62 displays each instruction s exe cution characteristics Cache Viewer information indicates the type of cache event and describes the cause of the event Each instruction that exe cutes from cache is marked with an H hit or an M miss Hits represent cache instructions executed without a stall Misses identify instructions fetched from slower parts of memory because they were not found in cache gt Cache iewer Iof x Set Way 0 73 W 0200002138 74 E 0200002158 Way 1 75 ox00002168 W 0200002978 76 H 0x00002198 M 0x00002980 77 H 0x000021b8 H 0x00 Details for set 76 way 1 78 DERTIEN 0200 cycle 23997 79 ox000021e0 ox00q PC Address 0x00002980 Ref Address 0x00002980 80 MM ox00002218 M 0x009 So ier 81 MM ox00002238 E ox000 valid ves 82 H Ox00g Event Type Compulsory Miss 93 H ozood Description Data was accessed For first time Configuration Detailed iew Figure 2 62 Viewing a Cache Event s Details in the Cache Viewer VisualDSP 5 0 User s Guide 2 93 Debugg
188. he following memory configurations apply to the ADSP BF535 proces sor Note that the causal factors in offending instructions and the stall consequences appear in bold typeface D 34 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Minibank Access Collision This section describes the following stalls e SRAM access e Cache access SRAM Access 1 Cycle Stall This stall can occur only when an instruction accesses a bank configured as SRAM The memory regions associated with SRAM banks are calcu lated when an offset is added to the value of SRAM_BASE_ADDRESS MMR The start addresses for banks A and B are e Bank A SRAM _BASE_ADDRESS lt lt 22 0x000000 e Bank B SRAM_BASE_ADDRESS lt lt 22 0x100000 The minibanks are contiguous 4096 byte 4 KB chunks within the A and B address space With two simultaneous accesses via a multi issue instruc tion to the same minibank a 1 cycle stall is incurred For example IO is address 0x001348 I1 is address 0x001994 R1 R4 L R5 H IS R2 I10 I1 R3 lt 1 cycle stall gt due to a collision in the second minibank in superbank A A collision occurs regardless of whether the accesses are both loads or a load and a store If the first access is a load DAGO and the second is a store DAG1 the cycles incurred are seen by the store buffer see Store Buffer Overflow on page D 39 Since the SRAM_BASE_ADDRESS value must be 4 MB
189. he rate of CLKIN The appearance of a check mark beside the CLKDBL command on the Simulator submenu indicates that this option is selected No Boot Mode ADSP 2106x and ADSP 2116x processors only The Simulation submenu s NoBootMode command is available for ADSP 21x6x simulators to support development code in configurations where the processor is in NoBoot mode starting execution from exter nal memory for pre ADSP 2126x processors or starting execution from internal ROM for ADSP 2126x and ADSP 2136x processors B 10 VisualDSP 5 0 User s Guide Simulation of SHARC Processors When this mode is selected check mark appears beside the NoBoot Mode command in the Simulation submenu Also a message displays reminding you to load a program or choose Debug gt Reset to complete the mode change Changing to NoBoot mode is not persistent Each time you bring up the simulator and or change sessions the mode reverts back to its default state which is Boot Mode The processor has a boot mode and a NoBoot mode In boot mode the IIVT bit is ignored and the interrupt vector table IVT and starting PC are in internal memory In NoBoot mode the I1VT bit is significant and the initial location of the IVT and PC are in external memory pre ADSP 2126x processors and in internal ROM ADSP 2126x processors and later Before VisualDSP 4 0 all of the SHARC ADSP 21x6x simulators supported Boot
190. he system memory and processors The 1df file cre ates an executable file using the target system memory map and defined segments in your source files VisualDSP 5 0 User s Guide A 75 Glossary loader A utility that transforms an executable file into a boot file The loader creates a small kernel which is booted into internal memory at chip reset A program of arbitrary size can then be loaded into the processor s internal and external memory makefile VisualDSP can export a makefile make rule file based on your project options Use a makefile mak or mk to automate builds outside of VisualDSP The output make rule is compatible with the gnumake utility GNU Make V3 77 or higher or other make utilities memory pool An area of memory containing a specified number of uniformly sized blocks of memory available for allocation and subsequent use in an application The number and size of the blocks in a particular memory pool are defined at pool creation message For VDK a signal similar to an event or semaphore used to syn chronize two threads in a system or to communicate information between threads A message is sent to a specified channel on the recipient thread and can optionally pass a reference to a payload to facilitate the transfer of data between threads Posting a message takes a deterministic amount of time and may incur a context switch mixed mode One of the two editor window display for
191. he tool and the message Table 2 9 describes the syntax of the error message description in Help To view the details of a message it must be viewed from the Help window If you run a tool from a command line interface such as a Command Prompt window or MS DOS Prompt window the message shows only the ID code error text and error location Table 2 9 Syntax for Error Message Help Part Description Identification Code Six character code unique to the message The first two char acters identify the tool e ar archiver e cc compiler e ea assembler e el expert linker id IDDE e 1i linker e pp preprocessor e si simulator e xml custom board support Error Text Text that appears after the identification code in the Output window Description Detailed description of the message Severity The degree of hardship imposed by the error Some messages display a D These are discretionary messages and can take more than one severity level You cannot change the severity level of non discretionary messages Recovery Extra information provided only if applicable Example Example code How to Fix The remedy for correcting the error Related Information Link s to more information 2 32 VisualDSP 5 0 User s Guide Environment Viewing Error Message Details Each tool error message includes associated explanatory text that can be viewed in the Help window
192. hen input to a computation unit and do not generate an underflow exception Refer to your processor s hard ware documentation for more information about floating point operations Short Word Anomaly This option applies to all ADSP 2106x processors except the ADSP 21065L processor B 4 VisualDSP 5 0 User s Guide Simulation of SHARC Processors Short word accesses read or write fail following a stalled instruction Any access read or write to short word memory space can fail if it follows a stalled instruction or causes an instruction stall see the example below A DMA process cannot cause this anomaly It is restricted to conditions set up in the core processor A DMA process is not impacted by this anomaly that is the DMA will function correctly even if the anomaly occurs Refer to your processor s hardware documentation The occurrence of the failure varies with temperature voltage and frequency An instruction can stall because of the following circumstances 1 DAG stalls An instruction that loads a DAG register followed by an instruc tion that uses the same DAG for a memory access causes the second instruction to stall L2 8 DM IO MO R1 Both L2 and IO reside in DAGI causing this instruction to stall Failure can occur if 10 points to a short word space or if the above instruction sequence is followed by a short word access 2 PM memory data access cache misses Any instructi
193. ide 2 119 Debugging Windows You select the image source from processor memory or a file on your PC and specify image attributes If the image is located in processor memory you must specify the image s address size and format The Image Viewer supports the following pixel formats Grayscale 8 Grayscale 12 Grayscale 16 RGB555 RGB565 RGB24 and RGB32 To open the Image Viewer window choose View Debug Windows and Image Viewer Refer to Help for information about format types packed data and detailed how to information Automation Interface The Image Viewer has an automation interface that permits COM aware languages to access Image Viewer functions such as loading retrieving displaying and saving data Toolbar The top of the window provides these tools Table 2 29 Image Viewer Window Toolbar Buttons Button Purpose Configure Opens the Image Configuration dialog box a Refresh Reads processor memory and updates the image display Zoom In Zooms in by a factor of two 2 120 VisualDSP 5 0 User s Guide Environment Table 2 29 Image Viewer Window Toolbar Buttons Contd Button Purpose Zoom Out Zooms out by a factor of two Zoom Cancel Save Opens a Save dialog box from which to save the image Print ho pp 2 Copies the image to the Windows clipboard Ba Status Bar As you move the mouse over the image the statu
194. iew from a menu from an editor window or from a user tool Refer to Script Command Output on page 2 40 for details on scripting Command window issuance Load a script from a command window with an idde command by typing the following idde f script_filename Optionally add s and the session name to specify a previously created session If no session name is specified the last session is used If the script encounters an error during execution VisualDSP automatically exits Output window issuance Load a script from the Output window s Console view by typing one of the following commands For the Microsoft ActiveX script engine type Idde LoadScript script_filename For Tcl type source filename Similar to C C use a backslash as an escape character If you specify paths in the Windows environment you must escape the escape character as shown in this example A 8 VisualDSP 5 0 User s Guide Reference Information c my_dir my_subdir my_file vbs For Tcl only you may also use forward slashes to delimit directories in a path as shown in this example source c my_dir my_subdir my_file tcl Command execution is deferred until a line is typed without a trailing backslash This permits the entry of an entire block of code or entire procedure for the script interpreter to evaluate at once Use the built in Idde object to easily access the properties and methods of the VisualDSP Aut
195. igerSHARC processors C 1 simulation See also simulating Blackfin processors D 1 compiled Blackfin D 44 debug session management 3 3 limitations of software models Blackfin D 7 loading a processor B 10 options B 1 platforms 1 17 restarting programs 3 12 SPI in slave mode B 13 targets 1 16 Timer TMR peripheral Blackfin D 8 UART peripheral in Blackfin D 7 vs emulation 3 3 simulator ADSP 21065L processors B 4 B 7 ADSP 2106x processors B 4 B 10 ADSP 21161 processors B 10 B 13 ADSP 2116x processors B 2 B 3 B 10 ADSP 21x6x processors B 2 B 7 B 11 ADSP TS101 processors C 1 ADSP TS20x processors C 12 Blackfin peripheral support D 2 instruction timing analysis ADSP TS101 processors C 2 instruction timing analysis ADSP TS20x processors C 12 sampling PC 3 8 simulator instruction timing analysis ADSP BF531 ADSP BF532 ADSP BF533 ADSP BF561 processors D 19 ADSP BF535 processors D 9 simulators as targets 1 16 Simulator submenu options SHARC B 10 simulator targets linear profiling 3 8 single stepping available commands 3 11 sm files 1 31 A 12 software updates 1 10 upgrades 1 10 software versions A 5 source code control SCC about 1 50 Project window symbols 2 9 source files comments in A 48 editing features 1 3 management 1 4 project 2 8 source code control 1 50 source mode 2 20 spectrogram plots 3 26 example of 3 26 FFT output 3 26 SPI simulation in slave m
196. iles A 13 JTAG emulator breakpoints 3 13 debug sessions 3 3 exchanging data without halting 2 73 platforms 3 2 project development 1 15 statistical profiles 3 8 statistical profiling 2 55 JTAG interface exchanging data 2 73 K kernel defined A 74 kernel See VDK Kernel tab about 2 4 keyboard shortcuts A 31 kills detected messages Pipeline Viewer ADSP BF535 D 16 VisualDSP 5 0 User s Guide 1 9 INDEX L L1 data memory stalls D 34 cache access 1 cycle stall D 36 minibank access collision D 35 MMR access D 39 SRAM access 1 cycle stall D 35 store buffer load collision D 40 store buffer overflow D 39 system minibank access collision D 39 latencies D 22 df files 1 31 2 14 A 12 customized 1 46 dr files A 13 B 12 legends in plots 3 26 librarian defined A 74 libraries C run time 1 29 Dinkum abridged C 1 29 library functions displaying 2 59 licenses list of A 3 management 1 10 status A 3 linear profiling features 3 8 minimizing energy 3 31 Linear Profiling window 2 57 3 8 about 2 55 power savings 3 32 line plots about 3 21 linker file associations for tools 2 14 input files 2 14 overview 1 31 Linker Description Files See ldf files linking object files 1 31 1 32 loader about 1 42 specifying options 1 42 terms 1 42 loading executable programs 3 11 programs 3 11 scripts 2 42 scripts from a shortcut A 11 Load Sim Loader submenu
197. in the library that contains a label used in your pro gram Source code is provided so you can adapt the routines to your needs A 74 VisualDSP 5 0 User s Guide Reference Information library files The VisualDSP archiver elfar ex combines object 00J files into library d1b files which serve as reusable resources for project development The linker searches library files for routines library members that are referred to from other objects and links them into your executable program linear profiling A debugging feature that samples the target s PC register at every instruction cycle Linear profiling gives an accurate picture of where instructions were executed since every PC value is collected The trade off however is that linear profiling is much slower than statistical profiling A display of the resulting samples appears in the Linear Profiling window which graphically indicates where the application is spending its time Simulator targets support lin ear profiling See also Statistical profiling linker The linker creates executable files shared memory files and overlay files from separately assembled object and library files It assigns memory locations to code and data in accordance with a user defined 1df file which describes the memory configuration of the target system Linker Description Files ldf files The 1df files describe the target system and map your program code within t
198. indow s right click menu described in Table 2 24 enables you to read write and step a cache events log which is a file that records cache events Table 2 24 Cache Viewer Window s Right Click Menu Menu Option Description Enabled Enables and disables collection of cache data while the target is running or stepping Clear Clears all displays and deletes all stored cache data Map References Opens the Map References dialog box where you specify the cache reference map start address and end address Event Log gt Read Opens the File Open dialog box where you select and open a cache events log file The log file data is used by the Cache Viewer window s Configuration view Event Log gt Write Opens the File Save dialog box where you save a cache events log file Cache events are written to this log file Event Log gt Step Executes one cache event at a time from the cache events log file The cache event displays in the Detailed View History and Histogram pages of the Cache Viewer window By default this option is enabled when a cache log file is opened for reading Properties Opens the Cache Viewer Properties dialog box where you specify the Cache Viewer window s appearance The cache events log file does not include icons Thus the Cache Viewer window s Detailed View page does not display icons Stepping enables you to execute one cache event at a time from
199. indow or from Windows Explorer VisualDSP 5 0 User s Guide A 51 Online Documentation Help Categories VisualDSP provides three processor specific Help categories one for each processor family that filter adjust the content of Help Each Help category for example Blackfin processor family Help displays the infor mation pertinent to that specific family of processors only A fourth category provides access to the entire documentation set of all three processor families similar to software releases prior to version 5 0 By selecting a Help category in effect you remove information about other families of processors from Help this improves your ability to quickly locate information in Help especially when running a search or looking up an entry in the Help Index You can also specify a user preference that selects a category You can also switch among the different Help categories Refer to VisualDSP online Help for details A 52 VisualDSP 5 0 User s Guide Reference Information Online Help VisualDSP online Help refers to the application product Help packaged together with the VisualDSP tool suite This section describes the following topics Portions of the VisualDSP Help window Context sensitive Help Copying example code from Help Printing from Help Bookmarking frequently used Help topics Navigating in online Help Search features Help Window The VisualDSP Help window c
200. indows Window Provides Output on page 2 28 A Console page that displays standard I O text messages such as file load status and error messages and streams and a Build page that displays build messages You can interactively enter script commands and view script output Editor on page 2 16 Syntax coloring context sensitive expression evaluation and status icons that indicate breakpoints bookmarks and the current PC position Disassembly on page 2 45 Code in disassembled format This window provides fill and dump capa bility Expressions on page 2 50 The means to enter an expression and see its value as you step through program execution Trace on page 2 52 A history of processor activity during program execution including buffer depth instruction lines cycle count and instructions executed such as memory fetches program memory writes and data memory transfers SHARC processors only Locals on page 2 54 All local variables within a function Use this window with Step or Halt commands to display variables as you move through your program Linear Profiling on page 2 55 Simulation only Samples of the target s PC register taken at every instruction cycle which provides an accurate picture of where instructions were executed Linear profiling is much slower than statistical profiling Statistical Profiling on page 2 55 JTAG emulation only Random
201. ined as follows VisualDSP 5 0 User s Guide 1 41 Code Development Tools non bootable PROM image files The splitter s output which consists of PROM files that cannot be used to boot load a system splitter The splitter application such as el fsp121k exe contained in the software release For more information about the splitter and options used to generate loader files refer to the VisualDSP Loader and Utilities Manual or VisualDSP Help Loader The loader e1 floader exe generates boot loadable files by processing executable files in addition to a loader kernel The loader output 1dr file enables the processor to boot from an external device host or ROM The loader creates programs that execute from internal memory The splitter generates programs that execute from external memory To specify loader options choose Project gt Project Options and open the Load pages Loader terms are defined as follows 1 42 VisualDSP 5 0 User s Guide Introduction to VisualDSP boot kernel The executable file that performs memory initialization on the target boot loadable file The loader s output 1dr which contains the boot loader and the formatted system configurations This is a bootable image file boot loading The process of loading the boot loader initializing system memory and starting the application on the target loader The loader application such as elf loader exe conta
202. ined in the software release For more information about the loader refer to the VisualDSP Loader and Utilities Manual or VisualDSP Help Processor Projects Your goal is to create a program that runs on a single processor or multiprocessor system A project is the structure where programs are built All development in VisualDSP occurs within a project A project refers to the collection of source files and tool configurations used to create a processor program The project file dpj stores program build information VisualDSP provides flexibility for setting up projects You configure settings for code development tools and configurations and you specify build settings for the project and for individual files You can set up fold ers that contain your source files A project can include VDK support VisualDSP 5 0 User s Guide 1 43 Processor Projects Use the Project window to manage projects from start to finish Within the context of a project you can e Specify code development tools e Specify project wide and individual file options for Debug or Release configurations of project builds e Create source files VisualDSP facilitates movement among editing building and debug ging activities This section describes the following topics e Project Wizard on page 1 44 e Project Options on page 1 47 e Project Groups on page 1 48 e Source Code Control SCC on page 1 50 e Mak
203. ing Windows Use the hit or miss information to increase an application s performance by locating instructions in the cache when they are needed Ensuring that no cache misses are located in frequently executed areas of an application as highlighted by the profiler utility is a critical step in optimizing your application s software performance As shown in Figure 2 62 the Cache Viewer window enables you to view the details of any cache event These descriptive details help you under stand the cause of the cache event Use this information to isolate areas where performance can be improved For example based on cache event details you might e Modify an application s layout in memory to avoid cache thrashing e Prefetch instructions to avoid compulsory misses e Lock down ways in the cache to avoid a conflict miss with a fre quently accessed instruction Open the Cache Viewer window by choosing View Debug Windows and Cache Viewer The Cache Viewer consists of several tabbed pages described in Table 2 23 Table 2 23 Cache Viewer Window Pages Page Displays Configuration Cache configuration information Detailed View Location set and way of cache event History List of cache events Performance Cache performance metrics Histogram A plot of cache activity Address View Cache events on an Address vs Cycle plot 2 94 VisualDSP 5 0 User s Guide Environment The Cache Viewer w
204. inisckanrernis D 40 Sore Daa Nor Reidy picincsanaticerinrmsbesbaetinee eons D 41 Tester Groups aeons D 41 Rerister GGUS seacatnstcrtsuncapereavadeldsumapnaesananieaeeersabeuadasnenwusts D 42 Compiled Simulation os taitecioeterente denne SAN D 44 Specifying a Session for Compiled Simulation oe D 44 INDEX VisualDSP 5 0 User s Guide xxi xxii VisualDSP 5 0 User s Guide PREFACE Thank you for purchasing Analog Devices Inc development software for digital signal processing DSP applications Purpose of This Manual The VisualDSP 5 0 User s Guide describes the features components and functions of VisualDSP Use this guide as a reference for develop ing programs for SHARC TigerSHARC and Blackfin processors This manual does not include detailed procedures for building and debug ging projects For how to information refer to VisualDSP online Help and the VisualDSP 5 0 Getting Started Guide Intended Audience The primary audience for this manual is a programmer who is familiar with Analog Devices processors This manual assumes that the audience has a working knowledge of the appropriate processor architecture and instruction set Programmers who are unfamiliar with Analog Devices processors can use this manual but should supplement it with other texts such as the appropriate hardware reference and programming reference manuals that describe your target architecture VisualDSP 5 0 User s
205. ion e View error details and offending code From the Output window s Build view display error details by highlighting the error code such as cc0251 and pressing the F1 key Double click an error line to jump to the offending code in an editor window VisualDSP 5 0 User s Guide 1 3 VisualDSP Features Project Management Features VisualDSP provides flexible project management for the development of processor applications including access to all the activities necessary to create define and build processor projects Define and manage projects Identify files that the code develop ment tools process to build your project Create this project definition once or modify it to meet changing development needs Access and manage code development tools Configure options to specify how the code development tools process inputs and gener ate outputs Tool settings correspond to command line switches for code development tools Define these options once or modify them to meet your needs View and respond to project build results View project status while a build progresses and if necessary halt the build Double click on an error message in the Output window to view the source code causing the error or iterate through error messages Manage source files Manage source files and track file dependen cies in your project from the Project window to provide a display of software file relationships VisualDSP uses cod
206. ion box shown in Figure 1 11 myMakeFile Target e 7 1 0 6 AAA Figure 1 11 Makefile in Configuration Box When you close a project the Make commands and the target list associ ated with each makefile are serialized in the project DPJ file Rules You can enable only one makefile when building a project If you enable more than one makefile VisualDSP generates an error message After you build your project with an external makefile the executable file is not automatically loaded even when this option is configured 1 52 VisualDSP 5 0 User s Guide Output Window Introduction to VisualDSP Make command error messages and standard output appear in the Output window Double clicking on an error message position opens the makefile in an editor window to the line of code causing the error Keywords in the makefile are syntax colored Note The error message format of gmake is parsed correctly when you double click on an error message If you use another make utility the double click feature does not function Example Makefile An example of a makefile appears below Generated by the Visua Note Any changes mad 1DSP IDDE e to this Makefile will be lost the next time the matching project file is loaded into the IDDE If you wish to preserve chang if externally to the IDDE if The syntax of this Mak higher is required df The current working di thi
207. ion systems Flash Programmer Window Figure 3 10 shows an example of the Flash Programmer window Flash Programmer Programming Commands Ox00000000 Ox00003FFF 7 C Program Files Analog Devices VisualDSP 4 0 Blackfin Fla Ox00004000 OxO000SFFF Ox00000800 OxO00007FFF Ox00008000 OxO000FFFF 0x00010000 OxO001FFFF 0x00020000 OxO0002FFFF O0x00030000 OxO003FFFF 0x00040000 Ox0004FFFF 0x00050000 Ox000SFFFF O0x00060000 OxO006FFFF Figure 3 10 Flash Programmer Window in Driver View 3 30 VisualDSP 5 0 User s Guide Debugging Energy Aware Programming Energy aware programming is the ability to use simulation to view the relative impact of instructions source lines functions programs frequency and voltage on an application s estimated energy profile This allows you to make trade offs that minimize power usage The technique used to estimate the energy of the application is a partial implementation of a process known as Instruction Level Energy Estimation ILEE For details on ILEE refer to EE 294 on the Analog Devices Web site Ranking The Linear Profiling window in the simulator displays an Energy Units column The numbers accumulated in the Energy Units column represent the ranking of each instruction executed with regard to a power change of the processor s core voltage These numbers are generated by measuring the core vol
208. ions and Latencies Register Move Latencies In each of the following cases the stall condition occurs when the same register is used in both instructions Table D 20 Register Move Latencies Description Example lt cycles stalls gt instruction ADSP BF532 ADSP BF535 dreg sysreg 1 lt 1 gt RO LCO ALU op using dreg as src 1 lt 1 1 gt R2 R1 RO or vector ALU op 1 lt 1 gt R2 LC0 1 lt 1 1 gt R1 L R2 RND dreg preg 1 lt 1 gt RO PO sysreg dreg 1 lt 1 1 gt ASTAT RO dreg sysreg 1 lt 1 gt RO ASTAT dreg dreg 1 lt 1 1 gt R1 R0 dreg sysreg 1 lt 1 gt RO LCO0 multiply video op with dreg as src 1 1 lt 1 2 gt R2 H R1 L RO H dreg sysreg 1 lt 1 gt RO LCO accreg dreg 1 lt 1 1 gt A0 RO preg dreg 1 lt 1 gt PO R3 any processor op using preg 1 4 lt 1 3 gt RO P0 dagreg dreg 1 lt 1 gt I3 R3 any processor op using dagreg 1 4 lt 1 3 gt RO I3 dreg sysreg 1 lt 1 gt RO LCO sysreg dreg 1 lt 1 1 gt ASTAT RO accreg sysreg 1 lt 1 gt A0 w LCO accreg dreg 1 lt 1 1 gt A0 RO0 accreg sysreg 1 lt 1 gt A0 w LCO accreg preg 1 lt 1 1 gt A0 w PO D 28 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Table D 20 Register Move Latencies Contd Description Example lt cycles stalls gt instruction ADSP BF532 A
209. isualDSP 5 0 User s Guide Simulation of Blackfin Processors e None of the above applies to the 10x core The 10x core stalls when the loop start does not directly follow the LSETUP This condition causes a one time 3 cycle stall while the loop buffer is filled at the beginning of the second loop iteration e LSETUP to the same loop count register in the shadow of a previous LSETUP is held in D code until the first LSETUP commits Instruction Alignment Unit Empty Latencies If the instruction alignment unit IAU is empty of the next instruction that next instruction incurs a 1 cycle stall while the IAU is being filled The following conditions can result in an IAU empty stall e An instruction cache miss or SRAM fetch miss e A change of flow to an instruction address aligned across a 64 bit boundary e The second instruction after a hardware loop is aligned across a 64 bit boundary e The sixth instruction within a hardware loop is aligned across a 64 bit boundary Table D 23 Instruction Alignment Unit Empty Latencies Description Example s lt cycles stalls gt instruction BF532 BF535 Move register or POP to I0 or I1 1 lt 1 gt Il SP SAA BYTEOP2PBYTEOP3P 1 4 lt 1 5 gt RO BYTEOP3P R1 0 R1 0 HI Move register or POP to I0 or I1 1 lt 1 gt I0 RO BYTEOPI1P 16P 16M BYTEUNPACK 1 4 lt 1 5 gt R3 BYTEOPIP R3 2 R1 0 VisualDSP 5 0 User s Guide D
210. ithout introducing significant bugs You can modify VisualDSP s default operation for either configuration by changing the appropriate entries on the Compile Assemble and Link pages You can create custom configurations that include the build options and source files that you want Project Wide File and Tool Options Next you must decide whether to use project wide option settings or individual file settings For projects built entirely within VisualDSP with no pre existing object or archive library files you typically use project wide options New files added to the project inherit these settings VisualDSP 5 0 User s Guide 1 25 Project Development Individual File and Tool Options Occasionally you may want to specify tool settings for individual files Each file is associated with two property pages a General page which lets you choose output directories for intermediate and output files and a tool specific property page Compile Assemble Link and so on which lets you choose options For information about each tool s options see the online Help or the manual for each tool Step 5 Build a Debug Version of the Project Next build a debug version of the project Status messages from each code development tool appear in the Output window as the build progresses The output file type must be an executable DXE file to produce debugger compatible output Step 6 Create a Debug Session and Load the
211. itor Tab mode provides an alternative tab based user interface for managing multiple source files in editor windows When this mode is enabled via the View menu a tab for each open source file appears at the bottom of the editor window VisualDSP 5 0 User s Guide 2 21 Editor Windows Example3 c ol x void second int j main 00004E si m4 O0004F m4 i4 000050 dm i4 m7 000051 si toppest 000052 dm i4 m7 000053 m5 Ox3 2 000054 modify i4 m5 000055 si m0 000056 dm i4 n7 si int x int y 10 while 1 outside 10 000057 ar 0x000a 000058 dmfoutside outsidel 10 000059 dmfoutsidel outside2 10 00005A ar Ox000a Figure 2 12 Example Editor Window in Mixed Mode 2 22 VisualDSP 5 0 User s Guide Environment Figure 2 13 shows an editor window with the Editor Tab option enabled ActiveXWnd cpp This file contains CActiveXWnd anc classes used to contain and disple Copyright c 2001 Analog Devices SOLPOCLPPOEPOOLLEDEEPEPELLEOEELEEOEPLEOES include stdafx h include debugapp h include lt comdef h gt include vdebug h include activexwnd h include utility h include mainfrm h include userprefs h He LDL nent ActiveWnd cp Click a tab to view the source file Figure 2 13 Switching Between Editor Windows Using Editor Tab Mode Context Sensitive Expression Evaluation When a
212. izes all columns to have the same width as samples are collected The default is On Stages to view Specifies the stages to appear in the window Note that all stages are collected but you view only the stages that you select to appear From the dialog box s Colors tab you can specify the colors that display in the Pipeline Viewer window The current color appears under Current Color Click a color in the color palette or click Other to specify a custom color Click the Reset button to restore the default colors 2 90 VisualDSP 5 0 User s Guide Environment Pipeline Viewer Window Event Icons Table 2 21 shows Pipeline Viewer window icons that indicate pipeline stage events for ADSP TS101 and ADSP TS20x TigerSHARC processors Table 2 21 Pipeline Viewer Event Icons Icon Event Description Abort A stage contains an instruction that has been aborted Invalid A stage contains a placeholder representing a result of an Instruction in invalid fetch This condition occurs when an instruction fetch pipe alignment buffer is full or the fetch pipe was flushed because of an abort in the execution pipeline Stall A stall has been generated at a stage of the pipeline Wait An instruction at a stage of the pipeline waits to be executed id because of a stall down the pipeline Bubble The pipeline stage contains an invalid instruction as a result of B a stall up the pipeline Hit An inst
213. ject can also include data files and header files 2 8 VisualDSP 5 0 User s Guide Environment Project Window Icons for Source Code Control SCC Icons in the Project window indicate source code control SCC status An icon with a green check mark W_ indicate that the file is under SCC and is checked in An icon with a red check mark W_ indicate that the file is under SCC and is checked out Files that are not connected to a controlled copy under SCC do not display a check mark Table 2 3 shows examples of file icons used to indicate SCC status Table 2 3 SCC Status Icons Icon Description lies File is under SCC and is checked in i Le File is under SCC and is checked out Project file is checked out File includes a file specific build command and is checked out Er Makefile is checked out E3 File is excluded from the build and is checked out VisualDSP 5 0 User s Guide 2 9 Project Window Project Page Right Click Menus Right click menus also called context menus or pop up menus operate on Project window objects the project group projects folders and files These menus provide fast access to many menu bar and toolbar com mands The commands available in a right click menu depend on context the selected object Project window right click menus offer these standard commands e Allow Docking dock the Project window to the frame e Hide remove
214. katika B 7 Recording a Simulator Anomaly or Event ssssrususcinennsns B 7 Selget Processor TO pene reiri ene ees B 10 SDa OE ONS EA E E E B 10 No Boor Nodi enancia E B 10 Load Sim Loader POTD doari E B 11 SPI Simulation in Slave Mode sercarcsioioienscviniokeoieriera B 13 SIMULATION OF TIGERSHARC PROCESSORS ADOP IOT TO O a eee ieee C 1 Simulator Timing Analysis Overview srisrssscriniaiisinant C 2 Pipeline a ea new biseieaane ean C 2 a E E eee E eee C 3 Stals Due to TALU en deesatsctsasctasesaericrsnnnnaesscenen C 3 Stalls Due to Compute Block Dependency i c2cscccccseccnsvenees C 4 SARI E E icp acinar E E A E C 5 Aborts Due to an Unpredicted Change of Flow 06 C 5 Abort Due to Mispredicted Change of Flow ceeeeeeeee C 6 xviii VisualDSP 5 0 User s Guide CONTENTS Branch Taget Baller HiS lt aicciesecceremieactoreenemnisicnts C 7 Pipeline Viewer and Disassembly Window Operations C 7 Current Program Counter Value casoceaieniss catsoncinomnoranesnnnidancnies C 8 E E E E E E E C 9 Simulator OpHoNS dou stnuiccusiddeuatinintelpsntmminianes C 11 ADSP TS20 Process0rs sncccumrrcewmeamiwosnianmnneeen C 12 Simulator Timing Analysis Overview cecsssniissronninss C 12 e E E E A E A E C 13 EEE E Oo MCRL E EDE E E A AE E EA cr erenret C 14 Stalls Due te TALU Dependency sirirsiuesariseiiviisenirenniat C 14 Stalls Due to Compute Block Dependency eee C 15 Salle Due wa acne Wits cee ewreees C 15 DOTIS ente
215. king on an error message displays the offending code in an edi tor window For more information see Viewing Error Message Details on page 2 33 By default VisualDSP output is blue and tool output is black You can modify these colors by using the Preferences dialog box VisualDSP 5 0 User s Guide 2 29 Output Window Console Page The Output window s Console page Figure 2 24 on page 2 39 allows you to View VisualDSP or target status error messages View STDIO output from C C programs View I O streams messages Scroll through previous commands by pressing the keyboard s up arrow and down arrow keys Perform multiline selection copy paste and clear Issue script commands and view script command output Auto complete script commands Execute a previously issued script command by double clicking on the command Enter multiline script commands by adding a backslash character to the end of a statement Use bookmarks Toggle a bookmark by pressing Ctrl F2 Move to the next bookmark by pressing the keyboard s F2 key All text that displays on the Console page is written to the VisualDSP log file 2 30 VisualDSP 5 0 User s Guide Environment Code Development Tools Batch Processing Messages The code development tools that perform batch processing can produce error and warning messages when returning a result These messages appear on the Build page in the Output window Every
216. lDSP uses dependency information to determine which files if any are updated during a build If an included header file is modified VisualDSP builds the source files that include include the header file regardless of whether the source files have been modified since the previous build dependency files Usually user files or system header h files these files are refer enced from a source file by a preprocessor finclude command device A single processor With regard to JTAG emulation and the JTAG EZ ICE Configurator a device refers to any physical chip in the JTAG chain device driver A user written model that abstracts the hardware implementation from the application code User code accesses device drivers through a set of device driver API functions DSP digital signal processor or processor A 70 VisualDSP 5 0 User s Guide Reference Information DWARE 2 Debug With Arbitrary Records Format A format for debugging source level assembly code via improved line and symbol information editor window source window A document window that displays a source file for editing When an editor window is active you can move about within the window and perform typical text editing activities such as searching replacing copying cutting pasting and so on ELF Executable Linking Format emulator Hardware used to connect a PC to a processor target board This hardware allows application software to
217. le expression to Integer changing the global format to Float will change the format of every expression to Float Complex variables C structures and C classes appear with a plus sign Click on the plus sign to display all variable information Statistical Linear Profiling Window To open a profiling results window choose Tools Statistical Profiling or Linear Profiling and New Depending on the target the window s title is Statistical Profiling or Linear Profiling The window comprises two panes as shown in Figure 2 34 Linear Profiling ADSP BF535 Blackfin Memory Instruction Samples 1 Histogran Execution Unit Line No 05 start 34 60 main 04 34 foofint 30 58 _mi_initialize 29 barfint 90 _exit 57 82 _ getargyv 13 39 __install_ 13 39 PC Oxffa00610 91 13 PC Oxffal06f6 AP Total Samples 770 14 15 16 17 H Delme test c FFA0OSD6 SSYN FF 005D8 LINK 0x14 int i r 7 19 Figure 2 34 Example of a Linear Profiling Window Window Components The window which comprises two panes and a status bar provides a right click menu for performing various window functions VisualDSP 5 0 User s Guide 2 55 Debugging Windows Left Pane The window s left pane displays a list of the executed functions assembly source lines and PCs with no debug information The time that each item spends on execution appears as a histogram an
218. led Simulator Peripheral Support Modeled Streamable Bootable SPORT Vv v FR UART FR FR FR PCI NP NP NP USB NP NP NP Flags v v NA System Timers v v NA RTC v NA NA EBIU NP NA NA SPI FR FR NP Watch Unit FR NA NA Trace Unit FR NA NA Core Timer v FR NA MEMDMA v NA FR DMA v v FR PROM NP NA NP VisualDSP 5 0 User s Guide D 3 Peripheral Support in Simulators Table D 3 Peripheral Support in the ADSP BF535 Compiled Simulator Peripheral Support Modeled Streamable Bootable GPIO FR FR NA Watchdog Timer vd NA NA D 4 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Table D 4 summarizes peripheral support for ADSP BF52x ADSP BF533 ADSP BF534 ADSP BF536 ADSP BF537 ADSP BF538 and ADSP BF539 processors ADSP BF54x processors have no support for any system peripherals Only the simulator core peripherals are supported Table D 4 Peripheral Support in the ADSP BF533 Simulator Peripheral Support Modeled Streamable Bootable SPORT v v FR UART v v FR Flags FR FR NA System Timers v v NA RTC v NA NA EBIU v NA NA PPI v v NP SPI FR FR NP Watch Unit v NA NA Trace Unit v NA NA Core Timer v NA NA Watchdog Timer FR NA NA PROM FR NA FR MEMDMA V NA FR DMA v v FR 1 SDRAM only Not all configuration settings affect simulation
219. lexed TDM multichannel mode session See debug session session name Although the choice of target platform and processor define the session you may want to further identify the session To prevent confusion later modify the default session name when you first create the debug session A session name can be any string and can include space characters There is no limit to the number of charac ters in a session name but the Session List dialog box can display about 32 characters session type See connection type shortcuts See keyboard shortcuts signal For VDK a method of communicating between multiple threads VDK supports four types of signals semaphores events messages and device flags VisualDSP 5 0 User s Guide A 83 Glossary simulator The simulator is software that mimics the behavior of a processor chip Simulators are often used to test and debug code before the processor chip is manufactured The way a simulator runs an executable program in software is similar to the way a processor does in hardware The simulator also simulates the memory and I O devices specified in the 1df file VisualDSP lets you interactively observe and alter the data in the processor and in memory The simulator reads executable files A simulator s response time is slower than that of an emulator source files The C C language and assembly language files that make up your project Other s
220. lication program enable I O capabilities and simulate source to target data streaming VisualDSP provides a Trace window Refer to Trace Windows on page 2 52 and to Help for details A trace includes the following information e Buffer depth instruction lines e Cycle count e Instructions executed such as memory fetches program memory writes and data memory transfers Viewing the disassembled instructions that were performed can also help in analyzing code behavior VisualDSP 5 0 User s Guide 3 9 Program Execution Operations Program Execution Operations By default when VisualDSP starts up it attaches to the previous ses sion You can override this behavior and instead force VisualDSP to start a new session When loading and running your program use VisualDSP features to step break and halt the program Selecting a New Debug Session at Startup If you had a problem such as a corrupted workspace in your last debug session use the following procedure to force a fresh session at startup l VisualDSP must be closed before performing the following procedure Hold down the keyboard s Ctrl key Do not release the Ctrl key until the Session Wizard appears as described in the next step Invoke VisualDSP as you normally do Typical methods include using the Windows Start button sequences clicking desktop icons or using Windows Explorer The Session Wizard appears Spe
221. link ports are rough estimates of cycle counts that you could obtain by running the code on the chip Do not rely on these counts for performance evaluation The Pipeline Viewer window shows the flow of instructions through the pipeline and any stalls due to sequencer or memory events It helps you understand how processor timing affects the execution of your program For information about configuring and using the Pipeline Viewer see Pipeline Viewer Window on page 2 88 or VisualDSP online Help Pipeline Stages The ADSP TS101 Pipeline Viewer window provides a representation of instruction flow through the processor s pipeline Table C 1 lists the pipe line stages Table C 1 Pipeline Stages ADSP TS101 Processor Stage Abbreviation in Pipeline Viewer Instruction Fetch 1 F1 Instruction Fetch 2 F2 Instruction Fetch 3 F3 Decode DECODE Integer INT Access ACCESS C 2 VisualDSP 5 0 User s Guide Simulation of TigerSHARC Processors Table C 1 Pipeline Stages ADSP TS101 Processor Cont d Stage Abbreviation in Pipeline Viewer Execute Stage 1 EX1 Execute Stage 2 EX2 Pipeline stages F1 through F3 represent the fetch unit pipe Stages DECODE through EX2 represent the execution pipe Fetch unit pipe stages contain raw quads of 32 bit words fetched from memory not valid instruction lines When you view the Pipeline Viewer window in disassembly format b
222. lities Manual Expert Linker graphically displays the available project information in an 1df file as input This information includes object files LDF macros libraries and target memory descriptions Use the drag and drop function to arrange the object files in a graphical memory mapping representation When you are satisfied with the memory layout generate the executable file DXE via VisualDSP project options VisualDSP uses a default 1df file when a project does not have one For an exiting Blackfin project you can add an 1df file via the Add Startup Code LDF subpage of the Project Options dialog box For SHARC and TigerSHARC projects use the Create LDF Wizard to create and customize a new 1df file When opened in a project that already includes an 1df file Expert Linker parses the 1df file and graphically displays the target processor s memory map and the object mappings The memory map appears in the Expert 1 34 VisualDSP 5 0 User s Guide Introduction to VisualDSP Linker window Figure 1 4 on page 1 36 Use this display to modify the memory map or the object mappings When the project is ready to be built Expert Linker saves the changes to the 1df file Expert Linker can graphically display space allocated to program heap and stack After you load and run your program Expert Linker indicates the used portion of the heap and stack You can then reduce the size of the heap or stack to minimize the m
223. lp especially when running a search or looking up an entry in the Help Index Enhanced Licensing and Registration Software licence borrowing for floating licenses allows you to check out a floating license from a server for a predetermined length of time On the Licenses page of the About dialog box when a client license is installed the server_name appears under Serial Number client appears under Family and use_server appears under Status The Machine ID box displays the C drive s volume ID If you are running off a server based floating license this box displays the MAC address of the primary Ethernet controller in the machine New Project Types The Project Wizard has been changed to simplify the process of creating a new project 1 8 VisualDSP 5 0 User s Guide Introduction to VisualDSP e Control over Automatic Breakpoints You can configure whether automatic breakpoints are set after a program is loaded You can specify additional breakpoints to be set after a load and you can specify each additional breakpoint as being a software breakpoint or a hardware breakpoint Enhancements to Call Stack Window To improve the debugging of Release configurations a call stack is provided regardless whether debug information is present When using the Call Stack window when debug information is not available double clicking on an item in the window will open a Disassembly window if one is
224. lso provides access to many debugging windows to facili tate project development For more information see Debugging Windows on page 2 43 You have to learn only one interface to debug all your processor applications VisualDSP supports ELF DWARF 2 executable files VisualDSP supports all executable file formats produced by the linker Title Bar Figure A 9 shows the different parts of the title bar which has been split into three parts to fit the page gt Analog Devices VisualDSP Target ADSP BFS35 4DSP BFS35 Family Simulator Project dot_product_asm dpj Figure A 9 Title Bar The title bar includes these components e Control menu button g e Application name Analog Devices VisualDSP e Name of the active target A 16 VisualDSP 5 0 User s Guide Reference Information e Project name e File name when an editor window is maximized in the main window e Standard Windows buttons Clicking the control menu button opens the control menu which contains commands for positioning resizing minimizing maximizing and closing the window Double clicking the control button closes VisualDSP The title bar right click menu Figure A 10 and control menu Figure A 11 are identical Additional Information in Title Bars A register window s title bar displays its numeric format such as octal An editor window s title bar displays the name of the source file Title Bar Right Click
225. lt in toolbar You can reset the buttons in a built in toolbar to their original default settings e You can change the name of a user defined toolbar but not the name of a built in toolbar For example the File toolbar cannot be changed to a different name Refer to VisualDSP Help for details Status Bar The status bar which is located at the bottom of the main application window provides various informational messages Figure A 15 shows examples of information displayed on the status bar VisualDSP 5 0 User s Guide A 29 Parts of the User Interface Ready Halted 4 Step one line Halted 00000000 For Help press F1 Line 21 Col 1 NUM 2 Figure A 15 Status Bar Appearance Depends on Context The type of information that appears in the status bar depends on your context what you are doing e Moving the mouse pointer over a toolbar button or a menu bar command displays a brief description of the button or command e Halting program operation with a Halt command displays the address where the program halted e When using script commands the status bar provides information such as when the menu item has focus While editing a file the right side of the status bar displays editor window information as described in Table A 7 Table A 7 Status Bar Information While Editing Item Indicates Line Cursor current line number Col Cursor current column number
226. lter tab select C C functions and click the Add but ton to open the Add Functions dialog box Then select the Show all functions option Working With Ranges Clicking on the icon in an address range expands or contracts the list of functions within that address range When expanded the list of functions appears and the profiling data appear immediately after the address range Switching Display Modes The right click menu s Mixed and Source commands simplify switching between two views Table 2 37 shows the source mode view and Figure 2 38 shows the mixed mode view Note that you can display the right pane in source mode while in mixed mode you can display C C source lines and assembly code 2 60 VisualDSP 5 0 User s Guide Environment C Program Files Analog D 4 8 void barfint i EN 10 i 13 maint 14 4 15 int 1 2 16 17 for i 0 i lt 5 i 18 19 r fooi 20 21 Ze Figure 2 37 Source Mode View KI Line C Program Files Analog D fa F000014 JUMP PO 3 12 13 main F000014C LINK 0x18 14 15 int i r 16 Li for i 0 i lt 5 i F0000150 R3 O0 F0000152 FP 12 F0000154 R2 FP F0000156 Ri 5 F0000158 CC R2 R1 F000015 IF CC JUMP 18 v Figure 2 38 Mixed Mode View When you view the window in mixed mode profiling data for each assem bly line displays as shown in Table 2 39 Mixed
227. lting the target Other wise the plot window halts the processor reads memory updates the plot and resumes the processor The plot window allows data to be streamed to or from a binary data file The data file can be converted into ASCII format for input to other applications such as MATLAB and Excel VisualDSP 5 0 User s Guide 3 17 Simulation Tools The processor application may collect and transfer data in four different ways e Sampling a test point over time ping P e Transferring a data array over BTC at a specified point in the application SHARC and Blackfin emulation targets only e Using GetMem directly e Periodically halting the target to read memory For information about using BTC refer to the VisualDSP Getting Started Guide 3 18 VisualDSP 5 0 User s Guide Debugging Plots Use the VisualDSP data plotting capability to display data in processor memory as a plot graph in a plot window Figure 3 2 A data plot can assist you by allowing you to visualize data Refer to Plot Windows on page 2 109 for plot window configuration information For complete details on configuring plots refer to VisualDSP Help G Line Plot Example Line Plot Example Line Plot Figure 3 2 Plot Window Displaying Processor Memory VisualDSP 5 0 User s Guide 3 19 Plots When plotting processor memory you can e Choose from multiple plot types and specify the plot s data a
228. makefile Project dependency T Project on which another project depends Folders can be nested to any depth Folders carry no attributes to the build process as they do not reflect the file system Folders do not appear in directory listings as in Windows Explorer When you add files to the project tree with automatic file placement each file is placed in the first folder configured with the same file extension After automatic placement you can manually move a file anywhere VisualDSP 5 0 User s Guide 2 7 Project Window To move a file out of one folder and into another folder select the file and drag it onto the other folder Project Files In the Project window files are represented by the icons in Table 2 2 Table 2 2 File Icons in the Project Window Icon Description Files that use project options Files that use options that differ from project options Files excluded from the current configuration OI Enabled active makefile The files appear in an expandable and collapsible node tree Source files are the C C language or assembly language files in your project Source files provide the project with code and data You can add delete and modify source files Each project must include one 1df file which contains command input for the linker If an 1df file is not included in the project the project is built with a default 1df file A pro
229. mats the other being source mode Mixed mode displays assembled code after the line of the corresponding C code A 76 VisualDSP 5 0 User s Guide Reference Information multiprocessor group The assignment of one or more processors to a group enabling a single multiprocessor operation MP Run MP Halt MP Step MP Reset and MP Restart to affect the processors in the cur rently selected group multiprocessor system A system built with multiple processors Often performance based products require two or more processors A system built with a single processor is called a single processor system Debugging a multiprocessor system requires that you synchronously run step halt and observe program execution operations in all the proces sors at once The SHARC and TigerSHARC simulators do not support this capability non bootable PROM image file Splitter output consisting of PROM files that cannot be used to boot load a system outdated file A file that has been edited since the last build payload For VDK an arbitrary amount of data associated with a message A reference to the payload can be passed between threads as part of a message to enable the recipient thread to access the data buffer that contains the payload pinning a window A technique that statically associates a window to a specific processor VisualDSP 5 0 User s Guide A 77 Glossary pipelining A feature that helps you analyze and tun
230. may appear in the Pipeline Viewer window VisualDSP 5 0 User s Guide D 17 Simulator Instruction Timing Analysis for ADSP BF535 Processors Table D 9 Abbreviations in the Pipeline Viewer Window Abbreviation Meaning ALU Arithmetic Logic Unit operations Logical ops Bit ops Shift Rotate ops Arithmetic ops excluding Mult Vector ops excluding Mult MAC ALU2op A two operand ALU instruction AQreg CC2dreg CC register move to a dreg ccMV Conditional move CCreg CC register This multipurpose flag typically holds the result of an arithmetic comparison DAG Data Address Generator unit Dagreg A DAG register for example P5 0 13 0 M3 0 B3 0 and L3 0 dreg Data register for example R7 0 or Al 0 Dsp32alu A 32 bit DSP ALU instruction EXU Execution unit IAU Instruction Alignment Unit MAC Multiplier Accumulator Unit MUL Multiplier Unit operations for example Vector Multiply 32 bit Multiply Vector MAC preg Pointer register for example P5 0 FP USP or SSP RAW Read after write regmv A register move sysreg System Register for example LC1 0 LB1 0 LT 1 0 SYSCFG SEQSTAT ASTAT RETS RETI RETX RETN RETE CYCLES and CYCLE2 WAW Write after write Video Video operations video pixel operations D 18 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Simulator Instruction Timing Analysis for ADSP BF531 ADSP
231. menu The available commands and subsequent windows depend on the processor 2 78 VisualDSP 5 0 User s Guide Environment Figure 2 53 shows an example Register menu tree for a SHARC processor Register File Program Counters Manage DAGI DM Loop Counters are DAG2 PM Cycle Count ngn Interrupts Counters Loop Address Register Stacks Loop Counter Custom Status PC Stack Inactive Registers Status Core Other System IOP System Control DMA Addressing DMA Status External Port Control Register File SPORT Multichannel Control DAGI DM SPORT Divisors DAG2 PM SDRAM Control MR Registers lo Port Control PX Registers I O Ports Status 125 Mode Cache Control SPORT Control DSP Serial Mode Cache Contents Timer Control Multi Channel Mode Figure 2 53 Example Register Menu Tree for a SHARC Processor VisualDSP 5 0 User s Guide 2 79 Debugging Windows Figure 2 54 shows an example of a data register file in a register window Active Register File E3 Figure 2 54 Example Register Window 8000001800 3EDO3FC900 8000000100 8OH00000100 8000001900 AAAAAAAAAA 8900001900 8000001900 R8 R9 R19 R11 00AAAAALAA AAAAAAAAAA 40CSO0FDBO0 GOHOHOO100 G8OHOHOO100 AAAAAAAAAA GAHOHOHOHOH HOHOHOHHOH A register window enables you to e View and change register contents Change the window s presentation number format Regis
232. mize VisualDSP to meet your needs Refer to VisualDSP Help for how to information This chapter is organized as follows e Project Window on page 2 2 provides a project hierarchy e Editor Windows on page 2 16 allow you to view and edit files e Output Window on page 2 28 provides I O messages and a scripting input e Debugging Windows on page 2 43 focuses on each debugging window presenting its purpose and features For information about the VisualDSP title bar menu bar and control menu toolbars and user tools and status bars refer to Parts of the User Interface on page A 15 VisualDSP 5 0 User s Guide 2 1 Project Window Project Window To open a Project window choose View and Project Window Figure 2 1 shows a Project window with VDK enabled Project Test DK dpj Project group 1 project s lp Test DK oe Source Files The project includes i yp a Kernel Files folder ay Header Files when the project has H Linker Files VisualDSP kernel H E Kemel Files support Project Kernel tab displays a VDK view Project tab displays a project view Figure 2 1 Example Project Window With Kernel Tab An additional folder titled Generated Files may be present when a project includes startup files The Project window can include two sub tabs e The Project tab Project which is always available displays a hierarchal
233. mode only regardless whether an 1df file was being booted because most users develop code whose final form is booted into the processor Load Sim Loader Options Depending on the target processor the Load Sim Loader submenu provides these boot options e Boot from Host 32 bit Host 16 bit Host or 8 bit Host e Boot from PROM e Boot from Link ADSP 21060 ADSP 21062 and ADSP 2116x processors only VisualDSP 5 0 User s Guide B 11 Load Sim Loader Options Boot from SPI 32 bit Host 16 bit Host or 8 bit Host for ADSP 2116x processors only None of Above disables boot mode Create a boot loader file 1dr based on the peripheral from which you are loading In a simulation target session choose a peripheral boot option and boot file as follows To create a boot loader file 1 From the Settings menu choose Load Sim Loader and a boot option such as Boot from Host to open the Open a Boot File dialog box Navigate to the 1dr file and select it Then click Open and OK A message instructs you to issue a reset instruction to execute the loader From the Debug menu choose Reset The simulator runs and boots in the boot kernel also called loader kernel A message instructs you to issue a run instruction which executes the loader From the Debug menu choose Run F5 to execute the loader The loader runs to completion and then displays a message indicating that the loader is finished and tha
234. mote an error to a warning or remark Say for example that a condition in the input is crashing the tool You could restrict the severity level of the problem to report an error instead of a fatal error Another way to suppress the reporting of an individual error message is to use pragmas in the input source via the tool s command line For more information about pragmas refer to your processor s VisualDSP C C Compiler and Library manual The following examples demonstrate how to promote demote and sup press messages The source file test c is being compiled include lt stdio h gt int foo void printf In foo n doesn t return a value int main void int x no initial value printf x d n x return foo VisualDSP 5 0 User s Guide 2 35 Output Window Example 1 Compiling from the Command Line Interface Compiling test c yields two warning messages cc0117 and cc0549 cc21k c test c test c line 5 cc0117 D warning non void function foo should return a value A test c line 10 cc0549 D warning variable x is used before its value is set printf x d n x A build completed successfully Notice that the compiler appended the letter D to each warning message indicating that the message is discretionary Example 2 Promoting Warnings to Errors For example typing cc21k c test c Werror 549 in a command win dow promotes o
235. n dow is the address of the instruction at stage E2 When a breakpoint is set at a certain address the simulator halts after the instruction at this address is executed at stage E2 You can specify which instruction the simulator executes next by manually changing the program counter value in the PC Register window Note however that the current instruction indicated by gt in the Disassembly window is executed prior to the user specified instruction When you change a PC value the simulator flushes the pipeline and aborts all its instructions After the pipeline is flushed normal execution resumes from a memory address indicated by the new PC value The simulator contin ues to run until an instruction at the new PC reaches stage E2 of the pipeline Manually changing the PC value during simulation can result in unpredictable program behavior VisualDSP does not safeguard against invalid PC values Ensure that the specified PC indicates a valid instruction within program address space An example of an invalid PC is a data memory address whose con tents is not recognized as an instruction by the simulator In this case the simulator generates an unhandled software exception Another example of an erroneous PC is the middle of an instruc tion line Only part of the instruction line is executed while instructions in the beginning of the line are ignored C 20 VisualDSP 5 0 User s Guide Simulation of TigerSHARC Process
236. n you rely on the BAUDR field in slave mode a maximum value of 0x5 is used for this field The End of file and File not connected errors are sup pressed until a read of SPIRX or a valid DMA is set up Refer to the ADSP 21161 SHARC DSP Hardware Reference for details VisualDSP 5 0 User s Guide B 13 SPI Simulation in Slave Mode B 14 VisualDSP 5 0 User s Guide C SIMULATION OF TIGERSHARC PROCESSORS This appendix describes how to simulate TigerS HARC processors The information is organized as follows e ADSP TS101 Processors on page C 1 e ADSP TS20x Processors on page C 12 ADSP TS101 Processors This section includes the following topics which apply to ADSP TS101 processors e Simulator Timing Analysis Overview on page C 2 e Pipeline Stages on page C 2 e Stalls on page C 3 e Aborts on page C 5 e Pipeline Viewer and Disassembly Window Operations on page C 7 e Simulator Options on page C 11 VisualDSP 5 0 User s Guide C 1 ADSP TS101 Processors Simulator Timing Analysis Overview The ADSP TS101 simulator is a cycle accurate simulator It not only models the instruction set functionally but also correctly models pipeline effects stalls and aborts Currently the processor s external port and link ports are not modeled in a cycle accurate manner The simulator cycle counts the code but the cycle counts used for the external port or
237. n a multiprocessor debug session a s PO Halted PT Halted P2 Halted A P3 Halted P4 Halted A P5 Halted Figure 2 56 Example Multiprocessor Window Multiprocessor Window Pages The Multiprocessor window has two tabbed pages Status and Groups Status Page The Status page Figure 2 57 shows the status of each processor in the multiprocessor system A horizontal bar highlights the processor with focus Change focus by clicking on a processor in the list 2 84 VisualDSP 5 0 User s Guide Environment Processor sd State O PO Halted PI Halted P2 Halted A P3 Halted D P4 Halted Halted Figure 2 57 Multiprocessor Window Status Page Groups Page The Groups page Figure 2 58 shows the current list of multiprocessor groups A Default group is created with each new multiprocessor session The members of the Default group are the processors that you checked off under Multiprocessor System in the New Session dialog box Multiprocessor x Figure 2 58 Example Multiprocessor Window Groups Page VisualDSP 5 0 User s Guide 2 85 Debugging Windows From the Groups page you can assign one or more processors to a group Performing a multiprocessor operation MP Run MP Halt MP Step MP Reset and MP Restart affects only the processors in the currently selected group Right clicking on the Group page displays a context menu for adding or removing a group Oper
238. n page 3 10 e Simulation Tools on page 3 16 e Plots on page 3 19 e Flash Programmer on page 3 26 e Energy Aware Programming on page 3 31 Debug Sessions You run the projects that you develop as debug sessions sessions A session is defined by the elements listed in Table 3 1 Table 3 1 Specifying a Debug Session Element Description Processor When you create an executable file the processor is specified by the Linker Description File 1df and other source files VisualDSP 5 0 User s Guide 3 1 Debug Sessions Table 3 1 Specifying a Debug Session Cont d Connection The connection type target is the software module that controls a type of type debug target a simulator or an emulator A simulator is software that mimics the behavior of a processor chip Simula tors are used to test and debug processor code before a processor chip is man ufactured The choice of an EZ KIT Lite connection type uses a debug agent as the platform An emulator is software that talks to a hardware board that contains one or more actual processors Platform For a given debug target several platforms may exist For a simulator the platform defaults to the identically named simulator When the debug target is an EZ KIT Lite board the platform is the board in the system on which to focus When the debug target is a JTAG emulator the platforms are the individual JTAG c
239. n page B 4 e Recording a Simulator Anomaly or Event on page B 7 e Select Processor ID Options on page B 10 e Simulator Options on page B 10 e Load Sim Loader Options on page B 11 e SPI Simulation in Slave Mode on page B 13 Anomaly Options The Anomalies submenu under the Settings menu provides commands to help you determine where an anomaly might be affecting your code This submenu appears only when the simulator supports anomaly com mands for the selected processor VisualDSP 5 0 User s Guide B 1 Anomaly Options ADSP 21x6x Processor Anomalies If you know that your silicon has anomalies the simulator lets you configure reporting for the following anomaly events By default these options are OFF disabled e Shadow Write This command opens the Configure Simulator Event dialog box from which to configure reporting for shadow write anomalies e SIMD FIFO This command opens the Configure Simulator Event dialog box from which to configure reporting for SIMD FIFO anomalies Shadow Write FIFO Anomaly ADSP 2116x Only For examples and workarounds refer to anomaly 39 at the Analog Devices embedded processors and DSPs Web site This anomaly has been identified in the shadow write FIFOs that exist between the internal memory array of the ADSP 21160M and core I O processor IOP buses that access the memory Refer to the hardware doc umentation for more details on shadow register
240. n to VisualDSP Table 1 6 Build Options Options Description Project Specify these options from a tabbed page for example Compile or Link for each of the code development tools Individual file These settings override project wide settings Custom build For maximal flexibility edit the command line s issued to build a particular file For example you might call a third party utility The build process updates the selected source file s output obj file and the output file s debug information Building a single file is very fast Large projects however may require hours to build If you change a common header file that requires a full build you can build only the current file to ensure that your change fixes the error in the current file Batch Builds Performing a batch build builds one or more build targets in the open project group You must configure the batch build before you can build it A build target in a project group is formed by the combination of a project and a project configuration such as a Release configuration Refer to VisualDSP Help for details on configuring and running a batch build Pre Build and Post Build Options Pre build and post build options are typically DOS commands that are executed before building a project and after a successful project build These commands invoke external tools You can configure these options via the Project Options dialog box
241. n which the expression relies may be incorrect if you change VisualDSP s context from the Call Stack window 2 50 VisualDSP 5 0 User s Guide Environment Expressions Hexadecimal Address index Ox00000004 Ox0002fffa Ox00000001 Hexadecimal primnes 4 11 Ox00028004 int O0x00000001 Unsigned Integer pi 3 14159 Ox0002fffd float Ox00000001 Float primes 0x00028000 int 0x00000014 Hexadecimal Figure 2 31 Expressions Window Expressions Permitted in an Expression Window Figure 2 13 lists and describes the types of expressions that may be entered in an Expressions window Table 2 13 Types of Expressions Permitted in an Expressions Window Expression Description Memory address Precede memory identifiers with a sign for example dm 0xF0000000 Register expression Precede register names with a sign for example r0 r1 ipend po or imask C C statements Use standard C C arithmetic and logical operators Multiprocessor expression emulator sessions only Expressions can be evaluated on a particular processor by using the format processor_name expression where processor_name is the name of one of your MP proces sors and expression is the expression that you want to evaluate on that processor For example on an MP system with two processors master and slave this expression evaluates the PC register on master master PC VisualDS
242. ncies appear in the Project view Project dsfs dpj Project group 3 project s i tiger Source Files Linker Files Header Files Component Files Documentation J acadia Ely acadia Source Files Linker Files E Component Files 9 Documentation 1 The tiger project depends on the acadia project The acadia project has no project dependencies yf Source Files Linker Files Header Files acadia gA tiger N Project o E Dp dts a a Qo wl The dts project depends on two projects Figure 2 4 Projects Dependencies Indicated in the Project View Project Nodes The Project window comprises the types of nodes described in Table 2 1 Project Folders Project window folders J and organize files within a project You can specify properties for folders 2 6 VisualDSP 5 0 User s Guide Environment Table 2 1 Types of Nodes in the Project Window Node Icon Description Project group Only one project group permitted in a debug ses sion Project Multiple projects permitted but only one is active indicated with bold typeface Folder Closed folder Opened folder revealing its contents File File that uses project settings File whose options differ from the project options BSW a ee File excluded from the current configuration F Enabled active
243. nd presentation e Apply a data processing algorithm to the processor s memory data e Modify a plots configuration and immediately view the results e Zoom in on a plot area or view data point values in a plot window e Print a plot save the plot image to a file or save the plot s data to a file Plot Types Each plot must be specified to be one of the plot types in Table 3 4 Table 3 4 Available Plot Types Plot Type Description Requires Line on page 3 21 Displays points connected by a line Y value for each data point X Y on page 3 21 Similar to a line plot but also uses X axis data X value and Y value for each data point Constellation on page 3 22 Displays a symbol at each data point X value and Y value for each data point Eye diagram on page 3 23 Typically used to show the sta bility of a time based signal Y value for each data point Waterfall on page 3 24 3 D plot typically used to show the change in frequency content of signal over time Z value for each data point Spectrogram on page 3 26 2 D plot displays amplitude data as a color intensity Z value for each data point The X Y and Z values are read from processor memory 3 20 VisualDSP 5 0 User s Guide Debugging Line Plots A line plot Figure 3 3 displays a range of processor memory values con nected by a line The values read from proce
244. nd clicking Toggle Breakpoint button w e Double clicking a line in a Disassembly window or editor window Symbols in the left margin of a Disassembly window or editor window indicate breakpoint status as shown in Table 3 3 Table 3 3 Breakpoint Status Symbols Symbol Indicates Enabled set software breakpoint Disabled software breakpoint recognized but cleared VisualDSP 5 0 User s Guide 3 13 Program Execution Operations Table 3 3 Breakpoint Status Symbols Symbol Indicates Enabled hardware breakpoint o Disabled hardware breakpoint i Unconditional and Conditional Breakpoints A breakpoint configured to occur when the Program Counter reaches a specific address is an unconditional breakpoint The breakpoint occurs when it is reached A breakpoint configured to occur when various conditions criteria are met is called a conditional breakpoint The conditions may include e A user defined expression that must evaluate to TRUE e A skip count that specifies the number of times to skip over the breakpoint before finally halting If both an expression and skip are set execution stops when the break point is reached n times when the expression is true where n represents the skip count When the expression is empty execution stops when the breakpoint is reached n times Automatic Breakpoints You can configure whether the automatic breakpoin
245. nd memory windows that you plan to use If these windows are not pinned they display information for any processor that has focus When a window is pinned to a processor a pin icon appears in the win dow s upper left corner For example PRQGIEUESEREINGY Window Title Bar Information Figure 3 1 shows a pinned window in a multiprocessor debug session The title bar of a pinned window shows e A pushpin icon 3 to indicate that it is a pinned window e The processor s name e Window title e Number format such as hexadecimal for windows that support multiple formats 3 6 VisualDSP 5 0 User s Guide Debugging 30000 93600C D 030018 F 030024 A 030030 03003C i 030048 EI 030054 i Er oAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA HAHoooeD GAHOooad oAAAAAAA AAAAAAA AAAAAAA AAAA AAAAAAA AAAA 800000 AAAAAAAA AAAAAAAA AAAA Figure 3 1 Pinned Window in a Multiprocessor Debug Session Additional Focus Indication If configured VisualDSP shades unfocused windows with a specified color You can specify the background color of focused and unfocused windows For details refer to VisualDSP Help Code Analysis Tools You use code analysis tools to examine your code s behavior and locate areas that may be optimized for better performance VisualDSP provides these code analysis tools e Statistical Profiles and Linear Profiles on page 3 8 e Trace
246. ndling interrupts in both C and assembly VisualDSP 5 0 User s Guide Introduction to VisualDSP Designing Structured Software With VisualDSP Consider elements of software design code reuse and interoperability If you are new to embedded systems try to acquire a clear understanding of The role of and motivation behind component software The role of an RTOS How to use VDK to manage multiple threads of execution and the communication between those threads Optimizing Performance With VisualDSP At this stage you should understand how to access the features of the processor and how to use a structured approach to develop software Next optimize your software to take full advantage of the processor s computa tional power This entails Understanding the compiler optimizer Writing mixed C and assembly programs Accessing C C data structures in assembly Harnessing the power of C Setting up and using overlays Configuring emulation L1 memory for cache versus SRAM with cache visualization Using statistical profiling VisualDSP 5 0 User s Guide 1 13 Project Development Testing and Debugging With VisualDSP At this stage you should have a good understanding of the various facili ties available for producing optimal software The last step applying software testing and debugging techniques includes e Collecting and viewing data using the advanced plot windows e Using compiled simulation
247. ne of the two warnings cc0549 to an error cc21k c test c Werror 549 test c line 5 error cc0117 D warning non void function foo should return a value AN test c line 10 cc0549 D error variable x is used before its value is set printf x d n x N l error detected in the compilation of test c cc21k Fatal Error Compilation failed 2 36 VisualDSP 5 0 User s Guide Environment Example 3 Demoting Messages to Remarks You can demote messages to remarks By default the compiler does not display anything less significant than a warning The Wremarks flag in the following command outputs the two warnings plus additional remarks cc21k c test c Wremarks The Wremark 549 117 flag in the following command demotes two spe cific messages to remarks The command produces no output because all the messages are changed to remarks which are not displayed cc21k c test c Wremark 549 117 The following command changes the two warnings to remarks and then displays all seven remarks cc21k c test c Wremark 549 117 Wremarks Example 4 Suppressing Messages The following command suppresses two specific warning messages The command outputs five remarks but the two warnings do not display even though the Wremarks flag requests all the remarks cc21k c test c Wsuppress 549 117 Wremarks Suppressing Compiler Warnings and Remarks You can suppress compiler warnings a
248. ng Windows Each debugging window has a control menu You can open a debugging window s control menu only when the window is floating in the main window For more information see Debugging Windows on page 2 43 Menu Bar By default the menu bar Figure A 12 appears directly below the applica tion title bar It displays menu headings such as File and Edit File Edit Session View Project Register Memory Debug Settings Tools Window Help Figure A 12 VisualDSP Menu Bar To display menu commands and submenus click a menu heading You can also run many menu bar commands by e Clicking toolbar buttons e Typing keyboard shortcuts e Right clicking and choosing a command from a context menu Toolbars and User Tools A toolbar is a set of buttons You can run a command quickly by clicking a toolbar button VisualDSP 5 0 User s Guide A 19 Parts of the User Interface Use toolbars to organize the tasks that you use most often Position tool bars on the screen for fast access to the tools that you plan to use VisualDSP includes standard built in toolbars You can create custom toolbars Refer to Toolbar Operation on page A 27 for more informa tion about toolbars Built In Toolbars Table A 3 shows the standard default toolbars Table A 3 Built In Toolbars Nae Toolbar File ojew sle Edit sjej ajs lelaga Aala Project ax etae Sle BTC AsmDemo D
249. ng to one of the DAG registers and imme 13 R3 diately reading I3 R7 dsp32alu implied ireg dependency RAW haz ard ccMV preg gt dreg RAW A conditional move of a preg into a dreg fol If CC RO Pl hazard lowed by a read of the dreg RO R1 ccMV dreg gt dreg RAW A conditional move of a dreg into a dreg fol hazard lowed by a read of the source dreg R2 RO ccMV dpreg gt preg A conditional move of a dreg into a preg fol If CC PO R1 RAW hazard lowed by a read of the preg P1 PO VisualDSP 5 0 User s Guide D 13 Simulator Instruction Timing Analysis for ADSP BF535 Processors Table D 7 Stalls Detected Messages ADSP BF535 Processor Contd Message Explanation Example loopsetup WAW hazard A LSETUP instruction followed by another LSETUP LSETUP both writing to the same LC reg LS LE LCO P0 LSETUP LS LE LCO P1 loopsetup while Ic is Using an LSETUP instruction and writing a LSETUP nonzero value other than zero to the Lcreg LS LE LCO P0 op loop top bot RAW haz Writing to a loop top bottom register followed LTO RO ard by a read of the same register R2 LTO write to loop cnt stall A write to a LCreg followed by any op LCO RO op any op multicycle ALU2o0p A two operand ALU instruction requiring more RO R1 instruction than one cycle to complete multicycle DAG SP instruction R7 0 P5 0 CC2dreg RAW hazard R
250. nguage Setti Eh Preprocessor E Processor 1 E Processor 2 E Profile quided Optimize fe Warning fy Assemble fig Link E General fy LDF Preprocessing E Elimination fe Processor z El Load fe Options fy Kernel fy Splitter Lo a oo 4 gt Project Options for BTC_audio_demo ed ifs Project me SD SP BF533 v Revision Automatic Type Executable file Name BTC_audio_demo r Tool Chain Compiler C C Compiler for Blackfin Assembler Blackfin Family Assembler bal Linker Blackfin Family Linker Loader Blackfin Family Loader m Splitter Settings for configuration Debug Cancel Figure 1 7 Example Project Options Dialog Box Showing Project Page For each code development tool compiler assembler linker splitter and loader one or more pages provide options that control how each tool processes inputs and generates outputs The available pages depend on your target Options correspond to tool command line switches You can define these options once or modify them to meet changing development needs Tools can also be accessed from the operating system s command line VisualDSP 5 0 User s Guide 1 47 Processor Projects Project options also specify the following information e Project target e Tool chain e Output file directories e Pre and post build options Project Gr
251. not already open and jump to the address linked to the specific item in the Call Stack window From these two windows you can now set the display format on a per expression basis Additional columns are available to display the expression s type address size and format e Stand Alone Flash Programmer This utility provides flash pro gramming support between the development prototype stage and early pre production runs The Stand Alone Flash Programmer enables the development engineer to script or automate this process with a license free tool allowing the manufacturing technician to repeatedly program any number of boards prior to major production Consult VisualDSP Help for details and how to use these new features VisualDSP 5 0 User s Guide 1 9 Product Updates and Upgrades Product Updates and Upgrades VisualDSP is a licensed software product Installation and licensing are described in the VisualDSP Licensing Guide which is available from Help This section describes product updates and upgrades Various support functions are available from the About dialog box as described in Support Information on page A 2 VisualDSP Product Upgrades From time to time Analog Devices releases new software versions upgrades Starting with VisualDSP 3 5 new versions of VisualDSP are discrete upgrades Your PC can maintain multiple versions of VisualDSP Refer to online Help for details on upgrading yo
252. ns that control auto refresh settings for plot windows These settings determine the method in which memory is transferred Plot Configuration A plot configuration comprises two parts data values and presentation configuration settings 2 114 VisualDSP 5 0 User s Guide Environment Audio Data Audio Data Zoom Line Plot Figure 2 76 Statistics Displayed for a Portion of Audio Data A plot window must contain at least one data set a series of data values in processor memory Create data sets in the Plot Configuration dialog box shown in Figure 2 77 Specify the type of plot for example waterfall the memory location the number of values the axis associated with each data set and other options that identify the data Note that three dimension 3 D plots require addi tional specifications for row and column counts The Settings button enables the configuration of presentation options such as titles grids fonts colors and axis presentation for each data set You can recall a plot from a saved settings file vps VisualDSP uses these settings and reads processor memory to display a plot window VisualDSP 5 0 User s Guide 2 115 Debugging Windows Plot Configuration Ter sets I Plot Type Line Plot x Title Untitled r Data Setting Name Daas ti iti S s S Memory pm COS Address Browse Offset oO Add Count pooo Row count a Remove Stride
253. o errors in source files The Output window also serves as a scripting interface The example Output window in Figure 2 19 shows build status informa tion Display the Output window by choosing View and Output Window C Program Files Analog Devices VisualDSP ccts c dft c g default C Program Files Analog Devices VisualDSP ccts exe Debug dft doj TS Build completed successfully Figure 2 19 Viewing Build Status Information in the Output Window This section describes the following topics e Build Page and Console Page on page 2 29 e Code Development Tools Batch Processing Messages on page 2 31 e Log File on page 2 38 e Output Window Customization on page 2 38 2 28 VisualDSP 5 0 User s Guide Environment e Right Click Menu on page 2 39 e Script Command Output on page 2 40 Build Page and Console Page The Output window s two tabs Console and Build provide different information and capabilities Build Page The Build page Figure 2 20 displays error messages generated during a build 1 error detected in the compilation of ccts Fatal Error Compilation failed Tool failed with exit exception code 1 Build was unsuccessful Nd Et Output Window x Figure 2 20 Example Error Messages in the Output Window Choosing Next Error or Prev Error from the Edit menu allows you to scroll through error messages Double clic
254. o include the BTC macros by using the finclude btc h statement Then each channel is defined with the macros The definitions begin with BTC_MAP_BEGIN VisualDSP 5 0 User s Guide 2 73 Debugging Windows which marks the beginning of the BTC map Next each individual chan nel is defined with the BTC_MAP_ENTRY macro which takes the parameters described in Table 2 17 Table 2 17 Parameters for the BTC_MAP_ENTRY_ASM Macro Parameter Description Name Name of the channel 32 characters max Starting address Starting address of the channel in memory Length Length of the channel in 32 bit words for ADSP 2126x processors Once the channels are defined end the BTC map by using the BTC_MAP_END macro Enabling BTC on ADSP 2126x and ADSP BF36x Processors After the channel definitions are added the BTC must be initialized with a call to the _btc_init function during the application s start up code After initialization BTC commands from the host are processed via the low priority emulator interrupt EMULI A vector to the interrupt service routine must first be installed In assembly language the vector can be installed with a jump to a _btc_isr instruction placed at the EMULI vector location JUMP _btc_isr After the interrupt vector is installed the interrupt itself must be enabled with the following code setup imask ustatl imask BIT SET ustatl EMULI imask ustatl 2 74 VisualDSP
255. o_int 33180000 70036 PowerProfile Set 27431639 68036 PowerProfile Mov 26643602 48000 float32 sub 18888000 2879 __ udiv32 2037437 341 _adi_ebiu_ApplyConfig 196800 263 adi_pwr_Init cons 206955 Total Samples 2373622 Figure 3 11 Power Savings On First we calculate the average Energy for the function by dividing the Energy Units by the number of cycles in the Count column e Power Savings On 2160473 5639 383 13 e Power Savings Off 4307328 5639 763 84 The ratio of these two numbers 383 13 763 84 is 0 501580 This is the power savings In the following example the ranking measurements are based on an EZ KIT Lite evaluation system configured at 1 2 volts and 250 MHz Having enabled power savings the voltage changes to 85 volts We apply these numbers to the Voltage and Frequency Scaling equation described in EE 229 VisualDSP 5 0 User s Guide 3 33 Energy Aware Programming 563948 float32_mul 430732847 480000 sinf 370920000 307970 int32_ to _float32 227936804 306000 float32_add 230307136 126039 PowerProfile Men 98751979 112038 PowerProfile Mat 87445111 106042 PowerProfile Cal 82685403 96000 float32_adi_lt 75844000 84000 float32_to_int 66168000 70036 PowerProfile Set 46509201 68036 PowerProfile Mov 44939127 48000 float32_sub 35912000 127 _init_devdrvtab 99264 91 _init_devtab 74208 68 _exit 52672 Total S
256. ode B 13 splitter about 1 41 specifying options 1 41 stacks usage in Expert Linker 1 38 stack windows 2 80 stalls Pipeline Viewer ADSP TS101 C 3 ADSP TS20x C 14 VisualDSP 5 0 User s Guide stalls detected messages ADSP BF535 D 12 Stand Alone Flash Programmer 3 27 3 28 about 3 28 standard output viewing 2 30 startup code 2 2 Project Wizard 1 45 statistical profiling 3 8 samples 3 9 Statistical Profiling window 2 55 2 57 3 8 statistics viewing in plots 2 112 status bar examples A 29 Image Viewer window 2 121 plot windows 2 110 status icons editor window 2 18 Pipeline Viewer 2 91 status messages log file 2 38 stepping available commands 3 11 3 12 cache events log 2 95 into instructions 3 12 out of instructions 3 12 over instructions 3 12 Pipeline Viewer ADSP TS101 C 9 Pipeline Viewer ADSP TS20x C 21 stk files A 13 streams simulating data I O 3 17 used with interrupts 3 17 subfolders project tree 2 2 support VisualDSP A 6 support information A 2 suppressing error messages 2 35 INDEX switching among editor windows 2 21 symbols Disassembly window 2 49 editor window 2 18 syntax coloring editor windows 2 19 system components A 4 system configurator VDK defined A 85 system menu A 18 T tagged expressions finding and replacing A 47 Target Load window 2 108 targets 1 15 defined A 85 emulators 1 17 EZ KIT Lite evaluation systems 1 16
257. odes and allows you to export an image to a file the clipboard or to a printer Multiprocessor on page 2 83 Current status of each processor in a multiprocessor system emulator ses sions only This window allows you to define and manage groups of pro cessors for synchronous multiprocessor commands Pipeline Viewer on page 2 88 Display of instructions in the pipeline and event details TigerSHARC and Blackfin processors only Cache Viewer on page 2 93 Analysis of an application s use of cache which is helpful in optimizing application performance VDK State History on page 2 105 VDK enabled projects only History buffer of threads and events Target Load on page 2 108 VDK enabled projects only Percent of time the target spent in the idle thread VDK Status on page 2 103 VDK enabled projects only At a program halt thread state and status data Image Viewer on page 2 119 A view of BMP JPEG PPM or MPEG data from processor memory or from a file on your PC You can edit copy print or export image data 2 44 VisualDSP 5 0 User s Guide Environment Disassembly Windows By default a Disassembly window appears when you open a new session You can open a Disassembly window by choosing View Debug Win dows and Disassembly Figure 2 27 and Figure 2 28 show examples of Disassembly windows one with and one without the address bar enabled T
258. ol configura tions used to create a processor program Through a project you can add source files define dependencies and specify build options related to producing your output executable program A project dpj file stores your program s build information VisualDSP helps you manage projects from start to finish in an integrated user interface Within the context of a processor project you define project and tool configurations specify project wide and individual file options for debug or release modes of project builds and create source files VisualDSP facilitates easy move ment among editing building and debugging activities project configuration This configuration includes all of the settings options for the tools used to build a project project file tree display See Project window Project window This window displays your project s files in a tree view which can include folders to organize your project files Right clicking on an icon the project itself a folder or a file opens a menu of actions that you can perform on the selected item Double clicking on the project icon or a folder icon opens or closes the tree list Double clicking a file icon opens the file in an editor window A 80 VisualDSP 5 0 User s Guide Reference Information Project wizard Simplifies the creation of a new project by opening a series of pages from which to specify options For Blackfin processors additional
259. ollows e Memory map describes the processor s physical memory located at the beginning of the 1df file e SEARCH_DIR LIBRARIES and 0BJECTS commands define the path names that the linker uses to search and resolve references in the input files e MEMORY command defines the system s physical memory and assigns labels to logical segments within it These logical segments define program memory and stack memory types e SECTIONS command defines the placement of code in physical memory by mapping the sections specified in program files to the sections declared in the MEMORY command The INPUT_SECTIONS statement specifies the object file that the linker uses to resolve the mapping For details refer to the VisualDSP Linker and Utilities Manual VisualDSP 5 0 User s Guide 1 33 Code Development Tools Expert Linker Expert Linker is a graphical tool that enables you to e Define a target processor s memory map e Place a project s object sections into that memory map e View how much stack or heap has been used after you run a proces sor program This interactive tool speeds up the configuration of system memory It uses your application s target memory description object files and librar ies to create a memory map that you can manipulate to optimize your system s use of memory Expert Linker works with the linker For more information about linking refer to the VisualDSP Linker and Uti
260. om the ensuing Go To dialog box Note that you can also use the address bar to navigate to an address symbol or expression An instruction and double click Toggle enable or disable a breakpoint An instruction and right click Then choose the appropriate com mand from the ensuing menu VisualDSP 5 0 User s Guide 2 47 Debugging Windows Right Click Menu The Disassembly window s right click menu provides access to the com mands shown in Figure 2 30 Figure 2 30 Disassembly Window Right Click Menus 2 48 VisualDSP 5 0 User s Guide Environment Disassembly Window Symbols Symbols at the far left of the Disassembly window indicate program execution stages Figure 2 12 Table 2 12 Disassembly Window Symbols Symbol Description cy Gray arrow The current instruction is being aborted due to a branch or jump instruction Enabled software breakpoint Disabled software breakpoint Enabled hardware breakpoint Disabled hardware breakpoint O SHARC processors only This instruction is currently in the Fetch Address stage of the pipeline P ADSP 2136x SHARC targets only This instruction is currently in the Prede code Fetch2 stage of the pipeline D SHARC processors only This instruction is currently in the Instruction Decode stage of the pipeline A ADSP 2136x SHARC targets only This instruction is currently in the Add
261. omation API when using a Microsoft ActiveX script engine For example Idde ActiveSession ActiveProcessor gt Evaluate expressions by using the character when a Microsoft ActiveX script engine is selected For example Idde FullName e Menu issuance You can quickly issue frequently used scripts From the File menu choose Recent Scripts and then select the script VisualDSP 5 0 User s Guide A 9 Extensive Scripting e Editor window issuance In an open editor window that contains a script right click and choose Load Script as shown in Figure A 6 5 test tcl set MAX_ITER 10 Umag ReGG for set iter puts Itera Gp Sopy HASLE dspreset b Boone With wait _ dspreset ee ee E RUT LG UTS GT ript jalsen Peereale Figure A 6 Running a Script in an Editor Window e User tool issuance From the User Tools toolbar click a user tool Alternatively choose a user tool from the Tools menu A 10 VisualDSP 5 0 User s Guide Reference Information You can invoke a script such as js or vbs automatically when launch ing VisualDSP from a shortcut on your Window s desktop or Start button Right click on the shortcut and select Properties and the Shortcut tab Then append f and the name of the script file to the executable file in the Target text box The example shown in Figure A 7 runs myscript js automatically when idde exe is launched isualDSP
262. omized 1 56 project 1 56 configurators VisualDSP Configurator 1 17 Configure Simulator Event dialog box B 8 connection type specifying 3 2 Console page about 2 30 constellation plots about 3 22 context switch defined A 68 control menu A 17 A 18 cpp files 2 14 A 12 C programs compiling 1 28 C programs compiling 1 28 critical region defined A 68 CROSSCORE defined A 68 C run time libraries 1 29 VisualDSP 5 0 User s Guide 1 3 INDEX current program counter value ADSP TS101 processors C 8 ADSP TS20x processors C 20 custom board support 2 82 custom build options 1 25 1 59 customizing Output window 2 38 plot windows 2 115 register windows 2 81 toolbars A 21 cxx files 2 14 A 12 D data files 1 30 I O simulation 3 17 plotting 3 19 simulating transfers 1 16 data collection methods 3 18 data logging displaying status in plot windows 2 111 data sets 2 115 definition 2 114 data streams purpose 3 17 data structures 1 13 dat files A 12 debug agent 3 2 Debug configuration 1 56 debugging IDDE features 1 5 multiple processors 3 4 overview of 1 20 programs 1 26 tools list 1 20 VisualDSP features 1 5 debug sessions 1 20 about 3 1 compiled simulation D 44 defined A 69 definition 3 1 management 3 3 managing 3 3 multiple 3 3 selecting a new session at startup 3 10 selection at startup 3 10 setting up 3 1 specifying A 7 specifying for m
263. omprises three parts The navigation pane provides tabbed pages Contents Index Search and Favorites that provide different views The viewing pane displays the selected object Help topic Web page video pdf file application Toolbar buttons provide navigation and allow you to specify options VisualDSP 5 0 User s Guide A 53 Online Help Figure A 23 shows the parts of the VisualDSP Help window Viewing pane EZ VvisualDSP 3 5 Helo for 16 Bit Proces Toolbar gt gt 25 gt A buttons Locate Back Forward Home Print Er Options Content F il a Contents index Search Favorites New Features in This Version Click below for a brief description of what s new LJ Wzicome to YisualDSP 3 5 Help Fj Assistance po Organization of this Help Sy te ee New Features Support for new Multiple project Navigation Software License Managemen processor support S t pane a R Sup Ciel Data streaming License Graphical Environment and logging management in GQ Manuals IDDE J Technical Articles on the Web Profile guided Integrated i Using this Help System optimization in source code IDDE control SCC Automation Profiling code aware scripting with Expert engine Linker Figure A 23 Parts of the VisualDSP Help Window Move through the Help system and view Help topics by using the Help window s navigational aids as sh
264. on of all Blackfin processor multicycle instructions and latencies Multicycle behavior exists when an instruction sometimes only under cer tain circumstances is completed in more than one cycle This cycle loss cannot be avoided without removing the instruction that caused it A latency condition exists when a pair of instructions incur extra cycles between them because of their proximity to each other in the code Avoid a latency condition s cycle loss by separating the two instructions by as many instructions as the cycles lost Each multicycle and latency entry indicates whether it is currently supported in the simulation environment All multicycle and latency conditions described here are native to the first implementation of the Blackfin processor architecture Future implemen tations may be different The tables in this section show the cycle latencies of the 10x core processors represented by the ADSP BF532 and the ADSP BF535 processor Multicycle Instructions All instructions not mentioned here are completed in one cycle This sec tion describes instructions that take more than one cycle Instruction names are consistent with the Blackfin Processor Instruction Set Reference The cycle counts in the following examples represent the entire cycle time of the instruction shown Push Multiple or Pop Multiple PushPopMultiple is completed in 7 cycles where n is the number of regis ters pushed or popped D 22 VisualDSP
265. on that uses the PM bus to perform a data access causes an instruction stall the first time it is executed PM I8 M8 R1 3 Memory block conflicts VisualDSP 5 0 User s Guide B 5 Event Options If an instruction requires two accesses to the same memory block the instruction stalls DMC IO MO RO PM 18 M8 R1 A stall will occur when both address pointers point to the same memory block 4 Wait states for external memory accesses An instruction that contains an external memory access where the wait state setting for that memory bank is greater than 0 or the access is held off because of the ACK signal or through bus arbitra tion causes that instruction to stall 5 Multiple bus accesses to IOP registers in the same IOP register group An instruction may be stalled because of multiple buses trying to access IOP registers in the same group For this anomaly the only applicable case is if an external host or processor accesses the same group of registers at the same time as the core DM MSGRO R1 Instruction executed while the host or another processor writes to MSGR2 6 Executing instructions from external memory with wait states Any instruction being executed from external memory where the wait state setting for that memory bank is greater than 0 or the access is held off because of the ACK signal causes that instruction to stall A workaround for cases 1 5 above is to insert a NOP bet
266. on to the selected memory segment Note Right click on a memory segment to access this command New gt Shared Memory Opens the Shared Memory Properties dialog box from which you specify the name of the shared memory output file and pro cessors that share the memory This command is not available on single processor systems New gt Overlay Opens the Overlay Properties dialog box from which you add a new overlay to the selected output section or memory segment Note The new overlay s run space is in the selected output sec tion Delete Deletes the selected object Pin to Output Section Pins an object section to an output section to prevent it from overflowing to another output section This command is available only after you right click on an object section that is part of an output section set to overflow to another section View Section Contents Opens the Section Contents dialog box which displays the con tents of the input or output section This command is available only after you link or build the project and then right click on an input or object section VisualDSP 5 0 User s Guide 1 37 Code Development Tools Table 1 4 Memory Map Pane Right Click Menu Cont d Command Purpose Add Hardware Page Overlay Support Sets up hardware overlay live and run spaces for all available hardware pages by a Checking if memory segments are currently defin
267. ont d Button Purpose Stops the current program Resets the target Toggles a breakpoint for the current line Clears all current breakpoints Enables or disables one breakpoint Disables all breakpoints Steps one line Steps over the current statement Steps out of the current function Runs the program to the line containing the cursor Opens the Expressions window Opens the Locals window Opens the Call Stack window AA REE Ss eee amp amp EAE A 26 VisualDSP 5 0 User s Guide Reference Information Table A 4 Toolbar Buttons Cont d Button Purpose a Opens the Disassembly window A j Runs the command associated with the user tool one of ten 1 m Opens the associated workspace one of ten Toolbar Operation This section describes the toolbars and shows how to customize their appearance Refer to Toolbars and User Tools on page A 19 for more information about toolbars Toolbar Button Appearance You can specify the appearance of the toolbar buttons An option large buttons increases the size of each button Table A 5 Table A 5 Toolbars in Different Viewing Options Option Settings Docked Floating Large buttons Off Help E3 a P A Large buttons On ca VisualDSP 5 0 User s Guide A 27 Parts of the User Interface Toolbar Shape
268. opherT hread lt amp Thread 3 kPhilosopherT hread Template ID gt Priority Stack Address NumT imesRun CreationTime cycles RunStartTime cycles RunLastTime cycles RunTotalTime cycles CreationTime ticks RunStartTime ticks RunLastTime ticks Thread 4 kPhilosopherT hread D E Value 5 Ready Ready kPriority1 0 Ox00000000 kSystemStartT hread 0x00000015 kPriority10 Oxf0030d24 6 8045 36088 39234 22274 0 1 1 Running kPriority5 Ready kPriority5 Sleeping 0 Ticks Remaining 000000001 kPhilosopherT hread 0x0000001 a kPriority5 Oxf0032894 3 22198 59793 59793 1407 0 3 3 Sleeping 0 Ticks Remaining Figure 2 69 Example VDK Status Window VisualDSP 5 0 User s Guide 2 103 Debugging Windows When the execution of a VDK enabled program is halted VisualDSP reads data for threads semaphores events event bits device flags mem ory pools and messages It then displays state and status data in this window When one of the above VDK entities is created it is added to the display An entity is removed from the display when it is destroyed Initially information is displayed in a collapsed state which shows only the name of the entity and in some cases its current state When a thread is in the Ready state its priority displays Clicking the plus sign next to the name of an entity
269. options B 11 local build options 1 25 Locals window about 2 54 Locate button A 55 log file VisualDSP 2 38 st files A 13 M main window program icon A 18 status bar A 29 makefiles 1 51 A 14 example of 1 53 Output window 1 53 rules 1 52 mak files See makefiles manuals online A 49 printing A 50 map files A 13 MATLAB data files 3 17 plot window data 3 17 measuring performance 3 8 memory displaying an address s value 2 67 dumping 2 46 2 67 filling 2 46 2 67 1 10 VisualDSP 5 0 User s Guide memory map defining 1 33 using Expert Linker 1 40 memory plots 2 109 memory pool defined A 76 memory segments 1 12 memory windows customization 2 72 expression tracking 2 69 locking columns 2 67 number format examples 2 67 number formats 2 67 right click menu 2 69 tracking an expression 2 67 tracking expressions 2 69 menu bar about A 19 menus application menu bar A 19 control menu A 17 A 18 right click A 38 system A 18 title bar right click A 17 messages Console page of Output window 2 30 kills detected ADSP BF535 D 16 Pipeline Viewer ADSP BF535 D 12 D 17 stalls detected ADSP BF535 D 12 VDK defined A 76 VisualDSP_Log txt file 2 38 Microsoft Script Debugger enabling 2 41 mixed mode 2 20 editor window 2 20 pipeline symbols 2 21 mk files See makefiles multicycle behavior D 22 INDEX multicycle instructions D 22 32 bit multiply D 23 ADSP
270. orithms on which many of the C library s math functions are based refer to the Cody and Waite text Software Manual for the Elemen tary Functions from Prentice Hall 1980 For more information about the C library portion of the ANSI ISO Standard for C refer to the Plauger text Draft Standard C Library from Prentice Hall 1994 ISBN 0131170031 Dinkum Abridged C Library The Dinkum Abridged C library software documentation is located on the VisualDSP installation CD in the lt install_path gt Docs Reference folder Viewing or printing these files requires a browser such as Internet Explorer 6 0 or higher You can copy these files from the installation CD onto another disk VisualDSP 5 0 User s Guide 1 29 Code Development Tools Assembler The assembler generates an object file by assembling source header and data files The assembler s primary output is an object file with a doj extension To specify assembler options choose Project gt Project Options and click Assemble in the Project Options dialog box Assembler terms are defined as follows instruction set Set of assembly instructions that pertain to a specific processor For information about the instruction set refer to your processor s hardware documentation preprocessor commands Commands that direct the preprocessor to include files perform macro substitutions and control conditional assembly assembler directives Dire
271. ors Figure C 14 shows how the program counter value is used for ADSP TS20x processors Pipeline viewer CSG Cycle F1 F2 F3 F4 PD 663 y l vy 664 y X 665 Wick S y X 666 y y 667 668 669 670 671 672 673 674 675 676 677 678 679 N a yrii yrl xixi aixi 1 y j i yr20 OX80100 x j ivsw yr20 r x j3 OX30000000 r r xr0 0 SB r r4 0X700000 y S y y y y y y a VD Suede ee OK MU IV WVU VV VM VU JB r4 Ox700000 STAT r4 OXFFFFFFFF oD Dd ee se yri yri B yri yir2 r0 Ti nono f 444g MMH MURS Disassembly i wlk 080020 yr0 XFFFFFFFF 080021 yri pe gt 080022 yfr2 rO ri 080023 yr3 OX7F800000 080025 yr4 OXFF800000 080027 yfrS r3 r4 080028 yfrS r3 r3 72 080029 yfrS r3 r4 yfr6 r3 r4 08002A yrS MANT fr3 08002B yr OX808FFFFF 08002D yfr8 RSORTS r7 08002E j3 0X1 xr0 X p 0 E Figure C 14 Using the Program Counter Value ADSP TS20x Processors Stepping When single stepping through a program the simulator performs an instruction line step and skips invalid instructions aborted bubbles or slots occupied by an invalid fetch VisualDSP 5 0 User s Guide C 21 ADSP TS20x Processors Sometimes a step takes more than one cycle and the Pipeline Viewer win do
272. ost that uses the Microsoft ActiveX script host framework This scripting host permits the use of multiple scripting languages that conform to the Microsoft ActiveX script engine 2 40 VisualDSP 5 0 User s Guide Environment The main benefit of calling scripts in these languages is that they have support for COM scripting which allows access to the VisualDSP Automation API VisualDSP supports the following Microsoft ActiveX script engines languages e Visual Basic Scripting Edition e JScript The Tool Command Language Tcl interpreter included with VisualDSP is not a Microsoft ActiveX script engine VisualDSP permits the use of other script engines languages that are not supported by Analog Devices technical support Script output is logged to VisualDSP_Log txt for viewing and analysis By default this file is located in the installation s Data directory In the Output window s Console view you can e Issue script commands and view script command output For more information about issuing script commands refer to Extensive Scripting on page A 8 e Enable the Microsoft script debugger Right click in the Output window and choose Enable Debugger The debugger steps through code sets breakpoints and so on Once enabled the debugger stops on the first error encountered in the script Although most script engines languages support this option some may not Consult the script engine s doc
273. oups A project group enables you to work with a number of projects at once A project group can be empty or contain any number of projects Opening a project adds it to the project group Closing a project removes it from the project group Similar functionality is found in Microsoft Visual Studio The Project window Figure 1 8 displays the project group icon and the projects opened in that workspace Project BTC_AsmDemo dpj Project group 2 project s Project group icon vectadd indicates the number of Source Files open projects E shell c Linker Files vdk 2191 Id Header Files Kernel Files BTC_AsmDemo Bold typeface indicates Source Files the active project Linker Files Header Files a N Project Figure 1 8 Project Window 1 48 VisualDSP 5 0 User s Guide Introduction to VisualDSP Each workspace has one project group When you switch among work spaces the project group is loaded and the same set of projects are opened just as when you last closed the workspace One project is active at a time The active project responds to commands and messages from menus and toolbars The Project window displays the active project with bold typeface A Project box located by default with the toolbar buttons displays the name of the active project see Figure 1 9 E 2 or ae Ge j X BTC AsmDemo Deb aay Project box P PPer ft amp indicates the
274. ource files that a project uses such as the 1df file contain command input for the linker and dependency files data files and header files View source files in editor windows source mode One of the two editor window display formats the other being mixed mode Source mode displays C code only splitter A PROM splitter utility that transforms an executable file into a non boot loadable image This file is loaded onto external proces sor memory statistical profiling A debugging feature that provides a more generalized form of pro filing that is well suited to JTAG emulator debug targets With statistical profiling VisualDSP randomly samples the target pro A 84 VisualDSP 5 0 User s Guide Reference Information cessor s program counter PC and presents a graphical display of the resulting samples in the Statistical Profiling window This win dow graphically indicates where the application is spending time JTAG sampling is completely non intrusive so the process does not incur additional run time overhead See also linear profiling stepping A technique for moving through source or assembly code to observe instruction execution streams A debug tool used during simulation to drive other devices or take part in processing a subset of data Use streams to simulate data input and output symbols Labels for sections subroutines variables data buffers constants or port names For more in
275. ouse access to commands The toolbar is a Windows docking bar which you can move it to different areas of the screen by dragging it to the selected location Table A 4 Toolbar Buttons Button Purpose Connects to the debug target or disconnects from the debug target G Creates a new document 5 Opens an existing document A 22 VisualDSP 5 0 User s Guide Reference Information Table A 4 Toolbar Buttons Cont d Button Purpose Saves the active document or template with the same name Saves all open files that have been modified including files not in the current project Prints the active document Loads a program into the target Reloads the most recent program into the target Cuts selected data from the document and store it on the clipboard Copies the selection to the clipboard Pastes the contents of the clipboard at the insertion point Undoes previous edit command multilevel undo Redoes the command undone by the previous Undo command multilevel redo Finds a text block in an editor window Finds again or repeats the previous find command bes E We Replaces the selected text with other text VisualDSP 5 0 User s Guide A 23 Parts of the User Interface Table A 4 Toolbar Buttons Cont d Button Purpose Searches through files for text or regular expressions Goes to or moves
276. own in Figure A 24 Other standard Microsoft HTML Help buttons are described in Table A 26 Context Sensitive Help You can view context sensitive Help information pertinent to your current activity for various items toolbar buttons menu commands windows and dialog box controls in VisualDSP A 54 VisualDSP 5 0 User s Guide E YisualDSP 3 0 Help for Blackfin DSPs Hide Locate Move through viewed topics Topics Debugain go Windows A View of What s Gi lash Programmer Window pstem r ull ext search Capability Reference Information Jump to the ADI DSP tools Web site amp Print Options C Run Time Libraries Note You must run VisualDSP to use the C run time libraries YisualDSP does not support C The C and C run time libraries are collections of functions macros and class templates that can be Open a bookmarked topic Figure A 24 Help Window Navigational Aids Table A 26 Standard Microsoft HTML Help Buttons Button Purpose TE Hide Show Hides the Help window s left pane This button narrows the Help window Displays the Help window s left pane This button restores a full view after you click Hide Locate Highlights the name of the current topic on the Contents pane After you jump around the Help system this button shows the cur rent topic s relation to other topics Note The
277. p To view window Help 1 Click the window to make it active 2 Press the F1 key A description of the window appears in the right pane Copying Example Code From Help You can copy code from Help and then paste it into your application Be aware that the copied text may carry unwanted control codes For example if you copy a hyphen with a parameter the actual code of the copied hyphen may be an ASCII 0x96 instead of an ASCII 0x2D The hyphen may look OK but it will cause an error when the command is run Printing Help You can print a specific Help topic or multiple Help topics an entire section of VisualDSP Help Table A 27 How to Print Help Topics To print Do this Current topic Right click within the help topic and choose Print Selected topic On the Contents page Right click the topic P and choose Print Entire section of On the Contents page Help Right click a book icon or e and choose Print Then choose Print the selected heading and all subtopics VisualDSP 5 0 User s Guide A 57 Online Help Tip From the Help window s Contents page click located at the top of the window Bookmarking Frequently Used Help Topics Bookmarking a topic in VisualDSP Help is just like bookmarking a page in a book This feature is also called setting up favorite places Note Each time a Microsoft HTML Help topic is bookmarked a record is recorded in the file
278. ple of Project Files e A file with an unrecognized file extension is ignored at build time e When you add a file to a project the file is placed in the first folder configured with the same extension If no such folders are present an added file goes to the project level File Associations VisualDSP associates the file extensions in Table 2 4 as the input to particular code development tools Table 2 4 File Associations Tool File Extensions Compiler C cpp and cxx Assembler asm S and dsp Linker ldf dlb and doj VisualDSP is case insensitive to file extensions 2 14 VisualDSP 5 0 User s Guide Automatic File Placement Environment Automatic file placement is a feature that enables you to drag and drop files into designated folders on the Project page in the Project window This saves time when you add files to a project File placement rules and the folder properties that you specify determine where files are placed By default project folders are associated with the file extensions listed in Table 2 5 Table 2 5 Default Files Associations in Project Folders Folder Default Associations Source Files C CPp CXX asm dsp S Header Files h hpp nxx Linker Files ldf dlb doj Kernel Files vdk File Placement Rules The following rules dictate file placement when you add files to a project e Dragging and dropping
279. points dialog box and specifying enabling the breakpoints for the processor that has the focus Watchpoints Similar to breakpoints watchpoints stop program execution when user specified conditions are satisfied Watchpoints however are used to set a condition such as a memory read or stack pop for halting events Use watchpoints only during simulation Watchpoints unlike breakpoints are not attached to a specific address A watchpoint halts anywhere in your program once the watchpoint conditions are satisfied VisualDSP 5 0 User s Guide 3 15 Simulation Tools Hardware Breakpoints Similar to simulator watchpoints hardware breakpoints enable you to set breaks on instructions or data transfers within a user defined memory range Choosing Hardware Breakpoints from the Settings menu opens the Hardware Breakpoints dialog box from which to configure the hardware breakpoints Refer to VisualDSP Help for your processor family SHARC ICE TigerSHARC ICE or Blackfin ICE for details about configuring the hardware breakpoints Latency Hardware breakpoints do not assert until one 1 or two 2 instruction cycles after the actual break condition occurs Note that the program counter is not placed on the instruction that caused the break Restrictions When using hardware breakpoints do not place breaks at any address where a JUMP CALL or IDLE instruction would be illegal Do not place breaks in the last f
280. processors in the MP group MP Run MP Halt and MP Step are synchronous operations which means that all processors in the currently selected MP group exe cute on exactly the same clock cycle Some commands have keyboard shortcuts refer to Keyboard Shortcuts on page A 31 Use the commands described in Table 3 2 to control program execution VisualDSP 5 0 User s Guide 3 11 Program Execution Operations Table 3 2 Commands Used to Control Program Execution Command Description Run Runs an executable program The program runs until an event stops it such as a breakpoint or user intervention When program execution halts all windows update to current addresses and values Halt Stops program execution All windows are updated after the processor halts Register values that changed are highlighted and the status bar displays the address where the program halted Run to Cursor Runs the program to the line where you left your cursor You can place the cursor in editor windows and Disassembly windows Step Over C C code only in an editor window Single steps forward through program instructions If the source line calls a function the function executes com pletely without stepping through the function instructions Step Into editor window or Disassembly window Single steps through the program one C C or assembly instruction at a time Encountered functions are entered Step Out Of C C cod
281. ption Data Cursor Displays the data value associated with the position of the plot window s data cursor View the value on the left side of the plot window s status bar Press the keyboard s arrow keys to move around the graph Reset Zoom Resets the plot window to its initial full scale display Configure Opens the Plot Configuration dialog box where you add remove or modify data sets You can also change the plot type and rename the plot Modify Settings Opens the Plot Setting dialog box where you customize the plot s appearance You can specify plot settings grids colors margins fonts axes and so on and settings for each data set data process ing Save Settings Saves plot configuration settings for future use The configuration is stored but not the data You can retrieve settings VPS file and load new plot data Export Exports the plot image to various destinations including the Win dows clipboard Save the plot image as a file JPG GIF TIF EPS TXT or DAT format or print a hard copy Auto Refresh Enables a plot window to refresh automatically based on settings that you specify The auto refresh timer starts Streaming data is read and displayed When this option is deselected the timer is stopped and streaming data is not processed You can specify auto refresh options such as BTC refresh rate and missing data indication Auto Refresh Settings Enables you to configure optio
282. r additional functionality 1 6 VisualDSP 5 0 User s Guide Introduction to VisualDSP e Portable Most of the kernel components can be written in ANSI Standard C or C and are portable to other Analog Devices processors e Pre emptive The kernel s priority based scheduler enables the highest priority thread not waiting for a signal to be run at any time e Prototypical The kernel and VisualDSP create an initial file set based on a series of template files The entire application is proto typed and ready to be tested e Reliable The kernel provides run time error checking e Scalable If a project does not include a kernel feature the support code is not included in the target system VisualDSP 5 0 Features VisualDSP 5 0 includes the following new features and enhancements e New Processor Support Refer to the processors listed in Supported Processors on page xxvii e Binary File Support for Fill and Dump You can choose to fill from a binary file or dump to a binary file in addition to a text file You can also choose the byte order little endian or big endian of the data in the binary file e Core File Support You can dump the entire state of registers and the memory content of a stopped target to a core file which can be loaded later by the IDDE to restore the saved target state so that the target can be examined This enables Analog Devices Support to diagnose customer problems The cor
283. racters have special meaning within a sequence These include not range and end of sequence By placing these characters appropriately you can specify these characters to be part of the sequence To search for a right bracket character place as the first character of the search string To search for a hyphen character place as the first charac ter of the search string after if present Place a caret anywhere in the search string except at the front where it means not Repetition and Combination Characters Each character described in Table A 21 extends the meaning of the item that immediately precedes it This item may be a single character a sequence in braces or an entire regular expression in parentheses Table A 21 Match Characters Character Description An asterisk matches the preceding any number of times including none at all Thus ap le matches apple aple appppple and ale For example void matches only when void occurs at the beginning of a line and is preceded by zero or more spaces A plus character matches the preceding any number of times but at least one time Thus ap 1e matches apple and aple but does not match ale A question mark matches the preceding either zero or one time but not more Thus ap le matches ale and aple but nothing else The pipe character matches either the preceding or following item For example hot cold matches eith
284. rd new or the word plot or both The first term without the new NOT plot Locates topics that contain the word second term new but not the word plot Both terms in the same new NEAR plot Locates topics that contain the word topic close together new within eight words of the word plot Do not use the amp or characters as Boolean operators You must use OR AND or NOT Nested Expressions Use nested expressions to create complex searches for information For example new AND plot OR waterfall NEAR window finds topics containing the word new along with the words plot and window close together or topics containing new along with the words water fall and window close together A 64 VisualDSP 5 0 User s Guide Reference Information Rules for Advanced Searches These rules apply to advanced searches e Expressions in parentheses are evaluated before the rest of the query e Ifa query does not contain a nested expression it is evaluated from left to right For example folder NOT file OR project finds topics containing the word folder without the word file or topics containing the word project The expression folder NOT file OR project however finds topics contain ing the word folder without either of the words file or project e You cannot nest expressions deeper than
285. ress Decode stage of the pipeline VisualDSP 5 0 User s Guide 2 49 Debugging Windows Table 2 12 Disassembly Window Symbols Symbol Description E SHARC targets only The instruction is in the Execute pipeline stage Yellow arrow This instruction is currently in the Execute stage of the pipeline cy The display of pipeline stages is available only when e The session is connected to a SHARC simulator target e Enable pipeline display is selected on the General page of the Preferences dialog box via the Settings menu Expressions Window The Expressions window Figure 2 31 lets you enter an expression to evaluate in your program Evaluations are based on the current debug con text Open this window by choosing View Debug Windows and Expressions The Name and Value columns are always visible Other columns Address Type Size and Format are user defined You can select the number format used by the window global format You can override the global format and specify each expression s format per expression basis Changing the window s global format overrides any per expression for matting for example if the global format is set to Hexadecimal and you set the format of a single expression to Integer changing the global format to Float will change the format of every expression to Float Because of the way registers are saved and restored on the stack the register value o
286. ritis Renee C 15 Aborts Due to an Unpredicted Change of Flow 0 C 16 Abort Due to Mispredicted Change of Flow cee C 18 Branch Taget Bulier His sostegseera i na C 19 Pipeline Viewer and Disassembly Window Operations C 19 Current Program Counter Valte ccsrsnasesirsiennass C 20 SMepp NE arriera n A O C 21 Sindao OPONE erara E C 22 SIMULATION OF BLACKFIN PROCESSORS Pernpheral Support in SIMIAN ccrassesoraanonne nein D 2 Special Considerations for Penpherals ccrorcisinioncinonseiakinii D 7 Universal Asynchronous Receiver Transmitter Peripheral D 7 VisualDSP 5 0 User s Guide XIX CONTENTS Timer EIR Peripheral sciences cecreeneeeniemmnmiviiecenieri D 8 Simulator Instruction Timing Analysis for ADSP BF535 Processors D 9 SN R CORES A eR r a CNS HEU Oy REC RISE aT Fre D 9 ola choses ete ea ese adeno noes D 10 Pipeline Viewer Window Examples diccacetdssicneicsniuisaceadeisas D 11 Pipeline Viewer Window Messages lt ccercscsvsncsvernneseverrereseenees D 12 Pipeline Viewer Detail View Stall Event Messages D 12 Kills Dewoed AS arrasininpi A D 16 TRA CUE Instrictions sincsemarcerircie D 17 Abbreviations in Pipeline Viewer Messages s cccicsncsrccssssnscnsens D 17 Simulator Instruction Timing Analysis for ADSP BF531 ADSP BF532 ADSP BP333 and ADSP BPSG1 Processors sorarssroneniesn D 19 SA REONE sarera EERO D 19 EE a EE E ne AA E A E er Soe D 20 Pipeline Viewer Window Examples si
287. ritten and built in VisualDSP EZ KIT Lite evaluation system A development board software and cable for evaluating a particu lar processor The kit includes fundamental debugging software to facilitate architecture evaluations via a PC hosted tool set Use the kit to evaluate Analog Devices processors learn about processor applications simulate and debug applications and prototype applications focus Refers to the active processor in a multiprocessor MP debugging session A 72 VisualDSP 5 0 User s Guide Reference Information ICE In Circuit Emulator Analog Devices offers emulators that provide non intrusive target based debugging of processor systems An emulator can single step or execute a processor at full speed to facilitate viewing or altering a processor s register and memory contents IDDE Integrated Development and Debugging Environment for Analog Devices processor development tools interrupt An external or internal condition detected by the hardware inter rupt controller In response to an interrupt the kernel processes a subroutine call to a predefined interrupt service routine ISR Interrupts have the following specifications Latency interrupt disable time The period between the interrupt occurrence and the first ISR s executed instruction Response interrupt response time The period between the inter rupt occurrence and a context switch Recovery interrupt recovery
288. rocessing assembling and linking that VisualDSP performs on projects and files During a build VisualDSP processes the files in the project that have been modified or depend on files that have been modified since the previous build A build differs from a rebuild all During a rebuild all VisualDSP processes all the files in the project regardless of whether they have been modified build type Replaced by configuration channel A transmission path between two communicating locations usually the smallest subdivision of a transmission system For VDK chan nel refers to a FIFO queue into which messages sent to a thread are placed Each thread has 15 channels Messages are received in priority order from the lowest numbered channel to the highest COFF Common Object File Format VisualDSP does not support files formatted in COFF configuration or project configuration A project is developed in stages configurations By default a project includes two configurations Debug and Release A configuration refers to the collection of options tool chain and individual options for files specified for the configuration You can add a configuration to your project at any time You can delete a customized configuration that you created but you cannot delete the Debug or Release configurations VisualDSP 5 0 User s Guide A 67 Glossary connection type A simulator EZ KIT Lite development system or an emula
289. rogram operations breakpoints 3 13 execution commands 3 11 hardware breakpoints 3 16 restarting programs 3 12 selecting a debug session at startup 3 10 unconditional amp conditional breakpoints 3 14 watchpoints 3 15 programs debugging 1 26 optimizing 2 94 running 1 26 program sections 1 12 program traces 2 52 3 9 Project box showing active project 1 49 project build specifying options 1 24 project dependencies example of 1 60 project group files 1 49 project groups 1 48 project management features 1 4 Project Options dialog box 1 12 projects adding files 1 24 build options 1 25 1 58 configurations 1 56 customized configurations 1 56 debugging 1 5 1 20 defined A 80 dependencies 1 24 development overview 1 11 development stages 1 14 files 2 8 folders 2 2 keyboard shortcuts A 35 loading A 7 managing 1 4 nodes 2 2 programming overview 1 12 project groups 1 48 specifying tool options 1 47 subfolders 2 2 VisualDSP 1 43 project wide file and tool options 1 25 Project window 2 2 about 2 2 files 2 2 folders 2 6 Kernel tab 1 22 2 4 makefiles 1 51 nodes 2 3 2 6 Project view 2 3 right click menu 2 10 rules 2 13 source code control icons 2 9 Project Wizard about 1 44 Project wizard 1 23 A 81 PROM files 1 41 1 42 promoting error messages 2 35 VisualDSP 5 0 User s Guide property pages 1 23 definition 1 12 pull t
290. rossing is reached Plotting continues for the remainder of the trace data When a breakpoint occurs or a step is performed the plot data is updated and a new trace is plotted The eye diagram uses a data shifting technique that stores the desired number of traces in a plot buffer default VisualDSP 5 0 User s Guide 3 23 Plots gt Eye Diagram Eye Diagram Eye Diagram Figure 3 6 Eye Diagram Plot is ten traces When the number of traces is exceeded the first trace shifts out of the buffer and the new trace shifts into the last buffer location This technique is referred to as first in first out FIFO You can modify options for threshold value rising trigger falling trigger and the number of overlapping traces Waterfall Plots A waterfall plot Figure 3 7 is typically used to show the change in fre quency content of signal over time The plot comprises multiple line plot traces in a three dimensional 3 D view Each line plot trace represents a slice of the waterfall plot The easiest way to create a waterfall plot is to define a 2 D array in C code a grid The first array dimension is the number of rows in the grid and the second dimension is the number of columns in the grid The number of columns is equal to the number of data points in each line trace 3 24 VisualDSP 5 0 User s Guide Debugging Q Waterfall Plot Example Waterfall Plot Example Tee bia Tr arty Mz 4 4d EODTT
291. rs to line up with the preceding opening brace Opening header files by right clicking on include statements Dragging and dropping highlighted sections of text usually a valid source statement to an open Expressions window When dropped the text is automatically added to the window and is evaluated Running scripts Many of these features are described next Refer to VisualDSP Help for how to information Editor Window Symbols The gutter left margin in an editor window displays icons to indicate breakpoints bookmarks and the current position of the program counter PC Table 2 6 describes these icons Table 2 6 Editor Window Symbols Symbol Indicates cy Current source line to be executed PC location Enabled software breakpoint VisualDSP 5 0 User s Guide Table 2 6 Editor Window Symbols Cont d Environment Symbol Indicates oO Disabled software breakpoint o Enabled hardware breakpoint a OC Disabled hardware breakpoint Bookmark Bookmarks Bookmarks are pointers in editor windows Place a bookmark in a location to return to it quickly at a later time Syntax Coloring Specifying colors can help you locate information in the types of files listed in Table 2 7 Table 2 7 File Types That Support Syntax Coloring File Type File Extension Assembly asm C C Linker Description Files ldf
292. ruction at a stage is a branch target buffer hit The address of the last slot of the instruction line was found in the branch target buffer The icons in the above table are listed in descending priority When more than one event occurs at a certain stage at a certain cycle only one icon displays the icon with highest priority For example if an instruction that was a Branch Target Buffer hit is aborted the Abort icon J appears VisualDSP 5 0 User s Guide 2 91 Debugging Windows Pipeline Instruction Event Details To view event details press and hold down the keyboard s Ctrl key and move the mouse pointer over the cell in the Pipeline Viewer window The pipeline event details appear in a tool tip message box as shown in Figure 2 61 S WB LINK 0x44 W LINK Details for stage ADDRESS cycle 6369 LINE Address Invalid Instruction Invalid Event 0 LINK Type Stall LINK Cause IAU empty LINE Details Stall in stage DEC LINE FP FP R1 L RO RI RO 12 R1 H Figure 2 61 Example Tool Tip Box Showing Pipeline Event Details A pipeline event can include the details described in Table 2 22 Table 2 22 Pipeline Event Details Item Displays Address Address of the pipeline stage at that cycle if valid Instruction Assembly instruction of that address if valid Type Type of event Cause Cause of the event condition Details Further explanation of the cause of t
293. s data set A series of data values in processor memory used as input to a plot You can create data sets and configure the data for each data set You specify the memory location the number of values and other options that identify the data Additional specifications for row and column counts are required for 3 D plots Debug configuration For a debug configuration you can accept the default options or specify your own options and save them The configuration refers to the specified options for all the tools in the tool chain See also configuration debug session The combination of a processor connection type and platform For example a debug session might consist of an ADSP 21262 processor an EZ KIT Lite connection and an ADSP 21262 EZ KIT Lite board Processor projects being developed are run as debug sessions The two types of sessions are hardware and software When setting up a session set the focus on a series of more specific elements debug target See target VisualDSP 5 0 User s Guide A 69 Glossary default intermediate and output file directories These file directories folders are Debug for the debug configura tion and Release for the release configuration By default VisualDSP creates these directories as children of the directory where the dpj file is saved which is called the project s current directory See also current directory dependencies Visua
294. s VisualDSP can be invoked from a command line or a shortcut Syntax idde exe f script_name s session_name p project_name Note Specify the full path to idde exe Only one instance of each parameter is permitted Table A 1 describes the idde exe command line parameters Table A 1 idde exe Command Line Parameters Item Description f script_name Loads and executes the script specified by script_name Use this parameter to automate regression tests You can also manipulate Visu alDSP by running a script from a library of common commands that you create If an error is encountered while executing this script VisualDSP exits automatically s session_name Specifies the session to which VisualDSP connects when it starts The session must already exist Use this parameter when you debug more than one target board Having multiple shortcuts to idde exe allows you to run a different session This overrides VisualDSP default behavior of connecting to the last session p project_name Specifies the project to load at startup The project must already exist Examples idde exe f idde exe s idde exe p c scripts myscript vbs My BF535 JTAG Emulator Session c projects myproject dpj VisualDSP 5 0 User s Guide A 7 Extensive Scripting Extensive Scripting You can issue script commands from a command window the Output window s Console v
295. s on page 3 9 e Plot Windows on page 2 109 e Pipeline Viewer Window on page 2 88 e Cache Viewer Window on page 2 93 VisualDSP 5 0 User s Guide 3 7 Code Analysis Tools Statistical Profiles and Linear Profiles VisualDSP provides two profiling methods that measure program performance by sampling the target s Program Counter PC register to collect data Use linear profiling with simulator targets and use statistical profiling with emulator targets The Linear Profiling window and Statistical Profiling window display the data collected by these two profiling methods and indicate where the application is spending its time Refer to Statistical Linear Profiling Win dow on page 2 55 for details The window s title Linear Profiling or Statistical Profiling depends on whether this tool is used during simulation or emulation Simulation Linear Profiling Linear profiling with the simulator is not statistical because the simulator samples every PC executed This feature provides an accurate and com plete picture of program execution Linear profiling is much slower than statistical profiling Simulator targets support linear profiling but do not support statistical profiling Emulation Statistical Profiling A statistical profile measures the performance of a user program by sampling the target s PC register at random intervals while the target is running the program Most of the execu
296. s Table D 29 lists register groups Table D 29 Allreg Register Groups allreg Dreg Preg sysreg dagreg RO PO ASTAT 10 R1 P1 RETS Il R2 P2 RETX I2 R3 P3 RETI 13 R4 P4 RETN MO R5 RS RETE M1 R6 FP LCO M2 R7 SP LTO M3 statbits accreg LBO LO ASTAT 0 AZ AO LC1 L1 ASTAT 1 AN A0 x LT1 L2 ASTAT 2 AC A0 w LB1 L3 ASTAT 3 AVO Al CYCLES BO ASTAT 4 AV1 Al x CYCLES2 B1 D 42 VisualDSP 5 0 User s Guide Table D 29 Allreg Register Groups Simulation of Blackfin Processors allreg ASTAT 5 CC Al w SEQSTAT B2 ASTAT 6 AQ SYSCFG B3 VisualDSP 5 0 User s Guide D 43 Compiled Simulation Compiled Simulation A traditional simulator decodes and interprets one instruction at a time Each executed instruction often requires repeated decoding Compiled simulation removes the overhead of having to decode each instruction repeatedly In VisualDSP 3 5 compiled simulation required you to first build a compiled simulation exe file from a dxe program file and then load and execute the program in a compiled simulation debug target In VisualDSP 4 0 the intermediate step is no longer required You can load the dxe program into the compiled simulation debug target directly When you run the debug target compiles the processor code into native code and executes the native code Specifying a Session for Compiled
297. s Makefile resides d Supported targets if Debug Debug_clean if Release if Release_clean Define ADI_DSP if it i d variable if you wish t i the host that created d different directory es rename this file and run it efile is such that GNU Make v3 77 or rectory should be the directory in which s not already defined Define this o run this Makefile on a host other than it and VisualDSP may be installed in a VisualDSP 5 0 User s Guide 1 53 Processor Projects ifndef ADI_DSP ADI_DSP C Program Files Analog Devices VisualDSP endif VDSP is a gmake friendly version of ADI_DIR empty space empty empty VDSP_INTERMEDIATE subst ADI_DSP VDSP subst space space VDSP_INTERMEDIATE Define the command to use to delete files which is different df on Win95 98 and Windows NT 2000 ifeq 0S Windows_NT RM cmd C del F Q else RM command C del endif i i Begin Debug configuration i ifeq MAKECMDGOALS Debug Debug debug mean dxe debug mean doj mean c include stdio h VDSP cc21k c Mean c g proc ADSP 21062 o Debug Mean doj debug benchmark doj benchmark asm include asm_sprt h include def21060 h VDSP easm21k exe proc ADSP 21062 o Debug benchmark doj g benchmark asm debug mean dxe debug mean doj debug benchmark doj VDSP cc21k exe Debug Mean doj Debug benchmark
298. s Overview The ADSP TS20x simulator is a cycle accurate simulator which not only models the instruction set functionally but also correctly models pipeline effects stalls and aborts and internal memory transactions timing Currently the processor s external port and link ports are not mod eled in a cycle accurate manner The simulator cycle counts the code but the cycle counts used for the external port or link ports are rough estimates of cycle counts that you could obtain by run ning the code on the chip Do not rely on these counts for performance evaluation Use the Pipeline Viewer window to understand how processor timing affects the execution of your program For information about configuring and using the Pipeline Viewer see Pipeline Viewer Window on page 2 88 or refer to VisualDSP online Help C 12 VisualDSP 5 0 User s Guide Simulation of TigerSHARC Processors Pipeline Stages The ADSP TS20x Pipeline Viewer window provides a representation of instruction flow through the processor s pipeline Table C 2 lists the pipe line stages Table C 2 Pipeline Stages ADSP TS20x Processors Stage Abbreviation in Pipeline Viewer Instruction Fetch 1 F1 Instruction Fetch 2 F2 Instruction Fetch 3 F3 Instruction Fetch 4 F4 Predecode PD Decode D Integer I Access A Execute Stage 1 EX1 Execute Stage 2 EX2 Stages F1 through F4 represent the fetch unit pipe Stag
299. s View Page The Address View page Figure 2 68 displays cache events on an Address versus Cycle plot Use this view to display the cache events for the speci fied addresses over time Icache Start address 100 Oxto0000215 15 000 20 000 25 000 Cycle Configuration Detailed History Performance Histogram Address Figure 2 68 Example Address View Page Address Range View Cache events display as icons identical to the icons used in the detailed view A start address and count are required Enter the start address as a hexadecimal value or a symbol Click the browse button to browse for a symbol The count determines the number of addresses displayed After entering a start address and count click Update to display the cache event data Use horizontal and vertical scroll bars to scroll the view 2 102 VisualDSP 5 0 User s Guide VDK Status Window Environment The VDK Status window Figure 2 69 is available when an executable file is built with VDK support enabled Open this window by choosing View VDK Windows and Status Thread 2 Idle Thread 2 Thread 0 kSystemStartT hread Template ID TO Priority Stack Address NumTimesRun CreationTime cycles RunStartTime cycles RunLastTime cycles RunTotalTime cycles CreationTime ticks RunStartTime ticks RunLastTime ticks amp Thread 1 kPhilosopherT hread lt amp Thread 2 kPhilos
300. s and hold down Alt and drag the cursor selects by column character instead of by line character Working With Bookmarks in an Editor Window When working with bookmarks in an editor window use the keyboard shortcuts listed in Table A 12 A 34 VisualDSP 5 0 User s Guide Reference Information Table A 12 Keyboard Shortcuts for Bookmarks Action Key s Toggle a bookmark Ctrl F2 Go to next bookmark F2 Building Projects To build projects use the keyboard shortcuts listed in Table A 13 Table A 13 Keyboard Shortcuts for Building Projects Action Key s Build the current project F7 Build only the current source file Ctrl F7 Using Keyboard Shortcuts for Program Execution For program execution use the keyboard shortcuts listed in Table A 14 Table A 14 Keyboard Shortcuts for Program Execution Action Key s Load a Program Ctrl L Reload a Program Ctrl R Dump to File Ctrl D Run F5 Multiprocessor Run Ctrl F5 Run to Cursor Ctrl F10 Halt Shift F5 Step Over F10 VisualDSP 5 0 User s Guide A 35 Keyboard Shortcuts Table A 14 Keyboard Shortcuts for Program Execution Cont d Action Key s Step Into F11 Multiprocessor Step Ctrl F11 Step Out Of Alt F11 Halt a Script Ctrl H Working With Breakpoints When working with breakpoints use the keyboard shortcuts listed in Table
301. s bar indicates e Zoom status e Processor address where the selected pixel is located e Pixel values for color images intensity values for gray scale images e Pixel coordinates column and row Pixel color depth 24 bits for color images and 8 bits for gray scale images Right Click Menu The Image Viewer window s right click menu provides these commands VisualDSP 5 0 User s Guide 2 121 Debugging Windows Table 2 30 Right Click Menu Commands Command Purpose Configure Opens the Image Configuration dialog box from which to specify image attributes Refresh Reads the image data from processor memory Color Gamma Adjust Opens the Image Effects dialog box from which to adjust gamma and view the resulting image Rotate Provides four selections 0 90 180 or 270 Flip Provides four selections None Horizontal Vertical or Both Auto Refresh A black check mark indicates that auto refresh is enabled based user specified settings Auto Refresh Settings Opens the Auto Refresh Settings dialog box from which to config ure auto refresh settings 2 122 VisualDSP 5 0 User s Guide 3 DEBUGGING This chapter describes VisualDSP debugging tools used during single processor and multiprocessor debug sessions The topics are organized as follows e Debug Sessions on page 3 1 e Code Analysis Tools on page 3 7 e Program Execution Operations o
302. s for ADSP BF535 Processors The ADSP BF535 Family Simulator is a core cycle accurate simulator with an eight stage pipeline The simulator models all the sequencer and memory events of the ADSP BF535 processor The Pipeline Viewer shows the flow of instructions through the pipeline and any stalls due to sequencer or memory events It enables you to understand the execution timing of your program For information about configuring and using the Pipeline Viewer see Pipeline Viewer Window on page 2 88 or VisualDSP online Help The Pipeline Viewer for the ADSP BF535 processor displays stages Decode through Writeback The first two stages of the pipeline IF1 and IF2 are not displayed because the information provided by the simulator in those stages is not significant Stall Reasons The stall reasons are grouped into three categories e Multicycle instructions latencies see Multicycle Instructions and Latencies on page D 22 e Instructions latencies see Instruction Latencies on page D 26 e LI data memory latencies see L1 Data Memory Stalls on page D 34 They are reported in the Pipeline Viewer as e Data address generator DAG read after write RAW hazard e Data register dreg hazard two cycle VisualDSP 5 0 User s Guide D 9 Simulator Instruction Timing Analysis for ADSP BF535 Processors Dreg register dreg hazard one cycle Memory stall Memory mapped register MMR stall CSYNC st
303. s for Peripherals on page D 7 Simulator Instruction Timing Analysis for ADSP BF535 Proces sors on page D 9 Simulator Instruction Timing Analysis for ADSP BF531 ADSP BF532 ADSP BF533 and ADSP BF561 Processors on page D 19 Multicycle Instructions and Latencies on page D 22 Compiled Simulation on page D 44 VisualDSP 5 0 User s Guide D 1 Peripheral Support in Simulators Peripheral Support in Simulators Use the following key for the tables in this section Table D 1 Symbol Vv Implemented NA Not applicable NP Not planned for implementation FR Planned for a future release Table D 2 summarizes peripheral support in the ADSP BF535 simulator Table D 2 Peripheral Support in the ADSP BF535 Simulator Peripheral Support Modeled Streamable Bootable SPORT Vv Vv NA UART v v NA PCI NP NP NP USB NP NP NP Flags v v NA System Timers v vd NA RTC v NA NA EBIU NP NA NA SPI v v NP Watch Unit NP NA NA Trace Unit NP NA NA Core Timer v V4 NA VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Table D 2 Peripheral Support in the ADSP BF535 Simulator Contd Peripheral Support Modeled Streamable Bootable MEMDMA V NA FR DMA v v FR PROM FR NA FR Table D 3 summarizes peripheral support in the ADSP BF535 compiled simulator Table D 3 Peripheral Support in the ADSP BF535 Compi
304. s not copy PDF versions of books and data sheets or supplemental reference documentation to the VisualDSP installation directory VisualDSP 5 0 User s Guide A 49 Online Documentation Printing Online Documentation Besides printing topics from VisualDSP Help on page A 50 you can print large documents VisualDSP manuals hardware manuals and data sheets and more from the VisualDSP Tools Installation CD ROM To print documents l Insert the VisualDSP Tools Installation CD ROM in the CD ROM drive Open the Docs folder by using one of these options From the VisualDSP Tools Installation main menu click View Documentation If the main menu does not appear run setup exe In Windows Explorer select the CD ROM drive for example D and open the Docs folder Open the folder where the document is located The Data Sheets folder contains processor data sheets Be sure to check the Analog Devices Web site for updated versions The Hardware Manuals folder contains hardware manuals The Reference folder includes the HTML files that comprise the Dinkum Abridged C library and the FlexLM network license documentation The Tools Manuals folder contains VisualDSP tools manuals Double click the document that you want to print Selecting a pdf file opens Adobe Acrobat Reader and displays the document Selecting an htm1 file opens a browser and displays the document From the File menu choose Prin
305. s well as compiler remarks You cannot suppress compiler warnings without also suppressing remarks Specify warning options from the Compile page Warning subpage of the Project Options dialog box VisualDSP 5 0 User s Guide 2 37 Output Window Log File The VisualDSP log file contains all the status and error messages that have been written to the Output window s Console page Figure 2 23 shows a sample log file VYisualDSP_Log_txt Notepad File Edit Search Help Loading C Program Files Analog Devices Vi Load complete Hit breakpoint at 6x18 Loading C Program Files Analog Devices Vi Load complete Hit breakpoint at 6x18 Loading C Program Files Analog Devices Vi Figure 2 23 Portion of a Sample Log File Messages are saved to the log file VisualDSP_Log txt which by default is located in the lt instal _path gt Data directory All sessions append to the log file Occasionally open the file and delete parts of it or all of it to conserve disk space Output Window Customization You can specify preferences that e Configure Output window fonts and colors e Enable command auto completion e Display file names only while building hide complete command lines 2 38 VisualDSP 5 0 User s Guide Environment By default the Output window resides at the bottom of the main applica tion window You can resize or move the Output window to a different portion of the screen by dragging
306. samples of the target processor s program counter PC and a graphical display of the resulting samples showing where the application spends time Call Stack on page 2 63 A means of moving the call stack back to the previous debug context Register on page 2 78 Pre configured windows display current values of registers You can change register contents and change the number format VisualDSP 5 0 User s Guide 2 43 Debugging Windows Table 2 10 Debugging Windows Contd Window Provides Custom Registers on page 2 81 User defined windows display the values of registers Select the Analog Devices processor memory mapped registers MMRs registers that you want to monitor Custom Registers on page 2 82 Custom board support Display contents of registers on custom boards View any register not just Analog Devices processor memory mapped registers MMRs User defined layout Memory on page 2 67 BTC Memory on page 2 73 A view of processor memory Similar number format and edit features as register windows plus fill and dump capability A view of background telemetry channel contents in real time The win dow displays the contents of the address that you want to see SHARC and Blackfin emulator sessions only Plot on page 2 109 A graphical display of values from memory addresses The window sup ports linear and FFT real and complex visualization m
307. section describes e Overview of Programming With VisualDSP on page 1 12 e Project Development Stages on page 1 14 e Targets on page 1 15 e Platforms on page 1 17 e Debugging Overview on page 1 20 e VisualDSP Kernel on page 1 22 e Program Development Steps on page 1 22 VisualDSP 5 0 User s Guide 1 11 Project Development Overview of Programming With VisualDSP Programming effectively with VisualDSP depends on how well you master a four step process You must learn how to 1 2 3 4 Work with VisualDSP Implement structured software design with VisualDSP Optimize performance with VisualDSP Test and debug your programs with VisualDSP Working With VisualDSP You should have a working knowledge of VisualDSP the front end for all available targets and platforms You should know how and when to use its various features and have a firm foundation in these project basics Work with property pages These pages of the Project Options dialog box provide options analogous to command line switches Set up debug sessions Know the distinctions between the three development stages simulation evaluation via an EZ KIT Lite evaluation system and emulation Understand how program sections and memory segments relate to prog ry seg physical processor memory Become familiar with Expert Linker Access peripherals This task includes setting up and ha
308. so being saved logged to a BIN file Live Data is being displayed in real time Playback A previously saved data log file is being viewed Tool Bar The plot window s toolbar shown in Figure 2 74 provides buttons for recording and playing back streaming data and a box for specifying streamed data bin file names Right Click Menu The plot window s right click menu is shown in Figure 2 75 This menu provides access to the standard window options docking closing and floating in the main window and to the plot window features described in Table 2 27 on page 2 114 VisualDSP 5 0 User s Guide 2 111 Debugging Windows Play New Stop Record Open Filename ST cra Lett Time Sec Figure 2 74 Plot Window s Toolbar Plot Window Statistics View various statistics mean standard deviation signal to noise ratio SNR minimum data value and maximum data value while displaying a plot Note that statistics apply only to the portion of data that is visible When the plot is zoomed the statistics are recalculated only for the visible area Figure 2 76 shows statistics displayed for a portion of audio data For details about viewing statistics refer to VisualDSP Help 2 112 VisualDSP 5 0 User s Guide Environment Figure 2 75 Plot Window s Right Click Menu VisualDSP 5 0 User s Guide 2 113 Debugging Windows Table 2 27 Plot Window Operations Feature Descri
309. ssen Sn 2 57 W mdv Uprrations sascicte tesco steesiopecamcessanmenneeentaenee 2 58 Changing the Window View secenanraiiieneniai 2 59 Displaying a Source File ssssuieunnsnicenornsenakana 2 59 Displaying Functions in Libraries serseimerercsnsioniae 2 99 VisualDSP 5 0 User s Guide CONTENTS Working Wih PARES screeners 2 60 recite Display Mods cccnesssenananannonsnos 2 60 Filtering PC Samples With No Debug Information 2 62 Call Stack WIndOW asec ecete encanto acmeesene 2 63 Applications Built With Debug Information 2 64 Applications Built When Debug Information is Not Available 2 64 RRO T MION ae eee eee 2 67 Number Formats in Memory Windows ssecsscecreeees 2 67 Memory Window Right Click Menu cecceeeeeseeseeeeee 2 69 Expression Tracking in a Memory Window eeeseeeeees 2 69 Memory Window Display Customization 2 72 Background Telemetry Channels BTCS scsvseinniverreesecerseions 2 73 BTC Detinitions in Your Programi succcciccncnnsuniner 2 73 Enabling BTC on ADSP 2126x and ADSP BF36x Processors 2 74 TOS RIED iiin a 2 75 BTC Memoiy Window sscuseesknsinir an NRN 2 75 BTC Memory Window Right Click Menu nsss 2 78 Rerister We LOUD creriraonon tron enintianeetiews 2 78 S a N E cee ace eee T 2 80 Custom Registers WIndows ersrperenia in 2 81 Custom Board SUpport sestssnsisenairensen ae eaa 2 82 Custom Board Support Files senssssmirseiiareousinsstemas 2 82 Processor Definition Piles poarsrscribancan akaki
310. sses and address ranges display in hexadecimal format The 0x notation however appears beside single addresses only Displaying a Source File Double clicking on a function name in the Execution Unit column not only displays the source of the function in the right pane but also displays profiling data for each line of the function Table 2 35 shows an example of code displayed for a function piste a apin marla I LL C TestLab Generic maint foofint include lt stdlib h gt PC 0xf 0000020 int foofint 1 PC Oxf00003fc PC Oxf00003fa return i 6 PC Oxf000009c barfint Fe Oxf 00000ac R void barfint i PHENO mS x 1 nm D a a 5 amp 5 ei D i Total Samples 364 Elapsed Time 00 00 00 Enabled Figure 2 35 Example Code Displayed for a Function Displaying Functions in Libraries The profiling window enables you to display functions in libraries as shown in Figure 2 36 VisualDSP 5 0 User s Guide 2 59 Debugging Windows ADSP BFS33 Blackfin Memory Instruction Samples 1 Execution Unit al start _init_devdrvtab _init_devtab _mi_initialize getargy PC Oxffa044da Pr fvffana7nn PC Oxffal46f2 Total Samples 556 ae Elapsed Time C Figure 2 36 Profiling Window Showing Library Functions To use this feature right click in the profiling window and choose Properties to open the Profile Window Properties dialog box Next click the Fi
311. ssions only Multiprocessing support for Blackfin ADSP BF561 and ADSP BF566 processors is available in simulation Setting Up a Multiprocessor Debug Session The first step in setting up a multiprocessor debug session is to develop a multiprocessor project by using the multiprocessing capabilities of the linker and an 1df file to describe the multiprocessor system Refer to the VisualDSP Linker and Utilities Manual especially sections about the SHARED_MEMORY and MPMEMORY commands The second step is to use the VisualDSP Configurator utility to describe the hardware to the VisualDSP software if you are running a JTAG emulator session VisualDSP uses this description when you set up your debug session Refer to VisualDSP Help for information about using the VisualDSP Configurator 3 4 VisualDSP 5 0 User s Guide Debugging When running a multiprocessor simulator debug session select the desired configuration from the Select Platforms page of the Session Wizard After specifying your hardware system build your project The first time that you launch VisualDSP for a new project the Session Wizard opens to enable you to configure the MP session The next time VisualDSP is launched the debug session is configured automatically Debugging a Multiprocessor System Debugging a multiprocessor system requires that you synchronously run step halt and observe program execution operations in all the processors a
312. ssor memory are assigned to the Y axis The corresponding X axis values are automatically generated gy Example 2 Example 2 Phase Maga tind Line Plot Figure 3 3 Line Plot Multiple data sets can be plotted on a single graph X Y Plots An X Y plot Figure 3 4 requires an X value and a Y value for each data point Unlike a line plot an X Y plot requires X axis data VisualDSP 5 0 User s Guide 3 21 Plots gv xY Plot Example XY Plot Example Figure 3 4 X Y Plot The X and Y data are specified separately in a user defined memory loca tion The number of X and Y points must be equal Constellation Plots A constellation plot Figure 3 5 displays a symbol at each X Y data point The X and Y data are specified separately in a user defined processor memory location The number of X and Y points must be equal 3 22 VisualDSP 5 0 User s Guide Debugging 3 Constellation Plot Example Constellation Plot Example Constellation Plot Figure 3 5 Constellation Plot Eye Diagrams An eye diagram plot Figure 3 6 is typically used to show the stability of a time based signal The more defined the eye shape the more stable the signal This plot works like a storage oscilloscope by displaying an overlapped his tory of a time signal The eye diagram plot processes the input data and optionally looks for a threshold crossing point default is 0 0 A trace is plotted when the threshold c
313. sted is both in the cache and dirty The number of cycles is determined as follows cycles 1 instruction 1 stall x read ack y cache penalty VisualDSP 5 0 User s Guide D 25 Multicycle Instructions and Latencies In an optimal environment x would be 5 and y would be zero If the address resides in a dirty line y is determined by the cycles to fill the dirty line plus any core boundary latencies The address should not reside dirty in the cache as the address contents are meant to be updated across multi ple processors and not be a local variable This instruction depends on off core conditions so it is not modeled by the simulation environment Table D 18 TESTSET Instruction Instruction ADSP BF535 TESTSET P0 7 cycles 1 Best case as determined by physical characteristics of external memory Instruction Latencies In addition to being based on instructions instruction latencies are con tingent on placement of specific instruction pairs relative to one another Avoid latencies by separating them by as many instructions as the number of cycles incurred between them For example if a pair of instructions incur a 2 cycle latency separate them by two instructions to eliminate that latency In the tables that follow note that bold typeface identifies register depen dencies within the instruction pairs Non bold typface in an entry means that the latency condition occurs regardless of the regi
314. sters used For a list of accumulator to data register Areg2Dreg math video multi ply and ALU operations as well as register groupings see Instruction Groups on page D 41 and Register Groups on page D 42 Instruction names are consistent with the Blackfin Processor Instruction Set Reference Calculate the total cycle time of each entry by adding the cycles taken by the instruction to the number of stall cycles for the instruction D 26 VisualDSP 5 0 User s Guide Simulation of Blackfin Processors Accumulator to Data Register Latencies Table D 19 Accumulator to Data Register Latencies Description Example lt cycles stalls gt instruction BF532 BF535 dreg Areg2Dreg op 1 lt 1 gt R1 R6 L R4 H IS video op using dreg 1 1 lt 1 2 gt R5 BYTEOPIP R3 2 R1 0 as src dreg Areg2Dreg op 1 lt 1 gt R4 L A0 R3 H R1 H rnd12 rnd20 using 1 lt 1 1 gt RO H R2 R4 RND12 dreg as src dreg Areg2Dreg op 1 lt 1 gt R4 L A0 R3 H R1 H shift rotate op using 1 lt 1 1 gt R1 ROT R2 BY R4 L dreg as src dreg Areg2Dreg op 1 lt 1 gt R0 H R0 L SIGN R2 H R3 H SIGN R2 L R3 L add on sign using 1 lt 1 1 gt R6 H R6 L SIGN R0 H R1 H SIGN R0 L R1 L dreg as src dreg math op 1 lt 1 gt R2 R3 RI Areg2Dreg op using 1 lt 1 1 gt R4 H R2 L RO H dreg as src VisualDSP 5 0 User s Guide D 27 Multicycle Instruct
315. t Click Menu Command Purpose Go To Opens the Go To dialog box in which you specify an address The specified address appears in the top left corner of the display The address must be within the range defined for the channel currently being displayed Tip Double clicking in the address column also opens the Go To dia log box Show Map Shows or hides a more informative map display of all the current chan or nel definitions Hide Map Show Map displays a channel list Double click a channel to display its contents in the lower portion of the window Hide Map removes the list of channels The selected channel remains in the display Lock Columns Locks or unlocks the number of columns currently displayed in the window Select Format Specifies how to display data in the window Choices include double words 32 bits words 16 bits and bytes 8 bits Refresh Rate Auto Refresh Specifies the refresh rate which is used when Auto Refresh is chosen The display is updated at the selected interval Enables the window to refresh itself at given intervals The rate is spec ified by Refresh Rate Auto Refresh mode is valid only while the pro cessor is running Channel Timeout Specifies the length of time to wait for any single response from the BTC If the timeout value is exceeded the current transaction ends Register Windows Access various register windows via the VisualDSP Register
316. t and specify the pages that you want to print and other print options VisualDSP 5 0 User s Guide Reference Information Invoking Online Help Invoke VisualDSP Help from within VisualDSP or outside of VisualDSP You can also access Help manually via Windows Explorer Access online Help from the VisualDSP Help menu by choosing Contents Search or Index To access online Help from the Windows Start button click the Start button and choose Programs Analog Devices VisualDSP lt version gt VisualDSP Documentation and then VisualDSP Documentation for All Families or VisualDSP Documentation for Blackfin SHARC or TigerSHARC gt The Help function is programmed to look for the Help system in the VisualDSP Help folder By default the VisualDSP software installation procedure places the complete set of Help files in the installation s Help folder If you receive an error message after invoking Help the Help system e May not have been loaded onto your PC e May have been deleted e May reside in a directory other than the default directory To locate the help chm files manually use the Windows Search function as follows 1 Record the Help file chm named in the error message 2 From the Windows Start button choose Search and For Files or Folders Enter the name of the chm file from Step 1 3 After locating the file launch it manually by clicking the file name from the Search Results w
317. t it is OK to run the application Before clicking Run load the symbols for the program as follows a From the File menu choose Load Symbols to open the Load a Processor Program s Symbols dialog box b Select the dxe file that was used to create the 1dr file A message indicates that the selected symbols are loading From the Debug menu choose Run F5 to run the application VisualDSP 5 0 User s Guide Simulation of SHARC Processors For booting information refer to the processor s hardware documentation or the VisualDSP Linker and Utilities Manual SPI Simulation in Slave Mode For ADSP 21161 processors the external SPI is not modeled in simula tion Since the master controls the timing there is no timing information for the transfers in slave mode Except during booting the BAUDR field of the slave SPICTL is used for the timing of the external master Since this field has no effect in slave mode in the hardware you can use it for simulation When the SPI is enabled in slave mode and the SPITX buffer is not empty an SPI transmit receive operation occurs If the SPITX and the SPIRX buff ers are empty a word is read speculatively into SPIRX buffer The SPI reads a maximum of one word ahead Once the SPIRX buffer is emptied by a DMA operation or a read the SPI reads another word in the time speci fied by the BAUDR field of SPICTL During booting the SPI operates at its fastest supported baud rate Whe
318. t once The following capabilities help to speed a multiprocessor debug session Multiprocessor debug commands Debug gt Multiprocessor operate similar to commands used to debug a single processor The only difference is that MP commands work synchronously on all active processors in the currently selected MP group Multiprocessor window refer to Multiprocessor Window on page 2 83 The Status page displays the status of each processor and lets you switch processor focus The Group page enables you to group processors into multiple logical units to which all MP commands are applied Window pinning Note that you can use pinning and the processor status items in the Multiprocessor window with single processor debug commands to debug individual processors in an MP session Window color specification see VisualDSP Help VisualDSP 5 0 User s Guide 3 5 Debug Sessions Focus and Pinning Often in a multiprocessor debug session you have to examine the behavior of a single processor to better understand its interaction with the other processors on the target When you debug a single processor in an MP session the processor being debugged has the focus By pinning a window to a processor you dedicate that window such as a memory window to a particular processor in a multiprocessor group Pinning associates a window to a specific processor statically Before debugging open and pin the register windows a
319. ta to a file For details refer to VisualDSP Help Plot Window Features Plot windows include a status bar toolbar and a right click menu Status Bar The status bar located at the bottom of the plot window displays the plot type and other information depending on the plot type and other settings The following examples show different plot information displayed on the status bar Line Plot li AZz 74 0 EL 22 0 Waterfall Plot Aru 45 1 V1 Line Plot BTC Buffer Capacity 38 Live Line Plot Figure 2 73 Status Bar Information for Plots In a waterfall plot the status bar indicates the azimuth and elevation view ing angles If you zoom in on a region the status bar indicates that zoom is enabled When using the data cursor the status bar shows the selected point s data value When a plot window s auto refresh mode is enabled in BTC mode the status bar indicates current buffer capacity for example 38 and data logging status 2 110 VisualDSP 5 0 User s Guide Environment Buffer capacity which dynamically changes between 0 and 100 indi cates the portion of the buffer currently in use The ideal size is a little below 100 Readings of 100 indicate lost data Table 2 26 describes the data logging status indicators in a plot window Table 2 26 Data Logging Status Indicators in a Plot Window Status Indicates Record Real time data being displayed is al
320. tack information when e Debug information is available e Debug information is not available Applications Built With Debug Information When debug information is available the call stack provides the C func tion names starting with current program context A program is built with debug information using the default Debug configuration or alternately by selecting Generate debug information on the Project Options dialog or manually using the compiler s g command line switch See Figure 2 42 Applications Built When Debug Information is Not Available An application may be build with limited or no debug information In this instance the Call Stack window will be based partly on debug informa tion and partly on the frame pointer alone This Call Stack window will provide a call stack that may contain assembly labels with offsets as well as C functions If code is being executed that does not adhere to the compiler standards the call stack cannot be guaranteed When debug information is not available at all the Call Stack window Figure 2 43 will provide limited information based on symbol table information If symbols have been stripped from the executable simple addresses will be displayed When debug information is not available for 2 64 VisualDSP 5 0 User s Guide Environment Call Stack Double clicking on a function opens an editor window or the Disassembly window function3 function2
321. tage while running test code for each instruction Utilizing these readings as absolute measurements would not be accurate enough considering factors such as leakage current temperature and fab rication process of the chip that play a part in an application s power Therefore these measurements are referred to as instruction ranking Example The following example demonstrates how energy aware programming can be used to profile the core power used by an application To set up the Linear Profiling window for power profiling 1 From the Tools menu choose Linear Profiling and then choose New Profile 2 Right click on the Linear Profiling window choose Properties and select Energy Units Then click OK VisualDSP 5 0 User s Guide 3 31 Energy Aware Programming When you profile your code each instruction ranking is converted to Energy and the PLL values are used for voltage and frequency scaling To create a project that enables Processor Clock and Power Settings l From the File menu choose New and then choose Project The Project Wizard appears In Name enter a name for the new project In Project types select Standard application Then click Next In Processor types select one of these processors ADSP BF531 ADSP BF532 or ADSP BF533 Then click Next Under Do you want to select Add startup code only Then click Next In the tree control left side of Project Wizard click Proc
322. tdated file is a file that has been modified since the last time it was built or a file that includes include a modified file For example if a C file that has not been modified includes a header file that has been modified the C file is out of date VisualDSP 5 0 User s Guide 1 57 Processor Projects VisualDSP uses dependency information to determine which files if any must be updated during a build Note the following e A file with an unrecognized file extension is ignored at build time e If an included header file is modified VisualDSP builds the source files that include include the header file regardless of whether the source files have been modified since the previous build e File icons in the Project window indicate file status such as excluded files or files with specific options that override project settings This section describes the following topics e Build Options on page 1 58 e File Building on page 1 58 e Batch Builds on page 1 59 e Pre Build and Post Build Options on page 1 59 e Project Dependencies on page 1 60 Build Options You can specify options for the entire project and for individual files Table 1 6 describes these build options File Building Building a file compiles or assembles the file and locates and removes errors You can build a single file or multiple files that you select 1 58 VisualDSP 5 0 User s Guide Introductio
323. ter window number formats include standard formats such as hexa decimal octal and binary Depending on the processor other formats may be available You can change a register s data directly from within a register window The modified register content is used during program execution Edits to data do not affect your source files To make changes permanent edit the source file and rebuild your project Stack Windows Depending on your processor access to various stack windows is available including PC stack Counter stack 2 80 VisualDSP 5 0 User s Guide Environment e Loop tack e Status stack Access stack windows via the Register menu For more information about your processor s stack windows consult VisualDSP Help Custom Registers Windows While debugging you can configure and display Custom Registers windows To create a Custom Registers window choose Register Custom and Manage Then configure and add the registers that you want to display The Custom Registers window appears immediately after it is created Each Custom Registers window displays a customizable title and the registers that you choose to monitor The Custom Registers window shown in Figure 2 55 displays the contents of five registers Custom Registers RO 0000204200 R4 0000204200 R3 0000000000 R5 0000000000 USTAT1 00000000 Figure 2 55 Example A Customized Registers Window VisualDSP 5 0 User s
324. the application s main window frame e Float a window A window s right click menu provides commands for docking or floating the window The Allow Docking command and the Float In Main Win dow commands are mutually exclusive Docked Windows The Project window in Figure A 18 is docked The docking option Allow Docking is enabled To prevent a window from docking hold down the keyboard s Ctrl key while dragging the window to another position Floating Windows The Project window in Figure A 19 is floating in the main window Float In Main Window is enabled The presence of an icon in the top left corner of a window indicates that it is floating VisualDSP 5 0 User s Guide A 39 Window Operations EER Oem n nr ae Owe vs miiir shell c Demum E DIRIRe DSP Figure A 18 Example of a Docked Project Window OTP ve Daa Figure A 19 Project Window Floating in Main Window 1 of 2 The Project window in Figure A 20 is also floating in the main window Float In Main Window is enabled The Project window in Figure A 21 is floating but not in the main win dow Float In Main Window is not selected A 40 VisualDSP 5 0 User s Guide Reference Information setupllFAi dsp DIRIIRc DSP Figure A 21 Example Project Window is Not Floating in Main Window VisualDSP 5 0 User s Guide A 41 Window Operations Window Position Rules The following rules
325. the following hardware conditions e Random interrupts that can occur during program execution e Data transfer through the processor s I O pins e Processor booting from a PROM or host processor Setting up VisualDSP to generate random interrupts during program execution enables you to exercise interrupt service routines ISR in your code EZ KIT Lite Targets An EZ KIT Lite target is a development board used to evaluate a particular processor Analog Devices provides EZ KIT Lite evaluation systems for each processor family and demonstration programs 1 16 VisualDSP 5 0 User s Guide Introduction to VisualDSP Emulator Targets An emulator target is a module that controls a physical processor con nected to a JTAG emulator system For example the USB ICE emulator communicates with one or more physical devices through the host USB port Platforms A platform refers to the configuration of processors with which a target communicates Several platforms may exist for a given debug target For example if three emulators are installed on your system you might select emulator 2 as the platform that you want to use The platform that you use depends on your project development stage See Table 1 1 Table 1 1 Development Stages and Supported Platforms Stage Platform Simulation Typically one or more processors of the same type By default the plat form name is the identical simulator Some proc
326. tile memories that can be read pro grammed and erased In most applications flash devices store e Boot code that the processor loads at startup e Data that must persist over time and through the loss of power Typically flash device programming is performed with a device program mer at the factory or by an application developer When a flash device is wired appropriately to the processor the processor can program the flash device Flash Programmer Functions Use the Flash Programmer to e Load a flash algorithm driver program onto the processor at any time e Obtain the flash manufacturer and device codes e Reset the flash e Program the flash from a data file e Fill portions of flash memory with a value and quickly punch in data e Erase the entire flash or a single sector e Send custom commands to the driver for batch processes or user defined behavior The Flash Programmer utility stores the most recently used information in the registry for retrieval when the utility is next started up A message box shows the utility s current state VisualDSP 5 0 User s Guide 3 29 Flash Programmer Flash Driver To use the Flash Programmer utility you must first load a flash driver onto the processor The driver is a processor application that interfaces with the Flash Programmer and performs all the interaction with the flash device Analog Devices supplies sample drivers for use with certain EZ KIT Lite evaluat
327. time The period needed to restore the processor s context and to start the return from interrupt RTI routine interrupt service routine ISR A routine executed as a response to a software interrupt or hard ware interrupt VDK supports nested interrupts which means that the kernel recognizes other interrupts services interrupts or both VisualDSP 5 0 User s Guide A 73 Glossary with higher priorities while executing the current ISR For VDK the ISRs are written in assembly language VDK reserves the timer and the lowest priority reschedule interrupt JTAG Joint Test Action Group This committee is responsible for imple menting the IEEE boundary scan specification enabling in circuit emulation of ICs JTAG ICE configurator See VisualDSP configurator kernel The main module of a real time operating system The kernel loads first and permanently resides in the main memory and manages other modules of the real time operating system Typical services include context switching and communication management between OS modules keyboard shortcuts The keyboard provides a quick means of running the commands used most often such as simultaneously typing the keyboard s Ctrl and G keys indicated with the symbols Ctrl G to go to a line ina file librarian A utility that groups object files into library files When linking your program specify a library file and the linker automatically links any file
328. tion Debug Builds a project that enables the use of VisualDSP debugging capabilities Release Builds a project with optimization enabled Available configurations appear in the configuration box which by default is located in the Project toolbar as shown in Figure 1 12 Figure 1 12 Configuration Box You cannot delete the Release or Debug configuration Customized Project Configurations You can add a configuration to your project A customized project configuration can include various project options and build options to help you develop your project Figure 1 13 shows a customized configuration Version2 listed in the configuration box 1 56 VisualDSP 5 0 User s Guide Introduction to VisualDSP Debug p ie A customized configuration named Version2 is added Figure 1 13 Selecting a Project Configuration Project Build The term build refers to the process of performing operations such as preprocessing assembling and linking on projects and files During a build VisualDSP processes project files that have been modified since the previous build as well as project files that include modified files A build differs from a rebuild all When you execute the Rebuild All command VisualDSP processes all the files in the project regardless of whether they have been modified Building a project builds all outdated files in the project and enables you to make your program An ou
329. tion time in the program is in the areas where most of the PC registers are concentrated Statistical profiling provides a more generalized form of profiling that is well suited to JTAG emulator debug targets Emulator targets do not sup port linear profiling JTAG sampling is completely non intrusive so the process does not incur additional run time overhead 3 8 VisualDSP 5 0 User s Guide Debugging Statistical Profiling of Short Run Programs Statistical profiling of short run programs does not display any results Statistical profiling requires a minimum number of samples The more samples the more accurate Below a minimum it is not worth reporting For a 600 MHz Blackfin processor at 10 MHz the emulator collects about 60000 samples per second which is about a 10000 to 1 ratio versus the number of instructions the processor executes per second If the pro gram has fewer than 10000 instructions the profile will contain only one sample at most which is not useful information Statistical profiling is meant to be run in an operational system over time allowing you to evaluate repetitive code such as FFTs and ISRs which are called often in the running system This requires a longer time to become statistically stable Traces SHARC processors only A trace captures a history of processor activity during program execution Run a trace execution trace or a program trace to analyze the run time behavior of your app
330. tions are inserted 2 24 VisualDSP 5 0 User s Guide Environment immediately below the corresponding source lines similar to mixed mode When first viewed the editor window displays an icon Figure 2 14 to indicate the presence of a compiler annotation B annot_vect_advice c Compiler int i ma annotation int sl 0 pe icon eo for i 0 i lt n i sl x i y i sE WZ Figure 2 14 Compiler Annotation Icon in Editor Window Hover the mouse cursor over an annotation icon to display the compiler annotations in a tooltip if it fits a tooltip When there are multiple anno tations the number of compiler annotations appears in the tooltip See Figure 2 15 int iil int sl l for 1 0 i lt n i sl x i y il Figure 2 15 Displaying Compiler Annotation in a Tooltip VisualDSP 5 0 User s Guide 2 25 Editor Windows Tip Double click to display the compiler annotations Double click again to hide the annotations Ry for 1 0 i lt n i Info This loop executes 1 iterations of the origina Info unknown trip count Info Succesfully found modulo schedule Info Modulo schedule parameters II 2 SC 2 M Advice Consider using pragma loop_count to specify Failure This loop would vectorize if alignment were sl px i py i Figure 2 16 Displaying the Compiler Annotations There are three types of messages Each compiler annotation is pre
331. tions of the simulation software models simu lator instruction timing analysis and compiled simulation XXIV VisualDSP 5 0 User s Guide Preface What s New in This Manual The VisualDSP 5 0 User s Guide supports all Analog Devices Inc processor families and processors listed in Supported Processors on page xxvil For a list of new VisualDSP 5 0 user interface features refer to VisualDSP 5 0 Features on page 1 7 See VisualDSP Help for details Also refer to the VisualDSP 5 0 Product Release Bulletin for information on features that are new updated or removed This document provides release specific information and should be of particular interest to those users who are familiar with previous versions of VisualDSP VisualDSP 5 0 User s Guide XXV Technical or Customer Support Technical or Customer Support You can reach Analog Devices Inc Customer Support in the following ways e Visit the Embedded Processing and DSP products Web site at http www analog com processors e E mail tools questions to processor tools support analog co e E mail processor questions to processor support analog com Wor processor europe analog com Euro processor china analog com China technicalSupport d wide support pe support support e Phone questions to 1 800 ANALOGD e Contact your Analog Devices Inc local sales office or authorized distributor e Send questions
332. to use for a particular target build 1 2 VisualDSP 5 0 User s Guide Introduction to VisualDSP Source File Editing Features VisualDSP simplifies tasks involving source files All the activities necessary to create view print move within and locate information are easy to perform e Edit text files Create and modify source files and view listing or map files generated by the code development tools Source files are the C C language or assembly language files that make up your project Processor projects can include additional files such as data files and a Linker Description File 1df which contains command input for the linker For more information about 1df files see Linker on page 1 31 e Editor windows Open multiple editor windows source windows to view and edit related files or open multiple editor windows for a single file The VisualDSP editor is an integrated code writing tool that enables you to focus on code development e Specify syntax coloring Configure options that specify the color of text objects viewed in an editor window This feature enhances the view and helps locate portions of the text because keywords quotes and comments appear in distinct colors e Context sensitive expression evaluation Move the mouse pointer over a variable that is in the scope to view the variable s value e Status icons View icons that indicate breakpoints bookmarks and the current PC posit
333. tor Previously called session type context switch A process of saving restoring the processor s state The scheduler performs the context switch in response to the system change A hardware interrupt can occur and change the state of the system at any time Once the processor s state has changed the currently running thread may be swapped with a higher priority thread When the kernel switches threads the entire processor s state is saved and the processor s state for the thread being switched in is restored critical region A sequence of instructions whose execution cannot be interrupted or swapped out Suspending all interrupt service routines ISRs before calling the critical region ensures that the execution of a crit ical region is not interrupted Once the critical region routine concludes ISRs are enabled CROSSCORE Analog Devices processor development tools which provide easier and more robust methods for engineers to develop and optimize systems by shortening product development cycles for faster time to market CROSSCORE components include the Visu alDSP software development environment and EZ KIT Lite evaluation systems and emulators for rapid on chip debugging A 68 VisualDSP 5 0 User s Guide Reference Information current directory Directory where the DPJ file is saved The build tools use the current directory for all relative file path searches See also default directorie
334. ts are set after a pro gram is loaded In VisualDSP 4 0 and earlier releases after a program is loaded software breakpoints were automatically set at main Also you 3 14 VisualDSP 5 0 User s Guide Debugging can specify additional breakpoints to be set after a load and you can spec ify each additional breakpoint as being a software breakpoint or a hardware breakpoint You conifer the automatic breakpoints via the Automatic page of the Breakpoints dialog box Next to each label in the breakpoint list is a brief description of the breakpoint location like start of program for main end of program for ___1ib_prog_term and so on User defined break points are labeled user breakpoint if you do not provide a description Automatic breakpoints may be set as software breakpoints or hardware breakpoints If the IDDE is connected to a simulator target the hard ware software specification is ignored since all breakpoints are software breakpoints If the IDDE is connected to an emulator target that supports hardware breakpoints you can specify each automatic breakpoint as being a hardware breakpoint or a software breakpoint in the target Automatic breakpoints are specified saved and restored on a per session basis Multiprocessor Sessions In a multiprocessor session you must configure the automatic breakpoints one processor at a time by setting focus on a processor opening the Automatic page of the Break
335. tten or read Refer to Code Analysis Tools on page 3 7 for related information Locals Window The Locals window displays the value of local variables within a function as shown in Figure 2 33 Open this window from the View menu by choosing Debug Windows and Locals Locals Hexadecimal Name Value Address Type Size Format Bs Oxff901ea0 3 0x0000010c Hexadecimal ui 0x00000000 Oxf f901ea0 unsigned int 0x00000004 Hexadecimal s 0x0000 Oxf f901ea4 short 0x00000002 Hexadecimal A s2 Oxff90leas S2 0x00000104 Hexadecimal 0 E TE 0 Oxf f901ea8 52 0x00000034 Hexadecimal 1 Oxf f90ledc 52 0x00000034 Hexadecimal 2 Oxff 901 10 52 0x00000034 Hexadecimal 3 Oxff 901 44 S2 0x00000034 Hexadecimal 4 Oxff 901 78 S2 0x00000034 Hexadecimal i 0x00000000 Oxff901fcc int 0x00000004 Hexadecimal j 0x00000000 Oxff901fd0 int 0x00000004 Hexadecimal Figure 2 33 Example Locals Window Use the Locals window with a Step or Halt command to display the cur rent value of variables when moving through your program You can select the number format used by the window global format You can override the global format and specify each expression s format per expression basis Changing the window s global format overrides any per expression formatting for example if the global format is set to Hexa 2 54 VisualDSP 5 0 User s Guide Environment decimal and you set the format of a sing
336. u can create or config ure one by specifying its name type and JTAG chain scan path You can also use the VisualDSP Configurator to run ICE Test a utility that checks the functionality of your emulator refer to Figure 1 3 Refer to VisualDSP Help for details about using the VisualDSP Configurator and the ICE Test utility 1 18 VisualDSP 5 0 User s Guide Introduction to VisualDSP Figure 1 3 ICE Test Utility VisualDSP 5 0 User s Guide 1 19 Project Development Debugging Overview Once you have successfully built a processor project and generated an executable file you can debug the project Projects developed in VisualDSP are run as hardware and software debug sessions In Table 1 2 Yes indicates the debugging tools that are available during the process of building and debugging a program Table 1 2 Tools Available During Simulation Evaluation and Emulation Tool Simulation Evaluation Emulation Linear profiles on page 3 8 Yes Interrupts on page 3 17 Yes Streams on page 3 17 Yes Traces SHARC processors only Yes on page 3 9 Pipeline Viewer not SHARC processors Yes on page C 2 Cache Viewer on page 2 93 Yes Breakpoints on page 3 13 Yes Yes Yes Watchpoints on page 3 15 Yes Hardware breakpoints on page 3 16 Yes Plotting on page 3 20 Yes Yes Yes Statistical profiles on page 3 8 Yes You can
337. ubmenu under Settings menu provides the Configure DMA File I O command which opens the DMA File I O Configuration dialog box Figure C 7 This is used to specify files as sources destina tions or both for DMA transfers DMA File I O Configuration DE o I Enable Description 0 External Port C1 External Port Path Source 2 External Port OO 3 External Port 4 Link Output Previews 5 Link Output 6 Link Output 7 Link Output 8 Link Input 9 Link Input 10 Link Input z 11 Link Input T Circular 12 Auto DMA On New Sequence Rewind Continue 13 Auto DMA On Chain C Rewind Continue Path Destination Format Hexadecimal x Comment On New Sequence Overwrite Append I Halt On Errors On Chain C Overwrite Append Cancel Save As Load From Figure C 7 DMA File I O Configuration Dialog Box VisualDSP 5 0 User s Guide C 11 ADSP TS20x Processors For information about dialog box options and simulating a DMA transfer in the simulator refer to VisualDSP online Help ADSP TS20x Processors This section includes the following topics which apply to the ADSP TS201 ADSP TS202 and ADSP TS203 processors e Simulator Timing Analysis Overview e Pipeline Stages e Stalls e Aborts e Pipeline Viewer and Disassembly Window Operations Simulator Timing Analysi
338. ulticycle instructions are a category of instructions that cannot complete in fewer than two cycles Consequently the extra cycles generated by such an instruction cannot be removed without removing the multicycle instruction itself In Figure D 3 multicycle instruction SP R7 6 P5 3 enters the pipeline Decode stage at cycle 16 and takes five cycles to complete 1 cycle per register to push on the stack SP The next instruction R7 0 takes only one cycle Cycle Decode Address Executel Execute2 Execute3 Writeback 15 NOP NOP NOP NOP 16 L S B NOP NOP NOP 17 SP L S B NOP NOP 18 SP SP SP NOP 19 SP L SP SP sP B F 20 SP L SP SP t s Mi e amp 21 R 0 SP SP L s Mc sej Me 22 R 0 R7 0 SP L s Mri e Mi e 23 P5 0 R6 R7 0 L sP Mri e Mie Se 24 P4 0 PS 0 R6 R 0 M s 1 ri spi 25 P3 0 P4 0 PS 0 R6 0 R7 0 M s 26 NOP P3 0 P4 0 PS 0 R6 0 R7 0 27 NOP NOP P3 0 P4 0 PS 0 R6 0 Figure D 3 Example of a Multicycle Instruction in the Pipeline Viewer For details about multicycle instructions see Multicycle Instructions and Latencies on page D 22 Abbreviations in Pipeline Viewer Messages Table D 9 shows abbreviations that
339. ultiprocessing 3 4 switching 3 3 types 3 1 viewing list of 3 3 debug target See targets demoting error messages 2 35 dependencies project 1 57 device drivers defined A 70 Dinkum abridged C library 1 29 Disassembly windows 2 46 address bar 2 45 examples 2 45 features 2 46 2 47 going to an address 2 47 invoking 2 45 opening multiple 2 46 pipeline stages 2 50 right click menu 2 48 symbols 2 49 discretionary errors 2 31 discretionary messages 2 35 dlb files 2 14 A 12 dlo files A 12 docked windows A 39 debugging windows docking control menu A 19 toolbars A238 list of 2 43 i 4 VisualDSP 5 0 User s Guide documentation printing A 50 doj files 1 28 1 30 1 31 2 14 A 12 DOS commands running 1 60 dpg files 1 49 A 14 dpj files 1 43 A 12 dsp files 2 14 A 13 DSPs See processors dumping memory 2 67 DWARF 2 1 27 defined A 71 dxe files 1 31 A 12 automatic loading 1 26 E editing features 1 3 files 1 24 keyboard shortcuts A 33 editor files comments in A 48 Editor Tab mode 2 21 editor windows about 2 16 bookmarks 2 17 2 19 breakpoints 3 13 compiler annotations 2 24 Editor Tab mode 2 21 expression evaluation 2 24 operations 2 17 parts of 2 17 program icon A 18 right click menu 2 27 source mode vs mixed mode 2 20 switching among 2 23 symbols 2 18 syntax coloring 2 19 INDEX ELF defined 1 27 ELF DWARE format A 12 elfloader exe 1
340. umentation for fur ther details on whether it supports the debugging interfaces within the Microsoft ActiveX script engine framework VisualDSP 5 0 User s Guide 2 41 Output Window e Specify the scripting language Right click in the Console view and select a language from the list of scripting languages installed on your machine The name of the current scripting language appears in the status bar at the bottom of the VisualDSP main window as shown in Figure 2 26 Current scripting language Halted Figure 2 26 Scripting Language Displayed in Status Bar e Load a script You can load a script by selecting Load Script from the File menu from the Console view s right click menu or the editor window s right click menu The script loads and runs until it finishes run ning or until you halt the script by choosing Halt Script from the Debug menu The Console view supports script command auto completion which you can enable on the General page of the Preferences dialog box accessible via the Settings menu The VisualDSP installation directory includes example scripts in the Scripting Examples folder located under the processor family name for example 21k and the Examples folder 2 42 VisualDSP 5 0 User s Guide Environment Debugging Windows VisualDSP provides debugging windows to display program operation and results Table 2 10 describes these windows Table 2 10 Debugging W
341. uoeatinne 1 14 DIAS E E E E a iipeiahded ola E E T 1 15 Simulation Tates ersan einai 1 16 EZ KIT Lite TEG arnaamonionniann enai 1 16 Emulator Ve cerns 1 17 idl Ts 5c one Reon en E Mirela nehr oR Mena N 1 17 iv VisualDSP 5 0 User s Guide CONTENTS Debuseing 90 societies eer nine 1 20 TIDS Per Rete soe 1 22 Program Deyelopment Steps cicncencssciatecuecnstuscasieonsdeamsenstwscsedaes 1 22 w Creme a Pe OS uaaa 1 23 Step 2 Configure Projest OPUONS sei csticitdacseisasciaesetninnses 1 23 Step 3 Add and Edir Project Source Files jscsiscsesisssscicerccns 1 23 Adding Files co Yont Project gcuieeusnenwieauncics 1 24 Creating Files co Add to Toar Project acerrime 1 24 Be Fie E E E E E 1 24 Managing Project Dependencies sessnrmriirisssnsiri 1 24 Step 4 Specifying Project Build Options oo eee 1 24 RNR eres R 1 25 Project Wide File and Tool Options sdcsccionsicsieesseve 1 25 Individual File ane Tool Options sisaridninonionirisieis 1 26 Step 5 Build a Debug Version of the Project cccccscccsesecccusc 1 26 Step 6 Create a Debug Session and Load the Executable 1 26 Step 7 Run and Debug the Program osnccarsrerissansias 1 26 Step 8 Build a Release Version of the Project scccisisocssceeerss 1 27 Code Development Tools sce ateue eee en 1 27 IOP N A AA E E AN 1 28 Cey Run Time Librarie erani n aR 1 29 Dinkum Abridged Ces Library sosersnirrisainieariisss 1 29 Assemble reenson akaa i aiii 1 30 Linker cineca emi 1 31 VisualDSP
342. ur software The upgrade procedure does not change the previous version s folder structure or license file The new installation process uses the previous version s path and license Check the Analog Devices Web site to ensure that you have the latest software version VisualDSP Product Updates As of VisualDSP Version 4 0 software updates are available from the Analog Devices Web site The content of an update is inclusive of all pre vious updates In addition the Release Notes for past updates are appended to the current update s Release Notes Updates to VisualDSP address problems and stabilize the release Updates do not contain significant new functionality However incre mental support e g emulation example programs header files default 1 10 VisualDSP 5 0 User s Guide Introduction to VisualDSP LDF errata accommodations EZ KIT Lite software and so on for new semiconductor products will be added as these products become available and gain support within the VisualDSP tools Starting with VisualDSP 3 5 new versions of VisualDSP are discrete upgrades Your PC can maintain multiple versions of VisualDSP Refer to online Help for details on updating your software Help explains how to identify the update currently installed on your system Project Development During project development VisualDSP helps you interactively observe and alter the data in the processor and in memory This
343. uring the plot or after generating the plot VisualDSP 5 0 User s Guide 2 117 Debugging Windows gv Line Plot Example e T E amp Line Plot Yi and Y2 50 iS 100 Time Line Plot Figure 2 80 Zooming in on a Selected Area Table 2 28 Plot Settings Options by Page Page Options That You Can Specify General Title and subtitle grid lines margins background colors and legend 2 D Axis For X axis and Y axis axis titles start and increment values scales 3 D Axis For X axis Y axis and Z axis axis titles Z axis settings step sizes scale multipliers color and mesh Font Font name color and size Style For a data set line type width color symbol and type Data Processing For a data set data processing algorithm sample rate and triggering 2 118 VisualDSP 5 0 User s Guide Environment Image Viewer The Image Viewer window reads and displays image data from processor memory or a file on your PC Use this window to configure image attributes and to view images This display is ideal for testing image pro cessing algorithms Figure 2 81 shows a typical Image Viewer window The status bar indi cates the DSP address RGB values and pixel coordinates Tools Image Viewer Address 0x10C475 RGB 0xB 0x17 0x23 col 200 row 139 7 gt Zoom status Status bar Figure 2 81 Image Viewer Window VisualDSP 5 0 User s Gu
344. ut Analog Devices and its products in any of the following ways e E mail questions or requests for information to processor support analog com World wide support processor europe analog com Europe support processor china analog com China support e Fax questions or requests for information to 1 781 461 3010 North America 49 89 76903 157 Europe e Access the FTP Web site at ftp ftp analog comor ftp 137 71 25 69 ftp ftp analog com VisualDSP 5 0 User s Guide xxix Product Information Related Documents For information on product related development software see these publications VisualDSP 5 0 Product Release Bulletin VisualDSP 5 0 Getting Started Guide VisualDSP 5 0 Assembler and Preprocessor Manual VisualDSP 5 0 C C Compiler Manual for SHARC Processors VisualDSP 5 0 Run Time Library Manual for SHARC Processors VisualDSP 5 0 C C Compiler and Library Manual for TigerSHARC Processors VisualDSP 5 0 C C Compiler and Library Manual for Blackfin Processors VisualDSP 5 0 Linker and Utilities Manual VisualDSP 5 0 Loader and Utilities Manual VisualDSP 5 0 Device Drivers and System Services Manual for Blackfin Processors VisualDSP 5 0 Kernel VDK User s Guide VisualDSP 5 0 Installation Quick Reference Card VisualDSP 5 0 Licensing Guide Throughout this manual and online Help tools manuals are often identified by their titles but without their software version that is
345. w advances by several lines while the yellow arrow which marks the current program counter location in the Disassembly window moves to the next instruction line While skipping invalid instructions aborted bubbles or an invalid fetch the simulator still processes memory transactions When the step is completed and the memory window is updated a surpris ingly large number of new values may appear When debugging DMA be aware that a single step may cause several DMA transac tions to be completed Simulator Options The Simulator submenu under Settings provides the Select Loader Program command This command opens the Open File dialog box from which to specify a custom loader program Once selected the loader pro gram automatically runs before a user program is loaded The simulator defaults to a standard loader program TS20x_prom dxe where x is 1 2 or 3 but you can define your own loader by compiling a program into a dxe file If you create your own loader your code must contain the label _init_debug_end to ensure that the loader is executed C 22 VisualDSP 5 0 User s Guide D SIMULATION OF BLACKFIN PROCESSORS This appendix provides Blackfin simulator specific information The information is organized as follows Peripheral Support in Simulators on page D 2 Note that VisualDSP online Help includes the most recent information about Blackfin processor simulation support Special Consideration
346. ween the stallable instruction and the short word access or remove the stall condition B 6 VisualDSP 5 0 User s Guide Simulation of SHARC Processors Case 6 has no workaround Ensure that a failing sequence does not occur when you use the delayed branch 08 option with jumps calls and returns For example ensure that the two instructions in RTI DB do not cause an instruction stall in a return to code that includes short word accesses Access to ADSP 21065L Short Word Internal Memory 9th Column at Even Addresses An Access to ADSP 21065L 9th column Even Address event is a simula tor anomaly The event occurs during access to an ADSP 21065L short word internal memory 9th column even addresses The simulator allows the event but the processor does not The simulator issues a warning when the event occurs VisualDSP lets you suppress the warning in various ways Selecting this option lets you control the simulator s behavior when the event occurs When this option is not selected a message box pops up and a warning appears in the Out put window s Console view Recording a Simulator Anomaly or Event You can record various simulator anomalies and events for ADSP 21x6x processors VisualDSP 5 0 User s Guide B 7 Recording a Simulator Anomaly or Event To record a simulator anomaly or event 1 From the Settings menu choose Anomalies or Events 2 Choose the anomaly or event to record The anomalies
347. ws and BTC Memory Figure 2 51 shows the contents of a specified channel only for example Channel1 ic BTC Memory F0002000 F0002010 F0002020 F0002030 F0002040 F0002050 F0002060 F0002070 F0002080 F0002090 F0002040 F0002050 F00020C0 F00020D0 F00020E0 03020101 13121110 23222120 33323130 43424140 07060504 Ob0a0908 17161514 1b1ai918 27262524 2b2a2928 37363534 3b3a3938 47464544 4b494948 53525150 57565554 5b5a5958 63626160 73727170 83828180 93929190 a3a2ala0 b3b2b1ib0 c3c2cic0 d3d2d1id0 eje2ele0 67666564 6b6a6968 77767574 7b7a7978 87868584 8b8a8988 97969594 9b9a9998 avabaSad4 abaaadIad b b6b5b4 bbbab9bs c cb6cSc4 chcac3c8 d d6d d4 dbdad3d8 efebeSed cheacdes Of0e0d0c 1fleldic 2f2e2d2c 3f 3e3d3c 4fdedd4c 5f5e5d5c 6f6e6d6c 7f7e7d7c Sf 8e8d8c 9f 9e9d9c afaeadac bf bebdbe efcecdcc dfdedddc efeeedec Figure 2 51 Example Viewing Contents of a Specified Channel Only 2 76 VisualDSP 5 0 User s Guide Environment Figure 2 52 shows the list of currently defined channels and the contents of the selected channel gt BTC Memory Channeli 0xf0002000 0x1000 03020101 Figure 2 52 Defined Channels and Contents of a Selected Channel VisualDSP 5 0 User s Guide 2 77 Debugging Windows BTC Memory Window Right Click Menu Table 2 18 describes the BTC Memory window s right click menu Table 2 18 BTC Memory Window Righ
348. y means of the right click menu instructions that appear in the fetch unit pipe are not valid instruction lines but merely bits and pieces Valid instruction lines appear in the execution pipe stages Stalls The examples that follow illustrate how the Pipeline Viewer displays dif ferent types of stall events for ADSP TS101 processors For a complete list of pipeline effects and memory transaction timing refer to the processor s hardware specification Stalls Due to IALU Dependency The following sequence of instructions causes a 4 cycle stall at the Decode stage J10 0x0 xb LITO dss This instruction is stalled in Decode until previous instruction reaches E2 VisualDSP 5 0 User s Guide C 3 ADSP TS101 Processors 81 k y n j2 OX1 82 il j y k10 0X15 83 Bai j j gio o 84 BJA j ers j10 s5 BS iBS jE iM rs j10 s6 BS i BS jE iM rs j10 87 E zr5 310 88 BJE jB j zr5 j10 89 BS jA jE j js j3 j2 90 B jA jj IF njeq JUMP 91 B jA GBS jW IF njeg JUMP Figure C 1 Stall Due to Cycle F1 F2 SES DECODE INT ACCESS EX1 EX2 j xr n nopi i s j3 x nop nop nop k j Bie xr5 r5 r5 0X1 i kl i j3 OXS oxi Wj j1 k j2 0X1 0X1 B j B j1 i k10 OX15 0X1 W j Bj Bij jlo 0 0X1 W j Bj Bi B j10 0 x B j1 Bi B j10 0 loop Wj r Bj B j10 0 loop Ele B
349. y run ning thread to the next running thread When you use the data cursor a yellow triangle to the left of a thread name identifies the currently running thread Window Operations The status bar at the bottom of the plot on the State History page shows the event s details and thread status when the data cursor is enabled Event details include the event type the tick when the event occurred and an event value The value for a thread switched event indicates the thread being switched in or out Right click on the plot and choose Data Cursor to activate the data cur sor which is used to display event and thread status details Based on the event that occurred the thread status changes Press the keyboard s right arrow key or left arrow key to move to the next or previous event When the data cursor hits a thread switched event it moves to the thread being switched in The yellow triangle to the left of the thread name indicates the currently active thread You can zoom in on a region to examine that area in more detail Perform this procedure 1 Hold the left mouse button down while dragging the mouse to cre ate a selection box 2 Release the mouse button to expand the plot 3 To restore the plot to its original scale right click on the plot and choose Reset Zoom VisualDSP 5 0 User s Guide 2 107 Debugging Windows Right Click Menu The VDK State History window s right click menu provides easy access
350. yle single line comment Online Documentation VisualDSP includes three types of user documentation Help files PDF files and HTML files Table A 25 Types of User Documentation Files Purpose chm VisualDSP Help system files and VisualDSP manuals are provided in Microsoft HTML Help format Installing VisualDSP automatically copies these files to the lt installation gt Help folder VisualDSP Help is ideal for searching the entire tools manual set Invoke Help from the VisualDSP Help menu or via the Windows Start button The chm files require Internet Explorer 6 0 or higher or the installation of a component that provides a CHM file viewer pdf Manuals and data sheets in Portable Documentation Format are located in the instal lation CD s Docs folder Viewing and printing a pdf file requires a PDF reader such as Adobe Acrobat Reader 4 0 or higher Running setup exe on the installa tion CD provides easy access to these documents You can also copy PDF files from the installation CD onto another disk htm Dinkum Abridged C library and FLEXnet network license manager software doc or umentation is located on the installation CD in the Docs Reference folder View htm ing or printing these files requires a browser such as Internet Explorer 6 0 or higher You can copy these files from the installation CD onto another disk The VisualDSP software installation procedure doe
351. your PC to the actual processor target board Emulators provide fast communications between the board and your PC An emulator enables application software to be downloaded and debugged from within VisualDSP Emulator software performs the communications that enable you to see how your code affects processor performance Targets A target or debug target refers to the communication channel between VisualDSP and a processor or group of processors A target can be a simulator EZ KIT Lite evaluation board or an emulator Your system can include multiple targets VisualDSP 5 0 User s Guide 1 15 Project Development For example the JTAG emulator communicates with one or more physical devices over the host PC s PCI bus and the HPUSB ICE emulator communicates with a device via the PC s USB port Simulation Targets A simulation target such as the ADSP 2106x Family Simulator is a pure software module and does not require the presence of a processor or any related hardware for debugging During simulation VisualDSP reads an executable DXE file and exe cutes it in software similar to the way a processor executes a processor image in hardware VisualDSP simulates the memory and I O devices specified in an 1df file Some processors permit you to run a compiled simulation Refer to Compiled Simulation on page D 44 Hardware Simulation When connected to a simulation target in VisualDSP you can simulate
352. zation Warning Warning and error reporting options The available subpages and options depend on your target proces sor and your code development tools For more information about compile options refer to your processor s VisualDSP C C Compiler and Library manual and VisualDSP Help 1 28 VisualDSP 5 0 User s Guide Introduction to VisualDSP C Run Time Libraries You must be running VisualDSP to use the C run time libraries The C and C run time libraries RTLs are collections of functions macros and class templates that can be called from source programs Many functions are implemented in the processor assembly language C and C programs depend on library functions to perform operations that are basic to the C and C programming languages These operations include memory allocations character and string conversions and math calculations The libraries also include multiple signal processing func tions that ease processor code development The RTL simplifies software development by providing code for a variety of common needs The compiler provides a broad collection of C functions including those required by the ANSI standard and additional Analog Devices supplied functions of value for processor programming This release of the compiler software includes both the Standard C Library and the Abridged Library a conforming subset of the Standard C Library For more information about the alg
Download Pdf Manuals
Related Search
Related Contents
Acer Extensa 5635Z-452G32N Samsung Samsung Ch@t 222 manual de utilizador Hampton Bay 16657 Installation Guide Betriebsanleitung - Ersatzteile Istruzioni per il montaggio Jonsered 2050 Chainsaw User Manual Sanyo PID-42AE1 Déménagement, mode d`emploi Huawei E180 User's Manual Copyright © All rights reserved.
Failed to retrieve file