Home
general information hardware installation user
Contents
1. Oty Description Ref Designator Vendor Part 1 C8 Panasonic ECS F1VE 104 1 390 pF C9 Murata Erie GRM42 6X7R301K050BB 2 10 uF C11 12 Panasonic ECS FOJE 106K 4 7 C13 14 Panasonic ECS HECK 01 uF C20 22 24 26 28 30 32 Murata Erie GRM42 6X7R103K025BB 1 1 0 uF C34 Panasonic 5 1 105 1 10 C35 501D107M010LM Diodes X 7 2 1 15711 D1 Hewlett Packard 1 27 MHz Xl l international Crystal lt 436161 27 00 e Abricon AB 27 00MHZ 10 Fundamental Frequency At Cut Crystal Transistors 3 2N3904 _ 013 Motorola Fuse 1 3 0 POLY F1 Raychem RUE300 P Light Emitting Diode 1 Green SMT LED1 Hewlett Packard HSMG T400 Note 1 must be parallel resonant 10 pF load fundamental frequency 2 Mylar spacer goes under crystal to insulate from PCB MOTOROLA DSPADSUM AD 6 11 Host Computer Card Command Converter Support Information Command Converter Bill of Materials Table 6 10 ADS Command Converter Hardware Parts List Rev 2 01 06 06 96 Oty Description Ref Designator Vendor Part Jumpers 2 1x2Bergstik JG14 R N NSH 028B 22 TG30 1 2x3 Bergstik JG2 R N NSH 06DB S2 TG30 1x3 Bergstik JG3 R N NSH 03SB S2 TG30 _ I Connectors 1 1x2Terminal Block Augat NC6 P102 02 1 37 Pin Connector JA Amphenol 617C03
2. Break 1 al p 3ab 1h Breakpoint Number Break 2 al p 3b1 1h 3 p 44b t r0 r1 gt 4017 1 i1 disabled Break 4 94711 1n Break 5 gt p 76e8 80 n N 7 22 Break 6 50 1h disabled din Break xax 0 1h disabled a Break 8 rw 50 1h Select breakpoint s bL L0 pum lt gt View details of Click OK to breakpoints in Breakpoint window Figure 4 63 Execute Breakpoint Clear Dialog Box MOTOROLA DSPADSUM AD 4 53 Graphical User Interface Execute Menu 4 9 11 Execute Breakpoints Enable Disable Breakpoints may be disabled and enabled from this menu Disable temporarily deactivates the selected breakpoints Enable reinstates them While disabled breakpoints have no effect on DSP program execution and do not cause any of the actions associated with the breakpoint Breakpoints Wait Stop Reset Set Software Set Hardware Clear 4 GT eA Breakpoint Break 1 al p 3ab 1h window also Breakpoint Number Break 2 al p 3b1 1h 4 gt Only disabled Break 3 pa p 44b t 0471254017 1 disabled shows Breakpoints Break 84 cs 64711 1n disabled are listed Break 5 gt p 76e8 80 n status of Break 6 rw xax 0 1h disabled b kpoint Select those to Break 7 xax 0 1h disabled _ breakpoints enab
3. Qva 2 81 en R lt 0 gt R gt 3222255 lt gt amp 5 Mug Wav a lt 2 gt 0 9 MOV gv 220 59838858 721 372 15 51 2 6 19 Figure 6 4 Sun Sparc SBus Interface Card Page 2 of 4 DSPADSUM AD MOTOROLA Y 30 35vd 06 42 21 059 8 Mug LSOH ot lt gt rt z beulu T DSHIUT 02 80 cl bogi 39 lt e gt beylul S lt p gt beyluy _ lt gt _ lt 9 gt _ lt gt 5 0080 S 1020 S 4080 S 6080 S lt v0 gt d S 4020 S 9024 S lt gt S Ni 81 58020 lt 91 gt S 91 6020 Za vl 50124 lt 8 gt 0 S SEEE gt Zn 189
4. owe UR IE e E mail PHONG oe Street Address us e do oi State xb atti Pe Country Please give a complete description of the configuration you are using with any comments or problems This should include the development environment in use the type of host computer software and any external circuitry you are using with this product and if possible how to reproduce any problem reported ALL INFORMATION WILL BE TREATED AS STRICTLY CONFIDENTIAL DSP device type Host Computer type PC SUN HP Host Operating System Version Please continue on reverse if necessary Motorola WSP Technical Helpline 512 891 3230 MOTOROLA Wireless Signal Processing Report Continuation Please continue on extra sheets if necessary Motorola WSP Technical Helpline 512 891 3230 adm D 53 D 61 ads cache registers D 8 ads startup D 9 Application development multiple targets 1 5 single target 1 5 breakpoint access 3 15 action 3 19 continue D 82 DEBUGcc 3 17 expression operators 3 20 FDEBUGcc 3 18 hardware access 3 15 hardware types 3 15 3 16 rules 3 14 software type 3 17 testing D 71 D 81 14 3 64 D 52 D 80 cmd 4 24 D 72 COFF B 1 B 24 command asm 3 12 break 3 14 cchange 3 23 cdisplay 3 24 cforce 3 25 cgo 3
5. 0 08 91 01 82 51 lt 91 gt lt gt eia lt gt lt 01 gt lt 6 gt lt 8 gt d XHMIN3IN kev eov 080 gst sive OHI soul 608 VAS l13Sauvsl LNOO VSI ovs LVS zvs evs 5 SyS 9vS LVS sys 6 5 01 5 LYS 5 112 SLYS 95 119 81 6 21123 N3V AQv3uol ods Las zas eas vas sas 905 198 8ev 92v Ezy 11 ely 60v 207 20 YOLOANNOO 8VSI oey 62 Lev sev vov eov 61 81 91 SIV viv 017 80v iv ev v sv 9v 4 9v LLY ely viv SLY oly n 81 61 N3V OI od ia Ss 90v Sov vov tov _ 9 29 OI Figure 6 3 PC Compatible Interface Card Rev 2 0 Page 3 of 4 MOTOROLA DSPADSUM AD 6 16 7307 dvd d1va 9661 82 69 11 0 unf gow is WI vi way Mov 1 18538 Wav 21
6. _ Pd 27 1 4 3 6 DSPADSUM AD MOTOROLA 3 4 User Interface Commands Command Parameters COMMAND PARAMETERS The following expanded definitions apply to the parameters shown on the command syntax line in lower case but not within parenthesis address P location X location Y location Seu address qualifier DSP56300 DSP56600 hardware breakpoint c address qualifier action 11 12 13 14 15 increment CNTn H halt N note S show registers T expression Test expression for true condition 2 address block address location address count bn break number decimal integer constant in the range 1 to 73 count positive integer expression in range 1 to S7FFFFFFF dev num specific device number to be addressed for a given command dev list dvx dv0 x dvx y z one or more targets to b addressed for a given command For example device group 0 to 4 is expressed as dv0 4 whereas the device set of 1 3 and 5 is expressed as dv1 3 5 expression any arithmetic apn valid for the Assembler in addition the register names may be used in th expression filename any valid pathname for operating system in use JTAG OnCE type JTAG OnCE breakpoint type location integer expression it will be mapped into the DSP address range 0 to 0 to SFFFFFF for DSP56300 or FFFFFFFF for DSP96002 OnCE type OnCE hardware breakpoi
7. RR OR II CIE eee 3 19 Expression 3 20 for Simulated 4 18 _ Register Requirements for Simulated 4 19 Summary of Window Functions oso isi Roe Coca ance ace 4 56 OnCE Sequence Control Codes 5 23 Instruction Register Encoding 5 27 DSP Core Status Bit Description 5 28 PC Interface Card J2 ISA16 Bus Connector 6 3 DSPADSUM AD MOTOROLA Table 6 2 Table 6 3 Table 6 4 Table 6 5 Table 6 6 Table 6 7 Table 6 8 Table 6 9 Table 6 10 Table 6 1 1 Table B 1 Table B 2 Table B 3 Table 4 TableB 5 Table B 6 Table B 7 Table B 8 Table B 9 Table B 10 MOTOROLA Sun 4 SPARC SBus Connector 6 4 Host Computer Interface 6 5 JIAG OnCE Connector J3 6 6 ADS PC Compatible Interface Electrical Parts List Rev 2 01 06 06 96 fo 6 7 ADS PC compatible Interface Hardware Parts List Rev 2 01 06 06 96 Ex pon TIPS 6 8 37 Conductor Cable Assembly List Rev 2 1 1 01 95 6 8 Sun 4 SBus Parts List Rev 01 May 27 1992 Zu 42 6 8 5 Elecineat Pana List Rev 2 01 06 0
8. Break Event Qualifier Meaning ZA and Breakpoint 0 and Breakpoint 1 7 Or Breakpoint 0 or Breakpoint 1 Breakpoint1 after Breakpoint ma Breakpoint 0 implies the first of two possible breakpoint expression There are seventeen types of DEBUGcc software breakpoints on the Condition Code Register CCR bit values Table 3 6 describes the command line options for the breakpoint types Table 3 6 Softwar Breakpoint Types DSP Type Meaning Condition Code Bit s all cc or hs clear 0 cs carry set 1 16 24 bit ec extension clear Bs all eq equal 2 1 16 24 2 5 N extension set 1 ge greater or equal N xor V 0 all m o gt greater than Z or N xor V 0 32 bit E oh higher than ZorC 0 16 24 bit lc limit clear ps0 al le less or equal Z or N xor V 16 24 bit ls limit set 1 1 all It less than N xor V 1 all mi minus N 1 all ne not equal Z 0 16 24 bit nr normalized Z or Not N and Not E MOTOROLA DSPADSUM AD 3 17 User Interface Commands Detailed Command Descriptions Table 3 6 Software Breakpoint Types Continued Note DSP Type Meaning Condition Code Bit s all pl plus 0 16 24 bit nn not normalized Z or Not U and Not E 0 32 bit vc overflow clear 0 32 bit vs overflow set ita
9. 1 ON 13 L 91 41 INH 1 HS RES10COM LSOH Figure 6 3 PC Compatible Interface Card Rev 2 0 Page 1 of 4 MOTOROLA DSPADSUM AD 6 14 Suaisio3u quvo3ovdH3INIISOH9L VS AND 9661 01 19 11 01 UNP YOW GAI4IGOW 15 1 20 7185 2785 MOV 1 TTTTTTTT COLO st cox LOCO C0 reo S lv 150 MOV LSOHY Tiv 0135 L13S 2185 19599 Wavad WONDHOrN O3H Gv xov Way dd 1SOH Oxotoc ooo 6 15 Figure 6 3 PC Compatible Interface Card Rev 2 0 Page 2 of 4 DSPADSUM AD MOTOROLA 7308
10. E e eoe 3 3 COMMAND 3 3 Memory Register Display Modification Commands 3 3 File A 3 3 Target Program Execution Commands df C Source Code Debug Commands ur PEE gt 23 4 Command Converter Commands 3 4 Miscellaneous Commands 3 4 COMMAND SYNTAX ouem ici 3 5 COMMAND PARAMETERS be 3 7 COMMAND SUMMARY X m TTL 3 8 DETAILED COMMAND DESCRIPTIONS 3 12 ASM Single Line Interactive 3 12 BREAK Set Modify or Clear Breakpoint 3 14 CCHANGE Change Command Converter Memory 3 23 CDISPLAY Display Command Converter Flags and Memory ua WP M cS 3 24 CFORCE Assert Reset M Break on Command Converter 3 25 CGO Execute OnCE Sequence ee ee en 3 26 CLOAD Load OnCE Command Sequence 3 27 CSAVE Save Command Converter Memory to a File 3 28 CSTEP Step through OnCE Sequence 3 29 CTRACE Trace through OnCE Sequence 3 30 CHANGE Change Register or Memory Value 3 31 COPY Copy a Memory 3 33 DEVICE Select Default target DSP address 3 34 DISASSEMBLE Single Line Disassembler 3 36 DISPLAY
11. 06 50 WM do LSY Od _ooalgy 19110994 vin 1541 99A 9 H 99A 2 Led gt OL ML 198 99A ANAL 99A 2 oey 230 vt 1591 LSWL 185840 OSWL 2 99 OF 8 MOSMOL 9 NI 2 ISQ IQ L er eor 21 lt 00A d 139uV1 6 2 AS 2 1 199198 OVLION Figure 6 7 JTAG OnCE Command Converter Schematic Rev 6 Page 2 of 5 6 25 DSPADSUM AD MOTOROLA 8406 39 ISOH H31H3ANOO Hl 1661 22 9 91 1 uer 4 03141 1sv1 ONIMVET 29189 145 801 ISOH JIGVNALSOH 65 0 S 13S3HW v 0 dnou5Wav 7777 Wavy e aes zlisWav g HBSWOV lt o1asWay lt LNI _ 13S 1008 INIINQVH MOVLSOH
12. 6 13 COMMAND CONVERTER CABLES AND SCHEMATICS 6 22 2260406 bbb iR rum EE ERE EMI veces A 3 RECORD A 4 Stat A 4 End 5 010 cedes queres Kost a 5 Blockdala 6 Symbol Record 5225 x me re RUOTA E a A 6 Comment A 7 OBJECT MODULE FORMAT EXAMPLE A 7 INTRODUCTION B 3 OBJECT FILE 5 B 3 OBJECT FILE 5 B 5 DSPADSUM AD MOTOROLA 3 1 FILE HEADER ug ae en oe RR B 5 B 3 2 Optional B 6 B 3 3 T a E gt 8 3 3 1 Section Headers imm ER or CR Ce B 8 B 3 3 2 Relocation Information B 11 B 3 3 3 Line NUmIDSIS vs tes 1 B 11 B 3 3 4 Symbol Table fo 12 3 3 5 Symbol 14 B 3 3 6 Symbol Value ES as oos B 14 B 3 3 7 Section Number eu B 14 B 3 3 8 Symbol du REIN B 15 B 3 3 9 Symbol Storage Class
13. devn 0 dsp_new devn 56002 Allocate structure for device 0 56002 dsp fmem devn memory map address blocksize amp memval MOTOROLA DSPADSUM AD D 45 C Library Functions Library Function Descriptions 0 3 39 dsp free Free a Device Structure include simcom h include protocom h dsp free device index int device index DSP device index to be affected by command dsp_free frees all allocated memory associated with a device structure for _ device_index and closes any open files associated with the device structure Example D 39 dsp free 1 Create three new device structures then get rid of device 2 include simcom h 2 X include protocom h Ne Wo 7 V ads startup 100 ADSP56000 V dsp startup Ww dsp new 0 56002 Allocate structure for device 0 6002 dsp new 1 56002 Allocate structure for device 1 a 56002 dsp new 2 56002 Allocate structure for device 2 a 56002 dsp free 1 Free structure for device 1 A 4 1 X 46 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 40 dsp free mem Free Memory Block The routines dsp alloc dsp free memand dsp realloc are replacements for the standard C functions malloc free and realloc They are used in much the same way as the standard functions for allocating spac
14. M EE B 16 B 3 3 10 Auxiliary Entries PPM CM pO B 18 B 3 3 10 1 bee D ERES B 18 B 3 3 10 2 Sections A CERO oh RETE B 19 B 3 3 10 3 Tag FETU B 20 B 3 3 10 4 END OF s 21 3 3 10 5 FUNCTIONS IO te B 21 B 3 3 10 6 Arrays c W MEME B 22 B 3 3 10 7 End of Blocks End EEG PUE EU MSS B 22 B 3 3 10 8 Beginning of Blocks and Functions B 23 B 3 3 10 9 Structure Union and Enumeration Names B 23 B 3 3 10 10 String ot o oe ERE eto deal B 23 B 4 DIFFERENCES BETWEEN DSP OBJECT FORMAT AND STANDARD COFFB 24 B 4 1 Multiple Memory Spaces B 24 2 6 _ OBJECT FILE TRANSPORTABILITY B 25 _ Structure Size Fields n oaoa B 26 B 4 4 Relocation B 26 4 5 Block Data B 27 B 4 6 5 5 B 27 B 5 OBJECT FILE DATA EXPRESSION FORMAT B 28 B 5 1 Data Expression Generation B 28 B 5 2 Data Expression Interpretation B 29 B 5 2 1 User 29 5 2 2 Relocatable 1 29 DSPADSUM AD xi
15. Soe he 4 29 Figure 4 22 Display Display Stack Output Bei 2 4 4 4 30 Figure 4 23 Display Display Version Oufbut WW 4 30 Figure 4 24 Display Display Off Output ZI mol 4 30 Figure 4 25 Dspay Disassembie Memory Dialog 4 31 Figure 4 26 Display Disassemble 4 31 Figure 4 27 Display List File Dialog BOX buo guinea Patto erant 4 32 Figure 4 28 Display List File 4 32 Figure 4 29 Display Evaluate Dialog BOX 4 33 Figure 4 30 yl Display Evaluate 4 33 Figure 4 31 47 Display Call Stack Dialog BOX 4 34 4 32 Display Call Stack 4 34 Figure 4 33 Display Radix 4 34 Figure 4 34 Display Device 4 35 Figure 4 35 Display Pati 4 35 MOTOROLA DSPADSUM AD xvii Figure 4 36 Display Input Files 4 36 Figure 4 37 Display IO Streams 4 36 Figure 4 38 Display Log Files 4 37 Figure 4 39 Display Breakpoints 4 37 Figure 4 40 Display Watch Show Output E ann 4 38 Figure 4 41
16. 0 gt x 50885 005a 0 0 59051 855 3 0055 reak Tiled window lt y Cascaded window Figure 4 82 Tiled and Cascaded Windows DSPADSUM AD 4 67 Graphical User Interface Help Menu 4 11 HELP MENU The Help menu item calls up the command line help for the ADS which is displayed in the Session window This lists all the commands available with a syntax summary for each Acceptable abbreviations are shown in red Session WSESSION OFF WSOURCE deu list OFF WSTACK deu list OFF WWATCH deu list vin num wn radix reg addr expression WWATCH deu list vin num tiun OFF comment string entry Macro filename Other Help Topics list of on chip io registers and their addresses memory map descriptions for various omr settings memory names with block addresses list of pin names with index and pin values list of periperhal names with index list of port names with index and mask Figure 4 83 00 on ee gt Further command details are available Using the Command window type Help H space is enough followed by the help topic the command name or abbreviation or port name etc and further details are to Session window Note The Help Help output is med 100 lines long and fills the output buffer Any previous in window will be lost Sess
17. 6 6 COMMAND CONVERTER BILL OF MATERIALS Table 6 9 ADS Command Converter Electrical Parts List Rev 2 01 06 06 96 Oty Description Ref Designator Vendor Part Integrated Circuits 1 DSP56002PV Ul Motorola at 1 MC1455D U2 Motorola 1 A53 20MHz U3 Connor Winfield 3 MC74HC244DW U4 6 13 Motorola 42755 1 MC74F245DW 05 Motorola 1 MC74F373DW 07 Motorola MCM6206DP12 08 9 10 Motorola 1 PALCE20V8Q15PC U11 AMD 1 MAX232CWE 112 4 Maxim 1 MC74ACT161D 014 Motorola Resistors 1 3 WR Bourns 12060302 28 10 KQ R2 3 4 6 9 11 12 13 14 15 16 Bourns CR12061002JVCA 18 19 22 23 25 29 30 31 32 3 3 34 35 36 39 41 42 43 2 18 R526 Bourns CR12060182JVCA 4 1 7 8 24 27 Bourns CR12060102JVCA 1 1MQ R10 Bourns CR12061004JVCA 4 330 Q 17 20 28 38 Bourns CR12060330JVCA 2 100 Q R21 37 Bourns CR12060100JVCA 1 500 Q 40 Bourns CR12060500 jVCA Resistor Networks 1 3 Bourns 4610 102 220 1 540 Bourns 4610 102 540 Capacitors 17 0 1 uF C1 6 8 15 18 20 Kemet C315C104M5U5CA 21 23 25 26 23 1 uF 1 6 10 15 19 21 23 25 Murata Erie 27 29 31 33 36 37 38 39 GRM42 6X7R104K025BB 1 47 uF C7 Panasonic ECS FIHE 474 6 10 DSPADSUM AD MOTOROLA Host Computer Card Command Converter Support Information Command Converter Bill of Materials Table 6 9 ADS Command Converter Electrical Parts List Rev 2 01 06 06 96
18. Z View 5 up down Now examine the values of the variables low high evaluate low evaluate high Since low and high are the bounds of our search within the area something should immediately strike you as being wrong In C array indices begin at zero and the last 3 94 DSPADSUM AD MOTOROLA User Interface Commands Example Debugging Sessions element of an array is indexed by the number of elements in the array minus one However in this program high has been set to the number of elements in the array It is off by one and this could cause it to access elements that are not a part of this array Modify the source program so that one is subtracted from the value assigned to high See the file binsgood c if you need help Recompile the program and repeat the steps necessary to get you back into the find keyword function of the newly com P program After repeating the previous steps you should be back at the beginning of the while loop and should be able to examine the variables low and high and see that they now have correct values Now we want to add a few expressions to our watch lis list s 50 that we can view them as we step over lines watch med watch low We watch high N A watch key toks med keyword y Let s go into the register view and step line line t through the source and watch the progress of our variables View next N
19. Sex windows required file or msapps Single click and C system C3 temp OK to open log Another dialog Save File as Type Drives box will open to iles confirm if existing Select drive file is to be from pull down replaced list Select desired file type from pulldown list to specify 4 which files are displayed in Specify action to be list taken if file selected Overwrite or entered already exists Figure 4 13 File Log Commands Dialog Box 2 File Log Session 4 6 12 3 Load File Log Session logs the Session window for the active device see Modify Device Set Default to a file Qutput Logging may be started and stopped at any time separate log file may be established for each device The Session ETCENEEEENNE window need not to be open for the session log to be written Selecting File Log Session opens the Open Log File dialog box If an existing file is selected for logging an action confirmation box opens with options to append to the existing file overwrite it or cancel the operation Source Display Status 4 22 DSPADSUM AD MOTOROLA Graphical User Interface File Menu Everything output to the Session window while in Register mode see Display View Register is written to the session log file Changed values and error messag
20. Valid values for devt ype are A iv ADSP56000 qm NN ADSP56300 ADSP96000 A The function return value is TRUE on successful completion FALSE otherwise Example D 2 ads startup Initialize ADS software A include simcom h include protocom h int status status ads_startup 100 ADSP56000 Initialize ADS Software UNIXM include simcom h protocom int status status ads startup dev mdsp0 ADSP56000 MOTOROLA DSPADSUM AD D 9 C Library Functions Library Function Descriptions D 3 3 dspd break Force Running DSP into Debug Mode include cc h include simcom h include driver h int dspd_break device_index command int device_index DSP device to be affected by command int command to be sent to DSP device 4 i dspd_break forces the target device device index into debug mode using the method specified by the parameter command Valid values for command N Ec V gt 2 22 e DSP JTAG for devices with JTAG port N DSP ONCE BREAK used for devices with OnCE port A The function returns DSP_OK if the operation succeeds DSP_ERROR otherwise w Example 0 3 dspd_break Force DSP into debug mode include cc h include simcom h include driver h i MR
21. e Disassemble PC reads memory starting with the PC address fills Session window and stops Each subsequent use continues from last location n decoded M Memory Space S Start Address EN 5200 End Address Figure 4 25 Display Disassemble Memory Dialog Box Disassemble Memory writes thi entire area specified This could easily be larger than the Session window or r even the device buffer Scroll to view if itis too large for the Session window use Display More On to pause if it is too large for the device buffer If no end address is specified the window is filled but there is no automatic continuation the next time Disassemble Memory is used Dv00 Session move r6 x r6 x F sig handlers 126 move ssh x r6 x F sig handlers 126 move 6 n6 move r6 r6 5 move r n6 move r8 3 move x r8 ssh x F sig handlers 126 move r8 r6 5 8288 66e663 tst a x r8 r8 x F c sig handlers 126 26209 88888c rts p 828a 685e88 move rB x r x F sig handlers 126 Figure 4 26 Display Disassemble Output MOTOROLA DSPADSUM AD 4 31 Graphical User Interface Display Menu 4 7 8 Display List Display Display Disassemble b List This selection displays the source file for the executing program in Evaluate 2 E Call Stack the
22. gt 4 2 18 DSPADSUM AD MOTOROLA SECTION 3 USER INTERFACE COMMANDS MOTOROLA DSPADSUM AD 3 1 User Interface Commands 3 1 INTRODUC TION REEL EE Ee ks 3 3 3 2 COMMAND OVERVIEW 3 3 3 3 COMMAND SYNTAX 3 5 3 4 COMMAND PARAMETERS 3 7 3 5 COMMAND SUMMARY a 3 8 3 6 DETAILED COMMAND DESCRIPTIONS 3 12 3 7 DEBUGGING C 5 3 90 38 CDEBUGGINGCOMMANDS 3 92 3 9 EXAMPLE DEBUGGING SESSIONS AN 5 3 92 ss eS N is N 3 2 DSPADSUM AD MOTOROLA User Interface Commands Introduction 3 1 INTRODUCTION This section describes the ADS user interface commands in detail There are examples on how to invoke command line arguments associated with each command and there are examples on debugging compiled C source programs written with the Motorola GNU based C Compiler Also the user interface program is designed to communicate with multiple devices in a system gms 3 2 COMMAND OVERVIEW A OL There are forty five commands available in six functional categories target memory register modification file I O target DSP address execution control C source code debug miscellaneous tasks and Command Converter tasks Since the ADS interface program supports multiple
23. listing the breakpoint number its location and the action to be Radix performed The breakpoint location is listed exactly as entered when the breakpoint was set ioe Fics Redirected 10 Streams IO Streams Status Breakpoints are Log Files set by clicking source and Assembler _ windows SW Session 1 al 2 al p 3c8 p 3ae 3 cs p 3b6 4 mi p 3de 45 rw xa 518 8 6 rw xa x 18F8 h h n n 1 1 1 4 Note at ar if s et SW 418FF 111 disabled 18FF t x8 6 1 12 Break on RW access to addresses specified Do action only if x0 is greater than 6 HW Figure 4 39 Display Breakpoints Output MOTOROLA DSPADSUM AD 4 37 Breakpoints Watch Graphical User Interface Display Menu 4 7 18 Display Watch Show Display Display Display Watch displays the value of expressions whenever Evaluate execution is interrupted The expression to display is Radix specified with Display Watch Add and may be reviewed with Display Watch Show The expression may be EN Redirected 10 Streams IO Streams Status Log Files Breakpoints specified using register names and Assembler labels If the expression is enclosed in brackets it is interpreted as a C expression using C variable names Use Modify Up and Down to navigate the call stack and select the evaluation context for the expressions
24. A Example 3 52 VIEW Command Examples View Cycle to the next display mode among Source Assembly and Register modes View S Select Source display mode View a Select Assembly display mode View N Select Register display mode MOTOROLA DSPADSUM AD 3 73 User Interface Commands Detailed Command Descriptions 3 645 WAIT Wait Specified Time WAIT dev list B break count seconds The WAIT command pauses for count seconds or until the user types any key before continuing to the next command If the WAIT command is entered without a count parameter the command will terminate only if the user types a key This instruction i is useful when executing a macro file and the current display on the screen needs to be examined before executing further instructions from the macro file The B option causes a pause until all of the specified devices have entered the Debug mode Su option is useful when executing a macro file where the devices must hit breakpoin S Or complete steps or traces before the next command is accepted 5 7 Example 3 53 WAIT Command Examples o Wait M Wait for a key stroke from the keyboard before executing any further instructions 10 Wait Wait ten seconds before executing another command from the keyboard Wait dv0 3 Wait until devices 0 1 2 and 3 have all entered Debug A 3 74 DSPADSUM AD MOTOROLA User Interfa
25. always When using software breakpoints the opcode at that address will be replaced by one of the software breakpoints chosen Therefore itis wise to set conditional software breakpoints at an address with a For the 32 bit DSP96002 there are 21 types of FDEBUGcc software breakpoints based on the Condition Code Register CCR and or the Exception Register ER bit values Table 3 7 describes the command line options for the breakpoint types Table3 7 Floating Point Software Breakpoint Types Type Meaning Condition Code Bit s eq equal S 4 2221 err error UNCC or SNAN or OPERR or OVF or UNF DZ 1 ge _ greater or equal NAN or N and 2 0 gl greater or less than NAN 2 0 gle greater less or equal NAN 0 Bt 77 greater than NAN Z or 0 inf infinity 1 1 A de A less or equal NAN or N or Z 0 less than NAN or Z or N 0 mi minus N 1 ne not equal Z 0 nge not greater or equal NAN or N and 2 ngl not greater or less 2 1 not greater less or equal 1 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions Table3 7 Floating Point Software Breakpoint Types Type Meaning Condition Code Bit s ngt not greater than NANorZor N 1 ninf not infinity 1 0 nle not less than or equal NAN or N
26. dspd write memory writes block of memory starting at address address length count in memory space mem_space on Command Converter device_index The values read are retrieved from the buffer pointed to EY val uel Valid values for mem space are Y e DSP CC PMEM program memory DSP CC XMEM X data memory DSP CC YMEM Y data N The return value is DSP OK for success gt ERROR if the transaction fails Example 0 10 dspd write Write memory block to Command Converter include simcom h include driver h include cc h int devn status unsigned lonc write addr write len unsigned long write buf devn 0 2 Z 427 write buf unsigned long dsp_alloc 100 sizeof unsigned long get values in write buf 1001 fetch values to write write addr 0x04001 write len 1001 status dspd cc write memory devn DSP CC PMEM write addr write len write buf MOTOROLA DSPADSUM AD D 17 C Library Functions Library Function Descriptions 0 3 11 check service request Check for Service Request include simcom h include driver h int dspd check service request device index int device index DSP index affected by command dspd check service request checks to see if the target device devi coin dex is requesting service from the host computer The return value
27. r3 58888 n3 40880 m3 ffff sr onr 82 r2 0000 n2 6888 m2 1 0000 ri 58888 ni 0000 mi ssl sp r8 n8 8888 m8 bcr FffF ictr cnt1 888888 cnt2 888888 cnt3 888888 cnth 608888 58808588 88ffbe 88FFbe 8888be B55e3c move ssh x r6 x F sig handlers 129 Values changed since Memory locations and Initial setting last output displayed in registers output at break Display all registers red Error messages selected by also in red Display Display menu Figure 4 81 Session Window The last 100 lines written to the Session window may be viewed with the scroll bar The size of this buffer may be set during installation Some operations may write more than 100 lines to the Session window The Display menu has a More feature which pauses the display every windowful allowing the display to be examined before accepting the next section of output See Display More 18 Session window but a separate output buffer for each device Output from each device is written to its own buffer but only activity for the current device is displayed in the Session window When another device is made the current device the Session window is refreshed with the buffer for that device Output to the session window may be logged to a file see File Log Session A separate log file may be e
28. 747319 1 1 37 Conductor Ribbon Cable 4 ft T amp B Ansley 28AWG stranded 050 inch pitch 5171 37 Table 6 8 Sun 4 SBus Parts List Rev 01 May 27 1992 Oty Description Vendor 2 74 1138 01012 Motorola 4 74 244 U4 7 8 9 Motorola 1 74 245 Ul Motorola 1 74 2 U6 Motorola 71 74 05 Motorola 1 74ACT32 02 Motorola 1 74 4 U1 Motorola 1 742374 017 Motorola 1 74 273 018 Motorola 2 74 273 U13 16 Motorola 1 74 373 019 Motorola 2 74ACT373 U14 20 Motorola 6 8 DSPADSUM AD MOTOROLA Host Computer Card Command Converter Support Information Host Computer Card Bills of Materials Table 6 8 Sun 4 SBus Parts List Rev 01 May 27 1992 Continued Oty Description 1 PALCE22V10H 15PC 4 U3 AMD 1 557 291 35 015 WSI a 2 R pack 8 x 2220 RN1 2 Bourns 4116R 001 RC _ 1 100k9 R1 Newark 10F305 0 01 Ceramic C22 Kemet C322C104M5R5CA 10 uf Electrolythic Axial C22 Sprague 501D106M063LL 100 uf Electrolythic Axial C21 Sprague 5010107 0101 24 Pin IC socket U3 15 R N ICE 243 S TG30 SBUS Male connector Fujitsu 234 096 37 D connector J2 Amphenol 617 C037P AJ221 VR y DSPADSUM AD 6 9 Host Computer Card Command Converter Support Information Command Converter Bill of Materials
29. If interactive change mode is entered with the GUI version of the ADS a dialog box displays the original value of the specified location preceded by a semicolon To change the location and display the next type the new value before the semicolon and click OK The old contents appearing after the semicolon may but need not be deleted To exit interactive Change mode click CANCEL Any new value which has been typed before clicking CANCEL will not be written to the current location MOTOROLA DSPADSUM AD 3 31 User Interface Commands Detailed Command Descriptions Interactive Input change 1 5040127 5000000 De Figure 3 2 Interactive Change Dialog Box _ M 211 The Session and Command windows are written during interactive change operations Both windows display the original CHANGE command the Session display each change as it is applied icem Example 3 13 CHANGE Command Examples Change Display the current default target DSP address s register values individua starting with register a and prompt the user for new values N Change X 55 m Display x memory location hexadecimal 55 of the current default target DSP address and prompt the user for a new value Subsequent or previous memory locations may be examined and changed using the up arrow key for me previous address and down arrow for the next address y Change dv3 pc Display the current value
30. On line help screens for each command and DSP register Compatible with the DSP CLAS Assembler amp Simulator Single Command Converter supports OnCE and JTAG protocols Choice of Text Based or Graphical User Interface 1 8 DSPADSUM AD MOTOROLA General Information Text Based User Interface 1 5 TEXT BASED USER INTERFACE The ADS provides a Text BasedUser Interface and a Graphical User Interface GUI This section describes the Text Based User Interface Refer to Section 4 for detailed information about the GUI 1 5 1 General Description e x The Text Based User Interface provides the fastest user response time command entry occurs from a fixed command line on the screen third line from the bottom A fixed error line second line from the bottom is used to flag any errors in the command line entry A fixed help line last line on bottom of the screen assists i in command line entry by displaying the command s optional or required parameters Additional help and examples can be viewed by typing a at any point during command entry As each valid command is accepted from the command line the command and its results are scrolled into the display screen The last 100 lines of a DOS display screen entry are available for review at any time by typing Pg Up Pg Dn Up Arrow or Down Arrow The Left Arrow and Right Arrow keys Jew cursor movement on the command line 1 5 2 Command Entry _
31. _BLOCKDATA Mem space Addr Count Value The Blockdata record provides shorthand method for loading repeated data values as might appear in a block constant storage BSC assembler directive This makes the object file more compact but requires more work on the part of the loading g software The space specifier is a single character representing the memory space Wie leaded X Y L or P The character may be upper or lower case although the assembler guarantees upper case output The address is an ASCII hex value indicating where to begin loading in the specified memory space It contains only hex digits 0 F with no leading or trailing radix characters The range of the address is 00000000 FFFFFFFF The count field specifies the number of times the ilani is to be loaded into consecutive memory locations starting at the load address The count value has the same format and range as the starting address and should be interpreted as an unsigned integer The value field contains the value to be loaded It has the same format and range as the values in a standard Data record hex digits 0 range 0 FFFFFFFF 2 A 2 5 Symbol Record D Format _SYMBOL Mem space lt Synibol Address The Symbol record contains information about symbols labels found in the assembler source file Symbol records are created at the end of assembly as the result of a SYMOBJ directive or the
32. 5 785 LNINGV 9084 traad dd 5 oadd 20 UJ JJ gt o ITI m 15 120 22222 co 2 0L ced 25222 e FILO CO I MOTOROLA Figure 6 7 JTAG OnCE Command Converter Schematic Rev 6 Page 3 of 5 DSPADSUM AD 6 26 SJO 49138 31 9I901INOGNVH AVHS PA Y3LYJANO9 ANYNWWOO ATLL 1661 77 96 91 1 uer 4 0414000 151 HLO3T3S 8LG dOul 8dOlN lt 91 gt lt 91 gt lt 61 gt 6 lt 81 gt 01 4a MOL 10019899 mA 238 7213 vw 928 055 6Y 2 8V cz2 470 IN s 90 9v SO SV vO TV g8 O V eV g LO 00 LL 2908951 02 2199195 1 0 sINN OGOW 680 11581 229 vc N 99 199195 5 ld Od MYaNdv N LO NY t j 2184 cI3SNaGv TivWav 194 3 T18VN31SOH 1 13e3HNQV 81
33. B 3 3 6 Symbol Value AL The symbol value is a union of a CORE ADDR typedef and an array of two longs If the symbol value is an address the contents will be stored as a CORE ADDR structure with memory and mapping attributes Otherwise the contents are stored in the val field Whether the symbol value is an address or not depends on the storage class of the symbol See Section B 3 3 9 Symbol Storage Class on page B 16 for more information on the relationship of symbol value and storage class pe NN B 3 3 7 Section Number The section number maps a symbol to its corresponding section in the object file e g the section in which the symbol is defined A special section number 2 marks symbolic debugging symbols including structure t nion enumeration tag names typedefs and the name of the file A section number of 1 indicates that the symbol has a value but is not relocatable Examples of absolute valued symbols include automatic and register variables function arguments and end of structure symbols A section number of 0 flags a relocatable external symbol that is not defined in the current file Section numbers greater than zero correlate to the ordinal sequence of sections in the object file Table B 13 Fundamental Types Type Type not assigned pex NOTTS Void 2 Character T SHORT Short integer T INT Integer T LONG Long integer T FLOAT Floating point B 14 DSPADSUM AD MOTOROLA
34. The return value is TRUE on successful completion FALSE otherwise Example D 1 ads cache registers 0 cache registers include simcom h include protocom h Mun 7 t devn 0 t periphnum regnum signed long pc value t status Y Y Find register reference numbers tatus dsp findreg devn pc amp periphnum pc amp regnum pc tatus dsp check service request devn Is device 2 qu sting service ckerr status if status i be uum 8 status ads cache registers devn cache the registers get pc addr for service request status dsp rreg devn periphnum pc regnum pc amp pc value D 8 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 2 ads startup lnitialize ADS Database and Driver include simcom h include protocom h int ads startup devp devtype char devp device driver name UNIX or board address PC int devtype Device family M ads startup initializes the device driver and allocates certain ADS devp points to a character string containing the name of the device driver on UNIX systems or the board address on PC systems DOS or MD indicates which family of DSP devices is being used ads startup must be called before calling dsp st artup Te N c
35. Y m 4 Figure 5 15 JTAG OnCE Interface A new bidirectional pin called the Debug Event DE has been added This pin provides an open drain output signal which indicates an event has occurred in the OnCE debug logic This event can be an entry to Debug mode a trace count decrement to zero or a vectored interrupt taken due to one of the above The DE pin provides an input function which acts as the debug request signal used to halt the DSP core The main advantage of this pin is in debugging multiple DSP applications The TAP controller is a synchronous finite state machine that contains sixteen states as illustrated in Figure 5 16 on page 5 26 The TAP controller responds to changes at the TMS and TCK signals Transitions from one state to another occur on the rising edge of TCK The value shown adjacent to each state transition in this figure represents the signal present at TMS at the time of a rising edge at TCK MOTOROLA DSPADSUM AD 5 25 Functional Description Changes to the OnCE Port Pins Test Logic Reset Run Test ldle 0 0 gt Shift DR A 1 2 0 BERE 5 Pause DR Exit2 IR Update IR 4 1 17 i 17 Update DR Figure 5 16 Controller State Diagram The TDO pin remains in the high impedance state except during the Shift DR or Shift IR controller states In these controller states TDO will
36. 1 IU dsp cc go starts the Command Converter for the target device device index executing from the address indicated by the current program counter MM The return value is TRUE for success FALSE otherwise lt L Example 0 27 dsp cc Start CC running S B c 1 include simcom h include protocom h lt int devn status devn 0 j dsp_new devn 56002 Allocate structure for device 0 56002 status dspd Start Command Converter monitor W AN A 27 1 4 NL i CN D 34 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 28 dsp cc 1dmem Load Command Converter Memory from File include simcom h include protocom h int dsp cc ldmem device index loadfn int device index Command Converter affected by command 1 char loadfn Name of file to be loaded _ dsp cc ldmem loads memory in the Command Converter device_ index f rom the file 1oad n This is a lower level routine which does not call the user level filename routines loadfn must contain the fully specified name of the be The file is OMF format the file extension should be lod 220 The return value is TRUE on successful completion FALSE otherwise N M x Example D 28 dsp cc lamem Load Command Converter memory from file Y include si
37. 4 Disable currently enabled breakpoints for target DSPaddress2 break off 2 Disable breakpoint number 2 of the current default target address break dv2 p 100 Halt DSP program execution of target DSP address 2 and display enabled registers and memory when the DSP instruction at program address 100 hex is reached This is a hardware breakpoint which will work with OnCE and DSPs break p 30 s Display enabled registers and memory of the current default target DSP address and continue program execution when the DSP instruction at program address 30 hex is reached This is a hardware breakpoint which will work with OnCE and JTAG OnCE based DSPs break dv3 p 200 t r0 gt r1 h If the value of is greater than R1 in target DSP address 3 when its DSP instruction at its program counter 200 hex is reached halt target DSP address 3 To evaluate whether is greater en the host computer will set a hardware breakpoint at address 200 and will interrogate the target DSP every time a breakpoint occurs at that address This is a hardware breakpoint which will work with OnCE and JTAG OnCE based DSPs break al 32 t i gt 10 h Break if the program reaches line 32 and the C variable break le p 320 h Halt DSP program execution of default target DSP address and enter Debug mode when the Z or N and V bits of the CCR are equal to 1 at the address 320 of program memory This is a software breakpoint and testing of the Con
38. Display the type of a C expression e Suspend Session window output when full Select operating mode of Session window MOTOROLA DSPADSUM AD 4 27 Graphical User Interface Display Menu Display Display 4 7 1 Display Display Active Active Disassemble Memory List Register Selecting this window writes the enabled registers and Evaluate Stack 4 B Call Stack Version memory locations to the Session window initial setting Radix Off Device is all registers and no memory displayed This is the same display as presented in the Session window whenever program execution stops See Display Display Memory Registers and Watch Note Display Display is hardware oriented and intended to monitor the DSP processor memory and registers Display Watch provides a similar facility which is also able to monitor program variables and expressions Command to Session enable memory display on p 8 12 displa display E rFFFFFFFFFFF y tFFFFFFFFFFF FFFFFFFFFFFFFF b 00000000000008 xi FFFFFF x8 FFFFFF r7 iFff n7 mz Register display yi FfFFFFF y8 FFFFFF r FFFF n FFFF FFFF a2 at FFFFfF a8 FFFFFF r5 FFFF n5 Vodity Radix Displ b2 00 bi 080000 b 000000 ry n FFFf my ay sets output
39. Interface Before removing or installing any equipment the PC compatible computer turn off the power and disconnect the power cord Refer to the appropriate Installation and Setup manual for your PC compatible for instructions an removing the system cover Jumper group JG1 selects the interrupt asserted on the host processor by the Host Interface Card when the target DSP device makes a Service Request by reaching a breakpoint for example Note The ADS software does not support interrupts No jumper should be placed JG1 when used with the ADS software Jumper group JG2 specifies the Host Interface card I O address The Host Interface Card supports 16 bit I O addresses and uses three consecutive addresses from the specified address The starting address may be configured with jumper pairs A8 A15 in JG2 to any multiple of 100 up to FF00 Place a jumper over a pair of pins to set that MOTOROLA DSPADSUM AD 2 3 Preparation and Installation PC compatible to Command Converter Interface address bit to 0 remove the jumper to set the address bit to 1 Address bits 0 not decoded In Figure 2 1 the selected address range is 100 102 Note Although the Host Interface Card supports 16 bit addressing the ADS software only supports address ranges 51 2XX and 3XX Once you have ensured that the selected address does not confilict with another expansion card installed in the moth
40. Open an output window for the current device ZR JA woutput dv1 off Close the output window for the device dv1 3 84 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 56 WREGISTER GUI Register Window WREGISTER dev list win num OFF WREGISTER is a GUI command that opens a register window Multiple register windows may be opened to display and change separate blocks of registers at the same time Multiple device windows may be opened for debugging target with multiple DSPs Example 3 64 WREGISTER Command Examples 0000 Wregister A T u Open a register window for the current device Wregister win3 Open a register window with a window number of 3 for the current device Wregister dv1 off 4 Close register windows for the device 1 DSPADSUM AD 3 85 User Interface Commands Detailed Command Descriptions 3 6 57 WSESSION GUI Session Window WSESSION OFF WSESSION is a GUI command that opens a Session window Only one Session window may be opened even for debugging target systems with multiple DSPs session output from all target devices is written to the Session window A message is output to indicate which target device produced the following output Example 3 65 WSESSION Command Examples 2 WSession Open Session window for the current device C N v b wsession Off N
41. include simcom h include protocom h dsp new device index device type int device index DSP device index to be affected by command char device type Name corresponding to DSP device type 1 1 1 SN 1 dsp creates a new DSP structure that represents DSP device device index and initializes it It will be necessary to use the dsp unlock function call prior to v if the selected device type is password protected Example 0 47 Create DSP device structures for three device emulation AT include simcom h N Pi 3 include protocom h ZA X int devn ads startup 100 ADSP56000 Ens gt dsp startup for devn 0 devn lt 3 devn devn 56002 Create new DSP structures Il g 2 5 1 54 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 48 dsp path Construct Filename include simcom h include protocom h dsp path path name base name suffix new name char path name Directory pathname char base name Base filename to be appended to path name char suffix Suffix string to be appended to base name char new_name Pointer to return buffer for constructed pathname l dsp load constructs a fully specified path and filename from the user provided path_name base_name an
42. independently of the ADS Each device must be started by separate command or function call Execution continues until an event in the device causes the device to enter Debug Mode such as reaching a breakpoint or the required number of instructions being executed or the ADS stops execution for a target with a force b command or a to function dsp stop All other devices will continue executing while that device is being serviced The emulator needs to check each device to see if it has entered Debug Mode by calling dsp check service request for each executing device in turn This may be coded as a tight loop for maximum response or interleaved with other activity as required D 6 3 Multiple DSP Emulator Display 1 2001 The emulator display functions are contained i in the source file scrmgr c in the emulator package This code supports the scrolling virtual screen for the ADS The supplied display code uses a single window The lines above the command line form a scrolling region in which session output is displayed The command line error line and help line are the three bottom lines of the display The default size of the scroll buffer holds 100 lines of output As each device causes output to the screen a message is output specifying which device caused the output The device command allows the user to switch the displayed device When it switches to a new device it refreshes the entire screen from the device s
43. 5 2 3 B 5 2 4 E 5 2 5 C 1 C 2 C 3 C 4 D 1 D 2 D 2 1 D 2 2 D 2 2 1 D 2 2 2 D 2 2 3 D 2 2 4 0 2 2 5 D 2 2 6 D 2 2 7 D 3 D 3 1 D 3 2 D 3 3 D 3 4 D 3 5 0 3 6 6 037 D 3 8 D 3 9 D 3 10 xii Memory Space 2 B 29 Bit Size Operator B 30 Memory Attribute Operator B 30 INTRODUCTION 152544 rk GE C 3 S RECORD 6 3 S RECORD 5 C4 S RECORD CREATION Ln 5 INTRODUCTION cce cubes ee RR ek 0 3 ADS OBJECT LIBRARY FILES AA oleas vs 0 4 ADS OBJECT LIBRARY 0 4 LIBRARY ENTRYPOINTS LISTED BY PREFIX 2 2 D 5 ads ADS Specific Utility Routines D 5 dspd cc Command Converter Driver Level Routines D 5 dspd_ Driver Level Routines D 5 dspt DSP DEVICE SPECIFIC ROUTINES D 6 dsp cc Command Converter Interface Routines D 6 dsp ADS Interface Routines D 6 sim User Interface Routines D 7 LIBRARY FUNCTION DESCRIPTIONS ten ae D 8 ads_cache_registers Cache OnCE and Core Registers D 8 ads_startup lInitialize ADS Database and Driver D 9 dspd_break Force Running DSP into Debug Mode D 10 dspd architecture lhitial
44. Comment The Start record begins an Object Module File The information contained in the record corresponds to the parameters in the first valid IDENT directive encountered in the assembler input If no IDENT directive is given the assembler uses the input file name without extension as the module name supplying zero for version and revision numbers and an empty Comment field which appears as a blank line in the object file The module id field conforms to the definition of a legal assembler symbol that being a series of up to eight ASCII characters starting with an alphabetic character and followed by alphanume ic characters or the underscore The version and revision numbers are ASCII numeric values corresponding to the expressions found in the IDENT directive 4 4 DSPADSUM AD MOTOROLA Motorola DSP Object Module Format Record Definitions A 2 2 End Record Format END Entry point address The End record terminates an Object Module File The only field in the record contains an address which is the result of the expression in an END directive If no END directive was encountered in the assembler source the address is the result of the expression found in the first valid ORG assembler directive with a reference to runtime program memory space P The address is in ASCII hex format it contains only the hex digits 0 with no special radix characters such as
45. Example Debugging Sessions Step into the first call to the find keyword function after the assignments to low and high but prior to the beginning of the while loop Set a breakpoint that will stop execution at line 62 when ow and high have the same value break al 962 t low high Recognize that when we set the breakpoint for main we simply used its name since it is a function but in this case we are using a C expression enclosed in braces U less you are specifying a function name to break on you should use the expression format as above NN Execute the program until you hit the breakpoint go Examine the values of low and high Now experiment on your own to get a better feel for debugging C programs within the ADS software At some point you will want to do the next tutorial which will introduce a couple more commands that can be useful in debugging C programs CX gt 3 9 2 Recursive Binary Tree Traversal Example This example introduces some more C debugging commands this time stepping through a program that doesn t have any known bugs to illustrate the result of using the debugging commands For brevity the full text of the source code for the tree traversal program is not shown here You should compile the file trav c start the ADS software and follow through the instructions in the rest of this section step by step so that what is happening in each step is
46. Figure 4 14 File Log Commands Dialog Box 4 6 13 File Log Close Use Log Close to close all or any of the currently open log files for the current device The Close Log File dialog box offers a list of log files which may be closed click the check boxes as required and clock Close to close the log s The check box for any log which is not currently active is shown shaded MOTOROLA DSPADSUM AD File Load Save Input Output IO Streams IO Redirect vv Log About Preferences Commands Session Source Display Status 4 23 Graphical User Interface File Menu Check box is Note that only log drawn shaded if Close Log File files for the current device will be Type closed Commands Ix Session a Source Display Status Log activity not M log is not active Click check boxes to select log activity checked __ to be closed remain active UE Figure 4 15 File Log Close Dialog Box os d 4 6 14 File Macro gt Path Load Save File Macro reads and executes a file containing commands for the GUI These commands are documented in the User Commands chapter The Macro file is a standard ASCII text file and may be created or dii edited with any text editor The default file extension is CMD Log Command log
47. Graphical Interface Functions Overview Under Motif the same effect is achieved in a different way There is only one button Apply which performs the appropriate operation and then dismisses it The dialog box can be made semi permanent by clicking on the pin in the top left corner so it will not be dismissed after clicking the Apply button The dialog box may then be used as many times as required click on the pin again to unpin it a and the window closes To dismiss the dialog box without taking any action double click on the pin i e and release and the dialog box closes 274 Set Default Device 4 4 3 MULTIPLE SELECTIONS S SY Many dialog boxes permit the selection of several items list Thisi is handled differently on different platforms V On Windows or the HP click with the 1 bution selects one item and clears any previous selection Click and drag selects a range of consecutive items the list scrolls when the drag reaches the end of the window To add to an existing selection hold the control key while or click dragging the items to be added On the Sun click or click and drag with the left button to make a selection and clear any previous selection use the middle button to add to an existing selection M 1 4 GRAPHICAL INTERFACE FUNCTIONS OVERVIEW The GUI provides a graphical interface to the debugger fo
48. Graphical User Interface Windows Menu 4 101 Windows Assembly Assembly Source Register Memnrv Opens the Assembly window for the current device If it is already open but hidden or minimized it is restored and brought to the front Adjust width of columns Binary is disassembled and Operands are decoded and by dragging the gap listed Illegal opcodes are interpreted as symbolic between labels listed as numeric constants references when appropriate Next instruction Dv00 Assembly 1 in Scroll TyAddress Ene Stat of b Address Label i Symbols i memory to 0000 2 E display May Double click 0001 2 omr f008b 1 use 0003 jclr 1 omr ff0020 on address 63200003S filenames or label field do lt 6 ff000d 2 line numbers to set or clear labels and breakpoints addresses Enabled breakpoints __ Click on a mnemonic field type display blue If debug information loaded in new instruction CR to store nearest label is shown with offset and step to next instruction Figure 4 66 Assembly Window Bn 1 The Assembly window displays the memory in the vicinity of the Program Counter PC The scroll bar gives access to the full program memory As the program executes the display is updated at each break in execution The next instruction to be executed is always displayed highlighted in red Breakpoints may be cleared and Halt breakpoints set by a double click o
49. Input Address R1 Y VARY Memory map P 0 X 1 Y 2 R2 RI Each time the DEBUG instruction is executed a data value is obtained from the input file associated with the file number specified and stored in the indicated location The format of the data file and programming requirements is documented in the command line Input Section 3 4 24 N M 2037 Specify Input Enter address of DEBUG Select default radix for this input file instruction which requests used in data file Radix Next available input from this file specifiers may also be number is offered Open Input File Select data Input Number Debug Addrewe Radix from file _ 51442 x entered at Ter terminal n C Hexedecimal mE 4 6 File Unsigned Click to V Terminal open file _ specify file Ple Name chooser name manually CATGUIX4 10 is Apply Figure 4 9 File Input Open Dialog Box Default file type 4 18 DSPADSUM AD MOTOROLA Graphical User Interface File Menu 4 6 6 File Input Close Path Input Close closes or selected simulated inputs to the default device A dialog box opens offering all of the currently open input numbers for the default device Select the inputs to be closed using the appropriate combination of mouse clicks lt CTRL gt Clicks and C
50. Move block to Y memory Space space 2 4 Execute DEBUG instruction to enter Debug mode of mode of operation Code Example MOVE 451000 0 file 1 input a block of 22 words DSP5600x only MOVE 4 0 R0 starting address of block is 0 MOVE 1 R1 in X memor Space DEBUG A jenter Debug Example3 37 Example Of Program That Resides on a Target DSP9600x Input Requirements 1 Load RO with file number in upper byte and word count in lower two bytes 2 Load with the starting location of the source block 3 Load R2 with the source memory space a MOVE 0 R2 Move block to P memory space b MOVE 41 R2 Move block to X memory space N MOVE 2 R2 Move block to Y memory space 4 Execute DEBUG instruction to enter Debug mode of operation Code Example MOVE 10000c RO file 1 input a block of 12 words MOVE en R1 starting address of block is 0 MOVE 1 in X memory space DEBUG enter Debug mode 3 58 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions Note For DSP56300 systems you must clear Bit 17 of the Status Register SR before loading the X0 register with the proper value of file number and word count Example 3 38 OUTPUT Command Examples Output M Display all output files currently open for all target DSP addresses A MM Output dv2 p 300 admout Open file admout io for logging of target DSP address 2 ou
51. Up to Seven Additional mI Command Converters Figure 1 2 Target Circuit Emulation 1 4 DSPADSUM AD MOTOROLA General Information General Description Figure 1 2 on page 1 4 illustrates how the ADS can be used as an emulator for a defined target system for which the user needs to debug the hardware or software Here the user must provide an access point on the target hardware for 14 JTAG OnCE interface cable which may be as simple as a 2 row 7 set of test points Section 5 provides complete details of the pinout of the JTAG OnCE interface cable The software program provides the routines necessary for the user to communicate with the target DSP on the ADM or the target application This program has a group of powerful commands which enables the user to perform a variety of tasks Operating system command calls may be made from within the program or temporary exits to the operating system may be made without disturbing current setups to target DSP The format for invoking the non windowed version of the ADS program 15 ADSxxxxx macro command filename X The format for invoking the Windowed version of the ADS program is Y GDSxxxxx macro command filename N Note The individual ADM User s Manuals specify which version of the software to load e g DSP56301ADM uses the ADS56300 or GDS56300 software The macro command filena
52. Upon entry into the Text Base User Interface program several of the available commands are displayed on the help line The remaining commands may be reviewed by pressing the SPACE bar when the cursor is at the start of the command line The user interface program requires a minimum number of key strokes to recognize a command The minimum number of required characters for each command is shown highlighted on the help line A command may be specified by typing the required characters followed by a space or by typing the entire command word followed by a space A detailed description of the commands and command syntax is provided in Section 3 Entering the command key strokes followed by a space activates the help line for that particular command The help line shows the syntax for the remainder of the command Additional help and examples of the current instructions may be obtained by typing a question mark at any point during the command entry Any text following a semicolon on the command line is considered to be a user comment This provides the user a means of documenting a session display Command execution begins when the user types the Enter or Return key If the specified command is not predefined an attempt is made to interpret it as a macro filename If a macro file of the same name exists its commands are executed Macro commands are a convenient way to group a series of commands that might be executed often under one command name MOTOR
53. Watch Show first Select watch expressions to remove Use Click Ctrl Click and Click Drag Figure 4 42 Display Watch Off Dialog Box 4 7 24 Display Type Display Disassemble Lint 22 This selection displays the type of a C variable or expression Use Modify Up or Down to select the evaluation context IO Streams Status Log Files 23 Breakpoints in Watch Expression 0151 Apply Figure 4 43 j Display Dialog Box L Dv00 Session Break 4 gi 227 n type gi i Figure 4 44 Display Output MOTOROLA DSPADSUM AD 4 39 Graphical User Interface Display Menu 4 7 22 Display More Display Display Disassemble iga List Display More freezes the Session window when it is full until P the user responds It is useful when the output from an operation Radix i may be longer than the Session buffer Path Input Files Output Files Redirected 10 Streams 10 Streams Status Log Files More Press to continue Breakpoints Watch More View Figure 4 45 Display More Dialog Box 4 7 23 Display View Register MN Display on PR Disassemble The Display View commands control the type of information displayed i in the Session window Register mode is used to view the output buffer for the current device This displays the breakpoint memory and r
54. int dspd cc revision device index revstring 0 int device index Command Converter affected by command M char revstring receives CC monitor revision string 98 dsp cc revision interrogates the Command Converter device_index to determine the monitor revision and returns a formatted string in revstring containing the monitor revision The format used to create the revstring is Command Converter monitor revision 4 2f 24 V The return value is TRUE on successful completion FALSE otherwise Example D 30 dsp cc revision obtain Command Converter monitor number finclude simcom h include protocom h i 2 2 int devn status Mac char revision string 80 devn 0 dsp devn 56002 Allocate structure for device 0 a 56002 Status dspd cc revision devn revision string DSPADSUM AD D 37 C Library Functions Library Function Descriptions 0 3 31 dsp cc rmem Read Command Converter Memory include simcom h include protocom h include cc h include coreaddr h int dsp_cc_rmem device mtype address value int device Command Converter affected by command M enum memory map mtype Memory space to read unsigned long address Address of location to read m unsigned long value Target location for read value 2 4 p dsp rmem reads one loca
55. lt int devn int break_status devn 0 A dsp_new devn 56002 Allocate structure for device 0 56002 7 an break_status dspd_break devn DSP_ONCE_ BREAK Force device into DEBUG mode D 10 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 4 dspd cc architecture lnitialize Command Converter for DSP Family include driver h int dspd cc architecture device index device type int device index DSP device affected by command int device type Type of DSP device 1 Initializes the Command Converter device index for the target M by device type The device attached to the Command Converter may d any member of the specified DSP family 4 1_ Valid values device type DSP 56000 7 DSP CC 56300 4 DSP 96000 lt Example 0 4 dspd cc architecture Initialize Command Converter for devi Q a 56002 include driver h B M _ int devn status 203 devn 0 status dspd cc architecture devn DSP CC 56000 setup CC for 56K family dsp new devn 56002 Allocate structure for device 0 a 56002 DSPADSUM AD D 11 C Library Functions Library Function Descriptions D 3 5 dspd cc read flag Read Command Converter Flag Word finclude cc h include simcom h include
56. Cu dus 4 41 EXECUTE MENU WINDOWS 4 55 HELP MENU 4 68 THE TOOL BABUa tia 4 69 N DSPADSUM AD MOTOROLA Graphical User Interface Introduction 41 INTRODUCTION This chapter describes the DSP ADS Graphical User Interface GUI Use of each operation is described using illustrations of the windows dialog boxes and expected output results from the operation Important features are indicated on each illustration M 4 2 HOST SYSTEM REQUIREMENTS 4 Nu The graphic interface version of the DSP ADS requires the following minimum system configuration Sun Workstation Any SPARCstation 2 or above with at least 10 MB of free disk Y 4 Hewlett Packard Workstation Any HP7xx series workstation with at least 10 MB of free disk space or Am gt PC compatible Computer An 486 or later system minimum 8 MB RAM color SVGA display at 800 by 600 resolution or better approximately 10 MB free disk space A high resolution SVGA display 1280 x 1024 with a 17 monitor will give a more productive working environment MM C S 43 PLATFORM SPECIFICS The operation of the ADS under the GUI varies slightly from one platform to another This is in the area of certain windows
57. D debug symbols only from filename LOG dev list OFF V source status C commands S session filename O A C OUTPUT dev list file number OFF OUTPUT dev list file number address filename TERM rd rt rh ru 0 A C hx dev _ num S state address block filename O A C 4 T Target Execution Control 3 8 BREAK dev list bn OFF E enable D disable BREAK dev list bn EOF 61 t expression count action BREAK dev list 67 swbp type address t expression count action DSPADSUM AD MOTOROLA CSource Code Debug User Interface Commands Command Summary Hardware Breakpoints DSP56300 and DSP56600 families BREAK dev list bn access TAG OnCE type addr qual address break qual qual address t expression count action e Other families M Z BREAK dev list bn access type address range count action FINISH dev list Br 1 FORCE dev list R reset to Debug mode RU reset to U ser mode S system GO dev list from location R reset bn oceurrence count NEXT dev list count Ll source lines IN instructions STEP dev list count Ll source lines INinstructions TRACE dev list count Ll source lines IN instructions UNTIL dev_list addr line _number address label DOWN dev_list count 4 FRAME dev list frame numb
58. DEBUG REQUEST 1 o X X X BYPASS other encodings are reserved for future enhancements and will be decoded as BYPASS The Instruction Register is reset to 0010 in the Test Logic Reset controller state Therefore the IDCODE instruction is selected on JTAG reset In the Capture IR state the two Least Significant Bits of the Instruction Shift Register will be preset to 01 where the 1 is in the Least Significant Bit location as required by the standard The two Most Significant Bits may either capture status or be set to 0 New instructions are shifted into the Instruction Shift Register stage on Shift IR state MOTOROLA DSPADSUM AD 5 27 Functional Description JTAG Instruction Register 5121 ENABLE 0110 The ENABLE instruction enables the JTAG port to communicate with the OnCE state machine and registers It is provided as a Motorola public instruction to allow the user to perform system debug functions When the ENABLE OnCE instruction is invoked the TDI and TDO pins will be connected directly to the OnCE registers The particular OnCE register connected between TDI and TDO is selected by the OnCE state machine and the OnCE instruction being executed communication with the OnCE instruction controller is done through the SELECT DR SCAN pus of the pem state machine 5 122 DEBUG REQUEST 0111 NS QN DEBUG REQUEST instruction asserts a request to halt the core entry to Deb
59. Display Register or 3 37 DOWN Move Down the Function Call Stack 3 39 EVALUATE Evaluate an Expression 3 40 FINISH Step Until End of Current Subroutine 3 41 FORCE Assert RESET or BREAK on Target 3 42 FRAME Select C Function Call Stack Frame 3 43 GO Execute DSP 3 44 DSPADSUM AD MOTOROLA 3 6 22 3 6 23 3 6 24 3 6 25 3 6 26 3 6 27 3 6 28 3 6 29 3 6 30 3 6 31 3 6 32 3 6 33 3 6 34 3 6 35 3 6 36 3 6 37 3 6 38 3 6 39 3 6 40 3 6 41 3 6 42 3 6 43 3 6 44 3 6 45 3 6 46 3 6 47 3 6 48 3 6 49 3 6 50 3 6 51 3 6 52 3 6 53 3 6 54 3 6 55 3 6 56 HELP ADS User Interface Help Text 3 45 HOST Change HOST Interface Address 3 46 INPUT Assign Input File 3 47 LIST List Source File 3 51 LOAD Load DSP Program 5 3 52 LOG Log Commands and or Session 22 s 9 54 MORE Enable Disable Session Paging Control 3 55 NEXT Step Over Subroutine Calls or Macros 3 56 OUTPUT Assign Output File AS YL 9 57 PATH Define File Directory Path 3 60 QUIT Exit ADS Program 3 61 RADIX Change Default Number Base 3 62 REDIRECT Redirect stdin stdout stderr iy C Programs 3 63
60. Save Input Output 10 Streams 10 Redirect Log Marrn Fi v v v File Log menu items control the creation of files containing a record of a debugging session Recording may be started and terminated at any time during the session Selecting File Log Commands opens the Open Log File dialog box If an existing file is selected for logging an action confirmation box opens with options to append to the existing file overwrite it or cancel the operation The command log file has two main purposes Its obvious purpose is to record a development session In addition the log file may also be Commands Se ccinn MOTOROLA DSPADSUM AD 4 21 Graphical User Interface File Menu used in the GUI as a macro file see File Macro when all the commands recorded in the log file will be executed This file is a standard ASCII text file and may be modified with any text editor as desired Note Nearly all GUI operations including menu operations and window interaction result in commands executed in the Command window ene will thus be stored in the log file M Enter file name manually if Select directories desired Command log files use from list by extension SIM Use wildcards to double click to specify which files build path are showma file Open Log File H list File Name Directories c windows Double click o
61. Section B 3 2 Optional Header on page B 6 Every symbol table entry for a section in a relocatable file has an extra auxiliary entry described in Section B 3 3 10 2 Sections on page B 19 One special DSP COFF structure not documented elsewhere is the comment symbol A comment symbol table entry is emitted either indirectly via the assembler IDENT directive or directly with the COBJ directive see Chapter 6 of the DSP Macro assembler User Manual comment symbol table entry may be identified by a symbol name of cmt and a type and storage class of zero The value field of a comment symbol holds the offset into the string table of the comment text The section number for a comment symbol produced with the IDENT directive is always 1 Comment symbols generated with the COBJ directive have the section number of the section where the COBJ directive appears in the source file Comment symbols have no auxiliary entry MOTOROLA DSPADSUM AD B 27 Motorola DSP Object File Format COFF Object File Data Expression Format B 5 OBJECT FILE DATA EXPRESSION FORMAT Object file data expressions are used in data relocation records to represent values to be loaded into memory An expression is a combination of symbols constants operators and parentheses Expressions may contain user defined labels integers floating point numbers or literal strings An object file data expression generally follows the guidelines of assembler expressions except that funct
62. TC ce cO 4 21 File Log Session 4 22 File Log Close E 4 23 Fe eoe a custard aS 4 24 File About dp c S TUTTI 4 24 File Preferences Eu m on 4 25 File Exit TOME 4 26 DISPLAY MENU c SE esee 4 27 4 28 Display Display Memory 4 28 Display Display Registers 4 29 4 29 4 30 Display Display Off 4 30 _ Display Disassemble From PC Memory 4 31 Lu TP 4 32 Bisplay Evaluate c 4 33 Display Call 4 34 Display Radix 4 34 Display Device 4 35 4 35 Display Input Files and Display Output Files 4 36 Display Redirected IO Streams Streams Status 4 36 Display Log Files 4 37 Display Breakpoints 4 37 MOTOROLA DSPADSUM AD vii 4 7 18 4 7 19 4 7 20 4 7 21 4 7 22 4 7 23 4 7 24 4 8 4 8 1 4 8 2 4 8 3 4 8 4 4 8 5 4 8 6 4 8 7 4 8 8 4 8 9 4
63. command entry line permits commands to be entered manually and a help line gives the syntax of the command being entered There is only one Command window shared among all the devices in use Session Window Whenever the debugger generates output it is written to the Session window the main screen for the current device When a command is executed it is echoed in the Session window When an error is detected it is reported in the Session window The Display menu basically causes information to be output to the Session window MOTOROLA DSPADSUM AD 4 11 Graphical User Interface Graphical Interface Functions Overview 4513 Command and Session Log Files commands entered through the Command window manually or from the GUT may be written to a log file This can serve as a record of the command input to a session but can also be used as command input itself A Macro file is an ASCII text file containing ADS Simulator commands which can be read and executed A command log one way of creating such files See Macro in the File menu M All activity i in the Session window can be logged as a permanent record of a debugging session Thus all the breakpoint data memory and register values output to the Session window may be examined and analyzed later Although there is only one Session window each device has its own output buffer The Session window displays the buffer for the current device activity on any other devic
64. devn 1s device devn requesting service D 42 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 36 dsp findmem Get Map Index for Memory Prefix include simcom h include protocom h include coreaddr h dsp findmem device index memory name memory map int device index DSP device to be affected by command M char memory name memory space name _ enum memory map memory map return memory map type dsp findmem searches the dt var mem structure for device device index fora match to the memory name string provided in the function call If a match is found dsp findmem returns the memory map maintype structure value through the memory map parameter and 1 as the function return value otherwise it just returns 0 as the function return value WS For a list of memory names use the emulator help mem command Example D 36 Get map index for memory space P lt include simcom h Le include protocom h e include coreaddr h int devn 7 4 enum memory map map int ok devn 0 4 dsp new devn 56002 Allocate structure for device 0 56002 ok dsp findmem devn P Get memory map index for P memory DSPADSUM AD D 43 C Library Functions Library Function Descriptions 0 3 37 dsp findreg QGet Peripheral and Regis
65. devn 56002 Allocate structure for device 0 a 56002 5 D wrif memtyp DSP CC XMEM set memory space write addr 0x00401 start address write length 551 and block length now write the memory block to device 0 status dsp wmem blk devn write memtyp write addr write length write store MOTOROLA DSPADSUM AD D 41 C Library Functions Library Function Descriptions 0 3 35 dsp check service request Check for Service Request include simcom h include protocom h int dsp check service request device index int device index device affected by operation dsp check service request checks to see if the target device devi ce index is requesting service from the host computer that is checks to see if the target device i isin Debug Mode Z AC JL The return value is TRUE if the device is requesting service FALSE if it is not and DSP_ERROR if the function cannot complete successfully Example D 35 dsp_check_ service_ quest 77 Check if device 0 is requesting service Wa finclude simcom h TEL 74 include protocom h int devn 0 int ok dsp new devn 56002 Allocate sect for device 0 a 56002 dsp reset devn reset command Coni ok dsp reset devn and 5 0 to debug mode dsp check service requ st
66. dsp fmem device index memory map address block_size value int device index DSP device to be affected by command M enum memory map memory map memory designator _ unsigned long address DSP memory start address to write i 73 unsigned long block size Number of locations to write pen is unsigned long value Pointer to value to write to memory location Lo dsp fmem initializes a block of DSP memory with a single value The memory_map parameter is a memory type that selects the appropriate dt memory structure from dt var mem for the selected device device index These structures are described in the simdev h file which is included with the emulator The memo ry map parameter can be obtained with the function dsp_findmem by using the memory name as a key Use the emulator help mem command for a list of valid memory names The memory map enum is memory map concatenated with a valid memory map name As an example memory map pa refers to off chip pa memory on the 96002 device If the selected memory map requires two word values the least significant word should be at the value location and the most t significant word at the value 1 location Example D 38 den fmem Write 300 locations beginning at P 5200 with the value 4 include simcom h include protocom h include coreaddr h int devn unsigned long address memval blocksize um blocksize m 41
67. execution asm dv3 b y 040100 Perform byte wide assembly from address 40100 in y memory Each byte of the instruction is stored in successive locations so two or three locations are required to store each 16 or 24 bit instruction Eveni if assembled into program memory this code cannot be executed directly it is intended for use v gt with code similar to the byte wide loader in the ROM bootstrap code Byte wide assembly may be used interactively as in this example or to assemble a single instructi asm nop MOTOROLA DSPADSUM AD 3 13 User Interface Commands Detailed Command Descriptions 3 6 2 BREAK Set Modify or Clear Breakpoint BREAK dev list bn OFF E enable D disable Software Breakpoints BREAK dev list bn swbp type address t expression count action DSP56300 DSP56600 Families Hardware Breakpoints d BREAK dev list bn access JTAG OnCE type addr qual address Ew break qual addr qual address t expression count action EN Other Families Hardware Breakpoints ine BREAK dev list fon access OnCE type address _block count action oy The BREAK command enables or disables breakpoints 1 which causes a auser s DSP program execution to halt and enter the Debug mode of operation There are two basic types of breakpoints that may be entered hardware breakpoints and software breakpoints Breakpoint list rule
68. in real time occur before returning to the Debug mode of operation The DSP56300 and DSP56600 OnCE circuitry allows the two breakpoint addresses to form a range of inclusive or exclusive addresses The address qualifiers in the breakpoint statement express whether the breakpoint address placed in the breakpoint comparator is to be less than greater than equal to or not equal to the address bus being monitored The address qualifiers correspond to the breakpoint control tables in the OnCE section in the user manual Table 3 4 DSP56300 AND DSP56600 Hardware Breakpoint Address Qualifiers Break Address Qualifier 5 Address bus is greater than breakpoint address Address bus is less than breakpoint address Address bus is equal to breakpoint address Address bus is not equal to breakpoint address 3 16 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions When enabling both of the DSP56300 or DSP56600 hardware breakpoint registers they form a sequential state machine This means that the breakpoint counter will not be decremented until the event qualifier is met for both breakpoints The breakpoints can be coupled so that the event qualifier is triggered when breakpoint 0 and 1 are true breakpoint 0 or 1 is true or breakpoint 0 becomes true then breakpoint 1 becomes true Table 3 5 DSP56300 and DSP56600 Hardware Breakpoint Event Qualifier
69. include protocom h int dsp status device index mode int device index DSP device affected by command int mode address of buffer to receive device status dsp status places the execution status of the target device device i ndex in the int pointed to by mode er Valid values for mode are N NE DSP USER MODE device is executing a user program 7 AX S DSP DEBUG MODE device is in debug mode The function returns TRUE on success or FALSE otherwise 2 iiio Example D 57 dsp status determine status of DSP 0 include simcom h include protocom h int devn status oo y int device mode receive mode of device 0 devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 status dsp status devn amp devic mode get current mode for device 0 D 64 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 58 dsp step Execute Counted Instructions include simcom h include protocom h dsp_step device_index step int device index unsigned long step dsp step causes the target device specified by device index to execute step instructions The device then returns to Debug mode x Note A success return code means the Command Converter has been instructed to make the target device execute the required number o
70. may not appear if the linker 5 option is used to strip symbols from the object file 4 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components B 3 OBJECT FILE COMPONENTS The following sections are detailed descriptions of each DSP COFF object file component The descriptions include the purpose of the component its structure in the object file and meanings of individual fields within the component fM B 3 1 FILE HEADER The file header is the first component in a COFF object file It contains information about the object file itself and is used for negotiating other components within the file There is only one file header per object file Table B 2 shows the structure of the COFF file header x v I N Table B 2 File Header Format N Bytes Declaration Name an Description 0 3 unsigned long f magic Magic number 4 7 unsigned long f nscns Number of em 8 11 long int f timdat Time and date when file was created 12 15 long int Esymptr File pointer to the start of the symbol table 16 19 long int nsyms Number of symbol table entries 20 23 unsigned long f opthdr Number of bytes in the optional header 24 27 unsigned long flags Flags See Table B 3 on page B 6 The magic number is a special code indicating the target machine for the object file DSP56000 DSP96000 etc The number of sect
71. single line interactive DSP Assembler program allowing the user to create or edit DSP object code programs in memory using assembly language mnemonics Each source line is immediately converted into the proper machine language code and stored in ADM or target system memory The source line entry is not saved The address parameter is optional The beginning address may be in any of the three p x or y memory maps of the DSP N Note The Y memory is only valid for DSP56000 and DSP96002 family members If no address is specified assembly begins in the p program memory space using the current program counter value as the beginning address Invoking this command causes existing object code at the beginning address to be disassembled and displayed on the Screen The user may optionally enter a new Assembler mnemonic on the command line or edit the existing object code The Assembler is called when the carriage return key is entered If the new instruction cannot be assembled correctly an error message is displayed on the error line and the cursor is placed at the point of error The B byte wide parameter takes one byte from each memory word starting at the specified address to build up the instruction word to be displayed Similarly the assembled mnemonic instruction is divided into bytes and stored in successive words If the interactive Assembler is invoked with the GUI version of the ADS a dialog box displays the original inst
72. startup Initialize emulator structures dsp_status devn mode Determine DSP Device Status dsp step devn step Execute counted instructions T dsp_stop devn Force DSP device into Debug Mode dsp_unlock Unlock device type device type password dsp wmem devn map addr val Write DSP memory map addr with val dsp_wmem_blk Block devn map addr count value dsp wreg Write DSP peripheral register with regval devn periphn regn regval D 2 2 7 sim User Interface Routines sim devn command string 2 s gt A M emulator command on DSP device sim gmcmd devn command string Get Command String from Macro File sim gtcmd devn command string Get Command String from Terminal JE MOTOROLA DSPADSUM AD D 7 C Library Functions Library Function Descriptions D 3 LIBRARY FUNCTION DESCRIPTIONS D 3 1 ads cache registers Cache OnCE and Core Registers include simcom h include protocom h FM int ads_cache_registers device_index int device device affected by command 7 ads cache registers caches all OnCE and core registers on the target device device index to ensure the integrity of values returned by dsp_rreg This routine must always be called before calling dsp_rreg Q each time the device returns to debug mode If it is not called the values returned by dsp rreg may be unreliable
73. that is structures which must be defined for each device type The prefixes sim dev are used for structure names of general device or simulation structures Global variable names may have a prefix dx_ dv_ sx_ or sv_ The prefix x is used for variables of dt structures The prefix is used for variables of dev_ structures The prefix sx is used for variables of st_ structures The prefix is used for variables of sev structures A list of emulator global variables is included in the distribution file named global sym MOTOROLA DSPADSUM AD D 85 C Library Functions Modification of Emulator Global Structures D 9 MODIFICATION OF EMULATOR GLOBAL STRUCTURES The source file simglob c which is included in the emulator package contains the global structures sv const and dv const There are some useful modifications described below that can be made to the constant definitions at the beginning of simglob c The simglob c module must then be recompiled and relinked using the make file with the emulator package _ D 86 DSP_MAXDEVICES This define constant determines the maximum number of devices that can be allocated using the emulator s device command A As a default it is set to 32 NN DSP CMDSZ This define constant determines the size of the previous command stack The emulator commands are stored in the stack and can be reviewed using the Ctrl f and Ctrl b key entries
74. 1 2 D 4 9 simw 5 with Output from Device simw redo device int device Use screen buffer from this device to repaint screen This function repaints the screen from a device screen buffer It is normally only called when reentering the emulator following a system command after loading the device D 76 DSPADSUM AD MOTOROLA C Library Functions Emulator Screen Management Functions state with the load s filename command or after switching devices in a multiple device emulation with the device command 0 4 10 simw redraw Redraw Screen after Scroll Count simw redraw count fm int count Number of lines to scroll before repainting the screen This function scrolls up or down count lines in the display buffer then redisplays the text in the buffer at that position This function only displays the text that i is in the scrolling portion of the display NV NS X 0 4 11 simw refresh Screen Update after Buffering Output simw refresh 2 The emulator buffers screen output in implementations other than MSDOS in order to decrease the time spent repainting the screen This provides a fixed display effect for consecutive trace commands The simw fresh function will take care of refreshing the screen following buffering of screen output It also resets the sim const scrnest variable to 0 to coincide with the non buffered status of the sc
75. 12020 4202060 59030000 L Each file has the same S0 header record and S9 terminator record The source code for the SREC program is also available to the user and is written in the C programming language 6 DSPADSUM AD MOTOROLA APPENDIX D C LIBRARY FUNCTIONS MOTOROLA DSPADSUM AD D 1 C Library Functions D 1 INTRODUC TION seus ee nds Eo USES Rd ee D 3 D 2 ADS OBJECT LIBRARY 5 D 4 D 3 LIBRARY FUNCTION D 8 D 4 EMULATOR SCREEN MANAGEMENT FUNCTIONS D 74 D 5 NON DISPLAY 0 79 D 6 MULTIPLE DEVICE V D 83 D 7 RESERVED FUNCTION 5 0 85 D 8 EMULATOR GLOBAL VARIABLES 0 85 0 9 MODIFICATION OF EMULATOR GLOBAL STRUCTURES 0 86 m Cx 2 DSPADSUM AD MOTOROLA C Library Functions Introduction D 1 INTRODUCTION The ADSDSP emulator package includes several libraries of functions which were used to build the emulator These libraries allow the user to build his own customized emulator and integrate it with his unique project The source code for many of the ADSDSP functions is provided including the code for the main entry point the code for the terminal I O functions and example code for a non display version of the The source code can modified to
76. 26 change 3 31 cload 3 27 copy 3 33 csave 3 28 cstep 3 29 ctrace 3 30 device 3 34 disasm 3 36 display 3 37 MOTOROLA INDEX evaluate 3 40 finish 3 41 force 3 42 go 3 44 help 3 45 host 3 46 input 3 47 list 3 51 load 3 52 log 3 54 3 55 next 3 56 output 3 57 path 3 60 quit 3 61 radix 3 62 save 3 64 step 3 65 system 3 67 trace 3 68 until 3 71 view 3 73 wait 3 74 command converter addressing 5 6 block diagram 5 6 flag word D 12 D 16 handshake 5 7 memory change 3 23 memory display 3 24 monitor program 5 17 monitor revision D 37 reset D 36 command entry command line editing D 73 expansion D 73 macro file D 71 D 72 terminal D 71 D 73 D 75 command execution macro file D 71 D 72 trace mode D 77 unlock 3 70 command overview 3 3 command syntax address 3 7 address block 3 7 DSPADSUM AD Index 1 address qualifier 3 7 boldface 3 5 breakpoint action 3 7 count 3 7 description 3 5 device number 3 7 symbolic address forms 3 6 commands system D 75 D 76 until 3 70 Comment object file B 27 comment from dspt masm D 30 control keys Ctrl W 1 10 CTRL C D 75 D Data block B 27 device mode D 25 D 26 D 42 display off 3 37 on 3 37 display mode select 3 73 display modes 1 10 display support D 3 dsp_alloc D 32 dsp_cc_fmem D 33 dsp_cc_go D 34 dsp_cc_ldmem 0 35 dsp_cc_reset D 36 dsp_cc_revision D 37 dsp_cc_rmem D 38 dsp_cc_rmem_blk D 39 dsp_cc_wmem D 40 dsp_cc_wmem_blk D 41 dsp_check_service_r
77. 4 80 Command 4 65 Figure 4 81 Session Window d n 4 66 Figure 4 82 Tiled and Cascaded Windows ue 4 67 ann 4 68 Figure 4 84 Help on a Specific 6 1368 4 68 Figure 5 1 Host Computer Bus Interface Card on TES 5 4 Figure 5 2 37 Pin Host Computer Interface Cable 22 42 5 6 Figure 5 3 Command Converter Block Diagram Y p 5 7 Figure 5 4 Target System OnCE Interface Connector 5 9 Figure 5 5 JTAG Connections iH T cp KM 5 9 Figure 5 6 Multiple JTAG Target Connections 2 5 10 Figure 5 7 Fan Out of TCK at S m 5 11 Figure 5 8 Reset JTAG device with RESET 5 12 Figure 5 9 Port 5 13 Figure 5 10 u oif CoMputer User Interface 5 16 Figure 5 1 1 7 Converter Monitor 5 17 Figure 5 1 2v Command Converter Target DSP Clock Constraints 5 18 Figure 5 13 OnCE 8 Bit Command 5 21 Figure 5 14 Port 5 22 Figure 5 15 JTAG OnCE Interface 5 25 Figure 5 16 TAP Controller State Diagram 5 26 XX DSPADSUM AD MOTOROLA Figu
78. 5 bit signed short offset f oM 1 Negated immediate shift 2 n 0 DSP word size immediate or absolute 1 Immediate shift A A 5 5 bit short immediate os 6 6 bit short immediate or absolute o 2 7 7 bit short immediate or absolute Mo 8 8 bit short immediate absolute 12 2 bitshortimmediateorabsolute 15 5 bit short absolute ge 19 9 bit short immediate 85 86 87 5 6 7 bit I O short absolute 4 5 2 5 Memory Attribute Operator The colon is used to assign a memory space and counter encoded in the right operand to the left operand The low sixteen bits of the right operand contain the counter designator for the left operand The high sixteen bits contain the memory space designator for the left operand The value here corresponds to the memory space values given for the memory space operator 0 described above Ts B 30 DSPADSUM AD MOTOROLA APPENDIXC MOTOROLA S RECORD INFORMATION MOTOROLA DSPADSUM AD C 1 Motorola 5 Information INTRODUCTION oat e exce Rx 3 2 S RECORD CONTENT ur rc me C 3 C 3 S RECORD TYPES 2 C 4 C 4 S RECORD CREATION C 5 IN C MCN C I 2 DSPADSUM AD MOTOROLA Motorola S record Information Introduction C 1 INTRODUCTION The Motorola S record format is recognized and supported
79. 60 D 361 D 3 62 0 3 63 D 3 64 D 3 65 D 3 66 D 4 D 4 1 D 4 2 D 4 3 xiv dsp_findmem Get Map Index for Memory Prefix D 43 dsp_findreg Get Peripheral and Register Index D 44 dsp_fmem Fill Memory Block with a D 45 dsp_free Free a Device Structure D 46 dsp free mem Free Memory 0 47 dsp go lhitiate DSP Program Execution gt D 48 dsp_go_address lnitiate Program Execution from Address D 49 dsp_go_reset lnitiate Program Execution after Device 0 50 dsp_init Initialize a Single DSP Device Structure 0 51 dsp_ldmem Load DSP Memory from OMF or File D 52 dsp load Load All DSP Structures from State File D 53 dsp_new Create New DSP Device Structure ts anne D 54 dsp_path Construct Filename D 55 dsp_realloc Reallocate Memory Block D 56 dsp_reset Reset Specified DSP Device D 57 dsp_rmem Read DSP Memory sse d ease D 58 dsp blk Head Block of DSP Memory Locations 0 59 dsp_rreg Read a DSP gt Device Register D 60 dsp_save Save All DSP Structures to State File D 61 dsp_spath Search Path for Specified File D 62 dsp_ startup Initialize DSP Structures D 63 dsp_status Determine DSP Device Status D 64 d
80. 9 4 9 1 4 9 2 4 9 3 4 9 4 4 9 5 4 9 6 4 9 7 4 9 8 4 9 9 4 9 10 _ 49 11 4 9 12 4 9 13 _ 4 9 14 4 10 4 10 1 4 10 2 4 10 3 viii 5 5 4 38 Display Watch Add 4 38 4 39 Display Type 4 39 Display More 4 40 4 40 Display View Assembly Source MODIFY e PEERS m EE 44 41 Modify Change ee Modify Change 2 42 Modify Copy CMS V PR 4 43 Modity Radix Set Default I 4 44 Modify Radix Set Display 4 44 Modify Device Set 4 45 4 45 Modify Device Unlock ee ee 4 46 Modify Up Modify Down 4 46 EXECUTE MENU I TC 4 47 meu EN dE 4 48 Execute Step Next Trade C 4 48 N Seu coe Eq eX Y 4 49 Execute Finish See EU NE 4 49 Execute Breakpoints Set Software 4 50 So
81. A good rule is to remove the 14 JTAG OnCE cable prior to powering down the target system when using separate power from the Command Converter MOTOROLA DSPADSUM AD 1 11 General Information Getting Started y _ 1 12 DSPADSUM AD MOTOROLA SECTION 2 PREPARATION AND INSTALLATION MOTOROLA DSPADSUM AD 2 1 Preparation and Installation 2 1 HOST COMPUTER INTERFACE CARD 2 3 2 2 PC COMPATIBLE TO COMMAND CONVERTER INTERFACE 2 3 2 3 INSTALLING THE PC COMPATIBLE SOFTWARE 2 5 2 4 SUN 4 TO COMMAND CONVERTER INTERFACE 2 8 2 5 HP7XX TO COMMAND CONVERTER INTERFACE 2 10 2 6 CONFIGURING THE COMMAND CONVERTER M 2 16 Lo NV N is N s 2 2 DSPADSUM AD MOTOROLA Preparation and Installation Host Computer Interface Card 2 1 HOST COMPUTER INTERFACE CARD This chapter covers the installation instructions for the different host computer platforms Schematics and bill of materials for the different host computer interface cards can be found in Section 5 _ 2 2 PC COMPATIBLE TO COMMAND CONVERTER INTERFACE The interface between the Command Converter and the ADS User Program is handled by a circuit board that resides in one of the PC compatible motherboard system expansion slots A single PC compatible interface card can control up to eight Command Converters NM 22 74 s 221 Installing the
82. As a default the previous command stack size is set to 10 DSP_WINSZ This define constant determines the size of the screen buffer that is maintained and displayed by the scrmgr c functions It specifies the number of display lines that will be allocated for each device as they are created with the emulator device command The user can use the Ctrl u Ctrl t Ctrl v and Ctrl d key sequences to review display lines that have scrolled off the screen This constant should not be set to a value smaller than the number of lines in the 22 21 display window c 2 DSPADSUM AD MOTOROLA MOTOROLA Wireless Signal Processing Suggestion Problem Report Motorola DSP Department welcomes your com ments on its products and publications Please use this form to report any problems enhancement requests or ideas you have concerning this product and send it to the following address Motorola Attention Wireless Signal Processors Mail Stop OE314 For fastest response Motorola DSP Department may also be may also be contacted electronically Send e mail to dsphelp dsp sps mot com doc update dsp sps mot com Or visit our web site You may browse our exten sive database including all our latest documenta tion and product news Our web address is 6501 William Cannon Drive West Austin Texas 78735 8598 http www motorola dsp com Please tell us about yourself Name
83. B 1 Table B 1 Basic COFF File Structure File Header Optional Header Section 1 Header M ZA Section Header 1 Section 1 Contents e Section n Contents 3 Section 1 Relocation Info 7 CN p Section Relocation Info z Section 1 Line Numbers Sainn Line untek E Symbol Table _ String Table The file header contains object file information such as timestamp number of sections pointer to the symbol table and file status flags Depending on how the object file was generated the Optional Header may hold link or run time information The Optional Header is followed by a list of Section Headers Each Section Header contains pointers to Section Data Relocation Information and Line Number entries After the Section Headers comes the raw data for all sections If the object file is relocatable the raw data may be followed by a block of Relocation Entries for all sections If the original source file was compiled or assembled with the G debug option the Relocation Information is followed by source Line Number and Address entries The Symbol Table contains information on program symbols used by both the Linker and the Debugger TheString Table may contain very long symbolic names comment text or relocation expressions Note The last four groups Relocation Info Line Number entries Symbol Table and String Table
84. B 3 3 10 8 Beginning of Blocks and Functions The format for C language symbol entries for the beginning of blocks and functions is described in Table B 25 The source file line number is retained The x endndx provides a link to the next beginning of block or function symbol in the symbol table Table B 25 Beginning of Block or Function Auxiliary Entry 4 Bytes Declaration Name Description 0 0 3 Unused zero filled 4 7 unsigned long x Inno Source file line number 8 15 Unused zero filed 16 19 long int x endndx Index of next beginning of block or function 20 31 Unused zero filled 3 3 10 9 Structure Union and Enumeration Names The format for auxiliary entries related to structure union and enumeration names is given in Table B 26 The tag index is used to access the tag symbol record that describes this structure Note that in Motorola DSP COFF the size of the associated structure or union is in words as opposed to bytes asin standard COFF Table B 26 Structure Union or Enumeration Name Auxiliary Entry Bytes Declaration _ Name Description 0 3 long int x tagndx Tag index 4 7 Unused zero filled 8 11 unsigned long x size Size of structure union or enumeration in words 1231 Unused zero filled B 3 3 10 10 String Table Symbol and section names longer than seven characters a
85. CCHANGE Command Examples CChange dv2 0 iN Display the current value of X 0 of Command Converter 2 memory and prompt the user for a new value Subsequent values may be displayed or changed by entering a carriage return To exit this interactive mode use the escape key CChange y 0 10 0 Change y 0 to y 10 of the default Command Converter to a value of 0 MOTOROLA DSPADSUM AD 3 23 User Interface Commands Detailed Command Descriptions 3 6 4 CDISPLAY Display Command Converter Flags and Memory CDispLay dev list FLAG XPTR YPTR address block The CDISPLAY command allows the user to examine the Command Converter flag register Y memory pointer or the P X or Y memory values used to transfer OnCE serial command sequences to the target DSP AII values will be displayed in hexadecimal Command converter X memory locations 0 to 10 hex are used for temporary st y storage of flags and constants as defined in 5 1 To display the Command Converter X or memory pointers command line arguments have been added to the e CDISPLAY and CCHANGE commands 7 3 6 CDISPLAY Command cdisplay Display the Command Converter flag register The register is used to store status bits of whether the target DSP is in the Debug mode or User mode as well as other Command Converter monitor flags m NN NX gt cdisplay y 0 10 Display the Command Converter Y memory space wh
86. DSPADSUM AD Ix 5 4 5 5 4 6 5 5 5 6 5 7 5 8 5 8 1 5 8 2 5 8 3 5 9 5 10 5 11 5 12 5 12 1 5 12 2 5 12 3 6 1 6 2 6 3 6 4 6 5 6 6 6 7 6 8 A 1 A 2 2 1 A22 i 9 A23 A24 A 2 5 A 2 6 2 3 Hardware Software 5 15 Program Single Stepping 5 15 HOST COMPUTER SOFTWARE 5 16 COMMAND CONVERTER 5 17 JTAG ONCE COMMUNICATIONS PERFORMANCE 0 18 COMMUNICATING WITH THE TARGET ONCE PORT b 5 20 OnCE Command Format eun 5 21 OnGE Pori 10601 beer raga Aen M OnCE Debug Acknowledge Signal esse ss s 5 22 WRITING YOUR OWN ONCE COMMAND SEQUENCE 5 23 COMMUNICATING WITH THE TARGET JTAG PORT 5 24 CHANGES TO THE ONCE PORT 8 25 22 5 24 JTAG INSTRUCTION REGISTER TD 5 27 ENABLE ONCE 0110 07 E 5 28 DEBUG REQUEST 0111 5 28 Polling for Chip Status From the JTAG Port Pius 5 28 INTRODUCTION 222 TEUER ERE S etie 6 3 HOST INTERFACE CARD BUS SIGNAL DESCRIPTION 6 3 HOST COMPUTER INTERFACE 6 5 JTAG ONCE INTERFACE CABLE 6 6 HOST COMPUTER CARD BILLS OF MATERIALS 6 7 COMMAND CONVERTER BILL OF MATERIALS 6 10 HOST INTERFACE CARD SCHEMATICS
87. Debug Serial Clock TCK DSCK lines are active The Test Data Out Debug Serial Output TDO DSO pullup is to insure that the Debug Acknowledge signal from the OnCE circuit is deasserted The debug request DR pullup is to insure that the Command yd controls when the target DSP is put in the Debug mode Whena command has been received by the Command Converter from the host computer a series of serial command packets are sent to the target OnCE debug port These serial command packets consist of an 8 bit command followed by a 16 24 or 32 bit serial read or write of data The serial bit width is dependent on the DSP architecture The Command Converter will always act as the clock master of the serial transfers In order to transfer a command the target DSP must be in the Debug mode of operation This may be accomplished by a force b or force r command from the user interface program 5 8 DSPADSUM AD MOTOROLA Functional Description Command Converter Card 10 GND ANNA TDI DSI 1 2 10 ka TDO D 201 10 ka vec GND AAAMALLCKDSCK 5 6 m 0 10kQ mm DSP 10k Voc AAAAA H 7 KEY No Connect CC RESET 50 for JTAG devices TARGET VDD D 2 TMS1 or JTAG devices 10 c Vec DEZ 4 TRST T JTAG devices CIRCUIT for JTAG devices VIEW N v Figure 5 4 Target System OnCE Interface Connector The force b com
88. Detailed Command Descriptions 3 6 15 DISPLAY Display Register or Memory DISPLAY W executing targets dev list V ADS user interface program version DisPrAY dev list ON OFF reg block group address block and or memory block in the radix specified by the RADIX command The default display radix is hexadecimal It may also be used to enable or disable particular registers or memory locations for automatic display when executing debug commands The DISPLAY command allows the user to examine the contents of a register 23 Entering the command with no parameters will cause the display of all enabled registers and memory blocks Registers and memory blocks may be enabled or disabled by entering the command with one of the enable keywords i e ON or OFF prior to the register and or memory list The keywords have the following meaning NN VN ON Enable display of the following registers and memory locations OFF Disable display of the following registers and memory locations Entering the DISPLAY command with only a register or memory list causes immediate display of the listed registers and memory locations without affecting their enable status Several register group names have been predefined and may be used in the display list to enable disable or display all of the registers in the group The list of group names available depends on the target device For a list of the peripheral name
89. Execute Menu 4 9 9 Hardware Break Processing During program execution the OnCE logic constantly monitors address lines for specified values e g program fetch from address P When the condition is true the counter is decremented when it reaches zero the DSP enters Debug mode The entry to Debug mode is detected by the Command Converter which sends a service request to the development host The ADS software then evaluates the expression if specified fetching register and memory values from the target DSP as necessary If the expression is false the DSP is returned to User mode and the program resumes execution The user is not notified of this activity dh yh 222 If the expression evaluates to true or no expression was specified the breakpoint has occurred The specified action is then taken such as returning control to the user Halt action or incrementing the specified counter Increment Cnt1 If the action is Halt the user has full control over subsequent activity For all other actions the target device is automatically returned to USER mode to continue program execution 4 9 10 Breakpoints Clear This selection removes a breakpoint Select the breakpoint or breakpoints from the pull down list and click OK to clear Cleared breakpoints can only be reinstated by recreating with Execute Breakpoint lt Set Software Set Hardware
90. Register Displays enables and dis bles breakpoints set for the current device A Memory Breakpoint wii dow may be opened for each device Breakpoints may be set Watch and cleared by List File Input 2 Output Double click on Assembly window address field Breakpoints ommani Double click on source line in Source window Execute Breakpoint Set or Clear menu Breakpoints that are set by clicking on the source window are identified by the line number Breakpoints that are set by clicking on the Assembly window have the address listed Disabled breakpoints are marked with the word disabled all other listed breakpoints are enabled MOTOROLA DSPADSUM AD 4 63 Graphical User Interface Windows Menu Breakpoints listed for current device only Those not disabled are enabled Breakpoint address displayed as hexadecimal Dv00 Break 1 al 5 1h Break 2 al 534 1h disabled Break 3 pl p 3c3 0 gt 0 1 x disabled p 1004 101f 512 First three are SW breakpoints Last is HW breakpoint Figure 4 79 Breakpoint Window Required action indicated by letter h Halt i Increment counter s Show registers amp memory in Session n Note breakpoint x Execute macro file did Double click to enable or disable breakpoint 00 1222 4 4 10 12 Windows Command 7 ma Lu
91. Repeat the NEXT command several times and watch what happens to each of the variables The form of the NEXT command being used NEXT li steps line by line rather than instruction by instruction which is the default for the NEXT command when not viewing source Repeat the NEXT command until you see Expression out of scope as a result of the watch expressions indicating that you have left the function that you were stepping through View the source View 5 If you were watching while you used next to go over the lines you might have noticed that high was not changing by much each iteration of the loop Examining the source carefully you ll see high high 1 where it should actually read high med 1 Correct this in the source code and recompile Repeat the previous steps needed to get into the function main If you ext over the lines while viewing source and stop after the call to find_keyword in which while is the parameter you ll notice that the variable was assigned value of 1 indicating that while wasn t found in the list Tracing through this call to find_keyword carefully it becomes apparent that the expression in the while loop should be low lt high rather than low lt high Correct this mistake recompile and then repeat the steps necessary to get into the function 4 Hn main MOTOROLA DSPADSUM AD 3 95 User Interface Commands
92. S state M memory only D debug symbols only from file The LOAD command transfers DSP Macro Assembler object files to the target DSP memory The object module format OMF is defined in Appendix A the Common Object File Format COFF is defined in Appendix B Programs are loaded into the memory map and address specified by each data record A directory path may be specified with the filename If only the file parameter is specified then the user interface program file is an OMF file The object file may be in either the special ASCII format in the DSP COFF format generated by the DSP Macro Assembler An OMF file may be created by using the DSP Macro Assembler by using the SAVE command or by some user generated method If no filename suffix is specified a OMF format lod file is searched first and if not found then a COFF format cld file is searched Loading a COFF format file replaces the target DSP symbolic debug information unless the M option is specified Programs are loaded into the memory map and address specified by each data record A directory path may be specified with the filename The default path for each target DSP address can be changed with the PATH command If 5 is specified as the second of three parameters the ADS interface program will load filename as an ADS state file The ADS state file may be created using the SAVE s command Loading the ADS state changes all ADS setups as
93. SAVE Save Memory To 4 3 64 STEP Step Through DSP 3 65 STREAMS Enable Disable Handling of I O for c ood ceases 3 66 SYSTEM Operating System 3 67 TRACE Trace Through DSP Programi ears 3 68 TYPE Display The Result Type of C Expression 3 69 UNLOCK Unlock Password Protected Device Type 3 70 UNTIL Step Until 55 3 71 UP Move Up C Function Call Stack 3 72 VIEW Select Display 3 73 WAIT Wait Specified Time 3 74 _ WATCH Set Modify View or Clear Watch Item 3 75 WASM GUI Assembly Window 3 76 WBREAKPOINT QUI Breakpoint window 3 77 WCALLS GUI C Calls Stack Window 3 78 WCOMMAND GUI Command Window 3 79 WHERE GUI C Calls Stack Window 3 80 WINPUT GUI File Input window 3 81 WLIST GUI List Window 3 82 WMEMORY GUI Memory Window 3 83 WOUTPUT GUI File Output Window 3 84 WREGISTER GUI Register Window 3 85 MOTOROLA DSPADSUM AD V 3 6 57 3 6 58 3 6 59 3 6 60 3 7 3 7 1 3 7 2 3 7 3 3 7 4 3 8 3 9 3 9 1 3 9 2 4 1 4 2 4 3 4 4 4 4 1 4 4 2 4 4 3 4 5 4 5 1 4 5
94. SO assembler option The space specifier is a single character representing the memory space to be loaded X Y L or P The character may be upper Or Les case the assembler guarantees upper case output An arbitrary be of symbol address pairs follows the memory space attribute The symbol field conforms to the definition of a legal assembler symbol that being a series of up to eight ASCII characters starting with an alphabetic character and followed by alphanumeric characters or the underscore _ The address is an ASCII hex value indicating the address at which the symbol was defined It contains only hex digits 0 F with no leading or trailing radix characters The range of the address is 00000000 6 DSPADSUM AD MOTOROLA Motorola DSP Object Module Format Object Module Format Example A 2 6 Comment Record Format COMMENT Comment The Comment record puts comment into the object file it is produced assembler directive The comment text appears on a line by itself in the object file it is delimited by newline characters P OBJECT MODULE FORMAT EXAMPLE Example A 1 DSP56000 assembler code fragment FIR ident 1 71 Complex Correlation Convolution n equ 500 NA o oet org 50 aaddr ds 1024 org 50 baddr ds 1024 iS org 50 start 4 move faadar oaddr r4 B clr x 1 y 4 0 l
95. Session window As execution proceeds source display tracks Radix PC Step to Next Previous Page with Apply 1 page Session window size Revert to PC with Current Page If Address is a number it is interpreted as line number in source file To specify a memory address include memory space as p 001F E I List File Contents AL List C Current Page C Next Page N Dem C Previous Page From Address 2 5 50104 LS 2 Figure 4 27 Display List File Dialog Box src prolog c 182 pc prolog c 185 pe 3ac Fm 182 main 2 183 185 int i 185 i pr8 186 1 1 187 i pr2 188 i pr3 2 amp P ia un 4 32 DSPADSUM AD MOTOROLA Graphical User Interface Display Menu 4 7 9 Display Evaluate Display Disassemble List This selection evaluates DSP Assembler and C expressions and ETT writes the result to the Session window C expressions display the 7 type of the expression and the value in the specified format the normal format for the expression type if All is selected DSP Assembler expressions may be displayed in any type Selecting gives a selection of interpretations depending on the expre ion itself iet C expressions are evaluated in the context of the current stack frame lefault that i is the value displayed is that w
96. Source The Command window provides the main interface between the user Memory interface and the rest of the system Calls List Fc The user may enter commands directly All commands generated by the d entered via the Command window Cascade The command 15 displayed and may be retrieved edited and re submitted Summary help is all commands e Commands executed may be written to a log file see File Log Commands The command history buffer holds the last ten commands If the last command is repeated exactly 1 the duplicate is not stored The default size of ten commands may be changed iuting installation 3 12 4 64 DSPADSUM AD MOTOROLA Graphical User Interface Windows Menu Click on history If history is edited original Use scroll bar to One command line to select command is always restored view command window handles CR to execute When executed the new history all commands for May edit first command is added to history the system MN lists 6 Click and type commands commands Spacebar directly into wasm cycles through command device Dv2 commands window Type portion in red and a space Prompt is command is current A completed and device A help gives No Command abbreviations shown inred syntax for that Figure 4 80 Command Window 4 10 13 Windows Sessi
97. To accomplish this a defined set of actions will occur when a sequence byte is in the lower byte of the command word of the Y memory Table 5 1 describes the actions associated with each sequence byte type Table 5 1 Sequence Control Codes 2 Action taken by Command Converter Monitor ve No Action 24 1 End of sequence return to monitor 4 2 Send command wait for ack clock in data into X memory 4 Send command wait for ack clock out data wait for ack 8 Send command wait for ack 10 Send command wait for ack clock out data MOTOROLA DSPADSUM AD 5 23 Functional Description Communicating with the Target JTAG Port An example Command Converter Y memory command sequence follows 800002 read OSCR register and store in X memory 000004 write OSCR register 123400 value of 1234 090004 write PDB no go no ex 22 3A1400 move r0 x OGDB opcode lt lt 490004 write PDB go no ex i SFFFF operand SN 880002 read OGDB no go no ex and store in X 1 2 000001 end of sequence 7 5 10 COMMUNICATING WITH THE TARGET Devices which have an IEEE JTAG 5 wire port communicate with the OnCE port via the IEEE JTAG protocol A special user defined command ENABLE_ONCE is executed through the JTAG state machine in order to pass serial commands and data to and from the OnCE controller The OnCE concept of co
98. X int devn status Papua char load fname filter2 cld NN devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 1 status dsp ldmem devn load fname load program into memory A status dsp go devn start program execution D 48 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 42 go address lnitiate Program Execution from Address include simcom h include protocom h dsp go address device index address int device index DSP device affected by command unsigned long address address from which to start executing C address causes the target device device index to begin executing in real time from the address specified by address 127 j The function returns TRUE on success FALSE otherwise T Example D 42 dsp go address Start execution from specified address gt include simcom h 29 include protocom h dy int devn status char load fname filter2 cld devn 0 4 dsp new devn 56002 Allocate structure for device 0 a 56002 3 1 1 status dsp ldmem devn load fname load program into memory status dsp go address devn 0x14001 start program execution MOTOROLA DSPADSUM AD D 49 C Library Functions Library Function Descriptions 0 343 dsp go reset lnitia
99. a 56002 dsp new 1 56002 Allocate structure for device 1 a 56002 Save device 0 and 1 to state file lunchbrk adm ok dsp save lunchbrk adm MOTOROLA DSPADSUM AD D 61 C Library Functions Library Function Descriptions 0 3 55 4 spath Search Path for Specified File include simcom h include protocom h int dsp spath base sufx retn char base Ptr to base file name char sufx Ptr to file extension char retn Ptr to buffer to receive completed file name AN dsp spath takes the base filename base and suffix su x supplied as arguments and searches the working directory and alternate source paths until the PIU file is found 77 V The working directory is searched first then each of the alternate source directories in the order in which the paths were specified The search termi ates immediately match is found If multiple files exist on the search path with the same name the only way to access files after the first file encountered in the search path i is to specify the full path explicitly in the input filename base JTN If a match is found the filename return buffer retn contains the fully specified filename retn is used as working storage and will be changed whether or not a match is found y This function returns TRUE if the file is found FALSE otherwise 003 Example D 55 dsp spath f
100. a single memory location or a block of memory to the same new value Change Register Change Memory Copy Memory Radix Device Up Down Copy a single location or a block of memory to another location or block The destination memory block may but need not be in the same memory space as the Source e Specify the Default Radix and the Display Radix The default radix is used for input numbers which do not include an explicit radix specifier The initial default radix is hexadecimal The display radix specifies how each memory location and register is to be displayed The initial display radix is hexadecimal Select the current device and set the device type e g set DV05 to be type 56002 Select a stack frame from the C call stack as the context for C expression evaluation MOTOROLA DSPADSUM AD 4 41 Graphical User Interface Modify Menu 4 8 1 Modify Change Register o Change Memory Copy Memory Radix b Modify Change Register changes the value of one or more registers on the current device A dialog box is opened which offers all the registers on the current device in a scrolling list Registers may be selected by a single click to select one register or click and drag to select a continuous range of registers The list scrolls automatically when the dragging reaches either end of the scroll list Use the control key to add to an existing selectio
101. a trace of each instruction executed After each instruction execution the enabled registers and memory locations are output to the Session window e Next executes a specified number of instructions or lines of code skipping over all subroutine calls e Finish executes to the end of the T subroutine terminating after the RTS instruction is executed Until specifies a temporary breakpoint and executes until that or optionally any other breakpoint is met Breakpoints allows the setting clearing of breakpoints A breakpoint is an event e g executing a particular instruction expression value non zero and an action e g increment counter stop execution Wait pauses either indefinitely until a timer has expired or the user cancels the wait This i is useful in Macro files to freeze the screen for examination Stop stops execution and returns control to the user Reset is used to reset the device registers to change the mode of a device or to 2 the entire ADS state MOTOROLA DSPADSUM AD 4 47 Graphical User Interface Execute Menu 4 9 1 Execute Go Execute Go Step Trace Execute Go opens the Go dialog box to control program execution There are options controlling the starting address and the way Until Breakpoints b breakpoints if any have been set are to be handled These options are summarized in the illustration bel
102. above Note This is only a general outline and may need to be modified for specific circumstances D 82 DSPADSUM AD MOTOROLA C Library Functions Multiple Device Emulation Consideration always needs to be given to the case where the first instruction to be executed is itself the target of a breakpoint In this case step over that instruction before inserting the DEBUG instructions Adding or deleting of breakpoints needs to be handled Steps 4 and 11 above do not need to be tight loops Calls to dsp check service request may be made at convenient points in other processing to determine when the device is ready D 6 MULTIPLE DEVICE EMULATION ADSDSP emulator may be used to emulate single DSP device multiple devices As many devices as are required by the target configuration may be configured using the device command dsp new function The following sections describe some details about the way the emulator handles multiple devices Section D 6 1 describes the required steps to allocate and initialize multiple DSP structures Section D 6 2 describes the method of controlling multiple devices Section display of device output in the multiple device environment R D 6 1 Allocation and Initialization of Multiple Devices NN 203 Most of the higher level emulator functions require a device index as one of the parameters The emulator uses the device index to select a previously al
103. an acknowledge from the DSO pin All write commands will also be followed by an acknowledge after the 32nd bit of the data has been shifted into the 051 050 pin A write to the PDB register with an exit to User mode will be the only case where an acknowledge will not be followed by a write command In order to insure that the target system will re enter the User mode in the correct state the host computer interface program will always store the pipeline register values when the target system enters the Debug mode of operation When the user wishes to re enter the User mode a go command is issued and the previous state of the machine is restored prior to exiting th the Debug mode If the user enters the Debug mode and wishes to change the program counter to evaluate code at a different address a long jump instruction is entered into the pipeline registers so that the program controller may reload the pipeline All data output on the target system is via a Global Data Bus Register To read a memory location a register is loaded with the address to read the data is retrieved and put into another register and then that register value is moved to the global data bus register The user then reads the value of Global Data Bus All registers used to move data should be saved prior to executing the commands and restored immediately after using them Reading and writing new values to registers are accomplished using two word opcodes which write directly to th
104. and dialog boxes supplied by the platform itself In all aspects of the ADS itself operation although not the details of appearance is consistent across the platforms Although this section addresses some of the relevant differences between the platforms it is assumed that the reader is familiar with his own environment Although there are frequent references to window operations no attempt is made to teach the windows or any other system After this introductory section all screen illustrations are taken from the Windows system MOTOROLA DSPADSUM AD 4 3 Graphical User Interface General Window Behavior 4 8 GENERAL WINDOW BEHAVIOR Under Windows all the GUI windows are constrained within the area of the main window To use the whole screen the main window must be maximized When one of the open windows is minimized it appears as an icon within the main window Dialog boxes however appear in the center of the screen and are not bound by the main window They may be moved as desired some can be re sized none can be minimized and all must be dismissed before any other operation may be Under Motif the windows are not bound by the main window They fih the whole screen without restriction When a window is opened an icon appears in the main window When a window is minimized by clicking in the down triangle in the top left corner it becomes an icon at the right of the screen These icons are not labelled so
105. another The Radix Device b source and destination memory maps may but need not be the same up Down Enter the memory block by selecting the source memory space and entering the start and end addresses Enter the destination of the copy with the memory space and start address The copy dn ene to the start of memory if it reaches the end I Copy Memory Select source From To memory space 5 Memory Space from pull down list s Start Address Start Address Select s destination AN P s4000 87622 address space e and enter starting Enter ar address 2 start and en gt 54166 resses Apply Cancel Figure 4 50 Modify Copy Memory Dialog Box MOTOROLA DSPADSUM AD 4 43 Graphical User Interface Modify Menu 4 8 4 Modify Radix Set Default _ Change Register Change Memory Copy Memory Radix Set Default Device Up Down Modify Radix Set Default specifies the radix used on all input fields unless the input value includes a radix operator The radix operators are listed in the table below The initial default radix is Hexadecimal 1 Note The Radix Operator is used as a prefix to the input value Click on radix Set Default Radix to be used for EN i input C Decimal
106. be initialized to a particular value by including an end address If the command is entered without a value the register or memory location of the current default target DSP address will be displayed with its current value on the command line and the user will be prompted for a new value Multiple changes may be specified in a single command line Each specified destination block must be followed by the value of expression to be assigned to it 4 LU An interactive mode of register memory display and change can be initiated by specifying a single register or memory location without an associated expression In this mode each register or memory location can be examined and optionally modified To change the register or memory location contents and display the next register or location type the new value followed by carriage return Subsequent Or previous memory locations or register names can be examined and changed if required by typing respectively Up Arrow Ctrl U or Down Arrow Ctrl N Typing a new value followed by Up or Down arrow does not change the open location Pressing the Esc key causes the interactive CHANGE command to ORUM VA _ CAUTION Users should be aware that some peripheral registers contain handshake bits that change state when they are read Reading these registers can interfere with the proper operation of the peripheral when returning to the user s program 1 E
107. be overwritten with DEBUG instructions e Save instruction word and overwrite with an unconditional DEBUG instruction MUST be the first word of multi word instructions EN It is the responsibility of the user code to retain the addresses of the DEBUG instructions and carry out the desired checks and actions when they are encountere 72 In the first two possibilities no special action is needed to continue program execution A call to go or dsp step will resume device execution at the location following the DEBUG instruction Although inappropriate for production code this approach is simple 52 With the third approach it is necessary to restore the original instruction before continuing and then reinstate the breakpoint as necessary The full operation of setting and handling the breakpoint is outlined PONE 1 save contents of breakpoint locations overwrite with DEBUG start execution with to dsp_go save registers with ads cache registers 1 2 3 4 repeatedly call dsp check service request until return value is TRUE 6 read pc address 7 check for breakpoint address and carry out required checks and actions write the saved instruction word back to memory A reset the pc register to the breakpoint address _ 10 execute 1 instruction with dsp step 11 repeatedly call dsp check service request until return value is TRUE 12 continue from 2
108. chip pa memory on the 96002 device Example 0 62 dsp wmem blk Copy 100 values in X c400 to 000 include simcom h amp include protocom h include coreaddr h sint devn unsigned long address count memval 100 memval 0L devn 0 dsp_new devn 56002 Allocate structure for device 0 56002 address 0xc400 dsp _ rmem devn memory_map_x address 1001 amp memval 0 fetch 100 values address 0xa000 from X c400 dsp_wmem devn memory_map_p address 1001 amp memval 0 and write to 5 000 MOTOROLA DSPADSUM AD D 69 C Library Functions Library Function Descriptions 0 3 63 dsp wreg Write DSP Device Register include simcom h include protocom h dsp wreg device index periph val int device index DSP device index to be affected by command int periph num DSP peripheral number int reg num DSP register number unsigned long reg val Value to be written to register ede dsp wreg writes selected register in the a DSP device SN 1 Use the emulator help reg command to obtain list of the valid periph and reg num values and reg val size for each register Also the function dsp findreg can be used to obtain the penpheral a and register n number by using the register name as a key A N Y If a register requires more than on
109. clear to you Assuming you have already compiled the trav c source file with the debugging flag started the ADS host software and reset the DSP you should now do tra to load the COFF file that resulted from compiling trav c The file trav c contains code to open a text file traverse a binary tree and write the numbers contained in the nodes out to a file If there are any problems in doing this it writes an error message out to stderr and exits By using the STREAMS command you can determine whether C input and output are currently being handled by the host software Streams By default input and output are handled by the host software One reason you might want to disable the handling of input and output by the C program is if you have written 3 96 DSPADSUM AD MOTOROLA User Interface Commands Example Debugging Sessions your own send and receive functions that were compiled into your C program and you have special communication needs that are handled in those routines like writing out to a peripheral on the DSP REDIRECT the output to stderr so that it gets written into a file redirect stderr stderr o This command will open the file stderr cio on the host side and force everything that is written to stderr to be written to this file The o flag specifies that stderr cio file should be overwritten if it already exists Now set breakpoint at main run until that breakpoint is hit and vi
110. contain things mentioned in the following section on restrictions For information on what makes up a valid C expression consult a manual on the C programming language 3 90 DSPADSUM AD MOTOROLA User Interface Commands Debugging C Programs In addition to supporting basic C expressions a new operator has been added This new operator is used to create an array from a pointer or another array The syntax of the operator is name size where name is the name of a pointer or array in the C program and size is a constant integer greater than zero indicating what size array to make So for 2 if vals is a pointer to a group of integers vals 10 is an array of the first te This can be useful for display purposes This operator be used to make single dimensional arrays only Attempting something like name size1 size2 will make one dimensional array with size2 elements d 1 One final addition to C expressions is the ability to use DSP registers in expressions by prefixing them with a dollar sign in the C expression For registers that are greater than the size of a long variable the upper bits are truncated So for example if a were specified in the 56000 ADS software only the lower 48 bits of register A would be used The in non C_expression evaluation is used to designate a hexadecimal value 1 3 7 3 Restrictions To improve u
111. display buffer Y Jf D 84 DSPADSUM AD MOTOROLA C Library Functions Reserved Function Names D 7 RESERVED FUNCTION NAMES The public function names used in the emulator all begin with the prefixes dsp or sim Functions which begin with sim are only available when a display version of the emulator is created Functions which begin with dsp and ads are available to both display and non display versions The screen management functions all begin with simw In general functions which begin with dsp sim are higher level inctions available for direct reference from the user s code those beginning with dspd dspl _ orsiml are meant only for internal use by the emulator The higher level functions and the screen management functions are documented in Section D 3 and Section DA The public functions are listed in the file named global sym which is included with the distribution e 0 8 EMULATOR GLOBAL VARIABLES Ww d In order to reduce conflicts with user variable names the emulator global variables have been grouped together into several large structures In general the structure names beginning with s are used defined in simusr h and are only used in the display version of the emulator while those beginning with d are defined in simdev h and are used by both the display and non display versions of the emulator The prefixes and dt are used for structure names of device type structures
112. dvd 02 SHOLO3NNOO 180H 91 VSI 9661 67 21 21 21 UNF uow qaldlaoW 1sv1 vad QNO 150 vias Wav S d dd Lad elas wav Wav LSOH ANI Wav xov wav Wav LSOH 0136 wav has wav 2185 wav 18538 wav Tv wav LSOH Wav LNI SE 26 gt 0 gt 62 82 42 92 282 7 mw 61 817 gt 91 91 v e17 HT 017 j 9 gt gt HOLO3NNOO Nid 26 91H3 1SVIA SOA 4 9MOVd 9108 9101 050 21 53 9434 X XOVG AWIN SMON nzi AS coul 19599 H31S VIA AS
113. entry for do Arbitrarily complex expressions can be used Here is an illustration of the operator 1 evaluate 10 5 10 You should see the display of the first 10 elements of the key_toks array Now on to debugging Repeat the procedure for loading the program so that we can st over from the beginning Run until you hit the breakpoint at main load binsbad cld NA i 72 View the source and then step into the find keyword function View S step Now step until the indicator is pointing at the line that begins the while loop After stepping to the while loop use the Ww HERE command to find out where you are and how you got there M where 4 You should see a list containing the function you are in and the function main This list tells you that the function you are in was called from main with the parameter listed The indicator tells you which level of the call stack is currently selected By selecting other levels of the stack with up down and frame you can examine local variables within those functions You can also view the source for those functions in which case the indicator will point at the place where you will return to when you get back up to that function For instance view the source code again and then move up a stack level and then finally down a stack level Note the difference in the source display as you move p and down levels
114. evaluate a0 b0 Calculate the sum of hexadecimal a0 plus hexadecimal evaluate count Display the value of the C variable count evaluate count max Evaluate the sum of the C variables count and and display the result evaluate lookup i Call the C function lookup from the command line with the argument i Display the result of calling the function 3 40 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 18 FINISH Step Until End of Current Subroutine FINISH dev list The FINISH command executes instructions until a Return To System RTS instruction is executed within the current subroutine The ADS interface program simply steps checking if any instruction is an RTS If so that RTS is executed and instruction execution halts immediately afterward While stepping if a branch to subroutine or jump to subroutine instruction is encountered tests for the RTS instruction suspended until execution resumes at the address following the subroutine call Example 3 20 FINISH Command Example 2 finish C Y Finish the current subroutine continuing from the current address until an RTS is executed NN 5 DSPADSUM AD 3 41 User Interface Commands Detailed Command Descriptions 3 6 19 FORCE Assert RESET or BREAK on Target Force dev list reset to Debug mode B break RU reset to User mode S Syst
115. have set a software aa that stops at main start execution of the DSP program M After the breakpoint is reached we want to view the source code for the program and get some indication of where we stopped when we hit the breakpoint for main View 5 By using the NEXT command we can step over the next two lines of source code the call to the function find keyword and the assignment to the variable next 2 So find keyword fas been called with typedef as an argument The index returned by find_keyword has been assigned to indx and the token value for the indx item of key_ toks has been assigned to t Now display what value t has evaluate dt You sould see the result enum token_t Typedef So t is of type enum token_t and it s value is Typedef the enumeration value that corresponds to the string typedef Now view the source again View S Repeat the procedure we have just gone through to examine the results of each additional call to find keyword While viewing the source display the entire key toks array MOTOROLA DSPADSUM AD 3 93 User Interface Commands Example Debugging Sessions evaluate toks You should see the display of an entire array of structure items Display the contents of a single structure for example the one at index 7 evaluate toks 7 You should see the structure
116. int dspd cc write flag device index flag value int device index M int flag M unsigned long value dspd cc write flag writes to word flag on Command Conve ter device index fetching the value from the location pointed to by value 000 Valid values for flag are Wee DSP CC FLAGS A MY DSP CC STATUS DSP CC XPTR eme DSP CC YPTR DEVICE ADDRESS C DSP CC RATE DSP CC DEVICE COUNT DSP CC DEVICE ACTIVE The function returns DSP OK on success D8P ERROR otherwise Example D 9 dspd cc write flag Write Command Converter flags finclude cc h include simcom h include driver h T int devn status 0 status dspd write flags devn DSP CC YPTR 0x04001 D 16 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 10 dspd cc write memory Write to Command Converter Memory include simcom h include driver h include cc h int dspd_write_memory device_index mem_space address count value int device_index Command Converter affected by command fM int mem space Memory space to write unsigned long address Address of first location to write a unsigned long count Number of locations to write unsigned long value Address of buffer of values to write 13
117. is TRUE if the device is requesting service FALSE if it is not rot requesting service and DSP_ERROR if the function cannot complete successfully 22 Example D 11 dspd check servic Are Check to see if DSP device is requesting service A include simcom h include driver h 7 gt int devn int status devn 0 3 dsp new devn 56002 Allocate structure for device 0 a 56002 ies 28 _ wait for device to vd d while status dspd check s rvic request yn FALSE if status DSP ERROR return DSP ERROR device requested service Now find out why 18 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 312 dspd fill memory lnitialize DSP Memory Buffer to Single Value include simcom h include driver h int dsp fill memory device index mem space address count value int device index index of DSP device affected by command int mem space memory space to fill unsigned long address address of start of memory block unsigned long count length of memory block a unsigned long value fill value 7 4 dspd fill memory initializes block of memory on the specified DSP device device index to the specified value count locations starting at address are filled with value 1 X i V Valid values fo
118. issued the specified pathname or comma separated list of pathnames is added to the current list When searching for files the ADS user interface program will search first using the default pathname specified for the current device then in each of the alternate source pathnames in the order that they were specified x a Example 3 39 PATH Command Examples path I Display the path for the current default target DSP address path dv1 4 m Define a path to the root directory for target DSP addresses 1 2 3 and 4 All subsequent commands with filename arguments will have this path string preceded to the filename when making an operating system call N path Mest 24 Add pathname Ntest to the list of alternate source pathnames path d Add pathnames test and help to the list of alternate source pathnames path 74 Clear the list of alternate source pathnames 3 60 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 32 QUIT Exit ADS Program QUIT E enable D disable The QUIT command passes control back to the operating system and closes all logging files assignment files and macro files currently open Use the SYSTEM command to exit the ADS program temporarily 2 QUIT enable and QUIT disable control the action taken by the ADS if an occurs during the execution of a macro command QUIT enable s
119. laa B memory map ya memory map lab 6 memory map yb 22 memory map 7 memory map ye 23 Saa 23 memory_map_lbb 8 memory map yi 2224 memory map le 9 memory map z 25 memory map li 10 memory map pt 26 memory map pa 11 memory map pf 27 memory map pb 12 memory map error 666666 memory map pe 13 N memory_map_pi 48 EUN 2 memory map pr 15 4 2 OBJECT FILE TRANSPORTABILITY There are many different structure definitions in the COFF specification These definitions consist of fields comprised of varying C data types These data types are recognized by any reasonable C compiler but their characteristics and sizes may change from machine to machine This is acceptable if the COFF files are to be used only ona particular machine architecture But if COFF files are produced on one machine to be used on another several problems may arise One is that since the data fields can vary in size there could be alignment problems when accessing structures or individual fields Another issue is byte ordering between machines Given an arbitrary byte stream some machines store the bytes in a word starting at the least significant bit LSB end of the word while others store bytes starting at the most significant bit MSB end of the word The Motorola DSP version of COFF addresses these potential problems by normalizing the object file Normalization occurs in a number of ways All structure and union ele
120. last command in the history buffer in the Command window and pressing CR 4128 RESET Button The RESET Button generates reset command for the current device It is equivalent to Execute Reset with the device mode unchanged 4 70 DSPADSUM AD MOTOROLA FUNCTIONAL DESCRIPTION N _ SECTION 5 MOTOROLA DSPADSUM AD 5 1 Functional Description 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 2 INTRODUCTION airo SEE ERE 5 3 HOST COMPUTER 5 3 COMMAND CONVERTER 5 6 PORT ARCHITECTURE 5 12 HOST COMPUTER SOFTWARE 9 16 COMMAND CONVERTER i 5 17 JTAG ONCE COMMUNICATIONS PERFORMANCE 5 18 COMMUNICATING WITH THE TARGET OnCE PORT 5 20 WRITING YOUR OWN OnCE COMMAND SEQUENCE c 5 23 COMMUNICATING WITH THE TARGET JTAG PORT 59 24 CHANGES THE OnCE PORT PINS e 5 24 JTAG INSTRUCTION REGISTER 272 5 27 oe M IM 47 DSPADSUM AD MOTOROLA Functional Description Introduction 5 1 INTRODUCTION The Application Development System ADS user interacts with the target DSP through two subsystem components the host computer interface and the Command Converter controller The host computer interface consists of a program written in the C language which interacts with
121. lt gt 5 lt 6 gt 2 S lt lt 02 gt 0 S lt gt S lt ee gt d S 60 S Lo 10 Figure 6 4 Sun Sparc SBus Interface Card Page 3 of 4 MOTOROLA DSPADSUM AD 6 20 9 06 62 21 teg 50 SNES a 220 120 020 19 539719121620 pu pu 7 7 99 223 29 11333 99 99 023 6 90 1 1 1 1 1 99 802 9 10 11331 99 015 69 99 1444 pub 6r Qd op SGP lt gt LE sr 136 SOvua ______ WV LE MOV Wav E OF Wdy 6 D3H 1SOH lt g 0135 Wav ras Wav 2136 Wav 18538 Wav Tv Wav Xov 18 Wav MOV LNI P ad AZ _ S6 19599 S 76 __ 5 2 vd S 2016 6 S 26 lt 16 488 06 312294 6 68 gt 88 lt 21 gt S 5 tG Vd S 20098 5 E 98 _ ei vd S 78 LYd S lt 60 gt Vd S 18 lt 0 gt 4 6 08 6L lt 50 gt 4 S 862 25 gt 123 225 6 54 _ lt 05 gt e 7 78 7 89 pub _ oo gt H Z
122. lt Fmain 12 gt section tfstruct Tun statement 1 78 j gj 1 to set a 79 ipr iprb uh 60x12 breakpoint 80 ipr iprb umi 3 81 ipr iprb um2 8x45 82 ipr iprb um3 6x67 Figure 4 68 Source Window source file present Windows Assembly Source Register Memory Stack Calle 4 10 3 Windows Register The Register window displays and modifies a group of registers for the current device To display registers for another device first make that the current device and open the Register window Multiple windows may be opened for each device A dialog box allows the selection of the register set to be displayed Each register window may display the registers for the core or any one peripheral Open Register Window Open Register Window Peripheral Peripheral core lel E OK Cancel Figure 4 69 Register Window Peripheral Group Selection 4 58 DSPADSUM AD MOTOROLA Graphical User Interface Windows Menu The selected registers core registers or registers for the specified peripheral are arranged in alphabetical order The window may be resized and scrolled to select which registers are displayed To view registers which are not conveniently displayed in one window at the same time open another window and adjust each one to the required range of registers The display is updated each time the device enters User mode and returns to Debug mode 1 To change a register click
123. memory The default display radix for registers and memory is hexadecimal The use of the values of hex A or B require the preceding the value otherwise the values will be evaluated as the contents of the registers A or B respectively Example 3 41 RADIX Command Examples radix 4 Display the default radix currently enabled radix h 27 Change default radix entry to hexadecimal Hexadecimal constant entries no longer require a preceding dollar 42 but any decimal constants will require a preceding grave accent 7 radix fa Change the default display radix for the long register a to display a fractional value whenever the a register is gt radix x 100 200 Enable the display 1 radix for X data memory block 100 to 200 to be unsigned when displayed on the gt screen 3 62 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 34 REDIRECT Redirect stdin stdout stderr for C Programs REDIRECT dev list STDIN OFF file REDIRECT dev list STDOUT STDERR OFF file A O C REDIRECT dev list OFF The REDIRECT command is used to redirect the stdin stdout stderr for C dE It allows the user to redirect stdin from a file and redirect stdout stderr to files No stream file redirection occurs while stream option is disabled See STREAMS command Section 3 6 37 on page 3 66 D Example 3 42 REDIRECT Command Examples NV TL A redirec
124. name desired M OK to open Cancel to dismiss Open folder is in next L Figure 4 2 Sun File Chooser Dialog or wildcard filter Directories c Mgui3 Scroll through Sex files or directories asiop2 lod 5 tgui3 C3 save Click on required file Select files to view from pull down list List Files of Type Drives OHF Files lod micron current directory above is path below is sub directories Select required drive Figure 4 3 Windows File Chooser Dialog Box 4 4 2 Multiple Operations Many operations may need to be performed several times in succession These include setting breakpoints specifying display radix for various memory areas etc To avoid navigating the menus each time the dialog box may be retained for repeated operations Under Windows such dialog boxes have three buttons usually labelled OK Apply Cancel Clicking on OK performs the operation and dismisses the dialog box Apply retains it for further operations When the Change Memory Memory Space s Start Address 1200 End Address Value 1364 0 01 Apply Cancel dialog box is no longer needed it must be dismissed by using OK on the last operation or Cancel No other GUI operations can be performed until the dialog box has been dismissed MOTOROLA DSPADSUM AD 4 5 Graphical User Interface
125. of the program counter on target DSP address 3 and prompt the user for a new value Subsequent or previous register values may be examined and changed using the up arrow key for the previous address and down arrow for the next address Change p 20 123456 Change the current default target RSR s p memory address hexadecimal 20 to hexadecimal 123456 change r0 r7 0 p 30 300 0 x fffe 55 100 Change the current default target DSP address s registers r0 to r7 to 0 memory addresses 30 hex to 300 hex to 0 address fffe hex to 55 hex and the program counter to 100 decimal Y change dvi 3 5 10 17 0 p 1000 2000 0 Change target I DSP addresses 1 3 and 5 registers r0 to r7 to 0 and their program memory addresses 1000 hex to 2000 hex to a value of 0 Change xdat xdat 5 35 Change memory block beginning at the address corresponding to symbolic label xdat and ending at xdat 5 to decimal value 35 3 32 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 12 a Memory Block COPY from dev num address block to address The COPY command copies memory blocks from one location to another The source and destination memory maps may be different This allows the user to move data or program code from one memory map to another or to a different address within the same memory map This command allows the copying of program or data blocks wit
126. on it once type in the new value and store the value with CR The new value will be displayed in red and the next register will be h highlighted for modification 9 Displays registers for core or peripheral for Current Device SS Single a select Type new value and CR to change Highlights Register values displayed in Stfffff d hexadecimal or radix set as red and selects next value to display radix Enter values in i 6000301 change specific radix or default radix 4 pee Mody Radas _ Scroll to view desired registers Figure 4 70 Register Window Windows Assembly Source Register Memory 4 10 4 Windows Memory 23 The Memory window displays and optionally changes the contents of memory Each memory window displays a contiguous block of memory from one of the address spaces Select the address space from a pull down list in the dialog box m Open Memory Window L Memory Space 50 0 ffff ye or yr depending upon address and omr values CX NY Figure 4 71 Windows Memory Dialog Box Resize the window to adjust the size of the memory area displayed The columns in the display adjust automatically to fit the width available The full range of the memory space selected may be viewed with the scroll bar To change memory click on a location enter the new value and
127. or Z 1 nit not less than NAN or Z or N 1 ordered NAN _ pl plus 0 un unordered 1 a The host computer program will evaluate the breakpoint expression when a breakpoint occurs and if there is not a test condition the user will be informed of the target having stopped If there is a test condition it must be true before the target is halted If the test condition is not true the user interface program will replace the original opcode at the breakpoint address single step through it replace it with the conditional breakpoint opcode and pass control of the processor back to the User mode from the Debug mode If a breakpoint is met during DSP program execution there are various actions which may be performed If no action argument is entered the default action is to halt program execution and display all enabled registers and memory blocks More than one action argument may be entered at once The valid action arguments available are listed in Table 3 8 ON 3 8 Breakpoint Actions Argument lt Action H execution this is the default In Increment counter variable CNTn n21 2 93 N m Note display the breakpoint expression and continue S 2 Show the enabled register memory set and continue T expression _ Test the expression within the parenthesis If the expression is true execute the actions following the expression otherwise continue prog
128. or macros or otherwise just advance one instruction and display the enabled registers and memory blocks next 10 Execute the equivalent of 10 NEXT instructions halting to display the enabled registers and memory blocks only after the tenth invocation M M 1 next 10 li Step over the 10 next source lines if there is a source file associated with the current program counter 3 56 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 30 OUTPUT Assign Output File OurPUT dev list file number OFF OUTPUT dev list file number address filename TERM rd rf rh ru 0 a c The OUTPUT command opens disk files that will accept data from the target DSP In order to do this the user must first open the file for output and assign an addre 8 where a DEBUG software breakpoint will occur Prior to executing the DEBUG instruction the user must load the register with the file number to write to and the transfer count value RO with the address of memory and R1 with the memory map type 0 1 2 2 Use of the keyword TERM assigns the output to the display NI rather than a file The output data is in ASCII and is expressed in hexadecimal rh unless decimal rd or fractional rf or unsigned ru radix is specified any number of files may be open for an target DSPs output up to the host computer limits M For file output it is ne
129. outside the device This is handled by Input and Output in the File menu Input associates a data file with a DEBUG instruction every time that instructi executed with the appropriate parameters the value returned to the programis provided by the data file Input from a file is directed to a memory location This simulated input represents a data stream so that each access gets the next item Each entry in the file can be read once and only once and can not be Simulated output is similar When a specified DEBUG instruction is executed a record is written to the output file consisting of the data value specified 4 5 11 Stream File Support Support is also provided for the basic stream files STDIN STDOUT STDERR program running on the DSP device may use these files and the IO will be handled by the host See File menu Stream to enable and disable stream IO and File menu Redirect to redirect the streams to files on the host system If stream support is disabled or the file accessed has not been the een is ignored Output is discarded no input is returned 4 512 Command and Session Windows There are two which are involved in most GUI operations Command W indow Most GUI operations generate commands which are passed to the debugger and stored in a history buffer that is displayed in the Command window Stored commands may be retrieved edited and _
130. pull down resistors so when the Debug mode is entered they will be in a deterministic state and not produce false clocks poms The hos computer must provide all clocks to the DSCK OS1 when reading or writing commands and data All serial data is clocked in on the negative edge while data is clocked out on the positive edge of the DSCK clock input The maximum rate of DSCK is 1 4 of the DSP internal clock rate When DR is asserted the DSP program controller completes the current instruction it is executing stores the contents of the pipeline registers and freezes the DSP program controller All program interrupt service requests are held in a pending state and the DSI OS0 and DSCK OS1 pins become inputs so data and commands may be transferred MOTOROLA DSPADSUM AD 5 21 Functional Description Communicating with the Target OnCE Port 5 8 3 OnCE Debug Acknowledge Signal Whenever the Debug mode is entered an acknowledge signal is transmitted out of the Debug Serial Output DSO pin This signal provides a means for synchronizing the host computer to the OnCE controller Figure 5 14 illustrates the timing protocol for the DSP56100 16 bit architecture The delay between the assertion of the DR and the transmission of the acknowledge signal can vary The DSP must complete the e current instruction being executed before entering the Debug mode Therefore if an external bus access is in progress and the DSP Bus Control Register i
131. radix r3 51 n3 n3 SFFFF pc 50042 sr 6314 onr 82 r2 ffff 2 SFFFF 2 SFFFF la FFFF 1 efff ri FFFF ni FFFF mi FFfF ssh FFFff ssl sp 488 r8 FFFF n8 FFFF 0 ipr 800000 ber pctl 5000000 Memory 3 chti 808000 cnt2 888888 cnt3 888888 cnt 000000 display oaf 080 30880580 508888 58008825 080525 06508 0 888 25 requested in 0bF080 000425 Sobroso 900425 IL Eu 5888425 86088 608425 856888 Next instruction 58642 66F008 888884 move x gt 4 r6 x F y size to execute Figure 4 19 Display Display Active Output 1 4 7 2 Display Display Memory Display UN Disassemble 1 List Register This menu selection controls the display of memory areas Evaluate Stack either immediately or as part of the post execution display Post execution display may be unconditional or conditional on the way in which memory has been accessed during execution 4 28 DSPADSUM AD MOTOROLA l Select display mode Memory Space 5 Start Address 4116 Display On Always display after execution Read Write Immediate Off Do not display End Address Immediate Display now 4 7 3 Display Display Registers The menu selection controls the display of registers either immediately or as part of the post exe
132. register may e considered to be an entity in its own right or a number of smaller registers that is a0 al and a2 Such registers require an element in the value array for the compound register and one for each of its component parts The value for the compound register is ignored Each of the component values is loaded thereby changing the value of the register The function returns OK on success _ otherwise Example D 20 dspd write core r gisters Write core registers include adsreg56 h include simcom h include driver h int devn status unsigned long core reg values 15 devn 0 B _ dsp pi delay 5980027 Allocate structures for device 0 a 56002 By write all core registers from buffer write core registers devn ADS 151 core reg values MOTOROLA DSPADSUM AD D 27 C Library Functions Library Function Descriptions D 3 21 dspd write memory Write to Memory in DSP Device include simcom h include driver h int dspd write memory device index mem space address count value int device index Index of DSP device affected by command int mem space Memory space to write unsigned long address Address of first location to write 22 M unsigned long count Number of locations to write Hon unsigned long value Pointer to area holding memory values dspd writ
133. store with CR The next location is selected for modification MOTOROLA DSPADSUM AD 4 59 Graphical User Interface Windows Menu Memory window Values shown in Display Radix Enter an address for displays one memory start of display area space for a device x Use filenames Dv0O Memory Winl p labels line Scroll To Address numbers and p 000001 a03f3b Sfdff38 ee29b7 memory addresses p 000004 5 6361 Sa3e0bd 007de4 1 M p 000007 windows for other p 00000a 97b4247 4 7a093b p 00000d f2ac87 9037573 T devices address Click to selecta _ location Type new e Enter new values in Default Radix or use value and to explicit radix specifier save and select next Figure 4 72 Memory Window Windows Assembly Source Register Memory Stack 4 10 5 Windows Stack LOW Y The Stack window displays the hardware stack It may be resized and scrolled to view as much or as little as regqired Dv00 Stack SSH SSL Drag gaps to S00ff002e 00c0031 4 adjust column 900feffff 500000020 width 500000000 500000000 Figure 4 73 Stack Window The hardware stack is used by the subroutine call instructions interrupt handling and by some other instructions In C procedures the return address is put on the stack by the JSR instruction but then removed and incorporated into the C stack frame Thus the return addre
134. symbolic debug information The symbol table consists of at least one fixed length entry per symbol yu some symbols followed by auxiliary entries of the same size Because of symbolic debugging requirements the order of symbols in the symbol table is very important Whereas an individual symbol table entry can completely describe a single debugging entity the entities exist within the framework of the source language that produced them For example symbol scoping and function blocks in C are represented by the appropriate ordering of begin end block entries in the symbol table Symbols in the symbol table appear in the sequence shown in Table B 11 11 COFF Symbol Table Ordering yJ Filename 1 Function 1 Local symbols for function 1 Function 2 Local symbols for function 2 Statics B 12 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components Filename 1 Function 1 Local symbols for function 1 Statics Defined global symbols Undefined global symbols Table B 11 COFF Symbol Table Ordering Continued N ia entry for each symbol is a structure that holds the symbol value its type and other information There are symbol table entries used for relocation and linking and there are special symbols used only for debugging The two kinds of entries are distinguished by combinations of field values in the
135. table and the library table Change the first available line of Third Party and User Drivers section to look like the following line An available line is one which has dashes in the first four entries Note that the last two entries are already set and are not to be changed The last entry is the major number for the device You may use a line which has 38 39 40 42 or 43 for the major number Make note of the number you choose as it is used in the next step Handle Type Mask Block Char Do not add this line u mdsp mdsp 1 1 1 major Find the alias table add the following line mdsp mdsp Find the driver library table add the following line mdsp libmdsp a Find the library table add the following line libmdsp a 0 MOTOROLA DSPADSUM AD 2 13 Preparation and Installation HP7xx to Command Converter Interface 6 Note Make a device file for the driver by executing the following hostname mknod c major minor The major and minor numbers of the device are given by major and minor respectively N is a user chosen device group number The ADS user interface software always defaults to device group 0 mdsp0 The lt major gt must be the same major number you used in the previous step The minor number is 0 450000 where S should be replaced by thec card slot number in which the card was placed 1 n For machines with a single slot th
136. to single value Begin execution on target DSP device Reset communications Read core registers from DSP device Read memory block from DSP device Read once registers from DSP device Reset specified DSP device Determine DSP status Write core registers to DSP device Write to memory in DSP device Write once registers from DSP device C Library Functions ADS Object Library Files D 2 2 4 DSP DEVICE SPECIFIC ROUTINES dspt masm mnemonic ops err dspt unasm XXXXX ops sr omr sdbp D 2 2 5 dsp cc Command Converter Interface Routines _ Assemble mnemonic string to ops Disassemble DSP opcodes es dsp_cc_fmem device mtype addr count value Fill Command Converter memory block f dsp cc go devn dsp ldmem devn loadfn dsp reset device dsp cc revision devn revstring dsp rmem device mtype addr value dsp cc rmem blk device mtype addr count value dsp cc wmem device mtype addr value dsp cc wmem blk device mtype addr count Start program on Command Converter Load Command Converter Mem from file Reset Command Converter Read Command Converter Monitor Revision ND A X N 7724 Read Command Converter Memory N Read Command Converter memory block Write Command Converter memory Write Command Converter memory block value N D 2 2 6 dsp ADS Interface Routines ds
137. update on the falling edge of TCK TDI is sampled on the rising edge of TCK 5 26 DSPADSUM AD MOTOROLA Functional Description JTAG Instruction Register There are two paths to the 16 state machine The 5 SCAN path is used to capture and load JTAG instructions into the instruction register The SHIFIT DR SCAN path is used to capture and load data into the test data registers The TAP controller will execute the last instruction decoded until a new instruction is entered at the Update IR state or until the Test Logic Reset state is entered All communication with the OnCE port is via the Select DR Scan path after the controller has decoded an ENABLE ONCE command 512 JTAG INSTRUCTION REGISTER 7 The DSP IEEE 1149 1 1990 implementation includes the three mandatory p blic instructions BYPASS SAMPLE PRELOAD and EXTEST and 1 four public instructions CLAMP HIGHZ IDCODE ENABLE OnCE The TAP controller contains a four bit instruction register The instruction is presented to an instruction decoder during the Update IR state Table 5 2 illustrates the four bits 5 83 0 ien ito decode sixteen instructions S Table 5 2 JTAG Tostritioh Register Encoding 2 1 gt Instruction 0 0 o EXTEST 0 0 1 SAMPLE PRELOAD 0 0 721 0 IDCODE 0 0 1 1 RESERVED 0 M 0 0 HIGHZ 0 LNA V0 1 CLAMP and BYPASS D 1 1 0 ENABLE_OnCE SM 4 1 1
138. using multiple host interface cards in your HP make multiple copies of this file in etc eisa changing the last digit of the file name on each copy Modity each copy to have the correct ID and PORT entries the ID entry should be the name of the file without the CFG extension Each PORT entry should be modified to contain the proper addresses for the additional cards that are supported 4 Run the EISA configuration program by typing hostname etc eisa config ils At the EISA prompt type add MOT0010 CFG slot num gt where slot num is the slot number in which the card is installed A Nd mid g If you have installed multiple host interface cards repeat the add command once for each configuration file and slot For example if you created a file IMOTO0011 CFG for a card in slot 2 and modified the PORT and ID entries in IMOTO0011 CFG to reflect the I O address of the card in slot 2 you would type 0011 2 to add that card to the EISA configuration information On machines with one EISA expansion slot the slot number is 1 44 44 477 Press 4 to quit the EISA configuration program and s to save 5 You must now edit the etc master file to include the ADS device driver Make a backup copy of etc master You will need to change one line and add three new lines in this file The entries will be in the Third Party and User Drivers the alias table the driver library
139. well as registers and memory to the previous definition saved i in the state filename If no filename suffix is specified adm is assumed If M is specified as the second 5 m the ADS interface program will load object file filename cld or lod without modifying the target DSP symbolic debug information If D is specified as the second parameter the ADS will load only the symbolic debug information from the object file filename The device memory contents are not altered Obr the COFF format files cld suffix are supported by this option If B is specified as the second parameter the third parameter must be an address offset which is added to the OMF data record start address where data is to be loaded The file must be in OMF and will be loaded byte wide sequentially incrementing the address counter on each byte load The low order byte will be loaded first and the high order byte will be loaded last in each word This is similar to the byte wide loading format of the bootstrap loader program on the DSP This feature allows users to download programs into RAM and debug bootloader or overlay programs 3 52 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions Example 3 32 LOAD Command Examples load source testloop lod Load testloop lod file from directory source load lasttest Load lasttest lod file from current directory If not found look for lastltest cld and Y load s lunchbrk Load l
140. with the system clock Exiting the Debug mode can only be achieved by a OnCE command or from the Reset state without the DR pin asserted The OnCE Status Control Register OSCR is used to enable or disable hardware breakpoints or the single step mode It also provides status information on how the Debug mode was entered 5 12 DSPADSUM AD MOTOROLA Functional Description OnCE Port Architecture 5 4 2 Program Controller Pipeline Information When the Debug mode of operation is entered the current state of the DSP pipeline is saved in three registers The Program Instruction Latch Register OPILR holds the next opcode to be executed when returning to the User mode of operation The host computer should immediately save this register when the Debug mode of operation is entered so the exact state of the program controller pipeline may be restored when to User mode _ 0 0 0 FN A DSCK OS1 050 CLOCK CTRS I STATE MACHINE OnCE CONTROLLER BREAKPOINT TRACE W REGISTERS amp LOGIC OPDBR TO OGDBR FROM Program Address Bus PROGRAM DECODER PAB FETCH COMMUNICATION T OPILR PABO H 5 PAB1 25 PAB2 SE sf DW OPADR 4 5 N PIPELINE NC INFORMATION FIFO Shift Reg PROGRAM CONTROLLER PROGRAM
141. 000 0 5000000 7 0000 0000 Sf 1 000000 0 5000000 r6 0000 n6 0000 m6 981 Figure 4 76 List File Window Note The whole file is read when the window is opened which may take some time with large files You may open as many List File windows as you wish This may be a convenient way of scanning source files Session window log files which may be viewed without first closing the log etc 4 62 DSPADSUM AD MOTOROLA Graphical User Interface Windows Menu 4 10 9 Windows Input Assembly Source Register Displays all simulated input which has been assigned for the current Memory device An Input window may be opened for each device Calls Watch List File Dv00 Input 1 Input file CATGUNRANDOM IO at address p c022 Nm 3 Input file CATGUI3Xerm0004 io at address 54172 Figure 4 77 Input Window 2 Vin o 9 d 4 10 10 Windows Output 22 A 7 Assembly lt b Source Register Displays all simulated output which has been mb for the current Memory gt Stack device An Output window may be opened for each device Calls Watch List File Input Dv00 Output 1 Output file term at address p 1447 3 Output file C TGUI3 T4R7 10 at address 51447 4 Output file CATGUISTRAGS IO at address 5 Figure 4 78 Output Window 4 10 11 W Assembly Source
142. 02 LEA lt 01 gt 01 60 11 MOVISOH 4M xd gt D m ELY sz LIV 6v 8v 5 9v SY 8 V 6 990290IN tz q 61 cea 81 _ 011 91 lt 0 gt SL eg Er Figure 6 7 JTAG OnCE Command Converter Schematic Rev 6 Page 4 of 5 6 27 DSPADSUM AD MOTOROLA 5305 dOVd ais ONlldnOO3GQ TviH3S H31H3ANOO 411 2 7 7 2661 66 96 61 21 uer 4 31 4180 1Sv1 YOLOANNOO H3MOd I mro 31101 955 1 geo 1 Do Xs mro T eio aNd aNd 4 mro 4 mro 51 dv Lo 4 mro 4 mro 1 1 859 159 T vO o T 20 SUA Jn8L 29 29 1V901 GND 3101 90d b 2 219 6 73 uas A A 40 Ho 14408 90d ZEZXYN 29 4 lt Tas A J v 90d 13309 99 vey 91 IH dnouo E Sey 2 1 PN XLS ein 3OVJH3INI or MOTOROLA
143. 1 0025 53 001 85 13 22 D 27 54 D 03 86 PA 15 23 29 55 D 05 87 PA 17 24 INTREQ6 56 5V 88 5V 25 003 57 D 07 89 PA 19 26 SIZ 0 58 D 09 90 21 22 SIZ 2 59 D 11 91 PA 23 28 INTREQ7 60 GND 92 GND 29 PA 00 61 D 13 93 PA 25 30 PA 02 62 D 15 94 PA 7 31 04 63 D 17 95 RESET 32 LERR 64 45V 96 12V 6 4 DSPADSUM AD MOTOROLA Host Computer Card Command Converter Support Information Host Computer Interface Cable 6 3 HOST COMPUTER INTERFACE CABLE The 37 pin cable which hooks to the host computer is called the host computer interface This cable provides the signals and power to the Command Converters MOTOROLA Table 6 3 Host Computer Interface Cable Pin Mnemonic Signal Name and Description 1 INT ACK Host ack of ADM service request 2 ADM GROUP CC group control flag from Host 3 5 Host ack of ADM data transfer request 006 4 ADM ALL Host signal which selects all ADMs 5 ADM RESET Host signal which asserts CC s reset 6 8 ADM SEL2 10 CC address select signals 2 0 for one of 8 CCs 9 HOST REQ Host signal which requests data 10 ADM REQ CC signal which requests Host data transfer 11 ADM CC ack of Host data transfer request 12 ADM INT CC service request status signal to Host 13 HOST service request signal to Host low true 14 ADM BRK Host signal to
144. 1 location This function also returns a flag that indicates whether or not the memory location exists It returns 1 if the location exists 0 otherwise The memory map parameter selects the appropriate dt memory structure from dt var mem for the selected device These structures are describe in the simdev h file which is included with the emulator The memory map parameter can be obtained with the function dsp_findmem by using the memory name as a key Use the emulator help mem command for a list of valid memory names The memory map enum is memory map concatenated with a valid memory name As an example memory pa refers to off chip pa memory on the 96002 device Example D 51 dsp rmem Read X memory location 100 from include simcom h include protocom h include coreaddr h unsigned long address unsigned long memval int devn int ok T Pa dsp devn 56002 Allocate structure for device 0 a 56002 address 1001 ok dsp_rmem devn memory_map_x address amp memval D 58 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 52 dsp rmem blk Read Block of DSP Memory Locations include simcom h include protocom h include coreaddr h int dsp rmem bik device index memory map address count return value int device index DSP device to be affected by command M enum memory map mem
145. 2 4 5 3 4 5 4 4 5 5 4 5 6 TAN 4 5 8 45 9 4 5 10 4 5 11 4 5 12 4 5 13 4 5 14 4 5 15 vi WSESSION GUI Session Window 3 86 WSOURCE GUI Source window 3 87 WSTACK GUI Stack 3 88 WWATCH GUI watch window 3 89 DEBUGGING C 5 3 90 C Debug 3 90 C Expressions 3 90 3 91 Compiling a Program for Debugging B92 C DEBUGGING COMMANDS are 3 92 EXAMPLE DEBUGGING SESSIONS 3 92 Binary Search NS ho rm 3 93 Recursive Binary Tree Traversal Example 3 96 INTRODUCTION TRE CUNT DINE 4 3 HOST SYSTEM 5 4 3 PLATFORM SPECIFICS Rhee oh dra 4 3 GENERAL WINDOW 4 4 File Chooser tc PM 4 4 Multiple Operations 3 4 5 MULTIPLE SELECTIONS poesis ea ERE 4 6 GRAPHICAL INTERFACE FUNCTIONS OVERVIEW 4 6 GUI Structure 4 7 Stating ADS 4 7 File 66655 4 8 Loading Object 4 8 _ Examining and Changing Memory 4 8 E
146. 244 TCK and TMS circuits similar Figure 5 6 Multiple JTAG Target Connections 1 534 Drive and Timing Considerations M The signals from the Command Converterare TDO TCK and TMS and TRST Signal TCK requires fast rise and fall times dictated by the TCK pin timing specification and consequently attention must be given to the drive capabilities of the circuits driving this signals There is no problem with TDO as each TDO output is connected to only one TDI input TMS need only be valid at the rising edge of TCK similarly there is no problem with TRST as the reset signal is not subject to the timing constraints of TCK There is a potential problem with driving the TCK circuit with a large number of target devices The problem is related to the rise and fall times of TCK caused by excessive capacitance which can cause communication problems with a single circuit connecting mop TCK input pins Acceptable transition times may be achieved for TCK by driving no more than four JTAG inputs from each buffered output This may be achieved with two configurations Figure 5 6 above shows one method Here in effect one track connects each of the TCK inputs A buffer is placed in circuit after at most each fourth input to restore the signal quality for subsequent inputs The propagation delay of the buffer is not significant 5 10 DSPADSUM AD MOTOROLA Functional Description Command Converter Card Figure 5 7 shows an
147. 4 gt amp Load The Preferences dialog box provides the 6 tion to save the window positions on exit Thus when restarting the GUI all windows will be Output restored to their positions on exit This may be used in two main ways Log Macro e If left checked each session will start with the About windows positioned as they were left at the end of the last Preferences session Alternatively if you prefer the windows to start arranged the same way each time arrange the windows check the save box and exit Restart and clear the check box Each time the debugger is started the windows will be arranged the way they were saved Preferences bT d X Save Window Positions On Exit Co Figure 4 17 File Preferences Dialog Box MOTOROLA DSPADSUM AD 4 25 Graphical User Interface File Menu 4 6 17 File Exit This option exits the debugger The Exit dialog box pops up to make sure you intended to exit This dialog box is also activated by other exit N 5 procedures Are you sure you want to quit EZ Figure 4 18 File Exit Dialog Box N M VM N O 1 y S V ME 4 26 DSPADSUM AD Path Load Save Input Output IO Streams IO Redirect Log Macro About Preferences MOTOROLA Graphical User Interface Display Menu 4 7 DISPLAY MENU Th
148. 4 7 12 Display Device This selection displays the status of each possible DSP device and lists the device types supported The configuration of each device is set with Modify Configure Session DEVICE STATUS TYPE unused unused unused unused unused unused unused Supported DSP family members are listed Figure 4 34 Display Device Output 4 7 13 Display Path This selection displays the search paths in the Session window Paths are established with File Path Set and File Path Add There are two types of path Display Menu Display Display Disassemble List Evaluate Call Stack Radix La Status of each _ is listed Display Display Disassemble List Evaluate Call Stack Radix Device Input Files The Working Directory is the main directory created with File Path Set It is used as the initial directory for all file chooser boxes Also whenever a file is created and the file name is specified without a directory the file is created in the working directory The Alternate Source Paths are only used when opening a file for read access when a file name is specified without a directory The working directory is Dv00 Session path Device Working Directory Alternate Source Paths C DSPCODE Figure 4 35 Display Path Out
149. 4ALS373DW USUI1 Texas Instrument 2 SN74ALS575DW 0101713 Texas Instrument 1 SN74ALS374DW U12 Texas Instrument 1 MC74F125D U14 Motorola 2 Resistors 100 R1 Bourns CR1206 1003 FVCA 1 10 R2 Bourns CR1206 1002 FVCA 2 mE Resistor Networks di 110 K0 8 resistor RN1 Bourns 4610X 101 103 _ pack common pullup 1 22 0 8 series resistors RN2 Brady 4816 P 001 220 1 220 10 series resistors RN3 Brady 4820 P 001 220 Capacitors 15 0 1 C1 C15 Murata GRM42 6COG104K050BL 2 100 16 17 Sprague 501D107M6R3LL Note Resistors are 5 1 4 w carbon unless otherwise specified MOTOROLA DSPADSUM AD 6 7 Host Computer Card Command Converter Support Information Host Computer Card Bills of Materials Table 6 66 ADS PC compatible Interface Hardware Parts List Rev 2 01 06 06 96 Oty Location Description Vendor Part Jumpers 1 JG1 5 row x 2 berg stick R N NSH 10DB S2 TG30 1 JG2 8 row x 2 berg stick R N NSH 16DB S2 TG30 Connectors 1 J2 AMP 37 pin SUB D Connector AMP 745097 1 Miscellaneous 1 PC Bracket Olsen 9007001 2 4 40 3 8 Screws 2 4 40 3 8 Nuts 1 Female Screwlocks AMP 205817 3 2 Molex jumpers Molex 15 29 1024 Table 6 7 37 Conductor Cable Assembly List Rev 2 0 11 01 95 Oty Description Vendor Part 2 AMP Mating Connector
150. 6 3 6 3 HOST COMPUTER INTERFACE 6 5 6 4 JTAG OnCE INTERFACE 6 6 6 5 HOST COMPUTER CARD BILLS OF MATERIALS Aus 057 6 6 COMMAND CONVERTER BILL OF MATERIALS 6 10 6 7 HOST INTERFACE CARD SCHEMATICS Ll 6 13 6 8 COMMAND CONVERTER CABLES AND SCHEMATICS 6 22 2 ae N 6 2 DSPADSUM AD MOTOROLA 6 1 Host Computer Card Command Converter Support Information INTRODUCTION Introduction This chapter provides the connector signal descriptions and parts lists for hardware that is required to run with the ADS software This list includes the host interface cards host interface cable and the Command Converter card 6 2 HOST INTERFACE CARD BUS SIGNAL DESCRIPTION M M 31 1 Each host interface card is designed for a unique host computer bus architecture This section gives each card edge connector description which is plugged into the host computer expansion bus This information is for reference only X Table 6 1 PC Interface J2 15416 Connector X Pin Mnemonic Signal Name and Description Al T OCHCK 2 9 D7 D0 PC Bus data bits 7 to 0 A10 I O RDY No Connect 11 PC BUS Address Enable output 12 21 19 10 No Connect A22 A31 A9 A0 PC Bus ad
151. 6 96 6 10 5 Parts List Rev 2 01 06 06 96 6 12 JTAG OnCE 14 Pin cabe Assembly Tm 6 12 Basic COFF File Structure 4 File Header i rmm B 5 File Header eite B 6 Motorola DSP Optional Link Header Format B 7 DSP Optional Runtime Header Format B 8 Section 9 section Header 5 10 Relocation Entry B 11 Line Number Entry Format B 11 Line Number Grouping B 12 DSPADSUM AD xxiii Table B 1 1 Table B 12 Table B 13 Table B 14 Table B 15 Table B 16 Table B 17 Table B 18 Table B 19 Table B 20 Table B 21 Table B 22 Table B 23 Table B 24 Table B 25 Table B 26 Table B 27 Table B 28 Table B 29 Table C 1 Table C 2 xxiv COFF Symbol Table Ordering B 12 Symbol Table Entry B 13 Fundamental 14 Derived TYPES N B 15 Storage E B 16 Storage Class and Value 6 1908 17 Section Symbol Auxiliary
152. 7PAJ221 1 1x4 Bergstik R N NSH 045B S2 TG30 1 2x7Bergstik J3 R N NSH 14DB S2 TG30 1 2x5 Bergstik J4 NSH 10DB S2 TG30 Sockets 1 24 PIN DIP Socket Ul RN ICE283 9 TG Switches 1 SPSTMOM SW1 51 _ Miscellaneous 4 Ruber Feet 1 7 Amatom 5186 4 3 4 NylonStandoffs HH Smith 4 4 40 x 1 4 Nylon Screws Waldon Table6 11 14 Pin Cable Assembly Oty _ Description Vendor Part 2 IDC Receptacle Connector Dupont 66432 014 AC 12 Flat Ribbon 14 Pin Cable Dupont 76825 014 1 Polarization Plug Dupont 465762 001 6 12 DSPADSUM AD MOTOROLA Host Computer Card Command Converter Support Information Host Interface Card Schematics HOST INTERFACE CARD SCHEMATICS 6 7 66 81 1 HO ADVd 01 LL d18V9 NAY 13 NOILVOIHaV4 I V IOWO LOIA ueijsisuoo 1snuJ 10129uu09 uonejuano L SALON seoejd Zg Buroedg 0 NAV Figure 6 2 37 Pin Host Interface Cable 6 13 DSPADSUM AD MOTOROLA 730 ssauaav wy 1SOH 9 YSI 1 7 4661 60 68 51 41 uer
153. 95 Wav 1199 wav 0146 wav Tv Wav _ LSOH 1SOH Wav Wavy 19539 wavy 215 wavy 113 wavy 0186 Wavy wavy LSOHY 1SOHH ud Wavy Figure 6 3 PC Compatible Interface Card Rev 2 0 Page 4 of 4 6 17 DSPADSUM AD MOTOROLA We 06 42 01 ilva 0704 LL PH S 051 61 8620 4121 9420 lt 0 gt SL 58624 LL 21 n Di 6624 0820 D 00 vd S lt 10 gt 4 S lt 20 gt 4 S gt Ted ee 18584 S INIA 195 101 Jes peel NI 5 LORIO LOO Dok eheee oN 222202 622 0 sin Figure 6 4 Sun Sparc SBus Interface Card Page 1 of 4 MOTOROLA DSPADSUM AD 6 18 Sre 06 52 21 609 SNAS aiva di lt gt 6 SIM 20S 1V 146 INI Wav
154. ADDRESS INTERFACE REGISTERS BUS FIFO Figure 5 9 OnCE Port Architecture MOTOROLA DSPADSUM AD 5 13 Functional Description OnCE Port Architecture Since the DSP is a pipelined machine there is no program counter in the DSP programming model Program flow is dictated by a program address generator so special registers are made available to give insight on where the program currently is The Program Address Fetch Register OPAFR holds the address of the opcode that was fetched for decoding and the Program Address Decode Register OPADR holds the address of the opcode that resides in the instruction latch These registers are read only and are not affected when in the Debug mode 5 4 3 Program Address Bus FIFO When programs are executing out of on chip Program RAM there is no Samal bus activity This is important for accessing multiple internal buses simultaneously during a single instruction cycle To provide better visibility into the user s program flow the last five addresses of DSP opcodes executed may be read from a FIFO circular buffer This FIFO is frozen when in the Debug mode and will not change unti re entering the User mode of operation The 8 bit command to read the FIFO automatically increments the FIFO pointer to the next location Successive reads will always give the oldest address first and the newest address last five registers should be read when addressing the FIFO so the pointer will alway
155. ADS Asoftware breakpoint is an instruction placed in the DSP code which when executed possibly conditionally for example if carry is clear places the device in Debug mode Software on the host then performs further checks and if satisfied performs the action specified for the breakpoint A software also be associated with end of file on simulated input e A hardware breakpoint involves circuitry built into the DSP monitors address lines etc and when the specified conditions are met places the device in Debug mode This monitoring involves no run time penalty Software on the host then performs further checks and if satisfied performs the action specified for the breakpoint 2 M Both types of breakpoint may have an associated count Tf specified the breakpoint i is ignored until the Nth occurrence This count is reinitialized each time execution is initiated There are several ways of specifying breakpoints The Source window displays the source code for the executing program double click on a line of code to set or clear a breakpoint There is no indication given in the Source window but the Command window shows the command to set the breakpoint or clear it and the corresponding address in the Assembly window will be highlighted blue to show the position of the breakpoint Similarly a double click in the Assembly window will set or clear a breakpoint on any instruction not just the start o
156. ADSUM AD 5 19 Functional Description Communicating with the Target OnCE Port 58 COMMUNICATING WITH THE TARGET OnCE PORT OnCE debug port registers are accessed via 8 bit command The 8 bit command contains the register address whether to read or write to that address whether to execute the opcode operand in the pipeline registers and whether to exit or stay in the Debug mode of operation There are two basic classes of registers in the OnCE port Registers port status and breakpoints will always be accessed with the intent to stay in the Debug mode and not to execute the opcode operand in the pipeline registers Registers associated with the pipeline are the only registers which are accessed when executing opcodes operands and exiting the Debug mode of operation T In order to retrieve or store information to target system memory the Command Converter must load opcodes and operands into the pipeline registers and execute them while still in the Debug mode Since the opcode and operand values may be loaded into the program instruction latch and program data bus latch it is possible to execute one instruction and then re enter the Debug mode of operation If the opcode operand is executed from the Debug mode the pipeline status registers will not be updated but if the opcode operand is executed from the User 4095 the pipeline status registers will change N 8 bit commands will be followed
157. Application Development Module connections a device argument is included in most of the commands This device argument designates which ADM Board or target DSP is to be addressed If no device argument is entered the default device will be addressed The user interface program will default to device number 0 upon entry but may be Shangoe to any one of eight possible default devices 3 2 1 ar Display Modification Commands There are six program data memory display change commands available which allow the user to ASSEMBLE ASM CHANGE COPY DISASSEMBLE and DISPLAY registers or memory A WATCH list may be used to display a variable whenever single stepping or program execution is halted 3 2 2 File VO Commands five program data file I O commands available which allow the user to INPUT or OUTPUT data to from a target LOAD macro assembler object module programs LOG commands and or display entries and SAVE program data memory to files MOTOROLA DSPADSUM AD 3 3 User Interface Commands Command Overview 3 2 3 Target Program Execution Commands There are eight program execution commands available which allow the user to set BREAK conditions in program memory instruct a target to GO to a program address and begin execution FORCE a reset or program halt on a target STEP x number of instructions before displaying register and memory changes and TRACE through a program one instructio
158. Break on X memory DMA access 32 bit ydma Break on Y memory DMA access MOTOROLA DSPADSUM AD 3 15 User Interface Commands Detailed Command Descriptions Table 3 3 JTAG OnCE Hardware Breakpoint Types DSP Break Type Meaning 16 bit pee Break on executed fetch only read only 16 bit pem Break on Program fetch or move r w or rw 16 bit Break on X address bus 1 access r w rw 24 bit pa Break on Program access r w or rw t 24 bit xa Break on X data memory access r w rw 24 bit ya Break on Y data memory access r w or rw gt 24 bit dma Break on DMA access r w Or rw Note Program fetches are always read only N WV in Note DSP56600 hardware breakpoint logic is the same as the DSP56300 m The number of simultaneous hardware Booi by on chip logic When more than one hardware breakpoint is set the last or highest breakpoint number with a hardware breakpoint set will be the one which i is set in the OnCE port The OnCE circuitry also allows the user to set conditional or unconditional software breakpoints to occur by using the special DEBUGcc instructions This allows the user to set as many breakpoints as required to debug algorithms User program execution is halted after the opcode is executed when a breakpoint occurs A breakpoint occurrence counter may be set so that from one to ffff occurrences of the breakpoint address es
159. C Increment ed end of file cute specified com Expression evaluated when break detected If false continue program if true continue break processing Specify address for breakpoint address source line no N Figure 4 60 Execute Breakpoint Set Software Dialog Box 4 9 6 Software Break Processing Before the target is placed in User mode for program execution the instruction at the breakpoint address is replaced with a DEBUG opcode If a conditional breakpoint is specified a conditional instruction is used such as DEBUGLE When the DEBUGcc 4 50 DSPADSUM AD MOTOROLA Graphical User Interface Execute Menu instruction is executed the target enters Debug mode The ADS program which has been polling the command converter detects the return of the target to Debug mode The expression is evaluated if false the target DSP is restarted if true count is checked and if the breakpoint has been encountered the correct number of times ignoring occasions when the expression was false the specified action is taken The count is then re initialized 4 9 7 Execute Breakpoints Set Hardware Set hardware breakpoint and specify action to be taken when breakpoint is met Available options will vary with DSP type type of breakpoint and action selected Breakpoints are y enabled when set and may be disabled Bre
160. DSUM AD Motorola DSP Object File Format COFF Object File Components Table B 16 Storage Class and Value Continued Storage Class Value A XDEF am Relocatable address A XREF String table offset to symbol name A SLOCAL Relocatable address N woo ULOCAL Relocatable address 7 A MLOCAL Relocatable address C HIDDEN Relocatable address A_FILE see below A_SECT String table offset to section name A BLOCK Relocatable address A MACRO String table offset to macro name n GLOBAL Relocatable address 2 _ If a symbol has storage class FILE or A FILE the value of that symbol equals the symbol table entry index of the next C FILE or A FILE symbol That is the C FILE and FILE entries form a one way linked list in the symbol table If there no more FILE or A FILE entries in the symbol t Eble the value of the symbol is the index of the first global symbol N Relocatable symbols have a value eid felocatable address of that symbol When the section is relocated by the linker the value of these symbols changes B 3 3 10 Auxiliary Entries Every symbol table entry may have zero one or more auxiliary entries These auxiliary entries are used to hold additional information about the primary symbol The number of auxiliary entries associated with a given symbol can be determined by examining the n numaux f
161. Display Watch Show displays the watch list N gt B Bu _ of expression List _ is output Note when f goes out of scope expressions Dv00 Session masked by another with reference the expression numbers gi 3 Expression out of scope Cannot be evaluated h 0141 Expression out of scope isl Figure 4 40 Papi Watch Show Output 4 7 19 Display Watch Add 23 Display Watch Add adds to the watch list Symbolic references are interpreted as Assembler mnemonics and register names unless the expression is in brackets The value of the expression is displayed by Display Watch Show or when execution terminates When a C variable goes out of scope the expression can no longer be evaluated Use Modify Up and Down to select an evaluation context Y WA Add Watch Expression i 6 Radix Select Decimal radix for ilgi i 100 Fractional display Floating Point lt Enter Unsigned expression for elu watch list Apply Figure 4 41 Watch Add Dialog Box 4 38 DSPADSUM AD MOTOROLA Graphical User Interface Display Menu 4 7 20 Display Watch Off This selection removes a Display Watch expression from the list As the dialog box only lists the reference numbers it may be helpful to use Display
162. Display Watch Add Dialog Box A a 3 4 38 Figure 4 42 Display Watch Off Dialog Box Qus M 4 39 Figure 4 43 Display Type Dialog Box ee A T DEEP 4 39 Figure 4 44 Display Type Output n ee eee eee Te 4 39 Figure 4 45 Display More Dialog Box Ee 4 40 Figure 4 46 Session Window Register View a 4 40 Figure 4 47 Session Window Assembly View MM 4 41 Figure 4 48 Modify Change Register Dialog 4 42 Figure 4 49 Modify Change Memory Dialog BOX 22s ou de eon oes redde 4 43 Figure 4 50 Modify Copy M s Dialog 4 43 Figure 4 51 u Modily Radix Set Default Dialog 4 44 Figure 4 52 Modify Padix Set Display Dialog 4 44 Figure 4 53 _ _ Modify Device Set Default Dialog 4 45 Figure 4 54 Modify Device Configure Dialog BOX 4 45 Figure 4 55 Modify Device Unlock Dialog Box 4 46 Figure 4 56 Modify Up Dialog 4 46 Figure 4 57 Execute Go Dialog 4 48 xviii DSPADSUM AD MOTOROLA Figure 4 58 Execute STEP Dialog Box 4 49 Figure 4 59 Execute Dialog 4 49 Figure 4 60 Execute Bre
163. E The ADS user interface program has eight special commands that allow the user to develop their own OnCE serial sequences These commands allow the user to CLOAD CSAVE CCHANGE CDISPLAY CTRACE CGO CFORCE or CSTEP through OnCE serial sequences Users have total control over the OnCE port They may wish to develop their own OnCE command sequences which they use in a system The Comma 22 Converter monitor and host computer user interface allows for dii oft sequences ese 77 Sequences consist of OnCE commands and data as described in the DSP user manual Sequences may read or write values to the OnCE registers in order to extract data from the target Sequences use a defined format so that the Command Converter monitor may know when data is to be read or written over the OnCE port Data that is read from the OnCE port is stored in the Command Converter X memory specified by a pointer in the X memory location 4 of the DSP56002 controller Data values that are read are stored in the upper 16 bits of the X memory 24 bit words Sa The 8 bit OnCE commands are stored in the upper byte of the Y memory 24 bit words with the lower byte value giving the appropriate action necessary to complete the 8 bit OnCE command For example when a OnCE read command is issued an acknowledge signal must be received to stay synchronized then the proper number of clocks must be issued by the controller to receive the data the target OnCE port
164. EMBLE command allows the user to review DSP object code in its assembly language mnemonic format All invalid opcodes will display DC for define constant The b byte wide parameter constructs the instruction words by taking one byte from each word of memory starting from the specified address Example 3 16 DISASSEMBLE Command Examples disassemble 7 Disassemble page of instructions pointed at by the user interface program disassembler counter of the current default target DSP address A counter maintains the last instruction disassembled so subsequent instructions may be disassembled by merely return to execute the same instruction again i disassemble 0 20 Disassemble program memory address block 0 to 20 of the current default target DSP address disassemble dv2 x 50 10 Neo SD Disassemble ten instructions of the target DSP address 2 starting at x memory map 50 hex disassemble lab 1 lab 2 Disassemble memory address block beginning at the address corresponding to symbolic label lab 1 and ending at lab 2 2 M disassemble b y 1000 40 Disassemble forty instructions starting at address y 1000 The instruction words are constructed by taking one byte from each location thus depending on the target processor two or three locations are required to hold each instruction word 2 3 36 DSPADSUM AD MOTOROLA User Interface Commands
165. ERFACE ur PPP 1 9 General Description T 1 9 Command Entry 1 9 Display V 1 10 GETTING 5 m NS ec ie ewe was 1 11 9 ES M DSPADSUM AD MOTOROLA General Information Introduction 11 INTRODUCTION The Motorola Application Development System ADS is a four component development tool for designing real time signal processing systems The ADS consolidates complex hardware and software development tools within a low cost workstation environment using a well supported Operating System By providing a solid foundation for application development and test the ADS significantly Sem development costs and time to market The versatile ADS not only allows rapid initial development but also supports comprehensive testing of prototype designs The four ADS components are 13 Lol Host Bus Interface Board There are two types of boards available 16 bit ISA bus for PC compatibles and HP7xx workstations and SBus for Sun and SPARC workstations Ws Command Converter CC This is a universal that all ADMs Control Development and Debugging Software This software is available in several versions DOS compatible 6 0 or later Windows compatible 3 1 or later and Windows95 Sun OS compatible Rel 4 1 1 or later Solaris compatible Rel 2 5 or later and HPUX
166. Entry TS M B 19 Section Symbol Auxiliary Entry 42 D B 19 Relocatable Buffer Overlay Auxiliary Entry z Y 20 Tag Name Symbol Auxiliary TTD B 20 End of Structure Entry 2 TT B 21 Function Symbol Auxiliary Entry a B 21 Array Symbol Auxiliary B 22 End of Block or Function Auxiliary Entry B 22 Beginning of Block or Function Auxiliary B 23 or Enumeration Name Auxiliary Entry B 23 CORE ADDR Format eee B 24 Mapping Enumerations B 25 Motorola DSP COFF Byte B 26 S Record Fields rero _ C 3 S record 4 DSPADSUM AD MOTOROLA SECTION 1 GENERAL INFORMATION MOTOROLA DSPADSUM AD General Information w 1 3 1 1 3 2 1 3 3 1 4 1 5 1 5 1 1 5 2 1 5 3 1 6 1 2 INTRODUCTION EMEN aed 1 3 GENERAL DESCRIPTION 1 4 OPERATING ENVIRONMENT 1 6 Requirements 1 6 Hewlett Packard HP7xx Workstation Requirements 1 7 4 or Compatible Workstation Requirements M UE ADS SOFTWARE 5 uc NS TEXT BASED USER INT
167. Figure 6 7 JTAG OnCE Command Converter Schematic Rev 6 Page 5 of 5 DSPADSUM AD 6 28 APPENDIX MOTOROLA DSP OBJECT MODULE FORMAT OMF MOTOROLA DSPADSUM AD A 1 Motorola DSP Object Module Format A 1 2 RECORD DEFINITIONS 2 1 Start Record 2 2 End 2 3 Data Record 2 4 Blockdata Record A 2 5 Symbol 2 6 Comment Record A 3 OBJECT MODULE FORMAT EXAMPLE N 2 2 DSPADSUM AD MOTOROLA Motorola DSP Object Module Format Introduction A 1 INTRODUCTION The Object Module Format OMF produced by the DSP cross assembler is an ASCII file consisting of variable length text records Records may be defined with a fixed number of fields or contain repeating instances of a given field such as instructions or data Fields within each record are separated by whitespace characters blank tab form feed newline The general format for a DSP OMF record is illustrated below ws represents whitespace _ lt TYPE gt lt ws gt lt fieldl gt lt ws gt lt field2 gt lt ws gt lt fieldn gt Every record starts with Type Definition Field which begins with an underscore _ character For records with repeating fields the underscore character indi
168. GENERAL INFORMATION HARDWARE INSTALLATION USER INTERFACE COMMANDS MENE ADS GRAPHICAL USER INTERFACE FUNCTIONAL DESCRIPTION HOST CARD COMMAND CONVERTER MOTOROLA OBJECT MODULE FORMAT OMF 8 MOTOROLA OBJECT FILE FORMAT COFF MOTOROLA S RECORD INFORMATION C LIBRARY FUNCTIONS INDEX BEBB GENERAL INFORMATION HARDWARE INSTALLATION USER INTERFACE COMMANDS ADS GRAPHICAL USER INTERFACE FUNCTIONAL DESCRIPTION HOST CARD COMMAND CONVERTER MOTOROLA OBJECT MODULE FORMAT OMF MOTOROLA OBJECT FILE FORMAT COFF MOTOROLA S RECORD INFORMATION C LIBRARY FUNCTIONS INDEX DIGITAL SIGNAL PROCESSOR DSP y L Application Development System ADS User s Manual Motorola Incorporated Semiconductor Products Sector Wireless Signal Processing Division 6501 William Cannon Drive West Austin TX 78735 8598 This document and other documents can be viewed on the World Wide Web at http www motorola dsp com OnCE is a trademark of Motorola Inc c MOTOROLA INC 1989 1997 a Order this document by DSPADSUM AD Motorola reserves the right to make changes without further notice to any products herein to improve reliability function or design Motorola does not assume any liability arising out of the application or use of any product or circuit described herein neither does it convey any license under its patent rights nor the rights of others Motorola pr
169. J J Close the Session window M 95 m NaS 3 86 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 58 WSOURCE QGUI Source window WSOURCE dev list OFF WSOURCE is a GUI command that opens a Source Code window Multiple device windows may be opened for debugging target systems with multiple DSPs Example 3 66 WSOURCE Command Examples d WSource Open a Source window for the current device WwSource Close the Source windows for the current device MOTOROLA DSPADSUM AD 3 87 User Interface Commands Detailed Command Descriptions 3 6 59 WSTACK GUI Stack Window WSTACK dev list OFF WSTACK is a GUI command that opens a Device Stack window Multiple device windows may be opened for debugging target systems with multiple DSPs 1 Example 3 67 WSTACK Command Examples wstack Y A Nd Open a Stack window for the current device M CS wstack off Close the Stack window for the current device Wen M k 4 A CC T 2 3 88 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 60 WWATCH GUI watch window WWATCH dev list win num wn radix reg addr expression WWATCH dev list win num wn OFF WWATCH is a GUI command that opens a Watch window Multiple device windows may be opened for debugging target sy
170. Menu 4 8 8 Modify Device Unlock The development system may contain hidden device types A password is required to activate such devices A password is not required for devices which are not hidden Unlock Device Type Device Type 56001 _ Change Register Change Memory Copy Memory Radix Set Default Configure Unlock Enter password OK If valid the device type appears in selection lists Bm Password E Enter device type to unlock DL47 2Px Figure 4 55 Modify Device Unlock Dialog Box 4 8 9 Modify Up Modify Down _ Change Register Change Memory Copy Memory Modify Up and Down are used to select the context to be used for evaluating C expressions with Display Evaluate Display Watch and the Watch window The potential problem arises because of the rules of scope for C Since each function can have its own variable 414 it may be necessary to specify which function s i14 is to be referenced As each function 1 is called a stack frame is created containing the variables belonging to that function The stack frame for the current function is stack frame 0 the calling function has frame 1 and so on back to the main program at frame 7 Display Evaluate returns the value which would be returned at the current execution point If the expression refers to a variable in a calling function which is masked b
171. Motorola DSP Object File Format COFF Object File Components Table B 13 Fundamental Types Continued Mnemonic Type T DOUBLE Double word floating point T STRUCT Structure T UNION Union T ENUM Enumeration T Member of enumeration T UCHAR Unsigned character T USHORT Jnsigned short T UINT Insigned integer T ULONG Insignedlong B 3 3 8 Symbol Type The type field in the symbol table entry contains information about the basic and derived type for the symbol This information i is generated by the compiler and assembler only if the G debug option is used Each symbol has exactly one basic or fundamental type but can have more than one derived type The type information is encoded as sets of bits in the field Bits 0 3 hold one of the fundamental type values given in Table B 13 Bits 4 15 are arranged as six 2 bit subfields These subfields represent levels of the derived types given in Table B 14 Table B 14 Derived Types Mnepvonic Value Type 1 DT NON 0 No derived type Lo 4 S 2 DT PTR 1 Pointer 0 2 Function DT_ARY 3 Array As an example of encoding fundamental and derived types consider a function returning a pointer to a character The fundamental type is character giving bits 0 3 of the symbol type field the value 2 Bits 4 5 would hold 2 for the derived type of function and bits 6 7 would contain a 1 for the p
172. NE SHELL SHUTDOWN 1 Change to the root directory with the following command hostname cd 2 Enter this command to initiate shutdown hostname etc shutdown h 0 2 10 DSPADSUM AD MOTOROLA Preparation and Installation HP7xx to Command Converter Interface 3 When the message Halted you may now cycle power appears you may safely turn off the power to your workstation 4 Goto step 1 of Section 2 5 1 3 2 5 1 3 ISA Card Installation The following steps should be used to install the ISA card 2 Remove the power supply cover plate see Figure 1 below located on the rear of the unit and marked TO ACCESS EISA PULL THIS HANDLE gently slide the EISA Adapter Card Assembly hereafter called assembly out of the unit 3 Remove the blank EISA slot cover from the assembly The cover is simply a piece of metal that covers the hole when there is no card installed and i is held in place by a single screw Be sure to save this screw as it will be used to secure the card 1 Remove the power cord from both the wall socket and the unit 4 Carefully slide the ISA card into the assembly making sure that the connector pins on the assembly meet up properly with those on the card and that the cable socket is positioned fully within the hole Use the screw saved from the previous step to securely attach the card to the assembly 5 Carefully slide the assembly back into the unit Press firmly on all four co
173. OFF Memory The Save Memory COFF Memory menu items save the contents of a single memory block into DSP or ASCII OMF files that can later be reloaded with the ADS or in any other environment where such files may be used A dialog box is used to specify which area of memory is to be written by _ specifying the memory space P X Y etc and the address range A separate operation is required for each memory space to be saved complements Load Input Output Both the OMF and Click here to enter the required file COFF options open name manually Device and path the SAVE Memory may be specified If omitted will dialog box use working directory or alternate Source path Select the 300 Memory space from the Wenn pull down list Tab to or click on Start Address End Address the address range fields and enter the 4E00 S4EFF memory range to be 1 chooser Enter file name M 2 irectl i directly ie spec y Be Select new file name tgui3 Te directories from 2 list by Double click on ae requ ired file ave File as Type Drives _ Single click and OMF Files micron 10 Another dialog box will open to i i 2 2 S
174. OLA 9138 10 1 H31H3ANOO 7 1661 18 56 41 21 ONIMVHO _ 830 1 NIL3S3H INN OGON VOHIA GOW 2 22 10039 WX 1 3 89 104 99d Sod 0d 9 220 6ta DSP56K2PV XIWN OQON dSOul adOlN VOHINGON MOLS NOLS MOLS MOL 0L 2182 6H 2 RESETOUT WI AN V 978 YHL NVV yp 1as34 ZH 110 719 1SH SSG3N f d 3 430 NIL3S3H AOL 0L Hv 12 Figure 6 7 JTAG OnCE Command Converter Schematic Rev 6 Page 1 of 5 MOTOROLA DSPADSUM AD 6 24 8402 c 9A3H 1 QNVAWOO n 1661 90 46 41 1 UEP 1 ONIMVEG ay 149
175. OLA DSPADSUM AD 1 9 General Information Text Based User Interface The ADS user interface software searches for the macro command filename default cmd extension The macro command file is a text file that should contain a sequence of commands that the user wishes to execute Macro commands may be nested a macro command file may call another macro command file to any level Macro command files may be conveniently created by enabling logging of command entries This procedure is explained in the documentation of the LOG command Once a valid command is entered it is stored in a holding buffer for repeated execution To execute the previous valid command the user need only type the Enter or Return key CM Command line editing is supported for command entry corrections The cursor may be moved on the command line by using the Left Arrow and Right Arrow keys The Back Arrow key on the upper right of the keyboard will backspace and delete the previous character The Del key will delete the following character The Ins key may be used to toggle between insert and overwrite modes of character entry The Ctrl C or Ctrl Break keys may be used to abort the execution of a display command The Ctrl S key allows the current screen output to be frozen for closer examination The Ctrl X key acts as a toggle to disable or enable Command Converter service requests Disabling Command Converter service requests freezes execution of multiple show or no
176. OROLA 1 3 2 General Information Operating Environment Hewlett Packard HP7xx Workstation Requirements The minimum hardware requirements for the ADSH User Interface Program include HP7xx Workstation running HPUX Version 9 x 10 x is not supported CD ROM drive Hard drive with 8 M bytes of free space f Mouse and keyboard One expansion slot 28 L 1 3 3 Sun 4 or Compatible Workstation Requirements AX The minimum hardware requirements for the ADSF User Interface Program include SUN Operating System Release 4 1 1 or later or SOLARIS Release 2 5 or later CD ROM drive Hard drive with 8 M bytes of free space M EN Mouse and keyboard NOS V One SBus expansion slot MOTOROLA DSPADSUM AD 1 7 General Information ADS Software Features 14 ADS SOFTWARE FEATURES Single Multiple stepping through DSP programs Source level symbolic debug of assembly and C source programs Conditional or unconditional software and hardware breakpoints Program patching using a Single Line Assembler M Session and or Command Logging for later reference Po Loading and Saving of files to from ADM Memory Macro command definition and execution Display Registers and Memory Wo Debug commands which support Multiple DSP development e Hexadecimal Decimal Binary Fractional Floating Point calculator Multiple Input Output file access from DSP object programs
177. OROLA User Interface Commands Detailed Command Descriptions 3 6 50 WCOMMAND GUI Command Window OFF WCOMMAND is a GUI command that opens the Command window Only one Command window may be opened even for debugging target systems with multiple DSPs The Command window is shared between target DSP devices All affect the current default device unless specifically addressed to other device s prompt on the command entry line indicates the current default device Example 3 58 WCOMMAND Command Cup P wcommand N Open Command window WCOrmand Off Close the Command window e un NND MOTOROLA DSPADSUM AD 3 79 User Interface Commands Detailed Command Descriptions 3 6 51 WHERE GUI C Calls Stack Window WHERE dev list n WHERE is a GUI command that displays the C function call stack Multiple device windows may be opened for debugging target systems with multiple DSPs Example 3 59 WHERE Command Examples die where Display the stack gt where 3 i Display the three innermost frames in the call stack Wee Where 5 7 7 Display the five outermost frames in the call stack s N T 3 80 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 52 WINPUT GUI File Input window WINPUT dev list OFF WINPUT is a GUI command that opens a
178. Object File Format COFF Object File Components B 3 3 10 6 Arrays The format for C language array auxiliary entries is given in Table B 23 The tag index contains the offset to the next array symbol in the symbol table The line number field gives the source file line number for the array declaration Table B 23 Array Symbol Auxiliary Entry Bytes Declaration Name Description 0 3 long int x tagndx Tag index 4 7 unsigned long x Inno Line number of array declaration 8 11 unsigned long x size Size of array 12 15 unsigned long x dimen 0 First array dimension 16 19 unsigned long x dimen 1 Second array dimension 20 23 unsignedlong dimen 2 Third array dimension 24 27 unsigned long dimen 3 Fourth array dimension 28 31 Unused zero filled B 3 3 10 7 End of Blocks and Functions The format for C language symbol entries for the end of blocks and functions is given in Section B 3 3 10 8 Beginning of Blocks anc Functions on page B 23 Only the source file line number for the end of the block or function i is stored Table B 24 End of Block or Function Auxiliary Entry Bytes Declaration Name Description 0 3 Unused zero filled 4 7 unsigned long x Inno Source file line number 8 31 Unused zero filled 22 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components
179. Open thes system unit Be sure to attach a grounding strap to your wrist and to the metal casing of the power supply Follow the instructions supplied with your system to gain access to the SBus slots 3 Remove the SBus slot filler panel for the desired slot from the inner surface of the back panel of the system unit Note that the Motorola SBus ADS Interface board is a slave only board and thus will function in any available SBus slot 4 Slide the SBus board at an angle into the back panel of the system unit Make sure that the mounting plate on the SBus board hooks into the holes on the back panel of the system unit 2 8 DSPADSUM AD MOTOROLA Preparation and Installation SUN 4 to Command Converter Interface 5 Push the SBus board against the back panel and align the connector with its mate and gently press the corners of the board to seat the connector firmly 6 Close the system unit 7 Connect the 37 pin ADM interface cable to the SBus ADS Interface board and secure 8 Turn power on to the system unit and check for proper operation M 2 4 2 Software Installation S Note In the instructions that follow ADSxxx represents the name of your particular system such as ADS56000 ADS96000 etc ne in The distribution CD included with the ADS package contain SBus device driver for the ADS as well as the ADSxxx user interface program for the ADS The following steps will allow you to install the
180. S This allows the user to inspect the command output before it is destroyed The command argument C continue RM oes to return to the ADS without prompting the user This may be useful in macro commands allowing system commands to be used without requiring operator intervention N 1 3 46 SYSTEM Command Examples Sa system Temporarily exit the ADS interface program and go to the Operating System To re enter the ADS interface program invoke the EXIT command previous setups will not be altered System dir Invoke the directory Operating System command from within the ADS Interface program system _ dir io del he de Ne Create a MS DOS and temporarily exit the ADS user interface program Execute two MS DOS commands and re enter the ADS user interface program using the EXIT command The current state as well as opened files of all target DSP addresses will remain the same System del e temp lod Delete the specified temporary files and continue without issuing the continuation prompt MOTOROLA DSPADSUM AD 3 67 User Interface Commands Detailed Command Descriptions 3 6 39 TRACE Trace Through DSP Program TRACE dev list count source lines instructions 1 The TRACE command gives a snap shot of each instruction during program execution This single stepping capability displays the enabled registers and memory blocks
181. SP D 26 dspd_write_cor MUS SR Core Registers to DSP N 27 dspd write memory Wfite to Memory in DSP Device 0 28 dspd write once _registers Write OnCE Registers to DSP Device M i Ben ea ee D 29 dspt_masm _xxxxx Assemble DSP Mnemonic D 30 dspt_unasm_ xxxxx Disassemble DSP Mnemonics D 31 dsp_alloc Allocate Memory D 32 dsp fmem FIll Command Converter Memory with a Value D 33 dsp_cc_go Start Command Converter Program Execution D 34 dsp 1dmem Load Command Converter Memory from D 35 _reset Reset Command Converter D 36 cc revision HRead Command Converter Monitor 211 a ek d e fee D 37 dsp_cc_rmem Read Command Converter Memory D 38 dsp bik Head Command Converter Memory be D 39 dsp wmem Write Command Converter Memory D 40 dsp wmem blk Write Command Converter Memory ho TTC TITO DOTT D 41 dsp check service request Check for Service Request 0 42 MOTOROLA DSPADSUM AD xiii D 3 36 D 3 37 D 3 38 D 3 39 D 3 40 D 3 41 D 3 42 D 3 43 D 3 44 D 3 45 D 3 46 D 3 47 D 3 48 D 3 49 D 3 50 D 3 51 D 3 52 D 3 53 D 3 54 D 3 55 D 3 56 D 3 57 D 3 58 D 3 59 D 3
182. Screen Buffering One Level D 77 simw_unnest Decrease Screen Buffering One Level PE D 78 simw winit lnitialize Window Parameters D 78 simw_wscr Write String and Logging tenens D 78 NON DISPLAY EMULATOR PUES b od ait D 79 Creating a New Device ME D 80 Loading Program Code or Device State D 80 Executing Device Instructions m D 81 Testing Breakpoint 5 D 81 MULTIPLE DEVICE EMULATION Y n D 83 Allocation and Initialization of Multiple Devices D 83 Controlling Multiple DSP Devices eee Te eee D 83 Multiple DSP Emulator Display D 84 RESERVED FUNCTION NAMES D 85 EMULATOR GLOBAL 5 D 85 MODIFICATION OF EMULATOR GLOBAL STRUCTURES D 86 MOTOROLA DSPADSUM AD Xv LIST OF FIGURES Figure 1 1 Application 4 1 4 Figure 1 2 Target Circuit eM 1 4 Figure 2 1 PC compatible Interface Card Jumper Group 2 2 4 2 2 HP 7xx Chassis Rear 7 2 11 Figure 3 1 Interactive Assembler Dialog Box D 3 13 Figure 3 2 Interactive Change Dialog Box lt X Ln 3 32 Figure 4 1 Main Window for Sun SPARCstation 2 ark bare 4 4 Figure 4 2
183. Streams lists the stream files and the assignments to files on the host Use of File IO Redirect to redirect STDOUT redirect stdout d6pir4 so 7 streams _ Stream Status Figure 4 37 Display IO Streams Output Dv00 Session streams enabled redirect stdin off stdout to C TGUI3 d6pir4 so stderr off _ Redirected IO Streams 4 36 DSPADSUM AD MOTOROLA Graphical User Interface 4 7 16 D Display Log Files All activity in the Command and Session windows may be written to log files There is only one Command log but may be a Session log for each device If command activity for different devices is to be logged separately the old command log must be closed before the command log for the new device can be opened Display Log Files displays a summary of the logging status Dv00 Session commands to session to From File Log to open the log files From Display Log to show open log files Note commands to session to Figure 4 38 Display Log Files Output amp Display Menu Display Display Disassemble List Evaluate Call Stack Radix Device Path Input Files Output Files Redirected IO Streams 10 Streams Status Log Files not listed i is closed y 4 7 17 reakpoints Ea bs RN Disassemble List This selection displays all breakpoints set for the current device
184. Sun File Chooser Dialog Box E net 4 5 Figure 4 3 Windows File Chooser Dialog Box Em 4 5 Figure 4 4 GUI Interface to ADS LE 4 7 Figure 4 5 File Path Set Add Dialog zo 4 14 Figure 4 6 File Load Memory COFF Memory OMF Dialog Box 4 15 Figure 4 7 File Save Memory COFF Memory OMF Dialog Box 4 16 Figure 4 8 File Load State File Save State Dialog Box 4 17 Figure 4 9 7 File Input Open Dialog BOX 4 18 Figure 4 10 4 File Input Close Dialog 4 19 Figure 4 11 File Output Open Dialog 4 20 Figure 4 12 File IO Redirect Dialog Boxes 4 21 Figure 4 13 File Log Commands Dialog 4 22 xvi DSPADSUM AD MOTOROLA Figure 4 14 File Log Commands Dialog 4 23 Figure 4 15 File Log Close Dialog 4 24 Figure 4 16 File About Dialog 4 25 Figure 4 17 File Preferences Dialog c A 4 25 Figure 4 18 File Exit Dialog Box Ner 4 26 Figure 4 19 Display Display Active 2 e 4 28 Figure 4 20 Display Display Memory Dialog Box een gt 4 29 Figure 4 21 Display Display Registers Dialog T AZ
185. a host computer bus interface card The Command Converter consists of a program written in DSP56002 assembly language which interacts with the host computer bus interface card and the target OnCE port It should be noted that older versions of Motorola DSP products use the OnCE port protocol while newer versions of Motorola DSP products use the IEEE JTAG 4 wire protocol to interact with their OnCE port New versions of the Converter support both OnCE and JTAG protocols Mes Y gt Commands entered from the host computer s keyboard are parsed and a series of low level command packets are sent to the Command Converter The Command Converter translates these low level command packets into serial sequences that are transferred to the target DSP via its OnCE port The OnCE port provides the necessary control to the target so programs may be loaded or saved registers read or modified and hardware breakpoints set or cleared The host computer interface is designed to communicate with as many as eight targets This requires a special software protocol to avoid data collisions between one target and another The purpose of this section is to describe the subsystem components of the ADS to give a better understanding of the communication link between the user and the target DSP 5 2 HOS TEN HARDWARE The host computer hardware interface provides the communications link between the user and the Command Converte
186. a leading 0X or trailing The address is the range 000000000 FFFFFFFF C X B NM E A 2 3 Data Record 2 Format _DATA Memory space Address Code data 225 The Data record is used to load values based on the specifier in the memory space field The Memory Space specifier is a single character representing the memory space to be loaded X Y L or P The character may be upper or lower case although the assembler guarantees upper case output The address is an ASCII hex value indicating where to begin loading in the specified memory space It contains only hex digits 0 F with no leading or trailing radix characters The range of the address is 00000000 FFFFFFFF A variable number of ASCII hex values to load follows the starting address These values are in the same format as the load address that being hex digits only with no radix indicator The range of the values is between 0 and FFFFFFFF The list ends when a field is read with an underscore in the first character position signaling the start of a new record 4 bo y In the case of Data records with L space memory specifier the data values will be paired high low such that the first data value in the pair will be loaded into the X memory space and the second data value will be loaded into Y memory space MOTOROLA DSPADSUM AD A 5 Motorola DSP Object Module Format Record Definitions A 2 4 Blockdata Record Format
187. able is not designed to draw more than 2 amps current at 5 volts Since each Command Converter draws approximately 250 milliamperes it is safe to power all 8 units via the cable but the target systems must be powered by a different source to insure correct operation MOTOROLA DSPADSUM AD 5 5 Functional Description Command Converter Card 8 bit DATA BUS host computer and Command Converter ADM SELO ADM SEL1 ADM SEL2 address select gt HOST REQ HOST ACK INT ACK host computer handshake 2 5 o 55 E m 2 ADM REQ ADM ACK Command Converter handshake 5 8 je so 8 g ADM_BRK ADM_RESET host computer control 8 p m M c 89 5 2 ADM INT HOST_BRK Command Converter service request A V gt foo 5 V Ground Command Converter power gt Figure 5 2 37 Host Computer Ir Interface Cable 53 COMMAND CONVERTER CARD The Command Converter is based on a DSP56002 which uses its on chip resources to minimize and simplify the interface to the target OnCE debug port Communication with the host computer is via the DSP56002 Port B or the SCI port while the serial interface to the target DSP is via the DSP56002 SSI port Each Command has a unique address ranging from 0 to 7 This allows the user to debug multiprocessor systems where as many as eight Command Conv
188. affected by command int reg num First once register to read unsigned long count Number of registers to read unsigned long value Pointer to area to receive register values J dspd read once registers reads count registers starting from register reg num from target device device index and stores the values i in the memory pointed to by value N V gt The order of the registers is specified in the header file _ Calling order is important read once registers must be called before calling dspd read core calling order is reversed the values in the OnCE registers will have been altered The function returns DSP OK on success DSP _ERROR otherwise Example D 17 dspd read once registers Read once registers include adsreg56 h include simcom h include driver h int devn status unsigned long count buf count core buf_core ADSCORI devn 0 2 dsp new devn 56002 Allocate structure for device 0 a 56002 count 15 Count core ADSCOREMAX status dspd read once registers devn OSCR count once buf once status dspd read core registers devn ADS A count core buf core D 24 DSPADSUM AD MOTOROLA C Library Functions Library Func
189. after each instruction until count instruction or C source lines are decremented to zero To execute an instruction requires exiting the Debug mode of operation and entering the User mode of operation so that the instruction pipeline may be restored and any result of the traced instruction and subsequent instructions update the pipeline and machine state Note The address of the instruction that is to be traced is in the OnCE Address Decode Register If the program counter is changed before a TRACE or STEP command is issued the address ofthe program counter register will point to the instruction to be traced When single stepping through the BRKcc instruction and the is true instruction immediately following the BRKcc instruction is displayed by the ADS but is be executed Instead the DSP correctly executes the instruction at LA 1 Single stepping a Tcc REPcc or REP instruction with initial loop counter equal to zero may cause incorrect DSP operation N The main difference between the TRACE and STEP commands is the OnCE port trace counter is armed to trace one instruction in the Trace mode The STEP command arms the trace counter with the count instructions to be executed in real time before re entering the Debug mode of operation and displaying enabled registers and memory ane 3 47 TRACE Command Examples trace Execute one instruction and display the enabled registers and memo
190. akpoint Set Software Dialog 4 50 Figure 4 61 Execute Breakpoint Set Hardware Dialog Box 4 51 Figure 4 62 Execute Breakpoint Set Hardware Dialog Box m DSP56300 5 56600 pore 4 52 Figure 4 63 Execute Breakpoint Clear Dialog Box 5 Eo 4 53 Figure 4 64 Execute Breakpoints Enable Dialog AP 4 54 Figure 4 65 Execute Wait Dialog Box A i ous Y m 4 54 Figure 4 66 Assembly Window Ax sae Obes ha oe oe 4 57 Figure 4 67 Source Window no source MeL 4 58 Figure 4 68 Source Window source fie present eee ee abo 4 58 Figure 4 69 Register Window Peripheral Group 4 58 Figure 4 70 Register Window 4 59 Figure 4 71 Windows Memory Dialog BOX 4 59 Figure 4 72 4 60 Figure p a Stack Window E EE E em oe eee ae 4 60 Figure 4 74 Window icem 4 61 Figure 4 75 7 Windows Watch Dialog 4 62 Figure 4 76 List File sur eREd UE C RERUMS QUE 4 62 Figure 4 77 Input 4 63 Figure 4 78 Output WIDUON 4 63 MOTOROLA DSPADSUM AD xix Figure 4 79 Breakpoint Window 4 64 Figure
191. akpoints are listed in the Breakpoint window and are indicated in the Assembly window with blue highlighting on the address when enabled For details on hardware breakpoint types see BREAK command Section 3 4 2 Breakpoints Set Software Wait Set Hardware Stop Clear Reset Enable Disable Specify Set breakpoint Specify break type Specify actiontobe Show Display which time number OnCE registers are taken when enabled registers amp break isto be Initially setto setto detect breakpoint is met memory acknowledge first free specified access Options are Increment speci d number i A Halt execution fied counter Note Display Command Exe breakpoint cute specified com mand on break Set Breakpoint Type Memory Expression Halt M 5 evaluated poh deal sais C Note Specify when break JE C Show address detected If Access C range for Start Address false LEN 1000 i breakpoint 2 1 Write CNT3 continue Read Write DT ncrement program if Execute ress C Increment true 2 1008 continue Expression break processing Apply Cancel Figure 4 61 Execute Breakpoint Set Hardware Dialog Box MOTOROLA DSPADSUM AD 4 51 Graphical User Interface Execute Menu 4 9 8 DSP56300 and DSP56600 Breakpoint Logic The DSP56300 and DSP56600 fam
192. al to zero may cause incorrect DSP operation The main difference between the TRACE and STEP commands is the OnCE port trace counter is armed to trace one instruction in the Trace mode The STEP command arms the trace counter with the count instructions to be executed in real time before re entering the Debug mode of operation and displaying the enabled registers and memory ME _ Example 3 44 STEP Command Examples ste instruction at the current target DSP address and display enabled registers and memory blocks Step 50 _ Execute hex 50 instructions and then display the enabled registers and memory blocks Step 3 li Step over the next 3 source lines for a source file associated with the current program counter Step dv2 5 5 Execute 5 instructions on target DSP addresses 2 and 5 simultaneously and display the enabled registers and memory blocks of each when they have each completed their 5 instructions MOTOROLA DSPADSUM AD 3 65 User Interface Commands Detailed Command Descriptions 3 6 37 STREAMS Enable Disable Handling of I O for C Programs STREAMS dev num ENABLE DISABLE uir The STREAMS command is used to enable and disable the handling of input and output on the host side for C programs By default it is enabled When enabled all input and output that is done in the C program running on the DSP is handled on the host side So for example when an fopen call is made
193. and COFF files 4 Select from loading memory debug symbols or both Usual operation is to load both Might load symbols only after loading patched memory saved after previous debug session May type file name directly May include drive _ use path shown in rest of dialog box Double click on required file or Single click and OK to load Load OMF file opens file chooser dialog box directly C Debug Symbols File Name s Memory and Symbols Initial dialog box is only used with COFF files to select the class of data to be loaded before starting the file search dialog box Load Memory COFF May enter name of load file manually if desired OK to load Click to open file access dialog box File Name Directories 5 consfile txt fmdbms32 dll mw32s16 dll fmw32s32 dll frame exe htmllite exe gt 5 clipart demos dict C3 filters fminit Drives c micron Select desired file type from pulldown list to specify which files are displayed in list Load Memory COFF Select directories from list by double click to build path Select drive from pull down list Figure 4 6 File Load Memory COFF Memory OMF Dialog Box MOTOROLA DSPADSUM AD 4 15 Graphical User Interface File Menu 4 6 3 File Save Memory C
194. and Installation Installing the PC compatible Software e MINMEM The minimum amount of RAM managed by the VMM Default is 512 KB e MAXMEM The maximum amount of RAM managed by the VMM Default is 4 MB SWAPNAME The swap file name Default name DOS4GVM SWP drive 1 DELETESWAP Specifies that swap file should be deleted CMS VIRTUALSIZE The size of the virtual memory space Default is is 16 MB Use the following format for the DOS4GVM environment variable set DOSAGVM option value option fvalue A ff is used with options that take values since the DOS contend shell vill not accept As an additional example the following line in your autoexec bat file will enable an 8 MB virtual memory swap file with automatic deletion of the swap file set DOS4GVM deleteswap 192 Lo 2 3 4 Using Default Settings N If you set DOS4GVM equal to 1 the default parameters are used for all options In this case the swap file will be called DOS4GVM SWP and will be given a size of 16 MB Also note that you should not have to use the DOS16M environment variable for PC compatible 486 based machines The only line required for the autoexec file is set DOS4GVM 1 2 3 5 _ Graphical User Interface GUI Program Installation n ya The GUI requires the Microsoft WIN32S to be installed on systems running Microsoft Windows 3 1 The WIN32S software is distributed on th
195. and VMS The code is provided to allow customizing of the emulator terminal I O for a particular environment The user may for example wish to redefine the control characters used by the emulator so that they map to seme terminal x d LT The following is a quick reference list of the emulator screen management functions simw 1 Clear to end of line MM simw ctrlbr Check for Ctrl C signal 0 simw_cursor line column Move cursor to specified fine Column simw endwin End the emulator mulator display simw_getch Non translated keyboard input simw gkey Translated keyboard input simw putc c Output character to terminal simw puts Output string to terminal at line and column line column text flag simw redo device M Kate screen with output from device simw redraw count NS draw screen after scrolling count simw_refresh 4 update after buffering output simw scrnest _ Nest output buffering another level simw unnest e Pop output buffering one level simw_winit Initialize window parameters simw wscr Write string and perform logging functions string commandflag 0 4 1 simw ceol Clear to End of Line ceol This function must clear the display from the current column to the end of line then return the cursor to the previous position D 74 DSPADSUM AD MOTOROLA C Library Functions Emulator Screen Managemen
196. and is able to interrogate its status This enables the user to debug hardware and software easily In the stand alone configuration a user program resident in ROM controls the ADM and may be used as a prototype system for an end product MOTOROLA DSPADSUM AD 1 5 General Information Operating Environment 1 3 OPERATING ENVIRONMENT The ADS hardware and software is currently supported on three different host computers PC compatibles e Hewlett Packard HP7xx Workstations Sun 4 and compatible Workstations 1 3 1 PC Compatible Requirements The minimum hardware requirements for the ADS User Interface Program include e PC compatible 486 or Pentium with 8 M bytes of R of RAM e MS DOS 6 0 or later Windows 3 1 or later or Windows 95 or later CD ROM drive Hard drive with 8 M bytes of free space Mouse and keyboard N V e One 16 bit I O ISA expansion slot e Free I O addresses 100 102 hex or 3 202 hex or 300 302 hex If the user debug setup involves many assigned disk files the operating system s limit of the number of open files may be reached In order to reduce the chance of this situation occurring it is recommended that your operating system CONFIG SYS file be modified with the following MS DOS configuration commands BUFFERS 32 FILES 20 _ These commands i increase the number of disk memory buffers and the maximum number of files that may be open at one time 1 6 DSPADSUM AD MOT
197. assis Keeping the top of the Host Interface Card level and any ribbon cables out of the way lower the card until the card connectors are aligned with the PC compatible system board expansion slot connectors Using an evenly distributed pressure press the Host Interface Card straight down until it seats in the expansion slot 1 Secure the Host Interface Card to the PC compatible chassis using the bracket screw Refer to the PC compatible Installation and Setup manual for on reinstalling the cover p The Host Interface card is factory configured for address decoding at 8100 8102 of the PC compatible I O Address Map which are undefined peripheral addresses Note Jumper JG2 should be left disconnected N gt ie The PC compatible interface card is factory configured for address 100 and no interrupts 2 3 INSTALLING THE PC COMPATIBLE SOFTWARE There are two debugger programs Tet Based User Interface program that provides information in one scrolling window has been used since the inception of the ADS A Graphical User Interface program GUI that supports multiple windows menus and many dialog boxes is also available for use in the Microsoft Windows environment 2 3 1 Defining ronment Variables The following sections specify environment variables which may need to be defined to establish the correct operating environment for the ADS user interface software These environ
198. at OMF and have a lod suffix name Refer to Appendix A for further details on OMF files This command allows the user to write a OnCE command sdquence 5 1 Example 3 9 CLOAD Example D using the Command Converter monitor program OnCE sequence format as s described i in Cload onceseq lod Load the file onceseq lod into the Y memory of the default Command Converter VN NN V 2 DSPADSUM AD 3 27 User Interface Commands Detailed Command Descriptions 3 6 8 CSAVE Save Command Converter Memory to a File CSAVE dev num address block filename 0 a C The CSAVE command allows the user to save the Command Converter X or Y data memory to a disk file This is useful when debugging user defined OnCE command sequences using the Command Converter monitor program sequence format 1 If a file currently exists with the filename specified the user will be prompted f Ex an action of either appending the data to the file overwriting the file or ge ung command 4 The selection of the file action may be included in the command line using the o overwrite a append or the c cancel argument This is useful when executing macro command files 7 oS Example 3 10 CSAVE Command Examples cSave dv0 3 0 20 onceseq lod J4 Save the contents of Command Converters 0 1 2 and 3 Y memor Y memory i addresses 0 to hex 20 to a file named once
199. ated with the specified address or line number If the display mode is already source or assembly the display mode is not altered The Assembly display mode displays disassembled instructions corresponding to the specified address or line number M The next or previous pages of the currently displayed source file may be selected by specifying or rather than a specific address or line number In a addition the source or assembly associated with the current execution address may be selected by specifying N period or by using the LIST command without a parameter 2 _ Example 3 31 LIST Command Examples list 20 List source or assembly corresponding to line 20 of the current source file list test asm 20 M 7 List source assembly corresponding to line 20 of the source file test asm list test asm 2 List source or assembly corresponding to line 1 of the source file test asm list Display the next page of the current source file or assembly list Z l Display source or r assembly corresponding to the current execution address list Display the previous page of the current source file or assembly list abt List or assembly corresponding to symbolic address lab 1 MOTOROLA DSPADSUM AD 3 51 User Interface Commands Detailed Command Descriptions 3 6 26 LOAD Load DSP Program Loan dev list B byte wide address offset from file Loap dev list
200. ation include simcom h include protocom h 42 MN int devn int err for devn 0 devn lt 3 devn devn 56002 Create new DSP structures Load device 1 with a program named filter2 lod VN err dsp_ldmem 1 c p42 bin filter2 lod 5 1 52 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 46 dsp load Load All DSP Structures from State File include simcom h include protocom h int dsp load filename char filename Full name of State File to be loaded 1 o dsp_load loads the emulator state of all devices from a specified emulator state file filename It is not necessary to allocate the device structures prior to calling dsp load This function does not invoke the user interface modules for pathname and automatic suffix extension the entire filename must be specified dsp load returns 1 if the load was successful 0 if there was an error AS Example 0 46 dsp 1 Load the emulator state from the file lunchbreak adm include simcom h include protocom h int err ads startup 100 ADSP56000 e dsp startup 1 err dsp load lunchbrk adm Sl 2 MOTOROLA DSPADSUM AD D 53 C Library Functions Library Function Descriptions D 3 47 new Create New DSP Device Structure
201. ation to read Ee unsigned long count Number of locations to read unsigned long value Address of buffer to receive read values dspd read memory reads block of memory starting at address address length count in memory space space on Command Converter device index The values read are stored in the buffer pointed to by Value N77 C Y Valid values for mem space are TR DSP CC PMEM DSP CC XMEM 1 DSP YMEM The return value is DSP OK for success psp ERROR if the transaction fails M Example D 6 dspd memory Read memory block from Command Converter include simcom h include driver h include cc h int devn status unsigned long read_addr read_len Mir a 2 buf devn 0 j 4 read buf unsigned long dsp alloc 100 sizeof unsigned long read addr 0x04001 read len 1001 status dspd cc read memory devn DSP CC PMEM read read len read buf MOTOROLA DSPADSUM AD D 13 C Library Functions Library Function Descriptions D 3 7 dspd reset heset Command Converter include simcom h include driver h int dspd reset device index int device index dspd reset resets the Command Converter device index ELA The return value is DSP OK for success 5 ERROR if theresetfails 1 lt Example 0 7 dspd cc re
202. auxiliary entries is given in Table B 21 Note that the size of the structure union or enumeration is given in words rather than bytes The tag index holds the symbol table index for the tag record associated with this structure Table B 21 End of Structure Auxiliary Entry 201 Bytes Declaration Name Description Bn 0 3 long int x tagndx Tagindex 0 00 im 4 7 Unused zero filled unsigned long Size of structure union or enumeration in words 12 31 Unused zero filled B 3 3 10 5 FUNCTIONS Function auxiliary entries have the format shown in Table B 22 4 Note The size of the function is given in words rather than bytes The function tag index holds the symbol table index to the begin function symbol for this function The x endndx field points to the next function symbol table entry The x Innoptr field contains a byte offset pointer within the object file to the line number entry that signals the start of this function see Section B 3 3 3 Line Numbers on page B 11 for more information Table B 22 Function Symbol Auxiliary Entry Bytes Declaration Name Description 0 3 2 int x tagndx Tag index 4 7 7 long int x fsize Size of function in words 8 11 long int x Innoptr File pointer to line number entry 12 15 long int x endndx Index of next function entry 16 31 Unused zero filled MOTOROLA DSPADSUM AD B 21 Motorola DSP
203. aw data words associated with the section This is in contrast to standard COFF section sizes which usually are given in bytes Raw data words currently are stored in the object file as long 4 byte integers independent of the target processor word size The file pointer fields are file byte offsets into the object file to the start of the current section raw data relocation entries and line number information The counts of relocation and line number entries provide an upper bound for scanning these tables The section flags comprise the section attributes and are described in Table B 7 Text sections are reserved for code to be loaded into program memory P space Data sections hold initialized data generated by assembler DC directives for example bound for data X Y L memory Bss sections are used for uninitialized blocks resulting from assembler DS and similar directives Padding sections are generated to provide alignment when modulo or reverse carry buffer is declared The block section attribute flags a block data section described above The overlay flag indicates the section is part of an overlay Macro sections represent code and data generated during a macro expansion Dummy sections are used internally by the assembler to mark empty sections after the first assembly pass Empty sections may still appear in the object file if a symbol is associated with a section which contains no data The noload group and copy attributes are not u
204. ay be repeated if desired For example when entering the DISPLAY command multiple registers may be specified for display on the same command line MOTOROLA DSPADSUM AD 3 5 User Interface Commands Command Syntax The following symbolic address forms may be used in any ADS command in place of an absolute address linenumber The line number in the current file filename linenumber The line number in the specified filename symbolname The symbol in the current section sectionname symbolname The symbol in the named section M 1 The character preceding the symbols may be omitted in most contexts but is required when the symbol name is the same an ADS register or peripheral name The ADS retains each symbol s associated memory space so that it is not necessary to type the memory space for example X preceding a symbol label which is associated with X memory in the assembly source program The disassembler provides symbolic information for the memory addresses being accessed This includes jump or branch target addresses as well as data memory accesses All addressing modes are supported The register indirect modes generate a label based on the current value of the referenced register The symbolic information is displayed as a label or label plus offset in a comment following the disassembled instruction J Refer to Section 3 7 2 and Section 3 7 3 for details on supported C expression syntax
205. be inserted It is then possible to reference source line numbers when using a debugger The structure of an object file line entry is shown in Table 9 Table B 9 Line Number Entry Format Bytes Declaration Name Description 0 3 2 long 1 symndx Function name symbol table index p x 0 7 ADDR paddr Line number physical address 8 11 unsignedlong l Inno Source file line number All line numbers in a section are grouped by function as shown in Table B 10 on page B 12 The first entry in a function grouping has line number 0 and has in place of the physical address an index into the symbol table for the entry containing the function name Subsequent entries have actual line numbers and addresses of the MOTOROLA DSPADSUM AD B 11 Motorola DSP Object File Format COFF Object File Components program text corresponding to the line numbers The line number entries are relative to the beginning of the function and appear in increasing order of address Table B 10 Line Number Grouping Symbol index 0 Physical address Line number _ Physical address Line number m QI Symbol index Physical address Line number Kk d Physical address Line number B 3 3 4 Symbol Table The COFF symbol table serves a dual purpose it resolution for symbolic references in relocation expressions during linking and it establishes a framework for the handling of
206. by a variety of EPROM EEPROM programmer manufacturers This appendix describes the S record format and explains how to convert DSP object module format files to S record format files _ The Motorola S record format was devised for the purpose of encoding programs or data files in a printable format for transportation between computer systems as well as development tools This transportation process can therefore be monitored and the S records can be easily edited lt 2 S RECORD CONTENT Wy S records are character strings made of several fields which identify the record type record length memory address code data and checksum Each byte of binary data is encoded as a 2 character hexadecimal number the first character representing the high order 4 bits and the second the low order 4 bits of the byte The five fields which comprise an S record are shown in Table C 1 Accuracy of transmission is ensured by the record length byte count and checksum fields vA Table 5 Fields Printable 74 Field Characters Contents Type 2 S record type S0 51 S9 etc Record 2 Character pair count in record exclude type record length Address 46 or 8 2 3 or 4 byte address at which the data field is to be loaded into _ memory Code data 70 20 From 0 to n bytes of executable code memory loadable data Pun in descriptive information For compatibilit
207. by the assembler or linker as part of its control requirements It is useful to isolate the user expression in order to check for relationships among absolute and relative terms In all other respects the curly braces behave like parentheses N 5 2 2 Relocatable Expression The square brackets are used to enclose a P TN expression The value contained in the square brackets is an offset from the base of the current section Usually this grouping operator is placed around the value of an assembler local label underscore label since these symbols do not migrate to the link file B 5 2 3 Memory Space Operator The at sign 9 is a binary operator that checks the memory space compatibility of the left operand based on the value of the right operand The right operand can have the following values 0 None 1 Xspace 2 Yspace 3 Lspace 4 The compatibility check is made based on the matrix outlined in the DSP Macro assembler User Manual EXPRESSION MEMORY SPACE ATTRIBUTE MOTOROLA DSPADSUM AD B 29 Motorola DSP Object File Format COFF Object File Data Expression Format B 5 2 4 Bit Size Operator The pound sign is a binary operator used to verify the size in bits of the left operand given the value of the right operand The following bit sizes and operand type correspondences are defined 16 16 bit signed short immediate or offset 7 7 bit signed short immediate 5
208. cates where one record ends and another begins A scanning program would examine the first character of each field looking for the underscore character If found the program would know it had encountered a new record and would use the remainder of the field to determine the record type The Type Definition Field may be upper or lower case although the assembler guarantees upper case e output The only exception to this processing is when a comment occurs in the object file as a result of an IDENT or COBJ assembler directive Comments in the object file are bracketed by newline characters and thus appear on a line by themselves Since the location of comment fields in an OMF record i is well defined scanning software need only look for an opening and closing newline sequence to determine the bounds of a comment The assembler will fill lines in the object file to a maximum of 80 characters using the minimum white space one blank or newline to delimit fields Records with repeating fields may be of arbitrary length MOTOROLA DSPADSUM AD A 3 Motorola DSP Object Module Format Record Definitions A 2 RECORD DEFINITIONS There are six DSP OMF record types defined Start End e Data Eo Blockdata e Symbol s Lo Comment Currently Data records used for both code and data 7 2 4 A 2 1 Start Record A Format _ START Module id Versions meinen a number gt
209. ce Commands Detailed Command Descriptions 3 6 46 WATCH Set Modify View or Clear Watch WATcH dev list wn radix reg addr expression c expression WATcH dev list wn OFF The WATCH command is used to add modify view and clear watch items Watch items are on a watch list that gets displayed every time the user does a trace e breakpoint is hit Additionally any time a user types WATCH without any p eters the watch list is displayed Example 3 54 WATCH Command Examples watch 0 YAS Add register r0 to the watch list watch 0 em Add 0 to the watch list A WA M watch count 1 total Add the given C expression to the watch list watch h count 2 Add the given C expression to the watch list with h display radix hex watch b flag Add the given C variable to the watch ut with display radix binary watch r0 x 0 2 M Add the expression 0 0 to the watch list watch Display the watch list watch 8 off Remove item number three from the watch list watch off N Remove all items from the watch list MOTOROLA DSPADSUM AD 3 75 User Interface Commands Detailed Command Descriptions 3 6 37 WASM GUI Assembly Window WASM dev list OFF WASM is a GUI command that opens an assembly window Multiple device windows may be opened for debugging target systems with multiple DSPs Example 3 55 WASM Command Examp
210. ce type may be selected with the DEVICE command M Example 3 49 UNLOCK Command Example unlock 56002 x51 234 9 Enable device type 56002 for simulation using the password x51 234 end RS VW M N 3 70 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 42 UNTIL Step Until Address UNTIL dev list addr line number address label The UNTIL command sets a temporary breakpoint at the specified line or address then steps until that breakpoint It then clears the temporary breakpoint and displays the enabled registers and memory blocks in the same manner as the STEP command The addr parameter may be expressed as a line number in the program source f fle Specification of a line number is valid only if the symbolic debug information has been loaded from a COFF format cld file The debug information is using the Assembler s g option Line numbers may be specified as filenameGline number for a line number in a particular file or simply by line number for line numbers i in the currently displayed file All other breakpoints are ignored while the UNTIL command ise Example 3 50 UNTIL Command Examples until 20 Go until the instruction associated with ns 20 in a tie current file is reached until p 50 Go until the instruction at hexadecimal address p 50 is reached until lab 2 NDA Go until the instruction at labe
211. cessary that a file be the OUTPUT command The file number in the output statement must correspond to the file number used in the DSP user program call to the Debug mode of operation The default path for each target DSP address can be changed with the PATH command If a file currently exists with the filename specified the user will be prompted for an action of either appending the data toi the file overwriting the file or aborting the command 2M y The selection of the file action may be in the command line using the 0 overwrite a append or the c cancel argument This is useful when executing macro command files To accomplish data transfers successfully the following rules must be followed when the ADS user program calls the monitor file output subroutines MOTOROLA DSPADSUM AD 3 57 User Interface Commands Detailed Command Descriptions Example 3 36 Example Of Program That Resides on a Target DSP5600x Input Requirements 1 Load with file number and word count a For 16 bit devices the file number will be in the upper byte and word count byte b For 24 bit devices the file number will be in the upper byte and word count in the lower 2 bytes 2 Load with the starting location of the source block S 4 A 3 Load R1 with the source memory space NN a MOVE 0 R1 Move block to P memory space EN b MOVE 1 R1 Move block to X memory space N MOVE 2 R1
212. code files It originated with Unix System V but has sufficient flexibility and generality to be useful in non hosted environments In particular COFF supports user defined sections and contains extensive information for symbolic software testing and debugging Later sections describe the COFF implementation for the Motorola family of Digital Signal Processors The DSP COFF format has been altered to support multiple memory spaces and normalized to promote transportability of object files among host processors See Section B 5 Object File Data Expression Format on page B 28 for a list of differences between the Motorola DSP Object file format and standard COFF 5 X Br Note A general discussion of COFF is provided in the reference Gintaras R Gircys Understanding and Using COFF Reilly amp Associates 1988 ISBN 0 937175 31 5 B 2 OBJECT FILE STRUCTURE A DSP COFF object file consists of up S of object file information Some of these groups are optional depending on the type of object file generated and others may have repeating occurrences The basic object file components are File header Optional header Section headers Section data v Relocation information 4 Wine Symbol table String table MOTOROLA DSPADSUM AD B 3 Motorola DSP Object File Format COFF Object File Structure The general structure of the object file is listed in Table
213. command will be used An expression consists of an arithmetic combination of operators and operands An operand may be a register name a memory location ora constant value For example A2 evaluates to the contents of register evaluate 2 as hexadecimal a dollar sign must precede the value The same holds for the values AO A1 A2 B0 B1 and B2 222 order of evaluation of an expression s operators will be associated from left to right Parenthesis may be used to force the order of evaluation of the expression A more extensive discussion of the expressions which are valid for the EVALUATE command is in the DSP Assembler Reference Manual Section 3 The valid symbols for an expression are listed in the description of the BREAK command Example 3 19 Command Examples evaluate r04p 50 Add the value in r0 register to the value in pro ram memory address hexadecimal 50 of the current default target DSP address and the result using the default radix evaluate dv4 r0 p 1000 Add the value in r0 register of target DSP 4 to the value in its program memory address hexadecimal 1000 and display the result using the default radix evaluate b 345 Convert hexadecimal 345 to binary and display the result evaluate h 10101010 amp p r0 Calculate the bitwise AND of program memory address specified by the value in r0 register and the binary valu e 10101010 and display the result in hexadecimal
214. compatible Ver 9 x only Application Development Module ADM This module supports development and test using a specific DSP chip Consult your local Motorola distributor a Motorola semiconductor sales office or the source for the latest information the Motorola DSP home page on the Internet http www motorola dsp com to identify currently available ADMs Motorola DSPs have a common OnCE module that allows the development tools to have identical features Using the concept of a common serial debug port one set of tools has been designed which allows the user to communicate with any of the architectures using a single Command Converter In some Motorola DSPs this module uses a dedicated OnCE serial port to access the internal module In other Motorola DSPs the internal OnCE module is addressed using the IEEE Joint Test Action Group JTAG 4 wire Test Access Port TAP Boundary Scan Architecture protocol The tools software can use direct OnCE serial port or the JTAG serial port This manual describes the installation use and functional description of the control system that interacts with the target DSP Note DSP CLAS Design In Software Package is a recommended companion product for the ADS The CLAS software package runs on PC compatibles Macintosh not supported by the ADS HP7xx Workstation or a Sun 4 Workstation The CLAS package includes the DSP Simulator Program and the DSP Macro Cross Assembler Pr
215. create an emulator customized for particular application A custom emulator may be built with or without display support Omitting display support reduces the program size by about half but sacrifices the screen output facilities used in the ADS and also the user interface and command parsing and execution routines which rely on the display routines A non display ADS may be used to provide direct program control of the hardware by calling the low level routines creating reports and activity logs using standard C functions Omitting display support does not preclude the use of the standard C input output functions or the creation of an alternative user interface The rest of the appendix covers various aspects of the specification and use of the libraries Ww Section D 2 lists and groups the functions e Section D 3 defines each function Section D 4 defines the display 1 functions Section 0 5 discusses display and non display support Section D 6 describes the emulation of multiple DSP devices D 7 lists Dered function names 8 describes global data used the emulator _ Section D 9 covers tailoring items in the global structures DSPADSUM AD D 3 C Library Functions ADS Object Library Files D 2 ADS OBJECT LIBRARY FILES D 2 1 ADS OBJECT LIBRARY ENTRYPOINTS The library functions are listed below They are divided into groups by their f
216. cted by command int mem space Memory space to read M unsigned long address Address of first location to read 2 unsigned long count Number of locations to read 73 unsigned long value Pointer to area to receive memory values dspd read memory reads count words of memory from the DSP device in memory space mem space starting at address address and stores them in the memory pointed to by value Valid values for mem space P MEM program memory e X MEM X data memory Y MEM Y data memory x The return value is set to DSP_OK if the operation succeeds DSP_ERROR if it fails 2 16 dspd ead memory LL Read DSP memory block include simcom h include driver h int devn status unsigned long x mem buf 0 100 devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 LM P A 222 Read back work buffer Status dspd read memory devn X MEM 0 00001 0 01001 x mem buf 2 2 77 DSPADSUM AD D 23 C Library Functions Library Function Descriptions 0 3 17 dspd read once registers Read OnCE Registers from DSP Device include adsreg56 h include simcom h include driver h int dspd_read_once_registers device_index reg_num count value int device_index Index of DSP device
217. ction of the function and steps through it This button is equivalent to Execute Step with a count of 1 e 4 12 4 NEXT Button The NEXT button executes one execution step If the source window is open tracking the program source NEXT executes one line of code Otherwise NEXT executes one instruction On encountering a JSR instruction NEXT allows the function to execute and stops after the RTS instruction This button is equivalent to Execute Next with a count of 1 MOTOROLA DSPADSUM AD 4 69 Graphical User Interface The Tool Bar 4 12 5 FINISH Button FINISH FINISH allows the current function to execute to completion Control returns to the user after executing the RTS instruction It is not affected if another function is encountered during a FINISH operation execution continues to the end of the current function FINISH is equivalent to Execute Finish 4 126 DEVICE Button 2 2 The DEVICE button opens the Set Default Device dialog box This selects which is the current default device to which all com will be directed until further notice This button cannot be used to configure or enable and disable devices The DEVICE button equivalent to Modify Device Set Default 2 gt 4 127 REPEAT Button REPEAT The REPEAT Button repeats the last command i in the history buffer listed in the Command window This button is equivalent to clicking on the
218. cution display in Session window Display C On Off Read Select display mode On Always display after execution O Write Read Write Immediate Off Do not display Immediate Display now m EN 47 44 Display Display Stack This menu selection sends the stack contents to the Session window The entire stack is displayed with the current Top of Stack marked and the active stack area highlighted in red MOTOROLA Display Graphical User Interface Display Menu Select memory space from list Enter memory rangeto display NN T Display Active Memory Disassemble List Register Evaluate Stack Call Stack Version Radix Off Device Select registers with CLICK CLICK DRAG CTRL CLICK 2 4 Figure 4 21 Display Display Registers Dialog Box Active Memory Register Disassemble List Evaluate Stack Call Stack Version Device Dath DSPADSUM AD 4 29 Graphical User Interface Display Menu Dv00 Session move rG x r6 SSL STACK LEVEL All 16 stack levels displayed Sue dcc 80000000 00000000 level 14 00000000 00000000 leuel 13 00000000 00000000 leuel 12 00000000 00000000 level 11 00000000 00000000 level 18 Top of Stack pointer 00088880 88888888 level 88 80000000 00000000 level 07 80000000 00000000 leuel 06 00000000 00000000 le
219. d address t being used host timeout 3 Change the host timeout to 3 seconds host io 200 Change the PC Host Interface address to 200 Note Changing the Host should be done only after changing JG1 of the IBM PC Interface Card otherwise the target DSP address will not respond to the ADS user interface commands 3 46 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 24 INPUT Assign Input File INPUT dev list file number OFF address TERM filename rd rf rh ru The INPUT command open files which will pass data to an ADM or target system whenever a user program enters the Debug mode of operation via a software breakpoint at a predefined address Use of the keyword TERM assigns input from a termir al file which is created using a single line editor The input data is in ASCII and is expressed i in hexadecimal rh unless decimal rd unsigned ru or floating point rf radix is specified Any number of files may be open for a target DSP put up t to pon computer limits los successfully accomplish data transfers the following rules must be followed when the ADS user program calls the monitor file input subroutines 1 Itis necessary that a file be opened using the INPUT cand and that the DSP user program have a DEBUG software breakpoint pow at the program address which is to enter the Debug mode of operation 2 The file n
220. d addresses This means that load file DATA record start addresses are multiplied by the DSP bytes word and subsequent 51 53 record addresses are computed based on the data byte count Entering the s command line option will write data to a single file putting memory space information into the address field of the S0 header record Bytes may be reversed with the r option Entering the w command line option will use word addressing when transferring load addresses to S record addresses This means that load file DATA record start addresses are moved unchanged and subsequent 51 53 record addresses are computed based on the data word count MOTOROLA DSPADSUM AD 5 Motorola 5 Information S Record Creation The following are example listings of the example code fragment used in Appendix A in each of the three files Example 2 S record File Low order Byte This is the FIR PO low order byte file of the 24 bit words M S0044649521A S10F00000000131B8109EACAA2B6111902 72 N 89030000 9 N 2 1 Example 3 S record File Middle order Byte This is the FIR P1 middle byte file of the 24 bit words Mn MN S0044649521A S10F000000000080F4009C000080000060 S9030000FC Example C 4 S record File High order Byte This is the FIR P2 high order byte fle of the 24 bit words S0044649521A 510 0000303420 40600
221. d at r vaddr with the result of the expression evaluation The relocation type is always zero See Section B 5 Object File Data Expression Format on page B 28 for more information on relocation expressions B 4 5 Block Data Sections mm Generic COFF does not make allowance for a block data section A block data section results from use of the assembler BSC directive where a large block of memory is initialized with a single value Block data sections are handled ir in Motorola DSP by making special use of the section s vaddr field and adding an informative flag In most cases the section virtual address is the same as the physical address However for block data sections in Motorola DSP object files the virtual address field holds the repeat count for the single raw data value associated with the section For example if the assembly language source file included a directive of the form BSC 400 FFFF the s vaddr field would contain the value 400 the s size field would be 1 or 2 if in L memory and the single raw data word associated with the section would be FFFF In addition the 5 BLOCK flag is set et in the section s_flags field B 4 6 Other Extensions If the object file is relocatable there are extra structures which the assembler and linker generate to support special constructs such as logical sections buffers and overlays The optional link file header contains information which the linker requires it is described in
222. d be followed for proper installation of the driver program Note hostname represents the system prompt is e itis not to be entered as part of the command The HP device driver for the ADS AN multipl t host interface cards up to three limited by the addresses that can be selected on the host interface card installed into a single HP 700 workstation 1 When the files were installed a directory called driver was created in the hierarchy Make this the current directory now by executing the following command where ADS PATH is the path to where the ADS files were installed hostname ADS PATH driver 2 Copy and change the ownership group and mode of the device driver library file libmds using the following commands hostname cp libmdsp a etc conf A nan chown bin etc conf libmdsp a hostnamef chgrp bin etc conf libmdsp a hostname chmod 444 etc conf libmdsp a 3 To install the device configuration file type the following command note that it may be necessary to escape the by using a backslash depending on the shell you are using hostname cp MOT0010 CFG etc eisa This copies the configuration file into the system EISA configuration directory Modify the copy of the file in etc eisa to reflect the I O port that the card is configured for change the PORT entry 2 12 DSPADSUM AD MOTOROLA Preparation and Installation HP7xx to Command Converter Interface If you are
223. d suffix The constructed filename is returned in T new_name uu If base name begins with a pathname separator or with a device designator path name will not be prefixed to base name If base name already ends with and some filename extension the string in suffix will not be appended Example D 48 dsp_ gt Load file filter2 lod from the current working directory for device 0 include simcom h Le include protocom h include simdev h extern struct dev const dv const ace structures char newfn 80 dsp 0 56002 Create new DSP structure Create file name from Path specified in device structure dv const sv 0 pathwork created by path command Base file name filter2 6 Filename suffix lod Note the is not explicitly specified path dv const sv 0 pathwork filter2 lod newfn dsp ldmem 0 newfn Load file into DSP device 0 ER Y DSPADSUM AD D 55 C Library Functions Library Function Descriptions D 3 49 dsp realloc Reallocate Memory Block The routines dsp alloc dsp free memand dsp realloc replacements for the standard C functions malloc free and realloc They are used in the much same way as the standard functions for allocating space for structures buffers etc These functions are used in the debugger lib
224. de simcom h include protocom h int dsp reset device index int device index Index of affected DSP device dsp reset resets the target device device index into Debug mode To reset a device into User mode see dsp go reset The function returns TRUE on success FALSE otherwise Example 0 50 dsp_reset Place DSP device 3 into debug mode NV A include simcom h include protocom h int devn status devn 3 dsp new devn 56002 Create new DSP structure ensure device in known state Y status dsp reset devn Reset device into DEBUG mode MOTOROLA DSPADSUM AD D 57 C Library Functions Library Function Descriptions 0 3 51 dsp rmem Read DSP Memory Location include simcom h include protocom h include coreaddr h int dsp rmem device index memory map address return value int device index DSP device to be affected by command enum memory_map memory_map memory designator 22 M unsigned long address DSP memory address to read Sug unsigned long return_value Returned memory value or values dsp rmem reads the contents of a selected DSP memory location fehed by memory_map and address and writes it to return_value If the memory_map implies a two word value the least significant word will be returned to return_value and the most significant word will be returned to the return _value
225. default to zero This maintains compatibility with previous versions 17 Example 3 15 DEVICE Command Examples device Display all activated target DSP addresses and device types and lists all supported family members 1 2 device dv0 2 on Sa 3007 Activate target DSP address 0 target DSP address 1 and target DSP address 2 device dv0 3 off Deactivate target DSP address 0 and target DSP address 3 device dv2 Select target DSP address 2 as the default target DSP for command entry device dvl x Deactivate target DSP address 1 and discard all associated data structures If this was the selected device select another device dv12 pos2 56301 Specifies that device DV12 refers to a DSP56301 which is controlled by Command Converter 3 occupying the third 0 1 2 position in the chain TMSO is used by default device cc3 tms0 posl ir 3 The device on Command Converter 3 TMS chain 0 position 1 is not to be used in this development session It has an instruction register 3 bits wide Note that no device number may be specified and that all fields are required Note The instruction register length must not be specified for a device which has been allocated an ADS device number MOTOROLA DSPADSUM AD 3 35 User Interface Commands Detailed Command Descriptions 3 6 14 DISASSEMBLE Single Line Disassembler DISASSEMBLE dev list B byte wide address _block The DISASS
226. device gt driver and run the user interface 1 Copy all of the software from the distribution CD onto your system using uncompress and tar See the readme file for details 2 Install the driver with the following commands hostname cd adsxxx driver M hostname make install M 2 3 Aftera successful installation you should see a module status message indicating that your module was successfully loaded and giving its ID To see this status at any time issue the modinfo command on SOLARIS modstat for SunOS 4 If the ADSxxx driver module was loaded properly you should be ready to run the ADSxxx user interface hostname cd X bin hostname adsxxx If for any re reason you wish to uninstall the driver use the following commands m _ hostname adsxxx driver p 5 hostname make unload SunOS 4 x hostname make uninstall SOLARIS 2 x MOTOROLA DSPADSUM AD 2 9 Preparation and Installation HP7xx to Command Converter Interface 25 TO COMMAND CONVERTER INTERFACE The Motorola HP7xx Interface uses the same ISA card which is installed in the PC compatible It is controlled by an HPUX device driver The HP7xx computer must have an ISA slot available to plug this card into Older versions of the HP700 series computer did not have ISA expansion slots The ISA board provides a parallel communication path between the HP workstation and a Motorola DSP development system For details on jumper confi
227. dition Code Register is done real time 1 15 10 DSPADSUM AD 3 21 User Interface Commands Detailed Command Descriptions Example 3 2 General Breakpoint Examples for DSPs with OnCE or JTAG OnCE Ports Continued break al p 320 Halt DSP program execution of default target DSP address and enter Debug mode unconditionally at the address 320 of program memory This is a software breakpoint and must be placed in SRAM break r 300 Halt DSP program execution of the default target DSP address and enter Debug mode when read access of X data memory address 300 occurs This is a hardware breakpoint which will work with OnCE and JTAG OnCE based DSPs i Example 3 3 General Breakpoint Examples for Dora with OnCE Ports break rw pcfm p 100 20 Who Halt DSP program execution of the default target DSP address and enter the Debug mode when the 32nd occurrence of a read or write access of a program core fetch or move occurs at address 100 break rw pce p 250 Halt DSP program execution of default target DSP address and enter Debug mode when a read or write access of program memory address 250 hex occurs N Example 3 4 General Breakpoint Examples f for DSPs with JTAG OnCE Ports break r gt 104 and x 110 Halt DSP program execution on default ates DSP when a read access of X memory address rang
228. dows Command ZA bow 4 64 5 WW 4 65 Windows Tile Cascade Microsoft Windows only 4 67 HELP urhe eit 4 68 THE TOOL E CONO Pp 4 69 Go 4 69 Stop cred ctetu ONCE ed 4 69 STEP Button A M tos TEE 4 69 NEXT Button Bur more 4 69 FINISH Button TOME 4 70 DEVICE Button gt WE 4 70 REPEAT 4 70 RESET Button v Pr S 4 70 INTRODUCTION esed seek a rh cheers RR d 5 3 HOST COMPUTER HARDWARE 5 3 Host Computer Bus Interface 5 4 Host Computer Interface 5 5 COMMAND CONVERTER CARD 5 6 _ Command Converter Handshake Signals 5 7 Command Converter Interface Connector 5 8 Multiple Target Connections 5 9 TCK Drive and Timing Considerations 5 10 Resetting Target DSP 5 11 ONCE PORT ARCHITECTURE 5 12 OnCE Controller 5 12 Program Controller Pipeline Information 5 13 Program Address Bus FIFO 5 14 Program Decoder Communication 5 14 MOTOROLA
229. dress bits 9 to 0 B1 GND PC ground B2 RESET PC reset signal positive true B3 5 5 B4 B8 No Connect 2 12 V BIO _ GND PC ground B11 B12 MEMW MEMR No Connect 2 B13 IOW I O write command negative true P ae B14 I O read command negative true 2 15 20 No Connect B21 IRQ7 PC Interrupt request 7 Printer NOT USED B22 B23 No Connect B24 IRQ4 PC Interrupt request 4 COM1 NOT USED B25 IRQ3 PC Interrupt request 3 COM2 B26 B31 No Connect MOTOROLA DSPADSUM AD 6 3 Host Computer Card Command Converter Support Information Host Interface Card Bus Signal Description Table 6 2 Sun 4 SPARC SBus Connector Pin Description Pin Description Pin Description 1 GND 33 PA 06 65 D 18 2 BR 34 PA 08 66 D 20 3 SEL 85 PA 10 67 D 22 4 INTREQI 36 ACKO 68 GND 5 D 00 37 PA 12 69 DQ4 6 D 02 38 PA 14 70 77 D 26 7 D 04 39 PA 16 AN NZ _ 8 8 INTREQ2 40 45V 9 D 06 41 18 7 D 30 10 D 08 42 PA 20 7 SIZ 1 11 D 10 43 22 275 12 INTREQ 3 44 76 13 12 45 24 77 01 14 14 46 26 78 03 15 D 16 47 DTAPAR 79 05 16 INTREQ4 48 80 5 17 D 19 gt 49 CLK 81 07 18 D 21 50 82 09 19 D 23 51 AS 83 PA 11 20 INTREQ5 52 GND 84 GND 2
230. driver h int dspd cc read flag device index flag value int device index Command Converter affected by command int flag Specify flag to read 22 M unsigned long value Location to receive flag value ee dspd_cc_read_flag reads flag word flag from Command tin device index storing the value obtained in the location pointed to by v alue Valid values for flag are A LL DSP CC FLAGS DSP CC STATUS J DSP CC XPTR COR DSP CC YPTR DSP DC DEVICE ADDRESS C 5 CC CLOCK RATE DSP CC DEVICE COUNT DSP CC DEVICE ACTIVE The function returns DSR OK on success DSP_ERROR otherwise Papi D 5 dspd cc read flag Read Command Converter flag word finclude cc h include simcom h include driver h int status flag value 5 devn 0 status dspd read flag devn CC XPTR amp flag value D 12 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 6 dspd cc read from Command Converter Memory include simcom h include driver h finclude cc h int dspd_read_memory device_index mem_space address count value int device_index Command Converter affected by command int mem space Memory space to read un unsigned long address Address of first loc
231. e RAM sim gmomd reads the next emulator command string from a macro file The sim docmd function will normally determine that a command is a macro open the macro file and set the device structure sim const in macro flag The sim gmcmd function returns the next line from the open macro file each time it is called It will clear the in_macro flag at the end of macro execution or if an invalid macro command is processed The command string buffer should be at least 80 characters NL LO VN PS Example D 65 sim gmem d Execute the macro command file startup cmd on DSP device structure 0 include simcom h include protocom h include simusr h extern struct sim const sv const Emulator device structures char command string 80 int devn N nO 4 devn 0 na SR 2A dsp new devn 56002 gt Create new DSP structure sim docmd devn startup Begin the startup macro while sv const in Until end of macro file sim devn command string Get command from macro file sim devn command string Execute command string D 72 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 66 sim gtcmd Get Command String from Terminal include simcom h include protocom h sim gtcmd device index command string int device index DSP device index to be affected by com
232. e 105 to 109 occurs 1 time break rw pa p 104 or 10 Halt DSP program execution on default target DSP when a read write access of program memory address 104 or 110 occurs 1 time 3 22 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 3 CCHANGE Change Command Converter Memory CCHANGE dev list FLAG XPTR YPTR address block expression The CCHANGE command allows the memory examination or modification of the OnCE Command Converter P X or Y data memory spaces of the DSP56002 This ae is useful for users who wish to design and debug their own OnCE command sequences The command sequence description with respect to the Command Converter monitor program is outlined in 5 1 The XPTR is Command Converter x memory location 4 and is used to point to the x memory area where values read from the target OnCE are to be stored The YPTR i is Command Converter x memory location 2 and is used to point to the y memory area where sequences are to start from when issuing a CGO command Note Command Converter X memory addresses 0 to 7F hex are e reserved for use by the Command Converter monitor These locations should not be changed by the user For more details on the usage of these these locations refer to the monitor program source listing P memory locations 0 to 1 0 hex are reserved for the monitor which is boot loaded from the Command Converter EPROM Example 3 5
233. e CD This software is loaded by invoking SETUP WIN32S DISK1 To install the development software run SETUP in the WIN directory See the README file for details MOTOROLA DSPADSUM AD 2 7 Preparation and Installation SUN 4 to Command Converter Interface 24 50144 TO COMMAND CONVERTER INTERFACE The Motorola SBus ADS Interface is an interface board that is designed to be installed in an SBus slot on a Sun SPARCstation or compatible workstation The board provides a parallel communication path between the workstation and a Motorola DSP development system 2 4 1 Installing the Sun 4 Interface The Motorola SBus ADS Interface is delivered ready to install your SBus system There are no user configurable jumpers or hardware configurable options Please consult the SPARCstation xxx Installation Guide or the board installation instructions supplied with your SBus system for installation details Following is a summary of the Instructions in the Sun manual 1 Turn off power to the system but keep in Be sure to save all open files and then the following steps should shut down your system hostname bin su E Y Password mypasswd hostname usr etc halt Wait for the following messages 7 Syncing file eee Halted Program Terminated Type b boot c continue n new command mode When these messages appear you can safely turn off the power to the system unit 7 a 2
234. e Display menu controls the Session window Most of the options cause output to the Session window a few control the way it operates Note Each device has its own session buffer Make the intended device the current device before performing any Display menu operations relate to that device M Most of the facilities offered by the Display menu may be obtained in other ways Kith the dedicated windows However the Session window does have one advantage the option to write all Session output to a log file As all output from the Display menu is sent to the Session window for the current device if the description of any Display menu item does not specify where the output goes it is assumed to be the Appropriate Session window Features include A v e Display selected registers amp variables s 2 Display 2 e View memory as instructions Disassemble List source file in Session window 4 2 qe e Calculate Assembler and expressions a e Display C call stack frames SIDA En 2 e Set default input and display radix deis Display device configuration and supported types 4 2 5 Display working directory alternate source paths Display simulated input assignments Pe simulated output assignments uu e List stream IO redirection IO stream support enabled disabled fe list log file assignments List breakpoints Control expression display at breakpoints
235. e breakpoints are useful for halting program flow only after a particular condition is true Users can select when to stop program execution based on predetermined conditions in a program s behavior When the Debug mode of operation is entered after executing a software breakpoint a special bit in the OnCE Status Control Register OSCR will be set to tell the user that the Debug mode was entered from a software breakpoint The same holds when the Debug mode is entered from a hardware breakpoint There is also a special bit in the OSCR which flags the user that a hardware breakpoint has been accomplished 9 4 6 Program Single Stepping To evaluate programs one opcode at a time the OnCE controller provides a single step capability Single stepping requires the chip be put into the User mode of operation so the pipeline registers are updated after the execution of the opcode This is accomplished by loading a Trace Counter register OTC with the n 1 opcodes to execute The OTC allows users to multiple step opcodes in real time so routines may be quickly executed Entering the Debug mode from a single step will cause a special bit in the OSCR to be set to flag the user how the DSP exited the User mode of operation MOTOROLA DSPADSUM AD 5 15 Functional Description Host Computer Software 5 5 HOST COMPUTER SOFTWARE The host computer user interface program comprises of two levels of support There is a turn key program which pro
236. e for structures buffers etc These functions are used in the debugger libraries and must also be used exclusively in the user debugger code Any attempt to use the standard routines will have unpredictable results include simcom h include protocom h void dsp free mem cp li char cp pointer to memory block to be freed 5 dsp free mem releases memory block previously allocated with alloc Its argument cp is the address of the data block 2 V Example D 40 dsp free mem Allocate and release memory block finclude simcom h include protocom h int buffer int i 7 3 buffer int dsp_alloc sizeof int 10 0 Use the buffer for 1 0 1 lt 10 144 buffer i t And discard it dsp free mem char buffer DSPADSUM AD D 47 C Library Functions Library Function Descriptions D 3 41 dsp go lnitiate DSP Program Execution include simcom h include protocom h int dsp_go device_index int device_index DSP device to start executing dsp go starts the target device device index to begin executing in real time from the address specified by the current program counter The function returns TRUE on successful completion FALSE otherwise y Example 0 41 dsp go start DSP 0 executing S include simcom h finclude protocom h
237. e function returns DSP OK if the operation succeeds D SP ERROR otherwise Example D 14 jtag reset reset JTAG communications with include simcom h LS include driver h W int devn 4 int status devn 0 dsp new devn 96002 Allocate structure for device 0 a 96002 status dspd reset devn DSP JTAG RESET HARDWARE DSPADSUM AD D 21 C Library Functions Library Function Descriptions 0 3 15 dspd read core registers Read Core Registers from DSP Device include adsreg56 h include simcom h include driver h int dspd_read_core_registers device_index reg_num count value int device_index Index of DSP device affected by command int reg num First register to read dit unsigned long count Number of registers to read ws unsigned long value Pointer to area to receive register values P cR dspd read core registers reads count core registers starting at register reg num for target device device index storing the values in the memory pointed to by value Wyo The order of the registers is specified in the header file M N Note Calling order is important dspd read once registers must be called before calling dspd read core registers Ifthe calling order is reversed the values in the OnCE registers will have been altered Some r
238. e memory writes count words of memory in the DSP device The values are taken from the buffer pointed to by value T y Valid values for mem_space are P MEM program memory M X MEM X data memory ON ___ gt Y MEM Y data memory The return value is set to DSP OK if the operation succeeds DSP ERROR if it fails Example D 21 dspd write memory Write DSP memory block Se include simcom h include driver h int devn status unsigned long x mem buf 0x100 devn 0 dsp new devn 56002 WE Allocate structure for device 0 a 56002 status dspd write memory devn X MEM 0 04001 0 01001 amp x mem buf 0 D 28 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 22 dspd write once registers Write OnCE Registers to DSP Device include adsreg56 h include simcom h include driver h int dspd write once registers device index reg num count value 1 int device index Index of DSP device affected by command int reg num First once register to write lcm unsigned long count Number of registers to write Ee unsigned long value Pointer to area holding register values C dspd write once registers writes count OnCE registers starting at register reg num to the target device device index The values weitten a are taken from the memory pointed to b
239. e or disable the paging of data on the session window This is particularly useful when displaying large amounts of data and you wish to examine the data page by page M The paging feature is turned off by default and data will scroll d across the screen when it is larger than the size of the screen Example 3 34 MORE Command Examples more N n Turn on session display paging control more i Disable session display paging control reset or default state MOTOROLA DSPADSUM AD 3 55 User Interface Commands Detailed Command Descriptions 3 6 29 NEXT Step Over Subroutine Calls or Macros NExT dev list count LI lines inst 1 The NEXT command functions the same as the STEP command except that if the next instruction to be executed calls a subroutine or begins execution of a macro all the instructions of the subroutine or macro are executed before stopping to display the enabled registers In order to recognize macros the symbolic debug information for the program code must be loaded The debug information is included in the COFF format cld files generated using the Assembler s g option 9 The optional count value enables repeating of the NEXT command the specified number of times before execution terminates breakpoints are ignored while the NEXT command is executing P d Example 3 35 NEXT Command nuc e Step over subroutine calls
240. e register or move the register directly to the Global Data Bus Register 5 20 DSPADSUM AD MOTOROLA Functional Description Communicating with the Target OnCE Port 5 8 1 OnCE Command Format OnCE 8 bit commands consist of five address select bits and three control bits as described in Figure 5 13 OnCE register addresses are slightly different on the 16 24 and 32 bit DSPs An example command sequence for reading a register value follows using the DSP56002 OnCE register addresses OPDBR register is at address 9 and the OGDBR register is at address 8 a 7 6 5 4 3 2 1 0 R W GO EX RS4 RS3 RS2 RS1 RSO an R W 0 Write Data to Register selected 1 Read Data from Register selected W Bee GO 0 Do not execute opcode OPDBR _ e PA 1 Execute opcode in OPDBR 0 Remain in the Debug mode gt 1 Exit the Debug mode to the User mode RS4 RSO OnCE Register Select bits 4 0 Figure 5 13 OnCE 8 Bit Command Format S 582 OnCE Port Protocol Two of the four OnCE port pins Debug Serial Input OnCE Status 0 DSI OS0 and Debug Serial Clock OnCE Status 1 DSCK OS1 are initialized to outputs during hardware reset of the DSP These pins provide information regarding whether the DSP is in STOP WAIT mode waiting for an external access to complete or whether executing normally from internal RAM These pins should have
241. e slot number is 1 For example slot 4 of a multi slot machine would be 0x440000 DNI Be sure to change the permissions for this file s by ME command hostname chmod 666 dev mdsp0 N T If you have installed multiple host interface cards repeat the mknod and chmod steps for each new card The major number for each will be the same but the lt minor gt number will reflect the slot in which the card was installed The device file names are arbitrary but you should make note of which card corresponds to each device file name We Suggeor using a final digit of N 1 for slot Edit the file usr sam lib kc ToS tx m add an entry for the ADS device driver You may wish to make a backup of the file before editing it Add the line mdsp Out Motorola ADS Host Interface Card Select and edit a dfile configuration description file First change directories by executing hostname Jetc eonf A dfile must now be selected Your current system dfile should be called either dfile dfile SAM for a kernel that has been configured with the HP System Administration Manager or a unique name given by you if you have altered your Kernel configuration by hand Use the dfile appropriate for your system If you aren t sure which version to use or if your choice doesn t work then you can pn use the file created by the command system TOOL get kdfile hp ux gt dfile current to
242. e will be recorded i in its own buffer and possibly also written to its own Session log file and displayed nen that device becomes the current device i N Note activity in the Command and Session windows may be recorded to a log file See Log in the File menu 4 514 Save Files y AA A At the end of a development session any other convenient time or part of the system status may be saved The entire debugger configuration all memory and register contents counters display settings breakpoints etc may be saved to a GUI status file This may be reloaded later and development may proceed from where it was interrupted This is handled by Save State and Load State in the File menu Memory contents may be saved as COFF or OMF object modules These files will contain any patches applied during the session See Save in the File menu Finally the window positions may be saved on exit See Preferences in the File menu The next time the debugger is used the windows will open where they were left Ps 4 5 15 Input Conventions N meric values including addresses are assumed to be in the default radix unless prefixed by a radix identifier grave accent decimal hexadecimal binary Many input fields accept expressions either expressions or DSP Assembler expressions Program symbols may be used in expressions if debug information 4 12 DSPADSUM AD MOTOROLA 4 6 The File m
243. e word to Guia value the least significant word should be at reg val with more reg val 1 etc Example 4 Write value 100 to pc register vid 0 Us dsp_ findr g to determin device and register numbers for include simcom h A RN u include protocom h 4 E int devn int periph num reg num unsigned long regval devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 regval 1001 if 45 findreg devn pe amp periph num amp reg_num 1 wreg devn periph num reg_num amp regval D 70 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 64 sim docmd Execute Emulator User Interface Command include simcom h include protocom h sim device index command string int device index DSP device index to be affected by command 1 char command string User interface command to be executed sim docmd executes emulator command that the emulator normally accepts from the terminal ADSDSP normally calls sim gtcmd to get a valid command string from the terminal then calls sim to execute it The device index determines which DSP device in a multiple DSP emulation is affected by the command execution The devices are numbered 0 1 2 n 1 in an n device system so be very careful for example to u
244. ecifies term as the input filename the ADS program enters a resident editor which allows creation of an input data file The data file is given a temporary name termxxxx io 0000 9999 and is saved on the disk at the termination of the INPUT command The entire contents of the input file may be specified in this manner including any of the valid fields specified above second level of terminal data input allows the user to be prompted any time the next input data value is needed This method is triggered if the lower case letter tis encountered in the data field of the input file Each time a t is encountered the user will be prompted for a single data value from the terminal The ADS user interface will read the input data using the radix option specified in the INPUT 15 the default input radix RS Example 3 27 Examples of Terminal Input Within an input File t 30 Request the next thirty input values from the user SQ SRM an ESCAPE character is entered 9 All input values are to come from the user interactively until an ESCAPE character is entered NR E 3 48 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions Example 3 28 Example Of Program That Resides on a Target DSP5600x Input Requirements 1 Load with file number and word count a For 16 bit devices the file number will be in the upper byte and word count byte b For 24 bit devices t
245. ection Header Format Bytes Declaration Name Description 0 7 s name Section name null padded 8 15 CORE ADDR s paddr Physical address 16 23 CORE ADDR s vaddr Virtual address M 24 27 long int S size Section size in words 28 31 long int s scnptr File pointer to raw data TS 32 35 long int s_relptr File pointer to relocation entries 36 39 long int s_Innoptr File pointer to line number entries 40 43 unsigned long s Number oi relocation 44 47 unsigned long s nlnno of line umber entries 48 51 long int s flags 4 flags see Figure E 7 The section name is an 8 byte character array padded with null zero bytes if required In Motorola relocatable object files section names may be longer than eight characters In this case the convention used for long ymbol names is followed where if the least significant four bytes of the section name field contain zeroes the name is in the symbol table at the offset given by the most significant four bytes of the name field See Section B 3 3 5 Symbol Name on page B 14 for more information on the handling of long symbol names 4 The physical address is the address where the section text or data will reside in memory The address value depends upon whether the section is absolute or relocatable If the section is absolute then the physical address is the actual address where the secti
246. efault or selected target DSP address tobe displayed on the screen Help for a particular command can also obtained by entering the command and a question mark 2 Example 3 24 HELP Soma Examples help Display a summary of the available commands with their arguments Display a summary of the ASM command i its sarguments and some examples help omr Display a description of the OMR ub target DSP address 1 help oscr Display a 5 of the Era bits of the default target DSP address break Display a summary of the BREAK command its arguments and some examples MOTOROLA DSPADSUM AD 3 45 User Interface Commands Detailed Command Descriptions 3 6 23 HOST Interface Address HOsT PC IO addr TIMEOUT value The HOST command allows the user to reconfigure the Host Interface card I O address or set the timeout count for interaction with ADMs or target systems The I O address may be started at 100 200 or 300 only on the IBM PC interface The TIMEOUT argument is used to change the host timeout value In order for the user interface to avoid becoming hung up it limits the time it will wait for the Command Converter to respond If the Command Converter does not respond within t this limit an error message will be displayed The default value of the timeout is 1 second Example 3 25 HOST Command Examples D host Display the current Host Interface Car
247. egister Register information commands error messages output from the Display menu etc This can be BUE normal mode for this window i i Register View shows E v00 Session LE commands entered l 0888 1 0000 rie 0088 nt m jer for device and output dpt 0000 bero d n n cyc ictr cnt1 800888 cnt2 666666 cnt3 800888 cnth 880688 p 83ac 962080 888058 jsr 2558 p Fpr8 path C DSPCODE OBJECT path C XDSPCODEXSOURCE load prolog At break all enabled Loading file C DSPCODEXOBJECT prolog c1d _ registers are output 1 fbreak p esca No memory enabled here Changed __ Break 1 p 88cd h deu 8 pc 88cd 1891 y 000000000000 b values are in red 1 x8 r7 0000 7 0000 m7 j yi 888888 y6 50000008 r 6 a2 1 r5 0080 n5 48888 5 b2 bi r4 58688 n amp 4 58888 r3 0000 n3 58888 m3 1 sr i omr 82 r2 158 2 225 2 1 0000 1 0000 ri 0000 ni 0000 mi Break instruction is Esha le zj ae hae nO SFFFF displayed ipr 8000 bcr fffF ictr cnti 888888 cnt2 888880 cnt3 888888 cnt amp 000008 3100 888882 move gt 2 0 Figure 4 46 Session Window Register View 4 40 DSPADSUM AD MOTOROLA 4 7 24 Display View Assembly Source Use the Session window to view the p memo
248. egisters for example the register may be too large to be held in a single location These registers are also defined as a number of smaller registers a0 a1 and a2 Such registers require an element in the value array for the compound register and one for each of its component parts The value returned for the compound register is undefined Each of the component values is returned and must be assembled by the calling program if the value of the compound register is required The return value is DSP OK if the operation succeeds DSP ERROR if it fails Example 0 15 dspd read core registers Read core registers include adsreg56 h include simcom h include driver h int devn status unsigned long count once buf once 15 count core buf core ADSCOREMAX devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 count once 15 all OnCE registers count core ADSCOREMAX all core registers get OnCE first then core Sstatus dspd read once registers devn OSCR count once buf once status dspd read core registers devn ADS A count core buf core D 22 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 16 dspd read memory Read Memory Block from DSP Device include simcom h include driver h int dspd read memory device index mem space address count value int device index Index of DSP device affe
249. elect desired file type from Select drive g pulldown list to specify which fr 1 4 file is to be j i in li files are displayed in list list replaced Figure 4 7 Memory OMF Dialog Box 4 16 DSPADSUM AD MOTOROLA Graphical User Interface File Menu 4 6 4 File Save State File Load State Memory COFF Memory OMF State The Load and Save State menu items allow the state of the m entire ADS system to be saved and later reloaded This Nutnnt includes the state of all DSP devices in the system their device type and for those devices which are enabled the entire contents of memory registers counters status registers peripheral registers etc Additionally the state of the GUI is saved including the command history buffer ences 3 and the session output buffer for each device Memory COFF Memory OMF State This may be used in several ways A protracted development session may be saved before a break and reloaded after the interruption to be continued where it was left off Alternatively if a particular part of a program is proving troublesome the state may be saved just before the problem area simplifying the setup for 1 attempts to isolate the problem Or a set of standard routines and data areas may be pre loaded in a GUI state file making it easy to set up the environment for testing some new code The dialog bo
250. elected Device Set Default Confiaure M Set Default Device 41 Select a device c from the pul downlistand click OK P cs Figure 4 53 Modify Device Set Default Dialog Box N 4 8 7 Modify Device Configure Change Register Change Memory 5 AS Copy Memory Modify Device Configure allows information to be Radix Devi specified about the DSP devices in use If a device is not UIT Down specified the current default device is assumed M M e Type tThis selection specifies which particular member of the DSP family is in use Type automatically adds a device to the system initially Device 0 On Device is turned on able to execute instructions e Off Device is temporarily unable to execute instructions Memory and register contents is retained Remove Device is no longer considered to be part of the system data is lost N Configure Device Select type of configuration to PES Select device Eon SM 10 configure Dvi C Off _ Defaultis Dv2 C Remove current default Dv3 device Dv4 Device Select DSP type from list selected above Figure 4 54 Modify Device Configure Dialog Box MOTOROLA DSPADSUM AD 4 45 Graphical User Interface Modify
251. em The FORCE command asserts a hardware reset or asserts a debug request on one or more target systems This command is useful for reinitializing all registers as well as peripherals to their Reset state or when the user wishes to halt real time executin of the target DSP to interrogate its registers and or memory All communication with the target DSP program model must be done while the target DSP is in the Debug mode of operation Asserting a debug request is only required once to enter the Debug mode Exiting the Debug mode is accomplished via a GO TRACE or STEP spans ora FORCE RU The B break argument asserts a debug request on the DSP and the register values will not be altered Program execution can be resumed after a break by 1 using a GO command The R reset to Debug mode argument asserts the debug request on the DSP after the RESET pin is asserted and continues asserting the debug request until after the RESET pin is de asserted thus bringing the DSP into the Debug mode of operation at reset CENE The RU reset to User mode argument asserts the RESET on the DSP pin only and does not assert a debug request thus bringing the DSP out of reset into the mode specified by the external mode pins which can be set by the user The S System argument causes a CFORCE R followed by a FORCE R of the devices specified in the command This command basically resets the Command Converter and then the target putting it into t
252. emory locations starting at 100 from device 0 include simcom h include protocom h include coreaddr h ON y unsigned long address unsigned long count nsigned long memval 20 t devn int devn 0 dsp_new devn 56002 Allocate structure for device 0 a 56002 address 100L count 20L ok dsp_rmem devn memory_map_x address count amp memval 0 MOTOROLA DSPADSUM AD D 59 C Library Functions Library Function Descriptions 0 3 53 dsp rreg Read a DSP Device Register include simcom h include protocom h dsp rreg device index periph val int device index DSP device index to be affected by command int periph num DSP peripheral number int reg num DSP register number M unsigned long reg val Return register value goes here E dsp rreg reads a register specified by periph_num and reg num from device device index and stores the value in the location pointed to by reg val Registers which return more than one word as the register value will return the least significant word in reg_val 0 the most significant word in reg_val 1 Use the emulator help reg command to obtain list of the valid periph and reg num values and reg val size for each register Also dsp findreg canbe used to obtain the peripheral and register number by using the register name as a key Exam
253. emory window see also Modify menu Register option MM 45 7 Program Execution the Tool Bar The tool bar provides convenient control of program execution The green light allows program execution to proceed until interrupted the red light interrupts it Step executes either an instruction or a line of code depending on whether the source information is available Next is the same as Step except on meeting a call to a subroutine or function if you speak C Step treats the subroutine like the rest of the code and stops after each instruction in the subroutine Next treats the subroutine as one instruction and stops after it is finished 4 5 8 Device Selection i The debugger can support multiple DSP devices up to thirty two depending on the configuration Each device may be configured as part of this session or excluded The DEVICE button selects which DSP processor is affected by user commands at any given time which device s memory bank is displayed in this Memory window which device s register is being changed which device is affected by this breakpoint This is called the Default Device The Device entry in the Modify menu can configure and turn devices On or Off when instructions are executed all devices which are on will execute in turn MOTOROLA DSPADSUM AD 4 9 Graphical User Interface Graphical Interface Functions Overview 4 5 9 Breakpoints There are two types of breakpoint used by the
254. en optimized When compiling with the alo flag this strange behavior might be considerably more noticeable If this is the case compile with the fno opt flag which disables optimization Ce NN e 752277 N 38 C DEBUGGING COMMANDS 2 Certain commands WHERE UP DOWN FRAME STREAMS REDIRECT exist specifically for debugging C programs while other commands BREAK EVALUATE FINISH GO NEXT STEP TRACE UNTIL and WATCH are useful in debugging C programs but are also used in assembly language debugging To eliminate duplicated functionality the EV ALUATE command is used in C debugging as the CHANGE DISPLAY and EVALUATE commands would be used in assembly language debugging For instance to display a C variable EVALUATE that variable To change the value of a C variable EVALUATE an expression that has an assignment to that variable EVALUATE is used just as it would be for an assembly language expression to evaluate and display the result of a C expression In addition to the result the type of the result is displayed For example when evaluating an expression that involves long integer variables the result type displayed would be long V 3 9 EXAMPLE DEBUGGING SESSIONS This section goes over debugging two simple C programs one that performs a binary search on a constant array and one that performs a binary tree traversal writing each elem
255. ent on the tree out to disk These two example programs contain examples of many commands useful for C debugging The two programs are both included in source form with the ADS distribution These files are binsbad c binsgood c and trav c The file binsbad c is a version of a binary search program with bugs in it The file binsgood c has no known bugs The file trav c is used in the second session to illustrate the use of more debugging commands 3 92 DSPADSUM AD MOTOROLA User Interface Commands Example Debugging Sessions 3 9 1 Binary Search Example For brevity the full text of the source code for the binary search program is not shown here You should compile the file binsbad c start the ADS software and follow through the instructions in the rest of this section step by step so that what is happening in each step is clear to you Assuming you have already compiled the binsbad c source file with the debugging flag started the ADS host software and reset the DSP you should now load binsbad cld 7 to load the file that resulted from compiling binsbad c The first thing we will do is step over the program text at a very high level to verify that the program appears to be working We will then step through in c detail and find that there are problems which result in both poor efficiency and i improper execution First set a breakpoint at function main y break al main Now that you
256. enu handles all operations associated with file handling The operations covered are Cm Graphical User Interface File Menu has been loaded C expressions must be enclosed in brackets 1 See Section 3 4 17 for expression information Program locations are often specified with the mapping in one field and the address in another field Sometimes one field is used for input In this case the location may be input as a program line number 116 see Section 3 3 or an address including the memory type e g p 4117 FILE MENU Pah 0 027 Save N it T Path specifies a primary directory as the default for all h Input operations and alternate paths for file read operations Output Separate paths are maintained for each DSP device 10 Streams 10 Redirect Load and Save operations load object modules into memory write selected memory areas out into object modules and save and reload the entire status of the development system N Input and Output provide simulated data for a program and saves output produced by a a program Log Macro About Preferences IO Streams and IO Redirect provide a basic stream IO environment for C programs running on the development system Stream IO may be enabled or disabled and the basic stream files STDIN STDOUT STDERR redirected to files on the development host Log permits Command and Session wi
257. equest D 42 D 65 dsp_findmem D 43 dsp_findreg D 8 D 44 dsp_fmem D 45 dsp_free D 46 dsp_free_mem D 47 dsp_go D 48 dsp_go_address D 49 dsp_go_reset D 50 dsp_init D 51 Index 2 DSPADSUM AD dsp_ldmem D 52 dsp_load D 53 dsp_new D 11 D 54 D 80 dsp_path D 55 dsp_realloc D 56 dsp_reset D 57 dsp_rmem D 58 dsp_rmem_blk D 59 dsp_rreg D 8 D 60 dsp_save D 61 dsp_spath D 62 dsp_startup D 63 dsp_status D 64 dsp_step D 65 dsp_stop D 66 dsp_unlock D 67 dsp_wmem D 68 dsp_wreg D 70 dspd_break D 10 dspd_cc_architecture D 11 dspd_cc_read_flag D 12 dspd_cc_read_memory D 13 dspd_cc_reset D 14 dspd_cc_revision D 15 dspd_cc_write_flag D 16 dspd_cc_write_memory D 17 dspd_check_service_request D 18 dspd fill memory D 19 dspd_go D 20 dspd_jtag_reset D 21 dspd_read_core_registers D 22 D 24 dspd_read_memory D 23 dspd_read_once_registers D 22 D 24 dspd_reset D 25 dspd_status D 26 dspd_write_core_registers D 27 dspd_write_memory D 28 dspd_write_once_registers D 29 dspt_masm_xxxxx D 30 dspt_unasm_xxxxx D 31 E execute 1 instruction 3 68 execute DSP program 3 44 execute n instructions realtime 3 65 execute n instructions until address 3 71 Expression object file B 28 MOTOROLA File object B 1 file i o commands D 71 D 72 filename D 55 memory D 80 state file D 53 D 61 D 80 filename suffixes adm D 53 D 61 cld 3 64 D 52 D 80 cmd 4 24 D 72 D 35 D 52 floating point breakpoint 3 18 f
258. er REDIRECT dev_list STDIN OFF file REDIRECT dev_list STDOUT STDERR OFF file A O C REDIRECT dev_ list OFF STREAMS dev_ list ENABLE DISABLE TYPE E dev_ list c_expression UP dev_ list count Command Converter Control _ CCHANGE dev list FLAG XPTR YPTR address block to expression CDISPLAY dev list FLAG XPTR YPTR address block CFORCE dev 1151 R reset B break D Debug mode U User mode CGO dev list address MOTOROLA DSPADSUM AD 3 9 User Interface Commands Command Summary CLOAD dev list filename CSAVE dev num address block filename O A C CSTEP dev list count CTRACE dev list count GUI Windows WASM dev_list OFF WBREAKPOINT dev list OFF d WCALLS dev list OFF WCOMMAND OFF WHERE dev list In Sey WINPUT dev_list OFF WLIST win num OFF file WMEMORY dev list win num space e addr WMEMORY win num OFF WOUTPUT dev list OFF N WREGISTER dev _ p vin mum OFF WSESSION OFF WSOURCE dev list OFF WSTACK dev list OFF WWATCH dev list win num wn radix reg addr expression WWATCH dev list win num wn OFF Miscellaneous p EVALUATE dev list B bin D dec F flt H hex U Uns expression C AN expression 2 DEVICE dev list device type ON OFF X DEVICE dev num cc num tms num chain
259. er B now installed and ready for use By default the ADS program attempts to open the device file dev mdsp0 If you want to use a different device i e different host interface card you can specify the device file name in an environment variable or on the command line The environment variable is ADMADDR The command line option is d followed by the name of the device file The d option must come before a command file name For example to use dev mdsp2 you could set an environment variable before invoking the ADS software using the following statements setenv ADMADDR dev mdsp2 58 adsXXXXX command file where XXXXX is the device or you can invoke the ADS software with a command line argument such as adsXXXXX d dev mdsp2 command file MOTOROLA DSPADSUM AD 2 15 Preparation and Installation Configuring the Command Converter 2 6 CONFIGURING THE COMMAND CONVERTER The universal Command Converter supports both the OnCE and JTAG serial protocols The universal Command Converter may be identified by the surface mount DSP56002 which controls its operation The monitor program resides in SRAM and is downloaded by the ADS software during Command Converter initialization and reset operations The Universal Command Converter has two user configurable jumper groups JG2 which selects the device number and JG3 which selects the power source forthe buffers 2 4 2 2 6 1 Selecting the Command C
260. er control sequences 5 23 SREC l communications protocol 5 21 creation C 5 connector pinout 6 6 format C 3 Index 4 DSPADSUM AD MOTOROLA types C 4 start execution D 48 D 49 D 50 D 65 stop execution D 66 Sun 4 Card installation 2 8 symbolic debug command finish 3 41 list 3 51 next 3 56 until 3 71 view 3 73 symbolic debug display display modes 1 10 T toolbar 4 69 U UNLOCK 3 70 W wait specified time 3 74 Watcom compiler 2 6 window behavior 4 4 windows function summary 4 56 wwads D 79 MOTOROLA DSPADSUM AD Index 5 Index 6 DSPADSUM AD MOTOROLA
261. erboard you may install the Host Interface Card Figure 2 1 illustrates the physical locations of JG1 and 2 LR 37 pin ADDRESS IRQ SELECT Converter SELECT Interface ___ ISA Interface not to scale Figure 2 1 PC compatible Interface Card Jumper Group Locations The Host Interface Card resides in the ive I O bus and is the particular address block with which the ADS User Interface Software communicates The Host Interface Card address block may Re changed to start at one of three addresses as follows 2 _ Table 2 1 PC compatible I O Addresses i address 1 0 PC compatible Peripheral 1 To 102 default Undefined A8 open all other pairs linked 200 202 A9 open other pairs linked 300 302 Prototype Port 8 A9 open all other pairs linked If the Host Interface Card address block is changed from the default 1XX46 the selected address must be specified to the ADS This may be done in one of three ways e Set the environment variable ADMADDR gt SET ADMADDR 200 e Issue the ADS command host 0 gt host io 200 e Use the d option on the ADS command line gt ADS56300 d 200 2 4 DSPADSUM AD MOTOROLA Preparation and Installation Installing the PC compatible Software To install the Host Interface Card properly position its front bottom corner in the plastic card guide channel at the front of the PC compatible ch
262. ere are various command line options available when executing the SREC utility When entering no command line options the default file output wil be X for X Data memory values Y for Data memory values 1 for Long ata memory values and P for Program memory values To create file which may be loaded into an EPROM programmer Motorola 5 record format and is suitable for BOOTLOADING a user must enter the b command line option This option uses byte addressing when transferring load addresses to S record addresses Following example is a a listing of the example code fragment used in Appendix A lt Example 1 S record File 32 bit Data S0044649521A 53240000300000340000200013 4801806 481000009 19 2000 20008204808620001113 S30600212000199F 5 57030000 Ww Entering the m command line option will create 4 separate files with 1 P2 and suffixes for Program memory files This option splits the 32 bit word into 4 bytes where PO files contain S records for the bits 0 7 P1 files contain S records for the bits 8 15 P2 files contain the bits 16 23 and P3 files contain the bits 24 31 This option allows the user to program 4 separate EPROMs EEPROMs where the data byte is aligned to the correct address on each device Entering the b command line option will use byte addressing when transferring load addresses to S recor
263. erters are physically in the target system JG2 of the Command Converter card defines the address selected for that card When a user wishes to communicate with a Command Converter its address must first appear on the interface cable output control lines before the Command Converter can communicate with the host computer The host computer must then hold that address on the control bus until communication has ended 5 6 DSPADSUM AD MOTOROLA Functional Description Command Converter Card Buffer amp I P select 14 pin Target JTAG OnCE DSP56002 37 pin Host Computer Interface Figure 5 3 Command Converter Block Diagram 5 3 1 Converter Handshake Signals The DS 56002 c on n the Command Converter card is configured such that bits 0 7 of its Port B are used for 8 bit data transfers and bits 8 14 are used for data transfer control There are three output control bits in the middle order byte of the DSP56002 Port B data word These bits are the ADM INT ADM REO and ADM ACK signals ADM REO and ADM act as handshake lines for reading and writing data ADM INT acts as a flag to indicate whether the ADM is requesting host computer service These three control bits are part of the host parallel control bus They are enabled when the host computer selects the ADM MOTOROLA DSPADSUM AD 5 7 Functional Description Command Converter Card There are three input control bits in the middle order b
264. es displayed in red in the Session window are enclosed in braces Using the List File window the session log can be viewed without closing the log first bypassing the limit on the session buffer size However anything written to the Session window after opening the List File window will not be accessible in that Selecting Source Display Status writes an additional line to the Session log This requires that the Source window must be tracking the source or the Session window must be set to View Source in the Display menu Enter file name manually if desired Session log files use extension Log Use wildcards to specify which files are shown in file list Open Log File File Name arm tlogsess log ydebug log Directories c tgui notes Double click on required file or Single click and OK to open log Another dialog box will open to confirm action if file already exists vdebug log Save File as Type All Files 755 Drives c micron ADS56000 A file with that name currently exists Overwrite Select desired file type from pulldown list to specify which files are displayed in the list f Select directories _ from the list by double clicking to build a path Select drive from pull down list Specify action to be taken if file selected or entered already exists
265. ew the source break al main go Wea The main routine contains calls to create_tree_node to create aes our tree It builds a simple tree and then calls write_tree_to_file to write the tree out 2 Step over the calls to create tree node next 8 Use the EVALUATE command to add yet another node onto this tree This illustrates the ability to call C functions from the command line evaluate tree gt right gt right gt r ight create djs node 9 Now step over the call to write tree_ to file and the tree will be written out to the file next Examine the file treefile txt to see the results MOTOROLA DSPADSUM AD 3 97 User Interface Commands Example Debugging Sessions gt MA 29 77 v _ 1 MSN 3 98 DSPADSUM AD MOTOROLA GRAPHICAL USER INTERFACE SECTION 4 MOTOROLA DSPADSUM AD 4 1 Graphical User Interface 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 2 INTRODUCTION rs suero peus 4 3 HOST SYSTEM 5 4 3 PLATFORM 5 4 3 GENERAL WINDOW 4 4 GRAPHICAL INTERFACE FUNCTIONS OVERVIEW 4 6 FILE 4 13 DISPLAY Lon qr MODIFY
266. ey Translated Keyboard Input simw gkey This function gets a keystroke from the terminal and maps it to one of the accepted internal codes used by the emulator The internal codes are defined in simusr h This function should not output the character to the terminal This function is a good candidate for modification if you want to change the set of input control characters used by the emulator B D 4 7 simw putc Output Character to Terminal No NU simw putc c AN NC This function outputs the character in the variable c at the current cursor and column position It advances and updates the sim const curclm variable This function is not used often by the emulator and it is not very time critical when it is used so the emulator implementation is just to call simw puts after creating a temporary string from the character c M gt 0 4 8 simw_puts Output String to Terminal simw puts line colum text flag int line Move cursor to this line for output int column Move cursor to this column for output char text Text string to be output int flag 0 1 1 bold on off by 2 all bold This function outputs the string in text to the terminal at the specified 1ine and column Highlighting of output can be enabled either by setting the flag parameter to 2 or by enclosing text in curly braces and setting the flag parameter to
267. f a line of code breakpoints are listed in the Breakpoint window These are HALT breakpoints the program is halted and control returns to the user With the Execute menu breakpoints may have several other actions associated with them For example incrementing a counter four are available tracks how many times a piece of code was executed a note can be written to the Session window record the event that the breakpoint was executed or a selection of registers memory locations and expressions values which may never have been calculated by the program during its normal execution but which may be useful for you to know can be displayed to the Session window this is set up by Breakpoint in the Execute menu So far all the breakpoints have been associated with program locations It is also possible to place hardware breakpoints in the data so that when a specific memory location or memory block is accessed wherever the PC is at the time the breakpoint occurs and the specified action is performed It is possible to set multiple breakpoints on a single location or event to specify multiple actions say increment a counter display some values and halt to be taken at the same time 4 10 DSPADSUM AD MOTOROLA Graphical User Interface Graphical Interface Functions Overview 4 5 10 Simulated Input and Output DSP programs do not usually exist in isolation It is necessary to simulate interaction with the electrical world
268. f instructions It is necessary to call 4 check service requ st O to find out when the target device has executed the instruction and retur ed to mode The function returns TRUE on successful completion FALSE Ts Example D 58 ds GNSEep DO Execute 1 DSP instruction on device 0 include simcom h include protocom h int devn status y unsigned long step count M TE devn 0 j dsp_new devn 56002 Allocate structure for device 0 56002 step_count 11 status dsp step devn step count MOTOROLA DSPADSUM AD D 65 C Library Functions Library Function Descriptions 0 3 59 dsp stop Force DSP Device into Debug Mode include simcom h include protocom h dsp stop device index int device index DSP device affected by command dsp stop forces the device device index into Debug mode ELA The function returns TRUE on successful completion FALSE otherwise Example D 59 dsp_stop force DSP device to debug mode MA finclude simcom h finclude protocom h gt x lt N int devn status p devn 0 s gt dsp_new devn 56002 allocate structure for device 0 a 56002 status dsp_1dmen devn x14 10d load program 6 file status dsp go devn start the device rumning user program Sic lt later M status dsp stop devn s
269. fetches program memory moves or data memory accesses A Memory Breakpoint Counter OMBC must be loaded to cause a halt of program flow on the nth occurrence of the breakpoint The Debug mode of operation will be entered after the opcode at the breakpoint address has been executed The OBC should be loaded with n 1 times of breakpoint occurrences The OnCE port is scalable so that single chip DSPs of different sizes can use the OnCE controller concept The die area of the DSP96002 permits extra features that are not feasible on less powerful devices therefore hardware breakpoint registers vary in size and features For example the DSP96002 has separate data and program memory breakpoint comparators while the DSP56002 only has one set of breakpoint comparators The DSP96002 and the DSP56002 have a Program Upper Limit Register OPULR and a Program Lower Limit Register OPLLR These registers allow breakpoint address ranges to be defined The DSP56L811 uses only a single breakpoint address OPBR Conditional or unconditional software breakpoint opcodes DEBUGCC may be set in Program RAM The DSP Status Register may be evaluated in real time to determine whether to halt program execution depending on whether particular bits are set or clear For example setting a DEBUGEQ opcode in program flow will only cause the program to halt if the status register Z bit is set Software breakpoints set on opcode addresses only DG 2 Softwar
270. ffer section number is really the buffer instance count in this file Buffer type is either modulo or reverse carry The buffer limit gives the upper bound for the buffer size even though the block may contain less initialized data than this limit suggests The overlay memory structure gives the runtime memory attributes for this block The overlay section number is really the overlay instance count in this file The overlay origin expression is the expressi given for the runtime counter in the assembler ORG directive N B 3 3 10 3 Tag Names Auxiliary entries for C language structure and union tag names have the format described in Table B 20 Note In Motorola DSP COFF the size of the associated structure or union is in words as opposed to bytes as in standard COFF The x endndx field is used to create a linked list of tag name entries through the symbol table DR Table B 20 Tag Name Symbol Auxiliary Entry Byte _ Declaration Name Description 0 5 2 Unused zero filled 8 11 unsignedlong x size Size of structure union or enumeration in words 12 15 Unused zero filled 16 19 long int x endndx Index of next structure union or enumeration entry 20 31 Unused zero filled B 20 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components B 3 3 10 4 END OF STRUCTURES The format for C language end of structure
271. files created with File Log Command may be submitted as Macro command files N vivvivvivviv As the commands are read from the o file m are displayed in the Command window executed and echoed in the Session window along with any output generated Commands which affect an individual device will execute on the current device unless the command specifies a particular device Thus a single command file may be executed repeatedly if required for a number of devices by selecting a different device before each execution Macro file execution may be aborted by Execute STOP or the Stop light button on the tool 7 4 6 15 Load Save File 2 T information panel which identifies the product Input name and version that Motorola has copyright on the product and Output acknowledges copyright of software incorporated into the product This notice is displayed during start up and closes automatically if not Log dismissed within three seconds Preferences 4 24 DSPADSUM AD MOTOROLA Graphical User Interface File Menu About ADS56000 Motorola DSP Debugger Version 6 0 18 Copyright c 1995 Motorola Inc All Rights Reserved i Copyright Visix Software Inc All Rights Reserved Run Time Components Only 2 Click to dismiss Figure 4 16 About Dialog Box 4 6 16 File Preferences
272. files for the current default target DSP address input dv2 p 200 data io Open data io file for input to target DSP address 2 and place in the target DSP address 2 input list Note 200 is the address where the DEBUG opcode will reside ed input dv2 7775 Close current input data files assigned to target DSP address 2 p input dv1 2 L Display the file number 2 input filename for target DSP address 1 input p 400 data io rf G 7 Open data io file for input to the default target DSP address as ASCII fractional and place in the default target DSP address input list NS Note 400 is the address where the DEBUG opcode will reside NS input 600 term Nns Create a term file for input The file number defaults to the first available number one or greater Note 600 is the address where the DEBUG opcode will reside N 1 1 4 gt ES 3 50 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 25 LIST List Source File Lines LIST addr The LIST command displays source lines or disassembled instructions from the specified source file or beginning at the specified address The current display mode determines whether a source file or assembly mnemonics will be displayed If the simulator is in the Register display mode this command will switch it to the Source display display the source file lines associ
273. ftware Break 4 50 Execute Breakpoints Set Hardware 4 51 DSP56300 and DSP56600 Breakpoint Logic 4 52 _ Hardware Break lt 5 0 4 53 Execute Breakpoints Clear err 4 53 Execute Breakpoints Enable Disable 4 54 Wall m 4 54 xi 29 ger Dee Io wed i e o NOV 4 55 4 55 WINDOWS 4 55 Windows Assembly 4 57 WilidoWs 4 57 Windows Register 4 58 DSPADSUM AD MOTOROLA 4 10 4 4 10 5 4 10 6 4 10 7 4 10 8 4 10 9 4 10 10 4 10 11 4 10 12 4 10 13 4 10 14 4 11 4 12 4 12 1 4 12 2 4 12 3 4 12 4 4 12 5 4 12 6 4 12 7 4 12 8 5 1 5 2 5 2 1 5 2 2 5 3 5 3 1 532 6 5 853 53 4 5 3 5 6 5 4 5 4 1 5 4 2 5 4 3 5 4 4 4 59 4 60 Windows Calls 4 60 Windows Watch 4 61 Windows List 462 Windows Input rM MES Windows Output sss 4 63 1 5 qo NA 4 63 Win
274. get DSP address DEvickE dev list device 11 DEvicE dev num chain num tms num chain pos device type DEVICE cc num tms num chain pos IR count The DEVICE command allows the user to Select the current device for command input and session output Activate one or more of the target devices controlled by the ADS e Specify the device type of each target device List the type and status of each device Specify the position of devices JTAG chain NA Specify non Motorola devices in a JTAG chain e Enable and disable each device A gt Deactivate device and deallocate associated structures iM gt The command line prompt displays the number of the currently selected device At start up device DVO is activated and selected as the current device device type specifies which type of ok DSP i is being emulated If omitted a default value will be selected depending on t the device family in use Use DEVICE command for a list of supported device types ON makes the specified device s active for program execution OFF suspends program execution for the specified device The state of the device is not otherwise changed y Xdeactivates the device and discards all associated structures If the X parameter is used for the current device another device will become the current device At least c one device must be act
275. get your current system dfile Make a backup copy of the selected dfile and edit the selected dfile by adding the following lines to the top of it Motorola DSP ADS Device Driver mdsp DSPADSUM AD MOTOROLA Preparation and Installation HP7xx to Command Converter Interface 9 Generate the files needed to rebuild the kernel with your new device driver Execute this command replacing dfile name with the dfile you selected in the previous step hostname etc config dfile name 10 Generate a new kernal object file in the current directory using the following command M hostname make f config mk XOBJS libmdsp a 11 If the build finished successfully your new kernel may now installed Make a backup of the current kernel by executing the following A hostname cp hp ux hp ux pre ads 12 The final step is to Install the new kernel in the root path and reboot the system Note the period before the first slash in the first the S command hostname cp hp ux hp ux VV To reboot the system using the new kernel pe the m command hostname exec reboot ot During boot up you should see the following message displayed on the screen if the installation was successful Slot slot num Motorola DSP Interface Card Initialized where lt slot num gt is the previously selected slot number in which the card is installed cu The ADS Device Driv
276. gurations of the ISA card refer to Section 2 2 2 on page 2 3 of this chapter The 7 device driver and user interface program support multiple gt host interface cards in a system Therefore when reading the software installation instructions keep in mind that the device driver name s must be different for each card installed in a system 2 5 1 Installing the HP 7xx Interface 7 Before installing one more ISA cards a sequence of steps must be followed to shut down your system If you are using HP VUE carry out steps 1 through 4 of Section 2 5 1 1 If you are using the HP UX command line shell carry out steps 1 through 4 of Section 2 5 1 2 N To shut down your computer you be logged i in as root Save all open files prior to shutting down and always follow the proper shutdown procedure before turning off the power to your workstation Failure to do so could cause damage to files Note hostname represents the system prompt i e it is not to be entered as part of the command 2 5 1 1 HP VUE Shutdown 1 Use the HaltSystem application located in the System Admin file of the General toolbox by double clicking on its icon 2 Click on t the OK Halt System button to initiate shutdown 3 When message Halted you may now cycle power appears you may safely turn off the power to your workstation 4 to step 1 of Section 2 5 1 3 on page 2 11 2 5 1 2 HP UX COMMAND LI
277. h for creating and accessing files The main path is used for created files assuming no path is explicitly specified with the file name and is the first place searched for an input file This is known as the Working Directory Alternate Source Paths are also searched in turn if an input is not found in the working directory Thus object files may be stored in one directory and sources in another and each may be accessed easily These paths are set up with Path in the File menu 4 5 4 Loading Object Files The development system can load object filesi in COFF and OMF formats into memory These files may be produced by the DSP gt Assembler and C Compiler with file types cld and lod COFF files may contain symbolic debugging information in addition to the object code permitting the use of variable names and labels during the debug session Use the File menu Load option to load the program into memory If the source files are present i e in the object directory or one of the directories set up with File Path the Source window displays the source code around the current instruction 4 5 5 Examining and Changing Memory After loading the program you can look at the program in memory The Assembly window Windows menu Assembly option lists the memory contents disassembled Symbolic references are included if symbolic data was loaded from a COFF file The Assembly window also permits editing the program wi
278. hardware breakpoints to occur on Program memory addresses or Data memory addresses A real time 24 bit breakpoint counter allows the user to stop program execution and to enter the Debug mode of operation after the nth occurrence of entering the breakpoint address The user has the option of selecting whether the Program memory access is either a read a write or read write generated from the Program controller T hardware breakpoint accesses are as follows Table3 1 Hardware Breakpoint Access c Break Access Meaning r Break on Program Data memory read Break on Program or Data memory write rw Break on Program or Data memory access _ Table 3 2 and Table 3 2 on page 3 15 describe the different breakpoint types for each DSP 3 2 OnCE Hardware NT Types DSP Break Type 4 lt Meaning on any Program core fetch read only pom Break on Program read fetch or move read only 24 32 bit pefm Break on Program access fetch or P move r w 24 bit Break on executed fetch only read only 32 bit Break on Program memory DMA accesses 24 bit pa Break on Program access r w l6bit Break on X address bus 1 access 16 bit xab2 Break on X address bus 2 access 24 32 bit _ i Break on X data memory access r w _ 24 32 bit Nu P ya Break on Y data memory access r w 4 32bit xdma
279. he Debug mode of operation Example 3 21 FORCE Command Examples force r Force a reset on the current default target DSP address This command will destroy the contents of some registers since reset initializes them automatically force b 2 Force the current default target DSP address into the Debug mode of operation Program execution will haltand the DSP will enter the Debug mode waiting for command entry from the Host EU viathe OnCE debug port force c dvi 45b Force target DSPs 1 4 and 5 to halt DSP program execution and enter the Debug mode of operation for user commands force ru Reset the default target DSP into the User mode specified by its mode pins 3 42 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 20 FRAME Select C Function Call Stack Frame FRAME dev list n The FRAME command is used to select the current call stack frame It can be used in conjunction with the WHERE DOWN and UP commands to display and traverse the C function call stack After entering a new call stack frame using FRAME that call stack frame becomes the current scope for evaluation In other words for C expressions the EVALUATE command acts as though this new frame is the proper place to start for variables 7 Example 3 22 FRAME Command Examples frame 2 Select stack frame number two but 9 frame 0 7 Select call stack fra
280. he code will be in the ops 0 location ge SIN e 2 The mnemonic assembled correctly nd required 2 words of code The first word will be placed in ops 0 the second in ops 1 e 3 The mnemonic assembled correctly and required 3 words of code The first word will be placed in ops 0 1 the second i in ops 1 the third in ops 2 Note The xxxxx in the name should be replaced by a device family number It should be 56k for the 56000 family devices 56n00 for the 56n00 family devices and 96k for the 96000 family devices Example D 23 dspt masm Assemble the instruction move r0 r1 include proto56k h _ unsigned long opcodes 3 char 2 int retval gt 1 0 amp error_ptr 2 P d D 30 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 24 dspt unasm xxxxx Disassemble DSP Mnemonics include proto56n h n k 1 3 8 include proto96k h int unasm xxxxx ops return string sr gdbp unsigned long ops Pointer to opcodes to be disassembled char return string Pointer to return character buffer unsigned long sr Value of device status register 1 unsigned long omr Value of device operating mode register 3 char gdbp Return value reserved for use by debugger _ dspt unasm disassembles 0 and possibly
281. he file number will be in the upper byte and word count in the lower 2 bytes 7 2 Load RO with the starting location of the source block 3 Load R1 with the source memory space B a MOVE 0 R1 Move block to P memory space 0 b MOVE 1 R1 Move block to X memory space MOVE 2 R1 Move block to Y memory space y 4 Execute DEBUG instruction to enter P n mode of operation Code Example MOVE 1000c x0 file 1 input a block of 12 words DSP5600x only MOVE 4 0 R0 starting address of block is 0 MOVE 1 R1 jin X memory space DEBUG enter Debug mode 7 CSS M Example 3 29 Example Of Program That Resides on a Target DSP9600x Input Requirements 1 Load RO with file number in upper byte and word count in lower two bytes 2 Load R1 with the starting location of the source block 3 Load R2 with the source memory space a MOVE 0 R2 Move block to P memory space b MOVE 1 R2 Move block to X memory space 78 MOVE 2 R2 Move block to Y memory space Execute DEBUG instruction to enter Debug mode of operation Code Example MOVE 10000c RO file 1 input a block of 12 words MOVE 450 81 starting address of block is 0 MOVE 1 R2 in X memory space DEBUG enter Debug mode MOTOROLA DSPADSUM AD 3 49 User Interface Commands Detailed Command Descriptions Example 3 30 INPUT Command Examples input Display currently open input
282. hich would have been returned if the expression had been included in the program at the current execution point C expressions can be evaluated in the context of any of the functions on the call path to the current function See Modify Up Modify Down and the Call Stack window to select an alternative evaluation context 2 C Evaluate Expression Radix Select C Binary radix for atb Decimal display Fractional Enter expression to O Floating Point evaluate Enclose C Hexedecimal C Unsigned expression in C All i Apply Figure 4 29 Display Evaluate Dialog Box Expression Expression is echoed evaluated and the result displayed 7 ________ 1 I 20 expressions in brackets expressions display type of _ expression but can print in any format evaluate a b Hex 86666069 66606066 080000015 0993943 Frac _ evaluate d a b lt DSP Assembler expressions print in 08000615 8993944 selected format or All gives a selection depending on the expression Figure 4 30 Display Evaluate Output MOTOROLA DSPADSUM AD 4 33 Graphical User Interface Display Menu 4 7 10 Display Call Stack This selection displays summary information about call stack frames The dialog box initially offers to display the entire call stack a selection can be made to display only the specified number of innermost or outer
283. hin a single target DSP device To transfer information from one target device to another use the SAVE command to create an object file which may then be loaded 1 into the destination device Example 3 14 COPY Command Examples copy 0 30 p 100 Me 5 2 Copy the data in current default target DSP address program memory starting at 0 and ending at 30 to program memory starting at 100 dv3 0 30 dv2 p 100 e Copy the data in target DSP address number 3 program imemory starting at 0 and ending at 30 to target DSP address number 2 program memory starting at 100 copy x 0 100 p 0 744 Copy one hundred memory locations beginning atx memory location 0 to p memory beginning at location 0 a r copy x 100 200 x 150 Copy the data in the current default target DSP address X memory starting from hex 200 down to hex 100 and put the data in the current default target DSP address X memory starting at hex 250 down to hex 150 Whenever the addresses of the source and destination overlap the source end address will be used and the addresses will be decremented rather than incremented copy xdat xdat 40 72 40 locations beginning at the address corresponding to symbolic label xdat to the block beginning at address corresponding to symbolic label ydat MOTOROLA DSPADSUM AD 3 33 User Interface Commands Detailed Command Descriptions 3 6 13 DEVICE Select Default tar
284. hine that is running and automatically choose an appropriate Real mode to Protected mode switch technique For those few cases in which this default setting does not work the dos4gw exe program supplied on Tools CD uses the environment variable DOS16M in order to choose an appropriate real to protected mode switch technique In case the default operation does not work on your computer change the switch mode settings with the following command set DOS16M value Do not insert a space between DOS16M and the equal sign The README file on the Tools CD gives more information on the use of different PC compatible machines and the value used for those machines The following procedure shows you how to test the switch mode s 1 Before running DOS 4GW applications check the switch mode setting by running the PMINFO program and note the switch setting reported on the last 7 line of the display PMINFO EXE is provided on the Motorola Tools CD If PMINFO runs the setting is usable on your machine 2 If you changed the switch setting add the new setting to your autoexec bat file 3 In order for the virtual memory capability to operate properly the PC s environment variables must have a defined variable DOS4GVM with options to define virtual memory parameters If the DOS4GVM environment variable does not exist the virtual memory capability does not operate The possible parameters are 2 6 DSPADSUM AD MOTOROLA Preparation
285. ice Structures Creation ads startup 100 ADSP56000 NS dsp startup dsp new 0 56002 Allocate structure for device 0 a 56002 dsp 1 56002 Allocate structure for device 1 a 56002 dsp 2 56002 Allocate structure for device 2 56002 D 5 2 Loading Program Code or Device State i N The display version of the emulator provides the high level sim_docmd function interface It allows the user to simply execute the high level load or load s emulator commands to load program code or a emulator state file The non display version of the emulator makes use of the lower level function calls 1 and dsp 1oad to accomplish the same results They are described in Section D 3 The major difference from their high level counterparts is that no filename expansion is provided in the lower level calls The program code loaded by the 1dmem function may be any COFF format or OMF format file The OMF format is created as the output of versions of the Macro Assembler prior to release 4 0 and of the Emulator save command The OMF file format is described in Section A 1 The COFF format files are the output of the Macro Assembler beginning with release 4 0 or those saved by the Emulator save command with the suffix cld The COFF file format is described in Section B 1 The Emulator state loaded by thedsp load function may have previously been saved by a display or non di
286. ich is used for the OnCE command sequence transfers to the target DSP cdisplay xptr iN Display the X memory pointer which is used to save valies read from the OnCE port when executing serial sequences 00 3 24 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 5 CFORCE Assert Reset or Break on Command Converter dev list reset B break D Debug mode U User mode The CFORCE command is used for forcing a hardware reset or hardware interrupt on a Command Converter The D option can be used to force the Command Converter into the Debug mode in the event that the target has entered the Debug mode by some means other than through the ADS program such as a DEBUG instruction in the user code The U option can be used to force the Command Converter into the User mode in the event that the target has entered the User mode by some means other than through the ADS program such as a push button reset or power on reset When using the U or D arguments internal flags of the user interface program are also set or cleared CAUTION Placing the Command Converter in Debug mode when the target is NOT in Debug mode can cause improper behavior of the ADS system M 1 Example 3 7 CFORCE Command Examples Cforce dvir Force a hardware reset on Command Converter 1 Cforce b l Force an interru
287. ield of the main symbol entry An auxiliary symbol table entry contains the same number of bytes as its associated symbol table entry and is contiguous with the primary entry in the object file Unlike primary symbol table entries however the format of an auxiliary entry depends on the type and storage class of the main symbol B 3 3 10 1 Filenames The auxiliary table entry for a filename contains a 14 character array followed by an unsigned long integer If the integer is zero then the filename is in the array Otherwise it is in the string table at the offset given by the integer value B 18 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components B 3 3 10 2 Sections Section auxiliary entries have the format shown in Table B 17 This information is analogous to selected fields in the corresponding section header If the object file is relocatable a section symbol entry will have a second auxiliary entry with the format shown in Table B 18 Table B 17 Section Symbol Auxiliary Entry M Bytes Declaration Name Description am 0 3 long int scnlen Sectionlength 4 7 unsigned long x nreloc Number of location eames 8 11 unsigned long x nlinno Number of ine numbers 12 31 Unused zeig filled Table B 18 Section Symbol 2 audias Bytes Declaration Name X Description 0 3 long int secno Logical section number 4 7 l
288. ilies feature breakpoint logic with twin comparators These comparators each provide a True False indication which may be combined in four ways to fully specify a breakpoint condition These combinations are e AND both conditions true causes breakpoint e OR either condition true causes breakpoint One access type and memory space applies to both conditions Specify how to combine the two conditions Complete one or both conditions as appropriate Remainder of dialog is as above Figure 4 62 Execute Breakpoint Set Hardware Dialog Box DSP56300 DSP56600 4 52 5 THEN first condition true and then second condition true causes breakpoint ONLY first condition true causes breakpoint second condition is not considered Type Type s Memory Space Option C And 6 Or C Then C Only gt Breakpoint Number Count 2 Lv Set Breakpoint First Condition Access Address Qualifier C Read Equal C Write C Not Equal Read Write Greater Than Execute C Less Than Address 100 Second Condition Access Address Qualifier C Read C Equal C Write C Not Equal Read Write Greater Than Execute Less Than Address 500 DSPADSUM AD Action Halt Note C Show C Command C Increment 1 C Increment CNT2 C Increment CNT3 Increment Expression 0 gt 5 2 MOTOROLA Graphical User Interface
289. imcom h include protocom h include cc h include coreaddr h int dsp_cc_wmem device mtype address value int device Command Converter affected by command enum memory_map mtype Memory space to write unsigned long address Address of location to write unsigned long value Source location for value to write a 152 dsp wmem writes one location in the Command Converter devi ce memory space mt ype address address using the value in the location pointed to by value Valid values for mtype N 4 N 2 A As DSP CC YMEM DSP CC 5 DSP CC gt The return value is TRUE on successful completion FALSE otherwise 0 Example 0 33 dsp wmem Wu Write to a location in Command Cortar memory include simcom h 52 include protocom h include cc h include coreaddr h int devn status NN enum memory map write memtyp memory space to write unsigned long write address address of location to write AER write store location to hold value to write 14 devn 0 Allocate structure for device 0 56002 Y 3 P A write memtyp DSP CC XMEM set memory space for write write address 0x00401 set write address write required location status dsp wmem devn write memtyp write address amp wr
290. in the C program running on the DSP call the host software intercepts the call and does the fopen on the host side See REDIRECT command Section 3 6 34 on page 3 63 2 CN Example 3 45 STREAMS Command Examples Streams e Enable handling of C input output All input output calls done in a C program running on the DSP will be handled by the host software e g fopen fwrite etc streams d Ww Disable handling of C input output 3 66 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 38 5 5 System Access SYSTEM C continue immediately system command argument list SYSTEM is a non GUI command that allows operating system commands to be executed The operating system commands may be executed as subprocesses of the ADS interface program or may be executed independently by temporarily exiting the ADS interface program Invoking this command with no arguments will cause the ADS Interface Program to pass control to the Operating system but stay resident To re enter the ADS Interface Program the EXIT command must be invoked from the operating system command line 1_ Operating System commands invoked from within the ADS Interface program will not be logged to the screen buffer for review C When a SYSTEM command is specified on the system command M the user is prompted to Hit return to continue before control returns to the AD
291. in the command line Output Section 3 4 30 Set Output File No First Enter address of DEBUG Select radix to available no is offered instruction written into be used for data output P Select data pen Output File to file or ah 1 aep _ session C Decimal Span 27 Hexedecimal Terminal String Enter file name for file File Name c jex tdata run4 io Click to open file WS gt 4 6 8 File Output Close Output Close closes all or selected outputs from the default 5 device A dialog box opens offering of the currently open Pin 10 Streams Address IO Redirect output numbers for the default device Select the outputs to be closed using the appropriate combination of mouse clicks lt CTRL gt Clicks and Click and Drag Then close all selected outputs by clicking OK See File Input Close for close dialog box usage illustration LN 4 6 9 Streams m rd Toad File Streams enables or disables stream I O for C programs 4 running on the current device The standard stream files are Output supported STDIN STDOUT and STDERR Any references C programs to these files may be redirected to files on the host See File IO Redirect Stream file handling may be configured independently for each device By default streams handling is enabled If a C pr
292. ind required file on search parh include simcom h i include protocom h int devn status char full name 80 devn 0 CN dsp 1 new devn 56002 Allocate structure for device 0 a 56002 sim dc d devn path c work temp set up working directory sim device_ index path c work bin and alternate source path gt find first occurrence of myfile on path status dsp spath myfile lod full name D 62 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 56 4 startup lnitialize DSP Structures include simcom h include protocom h int dsp startup dsp startup initializes general DSP structures which are not device specific It should be called once and only once during program initialization before any calls to ads startup and dsp new Example 0 56 startup startup include simcom h d include protocom h Ww M S ads startup 100 ADSP56000 24 lt dsp startup Initialize DSP structures 1 m dsp new 0 56002 Allocate structure for device 0 56002 dsp new 1 56002 Allocate structure for device 1 a 56002 lt Xn i DSPADSUM AD D 63 C Library Functions Library Function Descriptions 0 3 57 dsp status Determine DSP Device Status include simcom h
293. inted to by mode p dr Valid values for mode are l DSP USER MODE device is executing a user program Ws DSP_DEBUG_MODE device is in debug mode n The function returns TRUE on success or FALSE otherwise Ww M N Example D 19 dspd status determine status of DSP 0 include driver h include simcom h int devn status NL int device mode 4 devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 status dspd status devn amp device mode get device status 17 D 26 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 20 dspd write core registers Write Core Registers to DSP Device include adsreg56 h include simcom h include driver h A int dspd write core registers device_index reg num count value int device_index Index of DSP device affected by command int reg num First once register to write unsigned long count Number of register words to write aa unsigned long value Pointer to area holding register values dspd write core registers writes count core registers starting at reg num to target device device index The values written are taken from the memory pointed to by value 29 The order of the registers is specified in the header file adsregXX ho Some registers for example the a
294. interrupt CC s 15 BRACE SEL Brace56 Emulator select signal 16 19 1 3 5 7 CC data bus bits1 3 5 7 20 25 GND HOST CC ground lines 26 12v 12 volts from the HOST 27 29 5v 5 volts from the HOST 30 HOST ENABLE HOST signal which enables CC address logic 31 33 GND HOST CC ground lines 34 37 2 4 6 HOST CC data bus bits 0 2 4 6 DSPADSUM AD 6 5 Host Computer Card Command Converter Support Information JTAG OnCE Interface Cable 64 JTAG OnCE INTERFACE CABLE The Command Converter 14 pin connector is hooked to the target system through the JTAG OnCE interface cable These signals provide the control signals to as many as twenty four target DSP or other JTAG devices Table 6 4 JTAG OnCE Connector J3 _ Pin Signal Signal Description 1 TDI DSI Target JTAG OnCE Serial Input 2 GND Ground da e 3 TDO DSO Target JTAG OnCE Serial Output 4 GND Ground M 5 TCK DSCK Target JTAG OnCE Serial Clock 6 GND Ground 7 DR Target OnCE Debug Request Input 8 No Connect Used as Key 9 CC RESET Target DSP Reset Input 10 50 Target Test Mode Select 0 input 11 Vdd Target Vdd Supplies OnCE Buffer HC367 12 TMS1 Optional Target Test Mode Select 1 not required 13 DEZ JTAG OnCE Debug Event input output 14 TRST Target JTAG Reset Input 10k gnd AAAA TDI DSI 1 vc an m
295. ion sci 1 0 file format for sci peripheral portio 1 0 file format for portb or portc once I 0 file format for OnCE peripheral WSOURCE Source Window WSOURCE deu list OFF wsource Open a source window for the current device wsource off Close the source window for the current device Figure 4 84 Help on Specific Topic 4 68 DSPADSUM AD MOTOROLA Graphical User Interface The Tool Bar 4 12 THE TOOL BAR The Tool Bar is located in the main window just below the menu bar It comprises a number of buttons providing a convenient way of performing frequently used functions 4 12 1 Go Button fr The Go button starts program execution from the next address All break oints will be acknowledged This button is equivalent to Execute Go from current address with no target breakpoint QC i NC 4 12 2 Stop Button m d g The Stop button interrupts DSP program execution and returns control to the user The command force b appears in the Session window If a macro command file is executing it is aborted by the Stop button This button is equivalent to Execute Stop ae 2 MN c A AM 4 12 3 STEP Button The STEP button executes one execution step If the source window is open tracking the program source STEP executes one line of code Otherwise STEP executes one instruction On encountering a JSR instruction STEP proceeds with the first instru
296. ion entries and line number records in the file The buffer and overlay counts give counts for each instance of a buffer or overlay in the module The major version minor version and revision number fields reflect the assembler and linker versions to ensure linker backward compatibility The optional header flags hold special mode flags for the linker B 6 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components Table B 4 Motorola DSP Optional Link Header Format Bytes Declaration Name Description 0 3 long int modsize Object module size 4 7 long int datasize Module raw data size 8 11 long int endstr End directive expression string 12 15 long int secnt Logical section count 5 16 19 long int ctrcnt Counter count 1 20 23 long int relocnt Relocation entry count 24 27 long int Inocnt LIne number entry cunt 28 31 long int bufcnt Buffer count E 32 35 long int ovlent Overlay count 36 39 long int majver Major version number 40 43 long int minver Minor version number 44 47 long int revno Revision number 48 51 long int optflags Optional header flags Table B 5 on page B 8 defines the contents of the runtime optional header This header is similar to the standard COFF a out header but there are differences The magic number in this header is not the same as the magic number in the file header this magic nu
297. ion provides background information on what features are available and gives examples of the commands that implement these features The main thrust of this section is the tutorials at the end which give practical examples of how the debugging features might be used No special mode needs to be entered to debug C programs and all of the familiar ADS capabilities are available while debugging C programs 3 7 1 C Debug Features ND The features available for debugging C programs include Ww SN 3 Step line by line through C programs Examine and change the value of C variables Evaluate complex C expressions including the ability to call C functions from the command line N Set breakpoints based on C expressions e Add C variables and expressions 2 watch list Examine and traverse the C function call stack examining local variables and parameters at each level of the stack Redirect C input and output Determine the type and location of a C variable along with the result type of a C expression 372 Expressions C expressions may be used as arguments to the break evaluate type and watch commands Expressions must be surrounded by the left and right curly braces and This is so that expressions can have spaces in them yet will still be considered a single parameter to a command Any valid C expression can be used between the braces with the exception of expressions that
298. ions Library Function Descriptions dsp_cc_fmem Fill Command Converter Memory with a Value simcom h protocom h ccn coreaddr h int dsp_cc_fmem device mtype address count value int device Command Converter affected by command enum memory_map mtype Memory space to fill i unsigned long address Address of start of memory block unsigned long count Length of memory block a unsigned long value Fill value 23 TN pointed to by value Valid values for mt ype 5 DSP CC YMEM e DSP CC XMEM The return value is TRUE for success FALSE otherwise If the return value is FALSE then some but not all of the specified locations may have been changed e DSP CC PMEM Example D 26 dsp fmem Initialize CC statistics buffer include include include include simcom h protocom h A coreaddr h int devn fill value status LU devn 0 556002 Allocate structure for device 0 56002 fill value 0 dsp cc fmem dewn DSP CC XI EM 4101 0 201 amp fill value MOTOROLA DSPADSUM AD D 33 C Library Functions Library Function Descriptions D 3 27 4 cc go Start Command Converter Program Execution include simcom h include protocom h int dspd cc go device index int device index
299. ions are not supported e g they must be evaluated at assembly time and operators are provided for linker specific operations Also floating point terms found in these expressions are converted to binary values 5 1 Data Expression Generation NGI N Link file data expressions are generated when operands encountered during assembly incremental link processing In most cases the operand expression is copied verbatim from the source and embellished with link evaluation control constructs For example consider the source line below MOVE 2700 RO N The DSP96000 assembler produces following encoding for this line in the object file Bc 3A8D2000 FOO 8040 Since the symbol FOO is not known to the assembler it generates a two word instruction and places a relocation reference to the expression in the position of the second instruction word The braces indicate that this is a user expression that should adhere to certain integrity constraints such as those governing absolute and relative terms Otherwise the braces are treated much like parentheses The at sign 0 is a binary operator indicating the memory space of the left operand by the right The pound sign 9 is a binary operator signifying the size in bits of the left operand by the right More information on these special operators and their operands is given below ample of data expressi
300. ions is useful for scanning the list of section headers The date and time stamp is kept in binary form and may contain a host dependent time value The f symptr field contains a file byte offset to the beginning of the symbol table The number of symbol table entries provides an upper bound for looping through the symbol table and an indirect means for accessing the start of the string table The size of the optional header allows for jumping to the start of the section header list The flags field is a set of bit flags which convey status information about the object file It is used primarily by linkers debuggers and other loader software to determine whether the file is valid for a particular requested operation The individual bit flags are shown in Table B 3 MOTOROLA DSPADSUM AD B 5 Motorola DSP Object File Format COFF Object File Components Table B 3 File Header Flags Mnemonic Flag Meaning RELFLG 0000001 Relocation information stripped from file F EXEC 0000002 File is executable no unresolved external references F LNNO 0000004 Line numbers stripped from file Plc LSYMS 0000010 Local symbols stripped from file 2 1 F CC 0010000 File produced by C compiler Motorola DSP oly Wey B 3 2 Optional Header M The COFF optional header ordinarily is used to hold system dependent or runtime information This allows different operating environments to store data that only that environment u
301. isplay to the register display window will select the Register display mode and the ADS LOAD and LIST commands will switch from the Register display mode to the Source display mode 1 10 DSPADSUM AD MOTOROLA General Information Getting Started 1 6 GETTING STARTED After following the installation instructions in Section 2 you should be ready to begin a debug evaluation session In order to communicate with the target DSP it must be put into the Debug mode of operation When first entering the ADS user interface program and the user is just starting a debug session the user interface program automatically resets the Command Converter M A good starting reference when initially starting a debug evaluation session is to reset the Command Converter user interface program and target DSP into the Debug mode of operation by issuing a FORCE S system reset command If the user exits the user interface program and has put the target DSP into the User mode of operation by issuing a GO command or by toggling the target DSP reset pin the FORCE B put the DSP into the Debug mode from the User mode or FORCE R put the DSP into the Debug mode from the Reset state command must be executed so the target i is forced into the Debug mode There are status flags in the ADS user interface program and in the Command Converter monitor that are used to determine whether the target is in a User mode of operation in the Debug mode ready to communicate w
302. ite store D 40 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 34 dsp cc wmem blk Write Command Converter Memory Block include protocom h finclude cc h include coreaddr h int dsp_cc_wmem_blk device mtype address count value int device Command Converter affected by command enum memory mtype Memory space to write unsigned long address Address of location to write ose unsigned long count number of locations to write unsigned long value Source buffer for write values 22 dsp cc wmem blk writes count locations in the Command Converter device memory space mt ype address address and obtaining the values from the buffer pointed to by value N in A 6 Valid values for mtype DSP_CC_YMEM DSP and DSP __ _ The return value is TRUE on successful FALSE dsp wmem b lk Write several locations from Command Converter memory Example D 34 include simcom h include protocom h include cc h include coreaddr h int devn status enum memory_map write_memtyp memory space to write unsigned long write_addr address of first location to write write_length number of locations to write write_store 1024 buffer holding values to write J devn 0 A set device number dsp new
303. ith the JTAG OnCE port This is necessary so that if the user exits the ADS user interface program and the target is in the Debug mode the ADS user interface program will initialize its debug status flag correctly by reading the Command Converter monitor debug status flag For more information on the status flags refer to the CFORCE command in Section 3 When power is applied to the ADS system via the 37 pin connector there are two reset circuits that are activated The Command Converter has a reset circuit which will put the DSP56002 controller into its monitor program and will wait for commands from the host computer Any time the power is removed from the target and or Command Converter the FORCE 5 command should be executed This will insure that the user initializes the system into a deterministic state Section 4 discusses in detail the functional description of the system interaction between the ADS user interface program Command Converter monitor program and the target JTAG OnCE port good tip to remember for OnCE based systems is that whenever the target is put in the Debug mode of operation its DSO pin DE pin for newer DSPs is toggled low This pin is tied to the pin of the Command Converter If power is removed from the target with the 14 pin JTAG OnCE cable connected to the Command Conver er the DSO line will look like a low signal This will cause the Command Converter to request service from the host computer Note
304. ivated at all times the last device may not be deactivated LU JTAG parameters The ADS supports up to eight command converters on a development host Each Command Converter supports one JTAG chain which may service up to twenty four devices The DEVICE command associates each device in any position in the JTAG chain with an ADS device number dvn The ADS only performs debugging operations on Motorola DSP devices However to support target systems incorporating other devices the DEVICE command also permits the specification of the JTAG instruction register length so such devices may be handled correctly 3 34 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions DVn Specifies the device number to be used to access the device described by the remainder of the parameters 0 31 CCn Specifies the Command Converter to which the device is connected 0 7 TMSn Specifies which TMS Test Mode Select line controls this device 0 1 Command Converter revision 6 only supports TMSO POSn Specifies which position the device occupies in the JTAG chain The device connected directly to TDO from the Command Converter is position 0 0 n C vd T IR n Specifies the length of the instruction register for unsupported devices 2 lt n 7 7 Note The defaults for the above parameters are as follows Cn defaults to the device number DVn and all other parameters
305. ize Command Converter for DSP Family mr D 11 dspd_cc_ read 1ag HRead Command Converter Flag Word WO THEE D 12 dspd read memory Head from Command Converter AN Pn RR TREE D 13 dspd reset HReset Command Converter D 14 dspd cc Command Convertor Revision D 15 dspd cc write flag Wfrite Command Converter Flag D 16 dspd cc write 6 to Command Converter TOT P D 17 DSPADSUM AD MOTOROLA D 3 11 D 3 12 D 3 13 D 3 14 D 3 15 D 3 16 D 3 17 D 3 18 D 3 19 D 3 20 D 3 21 D 3 22 D 3 23 D 3 24 D 3 25 D 3 26 D 3 27 D 3 28 D 3 29 D330 0 3 31 0 3 32 0 3 33 0 3 34 0 3 35 dspd check service requ st Check for Service acq rr D 18 dspd fill memory lnitialize DSP Memory Buffer to eee aes D 19 dspd_go Begin Execution on Target DSP Device z D 20 dspd_jtag_reset Reset JTAG Communications D 21 dspd_read_core registers Read Core Registers from DSP Be eee ve een Odea be ae RA 22 dspd read memory Head Memory Block from DSP Device D 23 dspd read once registers Read SINCE Registers from DSP Device oes ae ERE Pen once x D 24 dspd_reset Reset DSP Device to Debie User Mode 0 25 dspd_status Determine D
306. l AR 2 18 reached MOTOROLA DSPADSUM AD 3 71 User Interface Commands Detailed Command Descriptions 3 6 43 UP Move Up the C Function Call Stack UP dev list n The UP command is used to move up the call stack It can be used in conjunction with the WHERE FRAME and DOWN commands to display and traverse the C function call stack 1 After entering a new call stack frame using UP that call stack frame becomes the c current scope for evaluation In other words for C expressions the EVALUATE command acts as though this new frame is the proper place to start looking for variables Bt Example 3 51 UP Command Examples up N X 2 i x Move up the call stack by one stack frame 3 fay Move up the stack by three stack frames AS 3 72 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 44 VIEW Select Display Mode VIEW A assembly S source R register The VIEW command changes the ADS display mode There are three display modes Assembly Source and Register See Display Modes in Section 1 for a description of the display modes If the VIEW command is entered with a parameter the specified display mode i selected When parameter is entered the display mode cycles to the next display mode in the following order Source Assembly Register The same results can be obtained by typing Cirl w A N E NX 7
307. le Break 8 rw x 0 1h Pd NOTE Disable dialog box is identical i from the title bar and is not shown Figure 4 64 Execute Breakpoints E Enable Dialog Box N 4 9 12 Execute Wait A Ad The WAIT command pauses for a of seconds or forever if no count specified Pause may be ended by pressing the Cancel button or hitting enter Wait is useful in macro files File Macro where it Breakpol freezes the display while details are examined N j as Enter wait time Seconds Wait command Press Cancel to in seconds or s ae _ check Forever Jf Forever Lo Figure 4 65 Execute Wait Dialog Box Click to terminate wait 4 54 DSPADSUM AD MOTOROLA Graphical User Interface 4 9 13 Execute Stop Execute Stop interrupts execution of the DSP program or macro execution Control is returned to the user interface Any temporary breakpoint set by Execute Until is cleared 4 9 14 Execute Reset Execute Reset Device performs hardware reset on the current device asserting debug request to leave the device v in Debug mode Some registers are initialized by a reset Execute Reset Command Converter resets the command converter Windows Menu Execute System Device Command Converter Execute Reset System resets the command converter then re
308. les E wasm a Open an assembly window for the current device lt 27 wasm dvO 1 1 27 Open an assembly window for devices dv0 and dv1 Nag hag wasm off 4 NZ gt Close the assembly window for the current device N 7 3 76 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 48 WBREAKPOINT GUI Breakpoint window WBREAKPOINT dev_list OFF WBREAKPOINT is a GUI command that opens a breakpoint window Multiple device windows may be opened for debugging target systems with multiple DSPs m Example 3 56 WBREAKPOINT Command 00 wbreakpoint Open a breakpoint window for the current device does Wbreakpoint dv0 3 4 1 Open a breakpoint window for the listed devices X wbreakpoint off Close the breakpoint window for the current device MOTOROLA DSPADSUM AD 3 77 User Interface Commands Detailed Command Descriptions 3 6 44 WCALLS QGUI C Calls Stack Window WCALLS dev list OFF WCALLS is a GUI command that opens a C call stack window Multiple device windows may be opened for debugging target systems with multiple DSPs 2 Example 3 57 WCALLS Command Examples WCalls Open a stack window for the current device 115 Close the C stack window for the current device UC m N 2 linc 3 78 DSPADSUM AD MOT
309. lick and Drag Then close all selected inputs by ing OK IO Streams IO Redirect All Inputs set up for Close InputFile _ Select a the current device Input Number single Input are listed in the number with scroll box Select click those to be closed Close Input File Select multiple individual input numbers by clicking on the first one then lt CTRL gt CLICK to select additional input Figure 4 10 File Input Close Dialog Box 4 6 7 File Output Open prepares for writing data from a memory location or block in the default device to the terminal or a file to provide output The output file is associated with a DEBUG instruction in the DSP code More than one output file may be associated with a single DEBUG instruction When the DEBUG is executed registers must be set as shown in Table 4 2 Streame Table 4 2 Register Requirements for Simulated Output Data Item DSP96xxx DSP56xxx Output File Number and byte count RO X0 Output Address R1 RO Memory map P 0 X2 1 Y 2 R2 R1 MOTOROLA DSPADSUM AD 4 19 Graphical User Interface File Menu Each time the DEBUG instruction is executed the data is obtained from the output address and written to the output file associated with the file number specified The format of the data file and programming requirements is documented
310. located DSP structure The DSP structures are allocated dynamically by calling the dsp_new function for each device The device type is also selected in the dsp new function call In the display version of the emulator the device command handles the details of calling dsp new The proper sequence of instructions necessary to allocate three DSP devices is Shown below i ads startup 100 ADSP56000 dsp startup dsp new 0 5e0029 _ Allocate structure for device 0 a 56002 dsp new 1 56002 Allocate structure for device 1 a 56002 dsp 1 new 2 56002 Allocate structure for device 2 a 56002 Fi D 6 2 Controlling Multiple DSP Devices Each target device operates independently under the control of the ADSDSP emulator The basic execution sequence for a single target device is unchanged 1 Initialize DSP device MOTOROLA DSPADSUM AD D 83 C Library Functions Multiple Device Emulation 2 Load memory 3 initialize breakpoints as desired 4 initiate execution dsp go dsp step etc 5 IF DESIRED interrupt execution with dsp reset or dsp stop 6 call dsp check service request to detect return to Debug Mode When controlling multiple devices all devices require initialization as above Whenever a device starts executing as a result of a command like step or a function call like dsp go execution starts immediately for the specified device and continues
311. long int bsize Size of uninitialized data in words 20 27 CORE ADDR entry Program entry point 28 35 CORE ADDR text start Base address of text 36 43 CORE_ADDR data start Base address of data 44 51 CORE ADDR text end End address of text 52 59 CORE ADDR data end End address of data S B 3 3 Sections A section is the smallest portion of an object file that is treated as one separate and distinct entity Sections can accommodate program text initialized and uninitialized data and block data COFF sections in DSP object files may be grouped under a logical section defined by the assembler SECTION directive N It is a mistake to assume that every COFF file will have a specific number of sections or to assume characteristics of sections such as their order their location in the object file or the address at which they are to be loaded This information is available only after the object file has been created Programs manipulating COFF files should obtain it from file and em nm in the file B 3 3 1 Section Headers Every object file has a table of section headers to specify the layout of data within the file The section header table consists of one entry for every section in the file The information in the section header is described in Table B 6 on page B 9 B 8 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components Table B 6 S
312. lt gt lt gt 99 lt 9 gt S9 8120 79 99 9 Lr 29 3 19 l 09 pu 6S lt ea 6020 83 lt 0 gt ER 22 lt gt 99 8 20458 1020 S 28 LG Sv S os od S o o 0 o 0 nnn nnn S lt 92 gt 4 S S eov 4 S 0 4 S lt 8 gt S 5 lt 91 gt 4 S S lt 21 gt S 009v lt 01 gt 4 S lt 80 gt Vd S lt 90 gt S uud1s lt v0 gt Vd S lt 20 gt S lt 00 gt Vd S j beuiu 2 45 S 046 S lt 5 gt g beuiu lt 6 gt 2 lt gt lt ez gt q Ie lt 61 gt lt gt 910 lt lt 21 gt lt e gt beylul 6 0rd o 9 9 0 nw 8v Lv 97 Sv vv 57 ev Lv 07 65 85 Ze 96 GE ve 55 26 LE 05 6c 82 10 92 1574 ve c ke 02 6 8l 21 91 St l t jji lt 80 gt 16 lt 90 gt eg beuiu _ _ 4090 S lt 00 gt S 5 7 d I IL 9 1 This card is not supported on Sun Sparc 1 and Sun Sparc 1 Plus systems Note Figure 6 4 Sun Sparc SBus Interface Card Page 4 of 4 6 21 DSPADSUM AD MOTOROLA Host Computer Card Command Converter Support Informatio
313. lt _ 5 5 Local Data o 5 Data 5 MT ES QO 5 ce 9 2E 2 8 Ctrl2 55 AD2 5v and Gnd F Figure 5 1 Host Computer Bus Interface Card always act as slaves to the host computer interface card to avoid transfer collisions The ADS user interface program allows as many as eight Command Converters to be addressed using one host computer interface card Command converters may be addressed in groups or individually depending upon the command and command arguments entered by the user Host computer interface card address zero has eight output control lines These output control lines are asserted using positive logic TRUE Three address zero signals ADM SELO ADM SELI1 ADM SEL2 select a Command Converter before sending a 5 4 DSPADSUM AD MOTOROLA Functional Description Host Computer Hardware command Further information on the method of Command Converter selection is discussed in subsequent sections Two handshake signals originate at the host computer and are used to pass data to and from a Command Converter HOST REO initiates a data byte transfer to a Command Converter while HOST ACK acknowledges receipt of a data byte from a Converter 1 3 4 Two control signals ADM BRK ADM RESET allow the user to assert an interrupt ora reset exception on a single Command Converter or a grou
314. m h include coreaddr h dsp wmem blk device index memory map address count value int device index DSP device to be affected by command enum memory map memory map memory designator 1 unsigned long address DSP memory address to write Cu unsigned long count Number of locations to write unsigned long value Pointer to value to write to memory location dsp wmem blk writes count locations starting at address memory space memory map in device device index with values taken from the memory block 7 pointed to by value CN If memory map implies a two word value the values will be from value in order with the low order half of the first word followed by the high order half then the low order half of the second word etc Thus for word n counting from 0 in the memory block the low order value is taken from va lue 2 n the high order value from value 2 n 41 52 The memory map parameter selects the Appropridje dt memory structure from dt var mem for the selected device These structures are described in the simdev h file which is included with the emulator The memo ry_map parameter can be obtained with the function dsp_findmem by using the memory name as a key Use the emulator help mem command for a list of valid memory names Valid memory_map values are memory_map_ concatenated with a valid memory name As an example memory_map_pa refers to off
315. mand Y char command string Pointer to return buffer for command line sim_gtcmd gets the next command string from the terminal in an interactive mode The command line editing command expansion and on line help functions are invoked by this terminal command input function The command string is fully checked for errors prior to returning The command_st ring buffer should be at least 80 characters Example 0 66 sim gtcmd Get and execute emulator commands for device until a go type command is 57 entered include simcom h include protocom h gf include simusr h TON 2 extern struct sim const sv const Emulator device structures char command string 80 E int devn devn 0 4 AN gt dsp new devn 56002 Create new DSP structure while sv const sv devn stat executing Check for go If not sim gtcmd devn command string 1 Get command and sim devn command string Execute command DSPADSUM AD D 73 C Library Functions Emulator Screen Management Functions D 4 EMULATOR SCREEN MANAGEMENT FUNCTIONS The following sections describe functions which are provided in source code form in the emulator package in the file scrmgr c These functions define all the operations associated with emulator terminal I O The code includes conditionally compiled sections for MSDOS UNIX
316. mand will cause an assertion of the DR pin of the target DSP until an acknowledge is received on the TDO DSO pin The force r command will cause an assertion of the DR pin while also asserting the reset of the target DSP When the target reset pin is deasserted the DR pin will remain asserted until an acknowledge is received on the TDO DSO pin The host computer user interface scam as well as the Command Converter monitor program each have a flag which is set when the force b command is issued This flag tells these programs that the target system is in the Debug mode of operation and is ready to receive commands For more information refer to the command in Section 3 5 3 3 Multiple Target Connections y basic JTAG connection comprises 5 pins as illustrated in Figure 5 5 TDO TCK TARGET TMS PROCESSOR TRST 1 Optional connection Figure 5 5 JTAG Connections MOTOROLA DSPADSUM AD 5 9 Functional Description Command Converter Card Multiple target devices may be connected in series allowing a single Command Converter JTAG OnCE connector to control multiple devices as in Figure 5 6 Data flows from the JTAG host into each JTAG implementation through TDI out through TDO and into TDI in the next chip eventually returning to the JTAG host RESET TRST 19 TCK TMS TCK TMS TCK TMS TCK TMS TCK TMS TDI a __ 5 Maximum of 4 loads on Buffer 74HCT
317. mber is used indicate the file type to a host operating system The magic number and version stamp fields currently are not used by the Motorola DSP tools and are set to zero The text size field gives the size of all text type data executable code in the object file The data size field holds a count of all initialized data apart from code in the file The uninitialized data size field is not used and is set to zero The propram field represents the address given in the assembler END directive The text start and data start values contain the low addresses for text and data segments respectively The text and data end values contain the high addresses for text and data segments respectively Note that addresses are expressed in terms of the C language typedef CORE ADDR A CORE ADDR is a structure containing a long 4 byte address and an enumeration type which classifies the address according to memory space X Y L P and memory mapping internal external etc See Section B 4 1 Multiple Memory Spaces on page B 24 for more information on the CORE ADDR structure MOTOROLA DSPADSUM AD B 7 Motorola DSP Object File Format COFF Object File Components Table B 5 Motorola DSP Optional Runtime Header Format Bytes Declaration Name Description 0 3 long int magic Magic number 4 7 long int vstamp Version stamp 8 11 long int tsize Size of text in words M 2 15 long int dsize Size of data in words 16 19
318. mcom h C lt include protocom h int devn status devn 0 dsp new devn 56002 Allocate structure device 0 a 56002 1 status cnc DSPADSUM AD D 35 C Library Functions Library Function Descriptions 0 3 29 cc reset Reset Command Converter include simcom h include protocom h int dsp reset device int device CC device affected by command dsp_cc_reset resets the Command Converter device Function _ dspd architecture is called to configure the Command Converter for the SOUPE of DSP device attached This procedure may be called as part of the initialization procedures to utes the Command Converter is in a known state to recover from a gt or at any other time when the Command Converter needs to be restarted N uu D B The return value is TRUE if the operation succeeds FALSE otherwise Example D 29 dsp cc reset T gt reset Comand Converter include simcom h include protocom h int devn status devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 status dsp cc reset devn reset the Command Converter for device 0 D 36 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 30 dsp revision HRead Command Converter Monitor Revision include simcom h include protocom h
319. me default cmd is an optional parameter The macro command file should contain a sequence of commands that the user wishes to execute upon ADS start up and prior to command entry from the keyboard Macro commands may be nested a macro command file may call another macro command file to any level The macro commands may be easily generated from within the ADS program using the log command Refer to the LOG command for further details For users who are on a host computer which invokes the ADS using a mouse it may not be easy to invoke the user interface program with a macro command file To solve this problem the ADS searches for a specific file named startup cmd in the same directory from which the ADS is invoked If it finds such a file it is opened as a macro command file and the commands are executed prior to checking for the optional macro command file argument The HOST BUS to ADM interface board provides a physical link between the HOST computer and the ADM via a parallel data and control bus cable The parallel data path is used jor high speed data transfers The control bus signals enable the HOST computer to reset interrupt and send commands to ADMs simultaneously or sequentially The ADM is the basic platform for evaluating the DSP It contains a DSP chip with a JTAG OnCE interface connector to configure it as a slave to the HOST computer or as a stand alone unit In the slave configuration the user controls the DSP processor
320. me number zero innermost frame DSPADSUM AD 3 43 User Interface Commands Detailed Command Descriptions 3 6 21 GO Execute DSP Program Go dev list from location R reset 4break number occurrence count The GO command initiates program execution of DSP code It can be used to start multiple ADMs or target systems simultaneously The Command Converter monitor passes control to the user program on the ADM or target system until a breakpoint i is reached or a break is asserted with the FORCE command The GO command can be used to resume execution after a force break m Invoking the command with no argument will start execution at the current program counter value Enabled break points are examined at the end of every instruction cycle If an address argumentis included program execution begins at the address specified The R reset parameter will cause program execution to start from the user defined reset exception NOU The optional ffbreak number parameter may be used to cause ie code execution to halt only if that particular breakpoint condition occurs All other breakpoint conditions are d ignore The optional count parameter may be used to cause the code execution to halt only if the breakpoint has occurred a specified number of times The occurrence count may only be used with the break number parameter 1 A 22 3 23 GO Co
321. ment variables may be defined during system startup by adding lines to the file Nautoexec bat which applies to all versions of DOS and WINDOWS Some Windows95 installations may not use the autoexec bat file If it does not exist it may be created and the SET commands inserted The general form of the SET command is SET symbolname value Use the names and values from the sections below and do not use spaces around the sign MOTOROLA DSPADSUM AD 2 5 Preparation and Installation Installing the PC compatible Software 2 3 2 Versions of User Interface Program If the I O address of the Host Interface Card is changed from the default setting of 1xx16 the ADS user interface program must be informed of the address to access the card This may be done with the environment variable ADMADDR 1 set admaddr 200 M 2 3 3 Text Based User Interface Program Installation The ADS DOS user interface program exceeds 300 K bytes in size and dynamically allocates memory The DOS version of the ADS user interface program uses an extended memory manager DOS 4GW supplied with the Watcom 386 compiler DOS 4GW is based on Rational Systems DOS 16M 16 bit Protected Mode support This program is called during the ADS user interface program startup and must be locatable using the DOS PATH environment variable Refer to the dos4gw doc file c on the Motorola Tools CD In almost all cases DOS 4GW programs can detect the type of mac
322. ments are cleared A Example 0 44 dsp init re initialize a device NS MA include simcom h M include protocom h 26 NC dsp new 0 56002 Create new DSP structure Se dsp_init 0 Re initialize device 0 MOTOROLA DSPADSUM AD D 51 C Library Functions Library Function Descriptions 0 345 dsp ldmem Load DSP Memory from OMF or COFF File include simcom h include protocom h int dsp ldmem device index filename int device index DSP device index to be affected by command char filename Full pathname of OMF format file to be loaded u dsp ldmem loads the memory space of a specified DSP device device index from an object file filename The file may be created as the output from the DSP Macro Assembler or by using the Emulator save command and may be either COFF format Or lod format In order to specify a COFF format file the filename suffix must be cld filename with any other suffix is assumed to be in lod format _ This is a lower level function that does not invoke the user interface modules for pathname and automatic lod suffix extension The entire pathname must be specified Gd The function returns 1 if the load is successful 0 if an error occurred loading the file Example D 45 dsp_ldmem Create DSP device structures for a three device emul
323. ments are converted to long values and raw data is stored in 4 byte quantities MOTOROLA DSPADSUM AD B 25 Motorola DSP Object File Format COFF Differences Between DSP Object Format And Standard COFF independent of the word size of the target processor In some cases this wastes space in the object file and in memory but it was considered worth the price for transportability among supported hosts Also it is not a completely portable solution by any means e g for machines with larger than 4 byte word sizes The byte ordering issue was dealt with by establishing a baseline ordering providing compliance for foreign hosts with conversion code This introduces overhead lo ic on machines that do not support the baseline word order but again it was seen asa reasonable trade off to insure transportability of object files among development environments Note that byte swapping logic only comes into play for fields that are not byte atomic such as integer fields Character arrays in structures for example should not have their bytes exchanged be The byte ordering for Motorola DSP COFF is shown in Table B 29 It m to what sometimes is called the big Endian approach to byte and word ordering 4 Table B 29 Motorola DSP COFF Byte Ordering Addrn Addr n 1 4 n 2 Addr n 3 MSB MSB 1 15841 LSB S B 4 3 Structure Size Fields In some of the COFF data structures there is a size field
324. mmand Examples go dv0 1 Start DSP program execution from the current address specified by the program counter of target DSP addresses 0 and 1 The target DSP addresses will stop at the first occurrence of any breakpoint set and report to the user the register results go 100 N Start DSP program execution at program memory address hex 100 of the current default target DSP address m 010044520000 Start DSP program n execution at location 100 default radix of the current default target DSP address and halt on the third occurrence of breakpoint number 5 3 44 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 22 M HELP ADS User Interface Help Text HELP dev command reg or command 2 The HELP command allows the user to review the Application Development System command set or a particular command s description The HELP line for command entry is designed so that a minimum amount of documentation is required to use the ADS interface program Invoking the command with a command name causes a summary of that conma 5 parameters with a brief description and example to be displayed on the screen If no command name parameter is included the entire command set is displayed 2 3 The HELP command may also be used to review the register names and bit descriptions of peripheral control registers Invoking the command with a register name causes the register contents of the d
325. mmunicating with registers via an 8 bit command continues to hold true There have been minimal changes to the OnCE controller and logic The major difference i Ne the communication protocol has been changed to adhere to the JTAG eX 1 511 CHANGES TO THE OnCE PORT PINS OnCE port pins have been converted to JTAG pins on newer devices The DSI OS0 i o pin has become the TDI input pin This pin adheres to the JTAG standard and therefore no longer provides status information The DSCK OS1 pin has become the TCK input pin Like TDI this pin will no longer provide status information The DSO output pin has become the TDO output pin This pin no longer provides the acknowledge pulse since it must adhere to the JTAG standard The DRZ input pin has become the TMS input pin This pin no longer is used as an external debug request mechanism Figure 5 15 is a block diagram of the IEEE 1149 1 1990 test logic coupled to the OnCE logic TAP Controller 5 24 DSPADSUM AD MOTOROLA Functional Description Changes to the OnCE Port Pins TRST TMS 8 Controller TDI LN gt Instruction Reg fp 4 bits IR Decode Le Boundary Scan Register PA i L ID Register i TDO Y Bypass Register Y Y OnCE Logic
326. most frames Innermost Start at current procedure and work back toward main Frames Innermost C Outermost Outermost Start at main and work toward current procedure Figure 4 31 Display Call Stack Dialog Box w gt Frames are listed in order selected from inner or outer end Dv00 Session p 88c5 45f666 888801e move x gt te x1 where 3 3 x Fgi gt 0 0 5 in pr5 k 4 1 p 6x122 in k 4 here inner 2 p 8x3d2 in main Address of next instruction to execute Figure 4 32 Display Call Stack Output E E Display Radix This the default radix used for numbers input without an explicit radix specifier This applies whether the number being input is a register or memory contents value or a 4 7 11 Display Display Disassemble List Evaluate Call Stack Dialog opens with of call vs frames on _ stack Reduce if desired Increasing gives _ error message Which was called with these parameters Display Display Disassemble List Evaluate Call Stack memory address It is not affected by any Display Radix The initial default radix is Hexadecimal Dv00 Session p 0122 205600 radix The current default radix is Figure 4 33 Display Radix Output move r6 4 34 DSPADSUM AD MOTOROLA Graphical User Interface
327. n Command Converter Cables and Schematics COMMAND CONVERTER CABLES AND SCHEMATICS 6 8 00622175 40 3079 0 1318V3 8018 4 22 ON FAC 119140 1192014 54 8115 10 41181 31977 JM d dold1ANO deus 70 neut nga EE 9a ug bn 42014 apeds 2 r 3d 180003 pauu Of 56 8416 94498 42014 apeds 51484 Figure 6 5 Command Converter Power Cable MOTOROLA DSPADSUM AD 6 22 66 16 8 HO 1 1 18 HOLIHZHANOO P 1091515002 JSNW JOJOBUUOD 01 e suy NOLLVOIHSVJ J0j9euuoo L2 4ariau 15 lt 1 lt H L54dN 102 501 151 SLYVd SALON ejqeo uoqqu pueg esf Z u1oq Jo 8 uid ui LL Uld Uld Bulseds 09 0 K see 2 5 8c 5 4 Kf 1 GQNVIAINOO 47 Figure 6 6 Command Converter Interface Cable 6 23 DSPADSUM AD MOTOR
328. n Ctrl Click adds one register Ctrl Click Drag adds a range of resisters Enter a new value in the value field and click OK to change all selected registers LN Change Register Select one or more registers 2 TO gt 2 Enter new value to _ apply to all selected registers 4 Click to update all Selected registers NM OA Figure 4 48 Modify Change Register Dialog Box Modify Change Memory Copy Memory 4 8 2 Modify Change Memory Modify Change Memory changes a range of memory locations in Radix one address space on the current device to a new value All locations Up are changed to the same value i lt lt Note Addresses are frequently specified in hexadecimal Use the radix specifier for hexadecimal or set the default radix to hexadecimal Modify Radix Set Default 4 42 DSPADSUM AD MOTOROLA Graphical User Interface Modify Menu Select memory space from pull down list Change Memory M S eis dea Enter new value for entire Enter start and address range end of address 1200 specified range ange End Address Value i 51364 0 01 Apply 8 Lo Modify 4 8 3 Modify Copy Memory S X Change Register gt Qo Copy Memory Modify Memory copies one block of memory to
329. n Notes Assembly Display and edit memory contents set and clear One per Device breakpoints follow program execution 1 Source Display source program One Device CAT Register Display and modify register contents Registers Multiple arranged in alphabetical order and grouped by A peripheral jean Memory Display and edit contents of memory Memory Multiple type may be selected scroll bars access entire range of selected bank of memory gt Stack Display stack contents Indicates current top of One per Device stack There be a maximum fifteen entries Calls Display C procedure call stack lt One per Device Watch Display expressions selected for Watching Erase Multiple with double click List File Examine any text file 5 Multiple Input Display simulated input assignments One Output Display simulated output assignments One Breakpoints Display breakpoints set in code Enable and One per Device disable with double click Command Display command history Retrieve edit and One shared for all _______ A functions Session Echo commands submitted to One switched Emulator Simulator and Display output Each between devices J device has its own buffer only currently selected and functions device is shown Tile Arrange open windows in tile pattern PC only Cascade Arrange open windows in cascade pattern PC only 4 56 DSPADSUM AD MOTOROLA
330. n an address or label field Enabled breakpoints are displayed in blue 4 i 4 10 2 Windows Source AM Y lt N Register The Source window displays the source code for the executing program Memory The source code may reside in the directory containing the object module or any or the directories specified in the path see File Path The window automatically tracks the PC displaying the corresponding source line highlighted in red The scroll bar may be used to scan the whole source file but the display will revert to the current line with each execution step MOTOROLA DSPADSUM AD 4 57 Graphical User Interface Windows Menu A halt execution breakpoint may be set with the Source window Double click on a statement to set or clear the breakpoint The breakpoint is added to the breakpoint list displayed in the breakpoint window and highlighted blue in the Assembly window The presence of the breakpoint is not indicated in the Source window If no source code is available for the executing code the window shows a message giving the current PC and indicating that no source is available NE 000 Source E m Figure 4 67 Source Window no source Single line display Current instruction Scroll through whole summarizes status highlighted in red Program Display reverts to current line after execution Dv00 Source Double clic sre tfstruct c 74 pc fstruct c 377 pi 118
331. n at a time For symbolic debug capabilities the NEXT command operates essentially the same as the STEP command except that if the DSP opcode being executed calls a subroutine or macro execution continues until return from the subroutine or macro The UNTIL command has the effect of setting a temporary breakpoint at a specified address executing until a breakpoint is encountered then clearing the temporary breakpoint The FINISH command ns bid an RTS opcode is encountered for the current subroutine kt NS ing 2 3 2 4 C Source Code Debug Commands A gt There are seven C source code debug commands available The user may use WHERE to display the C function call stack The user can then use UP DOWN and FRAME to traverse the call stack The user may RE IRECT data from stdin stdout stderr to files when STREAMS are enabled and the user may also DISPLAY the data type of a variable function or C expression Section 3 8 8 gives examples on how to use these commands using example C programs proged on the ADS software distribution media 3 2 5 Command e Commands There are eight commands associated with the Command Converter board These commands allow the user to CCHANGE CDISPLAY CLOAD CSAVE CSTEP CTRACE or execute a OnCE command sequence CGO in the Command Converter Y memory This allows users the ability to write and debug their own command sequences for the OnCE debug port The CFORCE command is used to reset or in
332. n input window The input window lists all simulated input assignments for the specified device Multiple device windows may be opened for debugging target systems with multiple DSPs Example 3 60 WINPUT Command Examples Winput A Open an input window for the current device winput off Close the input window for the current device Won 7 DSPADSUM AD 3 81 User Interface Commands Detailed Command Descriptions 3 6 53 WLIST GUI List Window WLIST win num OFF WLIST is a GUI command that opens a list window A list window is used to view a test file within the ADS environment Multiple list windows may be opened for viewing multiple text files Example 3 61 WLIST Command Examples wlist Ifile ist NL Open a list window with the text file Ifile 1st displayed wlist win2 Ifile 1st N C Open a list window with a window number of 2 with text txt displayed If list window 2 already exists replace the contents with lfile 1st N lt wlist win2 off Close list window number 2 9 wlist off Close all open list windows wlist win3 Open a list window with a window Of 3 Ns no text file displayed i T D 3 82 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 54 WMEMORY GUI Memory Window dev list win num space addr OFF WMEMORY is a GUI command
333. nCE registers 7 d Also it is important to remember that writing to the OPDBR register is in effect manipulating the DSP program controller Whenever 2 word opcodes are being written to the OPDBR it is best to CTRACE or CSTEP 2 before displaying registers So Example 3 12 CTRACE Command Example Ctrace 10 Execute 10 OnCE serial commands of the default Command Converter and display the OnCE register contents after each command is executed The serial commands reside in the Command Converter Y memory and are pointed at by the Command Converter YPTR register A macro command file can help in single stepping through user defined OnCE sequences and displaying results The display of registers after a CSTEP or CTRACE were not implemented because of the nature of having to access the OPDBR register to retrieve the register values An example of a macro file would be the following Ctrace 2 Zr Single step 2 OnCE commands and show XPTR and after each trace cdisplay x 80 90 y 80 9 display the Command Converter x and y memory display Lo display the target registers 4 3 30 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 611 CHANGE Change Register or Memory Value CHANGE dev list reg block address block expression The CHANGE command allows register or memory examination or modification Memory blocks may
334. nd comment text are stored contiguously in the string table with each string delimited by a zero byte The first four bytes represent the size of the string table in bytes offsets into the string table therefore are always greater than or equal to 4 An empty string table has a length field with value zero MOTOROLA DSPADSUM AD B 23 Motorola DSP Object File Format COFF Differences Between DSP Object Format And Standard COFF B 4 DIFFERENCES BETWEEN DSP OBJECT FORMAT AND STANDARD COFF Motorola DSP COFF is substantially the same as generic COFF and usage of format elements is similar However the original COFF specification did not envision aspects of machine architecture which the Motorola DSP family possesses Moreover standard COFF encompasses a file format which is quite adaptable among host processors but is not necessarily portable among those hosts It is straightforward enough to adapt COFF to a new host machine but the intent is that the derived host format will be recognized and executed only on that target host For Motorola DSP the format had to be extended for cross development such that a given object file would be usable on all targeted host systems The following sections outline the differences and changes between standard COFF and Motorola DSP COFF C 2 4 1 Multiple Memory Spaces fo Standard COFF has no built in mechanism for accommodating multiple memory space
335. nd peripheral registers display X 0 100 Display the values of x memory 0 100 3 38 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 16 DOWN Move Down the C Function Call Stack DOwN dev list n The DOWN command is used to move down the call stack It can be used in conjunction with the WHERE FRAME and UP commands to display and traverse the C function call stack After entering a new call stack frame using DOWN that call stack frame becomes the current scope for evaluation In other words for C expressions the EVALUATE command acts as though this new frame is the proper place to start or variables Example 3 18 DOWN Command Examples p down 2 Move down the call stack by one stack frame down 2 N M 2 Move down the stack by two stack frames N MOTOROLA DSPADSUM AD 3 39 User Interface Commands Detailed Command Descriptions 3 6 17 EVALUATE Evaluate an Expression EVALUATE dev list B binary D decimal float fract H hex U unsigned expression The EVALUATE command is used as a calculator for evaluating arithmetic expressions or for converting values from one radix to another The result of the expression evaluation is displayed in the specified radix If a radix is not specified inthe M EVALUATE command line the current default radix specified by the RADIX
336. ndows to be logged to files Commands i in 1 Macro file may be executed About displays the version of the program and claims and acknowledges p copyright B Jpreterdfices controls saving of window positions Exit allows the user to leave the debugger MOTOROLA DSPADSUM AD 4 13 Graphical User Interface File Menu 4 6 1 File Path Path Set 5 x 4 Save Clear Alternate Path List A separate set of file search paths is maintained for each device File Path Set sets the default directory referred to as the Working Directory for all file accesses for the current device see Modify Device File Path Add sets one or more Alternate Source Paths for the current device On all file operations the working directory specified in File Path Set mee as the initial directory in the file open dialog box The alternate source path is used ifa command is typed directly into the command window or a file name is typed into a dialog box specifying a file name without a path In this case an output file will be created in the working directory and an input file will be searched for initially in the working directory and in each alternate source directory in found File Path Clear removes all alternate source directories specified by File Path Add future file accesses for this device will only use the working directory AOO Shows path before E y 7 Dialog menus
337. nt type pathname any valid pathname for the operating system in use radix for hinary value for decimal value for hexadecimal value y reg see ADM reference manual for register names pertaining to the particular DSP being evaluated Note reg reg reg group ALL CORE IO STACK OnCE Check the DSP User s Manual for a description of peripheral registers in the particular DSP being evaluated Use the HELP REGS command to get a description of the full set of registers in the DSP for which you are designing MOTOROLA DSPADSUM AD 3 7 User Interface Commands Command Summary 3 5 COMMAND SUMMARY Target Memory Register Modification ASM dev num B byte wide beginning at address assembler mnemonic CHANGE dev list reg block address block expression 1 COPY from dev num address block to address DISPLAY dev_list V ADM user interface program Version W Wexecuting targets DISPLAY dev list ON OFF reg _block _ group address block DISASSEMBLE dev_list B byte wide address gt WATCH dev_list wn radix reg addr expression fe expression WATCH dev list wn OFF dE E e FileI O INPUT dev list file number OFF INPUT dev list file number address TERM filename rd rf rh ru LOAD dev list B byte wide address offset from filename LOAD dev list S state M memory only
338. oD 10k d ayy KSK 5 m T e idk vec 7 KEY Connect _ CC RESET 50 for devices PIN 9 TARGET VDD 1 2 51 for devices TARGET 10k DEE TRST for jtag devices RESET in NAT 018 049 CIRCUIT for jtag devices TOP VIEW Figure 6 1 Command Converter Interface 6 6 DSPADSUM AD MOTOROLA Host Computer Card Command Converter Support Information Note Host Computer Card Bills of Materials This is a plug connector that has all odd numbers on the left side and all even numbers on the right side when viewing from top Pin 1 is on upper left side Spacing between pins is 1 10th of an inch Refer to Command Converter J3 connector as an example 6 5 HOST COMPUTER CARD BILLS OF MATERIALS 1 1 fM 1 SA Lu This section contains the bill of materials for each of the host computer interface printed circuit board assemblies in the Application Development System Table 6 5 ADS PC Compatible Interface Electrical Parts List Rev 2 01 06 06 96 Oty Description Ref Designator 727 Vendor Part Integrated Circuits N i 1 MC7LS04D Ul Motorola 2 MC74F521DW 0203 Motorola 1 MC74F138D _ 94 Motorola 2 MC74F32D 0506 Motorola 1 MC74LS00D NU lt Motorola 1 MC74F245DW 0 Motorola 2 SN7
339. oducts are not authorized for use as components in life support devices or systems intended for surgical implant into the body or intended to support or sustain life Buyer agrees to notify Motorola of any such intended end use whereupon Motorola shall determine availability and suitability of its product or products for the use intended Motorola and are registered trademarks of Motorola Inc Motorola Inc is an Equal Employment Opportunity Affirmative Action Employer w N 1 3 1 1 3 2 1 3 3 1 5 1 5 1 1 5 2 1 5 3 1 6 2 1 2 2 2 2 1 2 3 2 3 1 2 3 2 2 3 3 2 3 4 2 3 5 2 4 2 4 1 242 2 5 X 2511 2 5 1 2 2 5 1 3 2 5 2 2 6 2 6 1 TABLE OF CONTENTS 1 3 GENERAL ner 1 4 OPERATING Larne 1 6 PC Compatible Requirements EEE 1 6 Hewlett Packard HP7xx Workstation Requirements 1 7 4 or Compatible Workstation wem E 1 7 ADS SOFTWARE FEATURES NT dc Qe 1 8 TEXT BASED USER INTERFACE NM MEE 1 9 General Description A ects b Me 1 9 Command Entry mem JO PP 1 9 Display Modes Nu ce 1 10 GETTING STARTED dc P n 1 11 HOST COMPUTER INTERFACE 2 3 PC COMPATIBLE TO COMMAND CONVERTER INTERFACE 2 3 Installing the PC Compa
340. ogram attempts to access a stream file while it is not enabled and redirected the access is ignored Output is discarded and a standard value is supplied as input 4 20 DSPADSUM AD MOTOROLA Graphical User Interface File Menu 4 6 10 Redirect File IO Redirect Stream redirects the selected stream on the current device to a file on the host Each stream file may be Output assigned individually unwanted streams do not have to be TUE redirected Streams may be redirected whether stream support is Log enabled or disabled however for the redirection to be effective stream operations must be enabled Disabling stream support while a stream is redirected does not terminate the redirection It merely makes it ineffective until streams are enabled again File 1 Redirect Off ends redirection of one or more streams for the current device Only streams which have previously been redirecte may be selected Redirect IO Stream Select stream to E Stream Olick to redirect STDIN Fil STDOUT 2 C STDERR Chooser File Name Enter file name manually or Off IO Stream Redirection Select stream s to close Only Streams redirected streams gt STDIN are offered Then ID click OK to close STDERR ON Figure 4 12 File Redirect Dialog Boxes 44 2 noah File Log Commands File Load
341. ogram which are compatible with the ADS user interface program MOTOROLA DSPADSUM AD 1 3 General Information General Description 12 GENERAL DESCRIPTION The ADS provides a tool for designing debugging and evaluating DSP based systems It consists of three hardware circuit boards as illustrated in Figure 1 1 and two software programs The hardware circuit boards are the Host Bus interface Command Converter and the ADM The two software programs are the ADS user interface program which is executed on the host computer and the Command Converter monitor program Figure 1 1 illustrates the ADS being used as a hardware evaluation tool or software accelerator The ADM card has a 14 pin connector which provides an access point for the Command Converter JTAG OnCE interface a 55 AppiGation 37 pin 14 pin Applic Interface Ribbon Circuits Cable Cable N gt V i 4 V Host Computer m 5 pe DSP Host Bus db Interface Card Command _ Converter Application Development Module ADM Figure 1 1 Application Development 37 Interface Cable Command 14 pin Converter1 Serial Interface be Host Computer Up to 24 2 201 14 Devices Host Computer 2x7 Interface Card connector
342. ointer derived type The value in the symbol entry type field would result in 01100010 binary or 62 hexadecimal MOTOROLA DSPADSUM AD B 15 Motorola DSP Object File Format COFF Object File Components B 3 3 9 Symbol Storage Class The symbol storage class indicates how a symbol will be used during execution or debugging Some storage classes actually reflect how a symbol will be stored e g as a register parameter Other storage classes provide information for special symbols used in debugging such as the beginning of blocks or the end of functions Storage classes are outlined in Table B 15 The value of a symbol depends on its storage class This relationship is summarized in Table B 16 on page B 17 Table B 15 Storage Classes Mnemonic Value Type ALI EFCN 1 Physical end of function NT C NULL 0 No storage class a C_AUTO 1 Automatic variable 2 External symbol 37 5 3 Staticsymbol 00 REG 4 Register variable C_EXTDEF 5 External definition C_LABEL 6 Label C_ULABEL 7 Undefined label C_MOS UND Member of structure C ARG 9 Function argument C STRTAG 10 Structure tag CMOU 11 Member of union C UNTAG 12 Union tag C TPDEF 13 Type definition C USTATIC 14 Uninitialized static C _ 15 Enumeration tag lt 16 Member of enumeration C REGPARAM 17 Regi
343. ommunications Performance Only PM0 PM7 and PSR should be changed all other fields should be left unchanged The value for 7 that will give the fastest link with a target DSP is given by 2 x Fcc 1 Ftgt where Fcc Ftgt are the clock speeds of the Command Converter and target DSPs use integer arithmetic fractional results are to be truncated If PM exceeds 256 set PSR to 1 and divide PM by 256 RI FA CES The PLL oscillator in the Command Converter DSP56002 rev 6 is controlled by the value stored in Command Converter memory location X 16 PLLVAR This value is used to initialize the PLL control register PCTL and may be altered to select the operating speed of the Command Converter N N A A These locations may be changed with the change command either manually or as part of a command file See Section 3 for more information For example the following values could be used for PLLVAR and SSICLK PLLVAR 540003 20 MHz external clock x 4 80 MHz system clock e SSICTL 1 80 MHZ system clock 8 10 MHz SSI clock After establishing communication with a target DSP device it is possible to lose communication if the target system reduces its clock speed possibly as a power saving feature or for some other reason To re establish communication the Command Converter SSI clock rate must be reduced to the range dictated by the clock in the target DSP MOTOROLA DSP
344. on N 2 Assembly Source Register The Session window provides the main output from the development Memory 2f Stack system The Display menu directs most of its output to the Session window 5 Watch and controls its operation pr Input 2 E Output e tems output to the Session window include Breakpoints Command Session Tile Cascade All commands input via the Command window are echoed e All output from commands is displayed Output rom m ny Display menu operations Views of source code and assembly code 2 Registers and memory locations enabled for display at breakpoints and after execution Error messages are sent to the Session window MOTOROLA DSPADSUM AD 4 65 Graphical User Interface Windows Menu Commands Window title Scroll bar Enlarge or echoed in shows current to review maximize window Session device output to display more of window buffer the device buffer 1 Dv00 Session M B break p 85a6 ER list vieu r display on x 8801 0005 0 g Break 81 8051 h deu 8 pc 8851 198 x 000880008888 y 8000800008088 a 00088000880008 b 00000000000000 1 50088008 0 5000000 r7 0000 7 0000 m7 yi 58880808 0 38080008 r m ffff a2 588 1 40008880 a8 40088880 r5 0000 n5 0800 5 b2 00 bi 5888800 0 58008000 r4 0000 n 8800
345. on generation _ JCLR 1 X LOC LABEL For this conditional jump the assembler produces the following object file code SO2A00481 amp 0 lt lt 8 lt lt 12 I LOC 1 8 amp 0 lt lt 8 lt lt 12 LABEL 0 0 The first expression is evaluated such that the relative address LOC resolved at link time is shifted and masked into the middle eight bits of the base instruction word B 28 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Data Expression Format 902 00481 The expression could have been more complex if the bit number was an external reference The relative value of the symbol LABEL occupies the second instruction word B 5 2 Data Expression Interpretation M Object file data expressions are similar to standard assembler expressions whi ch generally follow the rules of algebra and boolean arithmetic They are written using infix notation in conjunction with unary and binary operators and parentheses There are also extensions to the usual set of assembler arithmetic and grouping operators These are control constructs that assist the linker in size type and characteristics of an expression operand ES in N B 5 2 1 User Expression Y The curly braces delimit a user expression within a data m A user expression is that part of a data expression that was written by the programmer and not generated
346. on if file already exists Save dvi 8 0 Save the target DSP address 1 state to filename lunchbrk e1 Overwrite the current file lunchbrk e1 if it exists 3 64 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 06 STEP Step Through DSP Program STEP dev list count LI source lines instructions The STEP command allows the user to execute count instructions or C source lines before displaying the enabled registers and memory blocks This command gives the user a quick way to specify execution of a number of instructions without having to set a breakpoint It is similar to the TRACE command except that display occurs only after the count number of cycles or instructions have occurred Note The address of the first instruction that is to be executed is OnCE Program Address Decode Register OPABD If the Program Counter is changed before a TRACE or STEP command is issued the address of the Program Counter Register points to the instruction tobe executed NC SS CAUTION DSP5616x When single stepping through a BRKcc instruction and the condition is true the instruction immediately following the BRKcc instruction will be dis layed by the ADS but will not be executed Instead the DSP will correctly execute the instruction at LA 1 Single stepping Tcc or REP instructions with initial loop counter equ
347. on will be loaded into memory If the section is relocatable then the physical address is an offset from the start of the logical section implicit or defined by the SECTION directive in which the section is defined In most cases the virtual address is the same as the physical address However for block data sections in Motorola DSP object files the virtual address field holds the repeat count for the single raw data value associated with this section For example if the assembly language source file included a directive of the form BSC 400 FFFF the s vaddr field would contain the value 400 the s size field would be 1 or 2 if in L memory and the single raw data word associated with the section would be FFFF MOTOROLA DSPADSUM AD B 9 Motorola DSP Object File Format COFF Object File Components Table B 7 Section Header Flags Mnemonic Flag Meaning STYP REG 0000 Regular section STYP DSECT 0001 Dummy section STYP NOLOAD 0002 Noload section fM STYP GROUP 0004 Grouped section N STYP PAD 0008 Padding section ine STYP_COPY 0010 Copy section STYP_TEXT 0020 Executable text section z STYP_DATA 0040 Initialized data section STYP_BSS 0080 Uninitialized data STYP BLOCK 0400 Block data section OVERLAY 0800 _ Overlay bein STYP_MACRO 1000 Macro section LL _ The section size is the count of r
348. ong int lt gt Logical relocation section DU number 8 11 long int flags Section type flags 12 27 struct mematt mem Section memory attributes 28 31 0 Unused zero filled The logical section cibos is the ordinal related to a SECTION directive in the assembler source file The relocation section number usually i is the same as the logical section number but may be different if the logical section is static within an enclosing section The memory mapping is an alternate encoding of the CORE ADDR information in the section header Section type flags indicate whether this COFF section represents a buffer or overlay block If the current COFF section is a buffer or overlay block a third auxiliary entry is produced The layout of that entry is shown in Table B 19 on page B 20 MOTOROLA DSPADSUM AD B 19 Motorola DSP Object File Format COFF Object File Components Table B 19 Relocatable Buffer Overlay Auxiliary Entry Bytes Declaration Name Description 0 3 long int bufcnt Buffer section number 4 7 long int buftyp Buffer type 8 11 long int buflim Buffer limit 0 15 struct ovlmem Overlay memory attributes _ mematt 16 19 long int ovlent Overlay section number 20 23 long int ovlstr Overlay origin expresion 24 31 Unused zero filled B Buffers and overlays are mutually exclusive so their respective fields storage space in the object file The bu
349. onverter Device Number m c 2 M The Command Converter JG2 jumper group selects which device that particular Command Converter will respond to commands from the user interface program The following table describes the device address select option Table 2 2 Command Converters Rev 4 5 Device Number Selection Device Address Je O default 00 12 84 5 6 Ve CK 1234 2 1 2 5 6 3 1 2 4 3 4 5 6 5 3 4 b 6 5 6 27 2 7 no jumpers N Pa Note All Command Converters are factory configured for device address 0 2 16 DSPADSUM AD MOTOROLA Preparation and Installation Configuring the Command Converter 2 6 2 JTAG OnCE Port Buffer Vcc In order to provide support for low voltage DSPs a CMOS buffer exists between the DSP56002 controller and the target OnCE JTAG interface cable This buffer has its Vcc pin connected to JG3 Pin 2 See Table 2 3 for CMOS buffer configuration Table 2 3 CMOS BUFFER CONFIGURATION 1 Source Supply Vcc from Host System 5 V 1 2 E Supply Vcc from Target System default 2 3 Note The Universal Command Converter is factory confused j for the JTAG OnCE buffers to be powered from the target system JG3 2 2 6 3 Command Convertor Monitor Firmware Upgrades The monitor code for the Command Convetter Revision 6 tailored for the target DSP family in use is pr
350. oop 4 do n endloop _ mac x1 y0 b x 4 0 r0 yl mac x0O yl b 1 0 _ mac 1 0 x 1 y r4 yO endloop T nd _ a 2 Example A 2 Corresponding Assembler OMF Output File _ START FIR 0001 0001 Complex Correlation Convolution _DATA P 0000 300000 340000 200013 C4801B 06 481 000009 19 2000 200042 C480B6 200011 200019 END 0000 MOTOROLA DSPADSUM AD A 7 Motorola DSP Object Module Format OMF Object Module Format Example 11 C M 2 Ne C M uy y C Y J C 8 DSPADSUM AD MOTOROLA APPENDIX B zi MOTOROLA DSP OBJECT FILE FORMAT COFF y MOTOROLA DSPADSUM AD B 1 Motorola DSP Object File Format COFF B 1 INTRODUCTIONS scene ee oe ua er EE HP B 3 B 2 OBJECT FILE STRUCTURE ew r4 s B 3 B 3 OBJECT FILE B 5 A 4 DIFFERENCES BETWEEN DSP OBJECT FORMAT AND STANDARD COFF T A 23 B 5 OBJECT FILE DATA EXPRESSION FORMAT M B 28 18 75 C N 1 2 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Introduction B 1 INTRODUCTION The Motorola DSP Assembler and Linker produce a binary object file in a modified form of the AT amp T Common Object File Format COFF COFF is a formal definition for the structure of machine
351. ops 1 and ops 2 if ops 0 requires a second or third word and places the disassembled mnemonic in the return string buffer supplied by the user If correct disassembly requires a device status register and or operating mode register value the values should be provided in the sr and omr parameters The gdbp parameter is a pointer reserved for use by the symbolic debugger and should be NULL for other applications The mnemonic may require as many as 120 characters of return buffer The function returns the number 1 to 3 of words consumed by the disassembly It returns 0 for illegal opcodes and a return string containing a DC directive gt Note The xxxxx in the function name should be replaced by a device family number It should be 56k for the 56000 family devices 56n00 for the 56n00 family devices and 96k for the 96000 family devices Example 0 24 dspt unasm Disassembly of the opcode representing NOP include proto56n h unsigned long ops 3 Instruction words to be disassembled char return string 120 The return mnemonic goes here int numwords Number of operands used by disassembler 01 01 ops 1 01 DL ops 2 0L mumwords dspt unasm 56k ops return string OL OL NULL Now numwords 1 return string nop MOTOROLA DSPADSUM AD D 31 C Library Functions Library Function Descriptions 0 3 25 dsp alloc Allocate Memo
352. ory map memory designator 20M unsigned long address DSP memory address to read C unsigned long count number of memory locations to read unsigned long return value Returned memory value s i dsp rmem blk reads count locations starting at address from memory memory map in device device_index and writes it to the memory block pointed to by return_value If memory_map implies a two word value the values will be returned in order with the low order half of the first word followed by the high order half then the low order half of the second word etc Thus for word n from 0 in the memory block the low order value is stored in return value 2 n the high order value in return value 2 n 41 The function return vale indicates whether or not the memory locations exist It returns 1 if all the locations exist 0 otherwise The memory map parameter selects the appropriate dt memory structure from dt var nem for the selected device These structures are describe in the simdev h file which is included with the emulator The memory map parameter can be obtained with the function dsp findmem by using the memory name as a key Use the emulator help mem command for a list of valid memory names The memory map enum is memory map concatenated with a valid memory name As an example memory pa refers to off chip pa memory on the 96002 device Example D 52 dsp rmem blk Read 20 X m
353. ot end execution Finish MOTOROLA DSPADSUM AD 4 49 Graphical User Interface Execute Menu 4 9 5 Execute Breakpoints Set Software Execute Set software breakpoint and specify action to be taken when breakpoint is met Available options will vary with DSP type type of breakpoint and action selected Breakpoints are enabled when set and may be disabled Breakpoints are listed in the Breakpoint window and are indicated in the Assembly window with blue highlighting on the address when enabled More than one breakpoint may be set on the same location so that more than one action may be taken When the dialog box opens the first available breakpoint number is offered Breakpoint numbers do not have to be consecutive and may be allocated for convenience For details on softwa re breakpoint types see BREAK command Section 3 4 2 Set Software Ei Hardware Set breakpoint Specify break type Break 2 _ Specify action to be number instruction placed in code d taken when Initially set to checks that condition is met breakpoint is met first free Options are number Halt execution Note Display Specify which breakpoint expres time break is to sion be Show Display acknowledged enabled registers amp Address Command memory If Input files 084117 Increment C Increment speci C Increment CNT2 fied counter open Increment CNT3 Command Exe specify break at Expression
354. other possible configuration which also enables signal quality to meet the requirements In this configuration the signal is split and buffered into a number of parallel TCKn signals Each of these signals may drive up to 4 TCK inputs M Figure 5 7 Fan Out of TCK at Source y Either configuration above is equally valid The choice will depend on practical considerations related to each project or a combination co could be used JTAG signal TMS may also need some consideration Athough not subject to the strict requirements for TCK it is still important that TMS has settled to a valid level at the rising edge of TCK 5 3 5 Resetting Target DSP Devices The RESET signal from the Command Converter is typically connected to all target devices on a JTAG chain RESET is asserted by the ADS command FORCE R devices on the JTAG chain handling the specified device are reset Execution control is established immediately on exit from reset before any instructions are executed The sequence of events i is illustrated in Figure 5 8 on page 5 12 Since all targets on the JTAG chain are connected to the same RESET signal all devices enter reset The JTAG controller is still active during reset and while RESET is held low the JTAG instruction DEBUG REQ is clocked in When RESET is deasserted the device is immediately in Debug mode with no instructions executed since releasing RESET MOTOROLA DSPADSUM AD 5 11 Func
355. ovided with the ADS software and downloaded automatically into the command converter during ADS system initialization and Universal Command Converter reset If a revision is issued for the monitor firmware an environment variable must be defined to specify the filename of the revised monitor The specified file will be loaded into the Command Converter instead of the standard monitor program The variable which must be defined is CC56000 where 56000 is replaced with name of the DSP family in use and the defined value is the fully specified filename of the revised monitor software For example e DOS in AUTOEXEC BAT GET Gc56300 C ADS REVISIONS MONITOR LOD UNIX with C shell in login or cshrc setenv 56300 ads revisions monitor lod UNIX with Bourne shell in profile _ cc56300 ads revisions monitor lod export cc56300 specifies that for the ADS56300 or GUI56300 the standard DSP56300 family Universal Command Converter monitor code is to be replaced by the code in the file ADS REVISIONS MONITOR LOD MOTOROLA DSPADSUM AD 2 17 Preparation and Installation Configuring the Command Converter To verify that the monitor file is loading correctly start the ADS program and enter the following commands force s display v The monitor revision should be 5 05 If the error Unable to reset Command Converter is issued make sure the correct path is specified in the definition of CC56x00 M
356. ow The program is allowed to run free from the specified starting point until it is stopped by one of several events These include user action Execute Stop Stop light button the program hits a breakpoint specified to stop program execution or until the program executes an instruction which ends execution such as STOP or an illegal instruction MAN Select from A IF breakpoints have 1 Proceed from next address OR specified NS been established address 7 _ may select a target 2 Reset device before proceeding breakpoint If selected all other C lt STOP breakpoints Select which X M will be ignored device s execute Select target breakpoint from pull down list Go From s Address C Reset If the address is Specify how many selected above Address times to encounter may enter start breakpoint before address here If stopping i e stop blank proceed from on 4th time next address breakpoint is encountered Figure 4 57 Execute Go Dialog Box 4 9 2 1 Execute Step Next Trace Execute Step executes a specified number of instructions or lines of code If a function is called it is treated like the rest of the code Execute Next treats a function call as a single steps Execute Trace outputs all enabled registers and memory locations after each instruction execution At end of execution the Session window dis
357. p 10 Execute hex ten OnCE serial commands of the default Command Converter s Y memory pointed at by its YPTR The OnCE registers will be displayed after the hex 10 commands have all been executed A macro command file can help in ne stepping through user defined OnCE sequences and displaying results The display of registers after a CSTEP or CTRACE were not implemented because of the nature of having to access the OPDBR register to retrieve the register values An example of a macro file would be the following cstep2 772 execute 2 OnCE commands then show XPTR and YPTR cdisplay x 80 90 y 80 Of display the Command Converter x and y memory display display the target registers MOTOROLA DSPADSUM AD 3 29 User Interface Commands Detailed Command Descriptions 3 6 10 through OnCE Sequence CTRace dev list count The CTRACE command allows the user to single step through a OnCE command sequence in the Command Converter Y memory pointed at by the Command Converter YPTR This enables the user to write and debug OnCE command sequences using the Command Converter monitor program sequence format p M Note The OPDBR and OPILR registers always display the last values stored after executing a GO STEP or TRACE command or after servicing a breakpoint The values of these registers will not reflect the changes made to them when executing the CGO CSTEP or CTRACE when deme a display c of the O
358. p alloc nbytes clearmem Allocate Memory dsp_check_service_request Determine if device is requesting service devn dsp_findmem devn memname Get map index for memory prefix dsp_findreg Get peripheral and register index devn regname pval rval dsp fmem Fill memory block with a value devn map addr blocksz dsp_free devn Free memory allocated for a DSP device dsp_free mem e Free memory block 5 go devn Initiate program execution dsp go address devn addr Initiate program execution from addr dsp_go_reset devn Initiate program execution after reset dsp_init devn Initialize selected device dsp ldmem devn filename Load device memory from filename dsp load filename Load all device states from filename dsp devn device type Create new DSP device dsp path Create filename from path base and suffix path base suffix new name D 6 DSPADSUM AD MOTOROLA C Library Functions ADS Object Library Files dsp realloc mem blk nbytes Reallocate memory block dsp reset devn Reset specified DSP device dsp rmem Read DSP memory map addr to mem val devn map addr mem val rmem blk devn map addr count value Read Block of DSP Memory Locations dsp rreg Read DSP peripheral register to devn periphn regn regval dsp save filename Save the state of all devices to dsp spath base sufx retn Search path for specified
359. p of Command Converters The ADM_BRK signal is used to put the Command Converter back into Command Entry mode while the ADM_RESET signal is used to reset the Command Converter The Command Converter informs the host computer of target DSP entries to the Debug mode of operation by asserting the HOST BRK signal The ADS user interface program on the host computer periodically polls the HOST signal from the keyboard polling routine If the HOST BRK signal is asserted the host computer will determine which Command Converter is requesting service by reading the ADM _ INT signal The INT ACK signal is asserted by the host computer when a service request has been recognized Further details on the functions of each signal will be given in a subsequent section Figure 5 2 on page 5 6 illustrates the 37 pin cable and the direction of the signal groups 5 2 2 Host Computer Interface Cable The host computer interface card interacts with the Command Converters via a 37 pin ribbon cable assembly Each end of the ribbon cable has a 37 pin DIN receptacle connector The cable assembly is approximately 4 feet in length and is designed so that additional Command Converters may be easily attached to the existing cable by crimping a few DIN j L Normally d ADS is shipped with an Application Development Module ADM and power for both the Command Converter and ADM are supplied by the host computer interface card via the cable The ribbon c
360. pecifies that the macro command is aborted and the ADS quits immediately with a non zero exit status QUIT disable specifies that the ADS does not exit Example 3 40 QUIT Command Examples quit oe Close all currently open files and return to the Operating 4 Target DSP may be left running until the program is re entered quite Specify that errors in a macro command ADS to exit with a non zero status The ADS does not exit when this SOR issued _ 1 DSPADSUM AD 3 61 User Interface Commands Detailed Command Descriptions 3 6 33 RADIX Change Default Number Base Rapix dev list bin D dec F 1t H hex U uns 1 block address _block The RADIX command allows the user to change the default number base for command entry Hexadecimal constants may always be specified by preceding the constant bya dollar sign Likewise a decimal value may be specified by preceding the constant with a grave accent Note The default radix is hexadecimal when the user interface program is initially invoked 4 ME This means that hexadecimal constants must be entered with a preceding dollar sign Changing the default radix allows the user to enter constants inthe chosen radix without typing the radix specifiers before each constant e I The RADIX command also allows the user to select the display 1 of registers and or
361. plays the values of all registers memory locations and expressions which have been enabled Display Display Register Display Display Memory Display Watch 4 48 DSPADSUM AD MOTOROLA Graphical User Interface Execute Menu Number of Select steps to device s to count execute execute Increment 2 Lines Instructions Select type of steps to execute 0 Figure 4 58 Execute STEP Dialog Box jj 4 9 3 Execute Until S 4 M gt E 28 M Execute Until executes the program to a specified location The location may be specified as a program line number an address or a label This Until Qs sets a temporary breakpoint which is cleared when execution terminates Line numbers and labels may only be used if debug information has been loaded from a COFF file see File Load COFF Enter target location Select device s to p 1234 is an address execute 20 line 20 in current source module file 20 line 20 in module file mode5 label mode5 in current module Je AN M 4 9 4 Execute Finish Execute Program executes until the end of the current subroutine The RTS instruction is executed before execution stops Breakpoints are handled as normal If a function is called during a Finish operation it executes as gt normal but the exit from that function does n
362. ple D 53 dsp rreg Read register r3 from device 0 a 56002 Use dsp findreg to obtain the peripheral and register numbers corresponding to the register name r3 include simcom h include protocom h Et dm 4 _ gt int devn int periph num reg num 2 s unsigned long regval devn 0 dsp devn 56002 Allocate structure for device 0 56002 if dsp findreg devn amp periph num amp reg num dsp rreg devn periph num reg num amp regval X D 60 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 54 dsp save Save All DSP Structures to State File include simcom h include protocom h int dsp save filename char filename Full name of State File to be saved 0 dsp save saves DSP device structures to an emulation state file This function does not invoke the user interface functions which provide pathname and adm suffix extension so the entire filename must be specified The function returns 1 if the save is successful 0 if an error occurs when saving the file This function will call t the function dspl xmsave as one of the steps of saving the DSP structure Example D 54 dsp save 2 Save debugger status in file lunchbreak adm A VV include simcom h A n include protocom h int ok dsp new 0 56002 Allocate structure for device 0
363. portion of the keywords not in boldface may be typed if desired but is not required by the user interface The user interface types out the remainder of the TON gt you if you type the boldface characters followed by a space N Other command parameters shown in in the command syntax line in lower case but not within parentheses are used in place of the expanded definitions shown in the following section Square brackets enclose optional command parameters The brackets themselves are not entered as a part of the command For example in the WAIT count seconds command the count parameter is optional The solidus is used to separate entries in lists of alternate command parameters The user may only enter one of the parameters in the list The solidus is not entered as a part of the command For example when entering the LOG command log c filename and log 5 filename are valid entries but not log 5 filename Parentheses surround a description of an implied action This is only included to help the user understand the action of the command Neither the parentheses nor the description within are entered as part tof the command For example when entering the COPY command copy from p 0 10 to x 5 should be entered as copy p 0 10 x 5 The from and to words in the command syntax line are only an explanation of the direction of data transfer Three consecutive periods indicate that the preceding field m
364. pos device type DEVICE cc num tms num chain pos IR count HELP dev num command reg Alternative syntax command 2 HOST IO PC IO addr TIMEOUT value 3 10 DSPADSUM AD MOTOROLA User Interface Commands Command Summary LIST addr PATH dev list pathname PATH dev list pathname pathname PATH dev list QUIT E enable D disable RADIX dev list B bin D dec H hex F Flt U Uns reg block address block 22 SYSTEM C continue immediately system command argument list non GUI only UNLOCK dev type password 7 VIEW A assembly S source R register 7 2 WAIT dev list B break count seconds y Ctrl X toggle ADM service requests on Ctrl S screen scroll freeze Ctrl C abort display command insert next command in command circular buffer on command line _ Ctrl B insert last command in command circular buffer on command line up arrow down arrow scroll display screen MOTOROLA DSPADSUM AD 3 11 User Interface Commands Detailed Command Descriptions 3 6 DETAILED COMMAND DESCRIPTIONS The following subsections provide a detailed description for each of the user interface Commands 1 1 3 6 1 ASM Single Line Interactive Assembler M ER m dev num B byte wide beginning at address assembler 1 mnemonic The ASM command invokes
365. pt on the default Command Converter 1 Cforce d j Lo Force the default Command Converter into the Debug mode u Force te default Command Converter into the User mode MOTOROLA DSPADSUM AD 3 25 User Interface Commands Detailed Command Descriptions 3 6 6 CGO Execute OnCE Sequence CGo dev list from address The CGO command allows the user to execute OnCE command sequences in the DSP56002 controller s Y memory This command is useful for debugging user defined serial command sequences which will be used in a target system A sequence memory pointer resides in the DSP56002 controller s internal X memory at address 2 This pointer is used as the start location and may be changed using the command Example 3 8 Command Examples _ Execute the OnCE sequence of the default Command Converter starting at the current address in the Command Converter PTR 510 Change the Command Converter PTR to hex 10 and execute the OnCE sequence of the default Command Converter starting at that address gt 3 26 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 7 CLOAD Load OnCE Command Sequence CLoap dev list filename The CLOAD command is used for loading a user defined OnCE serial command sequence into the Command Converter internal Y memory The file must be in DSP object module form
366. put MOTOROLA DSPADSUM AD searched first then each of the alternate source directories in turn 4 35 Graphical User Interface Display Menu 4 7 14 Display Input Files and Display Output Files This selection displays the file assignments for simulated input and output for the current device See File Input and File Output for assignment procedures Session 1 Input file 2 Input file 3 Input file 82 Input file C XTGUI3Xterm88805 io at address p 4117 C TGUIS TRAGS I0 at address p 1856 C XTGUISATA4R7 10 at address p 2446 C XDSPCODEXOBJECTXTERH8888 I0 at address Sct Figure 4 36 Display Input Files s Output Wa Vy m Display Redirected 10 Streams IO Streams Status 4 7 15 IO stream redirection supports stream 10 for programs running on a DSP STDIN STDOUT and STDERR are supported Support may be enabled or disabled see File Streams and each of the stream files may be individually assigned to a file on the development host see File Redirect Display IO Display Disassemble List Evaluate Call Stack Radix Device Path Input Files Files Display Display Disassemble List Evaluate Call Stack Radix Device Path Input Files Output Files Redirected IO Streams 10 Streams Status Log Files Streams Status indicates whether stream support is enabled or disabled Display Redirected IO
367. r The ADS user interface program uses a software handshake when communicating with the Command Converter There are signals defined on the host computer bus interface card which are used for requesting and acknowledging information transfer Since the handshake is software driven the transfer rate will be dependent upon the host computer bus speed and its operating system This section describes the host computer interface hardware and software components MOTOROLA DSPADSUM AD 5 3 Functional Description Host Computer Hardware 5 2 1 Host Computer Bus Interface Card Figure 5 1 shows a block diagram of the host computer interface card for all supported computer platforms The interface consists of three fixed addresses in the host computer I O memory map Host computer interface card address zero is used as a control port for selecting resetting or interrupting one or more Command Converters Address one reads and writes eight bit data bytes to one or more Command Converters Address two acknowledges Command Converter service requests and selects group members for multiple Command Converter commands data is passed high order byte first For example in a 32 bit transfer bits 31 24 are transferred first by bits gt 23 16 bits 15 8 and then bits 7 0 5 u a D Addr M A N Z Bus Address Decoder 7 5 i on 2 a Ctrl gt Data lt lt i
368. r break expression the data values will be evaluated using the default radix when an ADM requests the host for breakpoint service Therefore the specific data representation should be used when setting breakpoints It should also be noted that there is a major difference between setting conditional software breakpoints in user memory and using breakpoint expressions to evaluate a breakpoint The conditional software breakpoint is done in real time inside the DSP whereas the breakpoint expression requires stopping the DSP and evaluating the expression from the host computer side This means that the host computer must interrogate the target DSP to determine if the breakpoint expression is 3 20 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions true This is not done in real time The same holds true for the CNT1 3 counters versus the breakpoint counter register in the OnCE port of the target system The CNT1 3 counters are software counters in the host computer whereas the breakpoint counter register is hardware and is decremented in real time Example 3 2 General Breakpoint Examples for DSPs with OnCE or JTAG OnCE Ports fM break EN Display all currently enabled breakpoints for all target DSPs break dv2 bt Display currently enabled breakpoints for target DSP address 75 break Disable currently enabled breakpoints for the default DSP address N break dv2 off
369. r mem space are EN if P_MEM program memory Frere X MEM X data memory lt Y MEM Y data memory A 27 1 The return value is DSP OK for success DSP ERROR if the transaction fails iu _ 2 Example D 42 eke fill_memory clear P memory on DSP device 1 include simcom h include driver h int devn int status 724 devn 0 i dsp new 56002 Allocate structure for device 0 a 56002 west buffer to no value ey MOTOROLA DSPADSUM AD D 19 C Library Functions Library Function Descriptions 0 3 13 dspd go Begin Execution on Target DSP Device include simcom h include driver h int dspd go device index opcode operand int device index Index of DSP device affected by command unsigned long opcode values to load into pipeline unsigned long operand before starting program execution _ dspd_go is called to start program execution on the target device device_index 1 The target device s pipeline is loaded with the parameters opcode and operand and the device is forced to start executing The values loaded into the pipeline via opcode and either be the values saved from the pipeline when the device entered debug mode or if execution is required to continue from a specific address the values loaded should form a long jump instruction to the req
370. r the Motorola families of DSP devices Versions support both the software DSP simulator and the ADS emulation systems The GUI consists of a set of tools menus dialog boxes windows and buttons Using these tools the user selects the desired operation and the interface generates the appropriate commands for the development system These commands are passed to the debugger via the Command window and the output and other information displayed in the Session and other windows The user may also enter commands directly into the Command window so retaining direct control over the debugging process if desired These features provide full control over the development process The menus provide the control functions the dialog boxes gather additional information as necessary and the windows display information and also provide facilities to modify certain items such as register and memory values This section describes in general terms the range of features offered by the GUI It is intended to provide a brief overview without going into great detail on any subject References are included to the appropriate sections for further study 4 6 DSPADSUM AD MOTOROLA 4 5 1 GUI Structure Graphical User Interface Graphical Interface Functions Overview The GUI provides an interface to the command line debugger generating commands from the user actions and interpreting the responses Assembler Disassembler Parser Expression Evalua
371. ram execution Note Ctrl X key acts as a toggle to disable or enable ADM service requests Disabling ADM service requests freezes execution of multiple show or note breakpoints and allows user interface commands to be entered and the registers to be examined Enabling ADM service requests resumes ADM execution MOTOROLA DSPADSUM AD 3 19 User Interface Commands Detailed Command Descriptions A breakpoint expression may be any logical expression that is valid for the DSP Macro Assembler Table 3 9 is a list of operators that may be used in the breakpoint expression Table 3 9 Expression Operators Operator Description lt less than lt less than or equal to equal to IN gt greater than equalto tens greater than mE not equal t addition 7 2 4 multiplication PN Tema J division amp amp mo logical and logical or 3 n WV logical negate AZ os D 3 nu amp bitwise and 7 bitwise or 2 bitwise one s complement 4 A gt bitwise exclusive or N Va shift left gt gt A shift right If more than one breakpoint expression is entered for a breakpoint address the actions following each expression are executed only if that expression is evaluated as true If no specific data representation is used in the break address o
372. ransfer operations proceed faster with a faster SSI clock However the maximum permissible SSI clock speed is determined by the clock speed used on target DSP processor and must not exceed target DSP clock 8 When multiple processors are connected in a JTAG chain the slowest target DSP clock must be considered Clock PLL Clock Out o TDI TS 5 gt 2 8 Clock In 4 SE lt 1558 e 5 ee 1 UN onverter Target DSP DSP Command Converter SSI and Target clocks must be set so that Clock Out Z Clock In x 8 Figure 5 12 Command Converter Target DSP Clock Constraints The SSI port in the Command Converter DSP56002 used for the JTAG OnCE serial link is controlled the value stored in Command Converter memory location X 6 SSICLK This value is used to initialize the SSI control register CRA on the Command Converter and may be altered to control the SSI clock speed See the 56002 User Manual for full SSI details briefly CRA comprises several fields Bits 0 7 Prescale Modulus 7 0 divide by 1 up to 255 divide by 256 Bits 8 12 DCO DC4 frame rate divider Bits 13 14 Word Length control WLO WL1 Bit 15 Prescale Range PSR O divide by 11 divide by 8 5 18 DSPADSUM AD MOTOROLA Functional Description JTAG OnCE C
373. raries and must also be used exclusively in the user debugger code Any attempt to use the standard routines will have unpredictable results include simcom h include protocom h void dsp realloc mem blk nbytes char mem blk Address of existing allocated block C b unsigned int nbytes Required size of memory block Ner dsp 11 changes the size of a memory block mem b1k previously allocated with alloc to the specified size nbytes The address of the reallocated block may not be the same as the address of the original block The contents of the original block is preserved either completely if the block size is increased or to the end of the new block if the block size is reduced If the requested block cannot be allocated the original block is unchanged 4 N Example D 9 dsp realloc M increase buffer size IN ay v include simcom h 1 include protocom h int status char bufptr Allocate temporary buffer of 50 characters Buffer is cleared bufptr char dsp alloc 50 sizeof char 1 if bufptr NULL 00 handle error P ams 7 increase buffer size to 82 characters preserving contents bufptr char dsp realloc bufptr 82 sizeof char D 56 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 50 dsp reset Reset Specified DSP Device inclu
374. re 6 1 Figure 6 2 Figure 6 3 Figure 6 4 Figure 6 5 Figure 6 6 Figure 6 7 MOTOROLA Command Converter Interface 37 Pin Host Interface Cable Interface Card 2 0 Sun Sparc SBus Interface M pu y eu 1 Command Converter Power Cable NOS 7 Command Converter OnCE Interface Cable TP JTAG OnCE Command Converter Schematic Rev des getan NA 4 DM 2 DSPADSUM AD xxi Table 2 1 Table 2 2 Table 2 3 Table 3 1 Table 3 2 Table 3 3 Table 3 4 Table 3 5 Table 3 6 Table 3 7 Table 3 8 Table 3 9 Table 4 1 Table 4 2 Table 4 3 Table 5 1 Table 5 2 Table 5 3 Table 6 1 xxii LIST OF TABLES PC compatible I O Addresses q 2 4 Command Converters Rev 4 5 Device Number Selection 2 16 CMOS BUFFER CONFIGURATION p d 2 2 41 7 Hardware Breakpoint E OnCE Hardware Breakpoint Types 3 15 JTAG OnCE Hardware Breakpoint Ties MG 3 16 DSP56300 AND DSP56600 Hardware Breakpoint Address Qualifiers TETTE 3 16 DSP56300 and MES Hardware I Event Qualifier 3 17 Software Breakpoint Types 3 17 Floating Point Software s Breakpoint 3 18 Breakpoint
375. reen following the refresh 0 4 12 simw_scrnest Increase Screen Buffering One Level simw scrnest This function increments a counter to signify the screen output buffering level The companion sim _unnest simw refresh functions provide the output buffering operations for the emulator The sim const scrnest variable is incremented each time this function is called MOTOROLA DSPADSUM AD D 77 C Library Functions Emulator Screen Management Functions 0 4 13 unnest Decrease Screen Buffering One Level simw unnest This function decrements the sim const scrnest variable each time it is called If the screen buffering level drops below one simw unnest will call simw ref 10 update the screen _ 4 0 4 14 simw winit lInitialize Window Parameters JO simw_winit 5 T This function initializes any screen or keyboard parameters thata are re required for the emulator terminal I O environment It is called whenever the emulator 1 is entered from the operating system level which includes the nu emulator entry and re entry M M N following the system command Ae S 0 4 15 simw_wscr Write String and Perform Logging simw_wscr text command_flag 4 ERN 2 char text Text string to write to screen int command flag Flag l string isa command 0 not command This function outputs the string text to the terminal above the command line af
376. rite memory devn mem addr count value 1 D 2 2 3 dspd break devn command dspd_check_service_request devn dspd fill memory devn mem addr count value dspd go devn opcode operand dspd_jtag_reset devn reset type dspd read core registers devn reg num count value dspd read Lnenory devn Lspace addr c count value dspd 1 once re egist rs devn reg i num count value dspd reset d vn reset mode dspd status devn mode dspd write core registers devn reg num count value dspd write memory devn mem space addr count value dspd write once registers devn reg num count value MOTOROLA dspd Level Routines DSPADSUM AD C Library Functions ADS Object Library Files LIBRARY ENTRYPOINTS LISTED BY PREFIX ads ADS Specific Utility Routines Read OnCE and core registers from device Initialize ADS database and driver dspd cc Command Converter Driver Level Initialize Command Converter for DSP family Read Command Converter flag word Read from Command Converter memory Reset Command Converter Read Command Converter revision number Write Command Converter flag word Write to Command Converter memory Force running DSP into debug mode See if DSP is requesting service from host Initialize DSP memory buffer
377. rners to ensure that the connectors on MN of the assembly fully engage with those inside the unit 6 Reinstall the power supply cover plate and then reconnect the power cord to both the unit and the wall socket Also connect the 37 pin ribbon cable from the ISA card to the ADM board 7 The system may now be restarted Power supply cover plate C AC Power Connection EISA Connector hole Figure 2 2 HP 7xx Chassis Rear View MOTOROLA DSPADSUM AD 2 11 Preparation and Installation HP7xx to Command Converter Interface 2 5 2 Installing the HP 7xx Device Driver An HP 700 formatted Digital Audio Tape DAT contains the necessary files for the installation of the device driver The device driver supports multiple cards so only one device driver needs to be installed regardless of the number of cards being used This tape is UNIX tar formatted and should be read in with the following command tar xvf dev rmt O0mn An alternate command would be T tar xvf dev rmt 0m ih M The number at the end of the command is the device number and should be changed if the tape drive number is different on the machine being used The n in the first example keeps the tape from being rewound after it is read AE the files c are extracted from the tape a directory named driver is created 4 The user must be logged in as root superuser to this point The following steps shoul
378. ruction at the specified location To change the instruction and display the next type the new instruction and click OK To exit the interactive Assembler click CANCEL Any new instruction which has been typed before clicking CANCEL will not be written to the current location 3 12 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions Interactive Input Change jclr 2 x lt lt Stfffc9 0076 Figure 3 1 Interactive Assembler Dialog Box The Session and Command windows will be written to during interactive Assembler operations Both windows display the original ASM command the Session window displays each change as it is applied A gt Example 3 1 ASM Command Examples asm p 50 Start interactive Assembler at program memory address 50 hex of the current default device asm Ww Start interactive Assembler at current program counter value of the current default device asm myfile asm 27 Start interactive Assembler at the address corresponding to myfile asm line 7 asm dv3 p 10 T b y Start interactive Assembler at target address 3 program memory address 10 TN P Overwrite the instruction at the current pc with the specified instruction asm 0 add lt 2 Store assembled instruction in specified data memory location This feature may be useful for patching overlaid programs where overlays are copied from data to program memory before
379. ry The routines dsp alloc dsp free memand dsp realloc are replacements for the standard C functions malloc free and realloc They are used in much the same way as the standard functions for allocating space for structures buffers etc These functions are used in the debugger libraries and must also be used exclusively in the user debugger code Any attempt to use the standard routines will have unpredictable results include simcom h J include protocom h 2 C99 void dsp alloc nbytes clearmem unsigned int nbytes Number of bytes to allocate E P int clearmem Clear allocated memory dsp alloc allocates the number of bytes of memory specified in nbytes The memory block allocated is aligned for use as any data type If clearmem is true nonzero the allocated memory is cleared to zero The address of the allocated buffer is returned as the return value type void If the requested memory cannot be allocated the error message Insufficient memory dsp alloc isoutput and the return value is the NULL pointer la 1 4 2 Example 0 25 dsp alloc Allocate temporary buffer of 50 int Buffer is cleared include simcom h include protocom h int tbptr 25 tbptr int dsp alloc 50 sizeof int 1 if tbptr NULL handle error D 32 DSPADSUM AD MOTOROLA D 3 26 include include include include C Library Funct
380. ry blocks If S is specified as the second parameter an ADS state file is created It contains ss the entire ADS state including memory contents breakpoint settings and the current pointer position of any open files This file is in an internal format that is efficient for the ADS Interface program to store and load see the LOAD s command ese The default suffix for an ADS state filename is adm If memory blocks are specified instead of 5 the specified memory areas are stored in Macro Assembler object module format so the file may be reloaded with the LOAD command The default suffix for an OMF file is lod filename suffix of cld is explicitly specified a COFF file will be created N If a file currently exists with the filename specified the user will be prompted for an action of either appending the data to the file file or aborting the command The selection of the file action may be in the command line using the o overwrite a append or the c cancel argument This is useful when executing macro command files M y M lt Example 3 43 SAVE Command Examples Save p 0 ff x 0 20 sessioni Save all three memory maps to OMF file session1 lod of the current default target DSP address Prompt for required action if file already exists Save 5 lunchbrk Save the default ADS state to filename lunchbrk adm Prompt for required acti
381. ry blocks N trace 20 Execute 20 instructions and display the enabled registers and memory blocks after each instruction trace 5 li Execute the next 5 lines of source and display enabled registers and memory blocks after each line trace dv2 45 Execute 5 instructions on target DSP address 2 and target DSP address 4 from their current program counter and display their enabled registers and memory blocks after each instruction 3 68 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 40 TYPE Display The Result Type of C Expression dev list c expression The TYPE command is used to display the result type of a C expression If result of the expression is a storage location e g just a variable name or an element of an array it will display the address of the storage location in addition to its data type E 1 Example 3 48 TYPE Command Examples type count Display the type and location of the variable count 7 type 0 5 i C Display the type of the given expression gt 7 ET WD 3 x MOTOROLA DSPADSUM AD 3 69 User Interface Commands Detailed Command Descriptions 3 641 UNLOCK Unlock Password Protected Device Type UNICCK dev type password The UNLOCK command provides password enabling for emulation of unannounced device types Once unlocked the devi
382. ry space as assembly instructions or to view the program source The display scrolls to view the entire memory area or source code This display does not use the 100 line device output buffer and is not limited to a scrolling region of 100 lines At each break in execution the window refreshes in the area of the PC marking the current instruction with the arrow symbol gt The display is very similar to the Address and Source windows However the Session window cannot be used to view set or clear breakpoints Dv00 Session asm pi 9b pc prolog c 29 pi 9e lt Fpr4 4 gt section prolog c Graphical User Interface Modify Menu Display Display Disassemble List Evaluate Call Stack Radix Device Path Input Files Output Files Redirected IO Streams IO Streams Status Log Files Breakpoints Watch Register Assembly Source 669b Fpr4 6661 move ssh x r6 x F c sig handlers 136 889c Fpr4 8882 move 1 n6 Fpr4 6663 move Fpr4 6664 move r6 n6 Fpr4 0005 move b8 x r6 x F sig handlers 136 Fpr4 6606 move b1 x r6 x F sig handlers 136 Fpr4 6067 move x8 x r x F c sig Figure 4 47 Session Assembly View 48 MODIFY MENU RS T The Modify menu examines and many aspects of the development system Change Register change one or more registers to the same new value Change
383. s 1 The default breakpoint will always be hardware of program core fetch if no break type is entered and a single address is used example break p 50 For the DSP56300 and DSP56600 families the access type defaults will always be read for program memory and read write for data memory 2 If more than one hardware breakpoint is entered in the breakpoint list only the last hardware breakpoint entered will be enabled all other hardware breakpoints will be disabled 3 Break counts may be used for hardware and software breakpoints If no count is entered it defaults to a value of 1 Software breakpoint counts may also be set with the GO command 4 brenkfoints should only be set on opcode addresses and not operand addresses In order to help prevent setting a breakpoint on an operand address 67 the user is issued a warning whenever a software breakpoint is set on an illegal opcode However if the operand happens to be a legal opcode no warning will be issued and the user program may not execute properly because a DEBUGCC opcode will reside in the operand location rather than the correct operand 5 When a breakpoint is defined it will be enabled by default The user must specifically disable or turn off the breakpoint number if that breakpoint is not desired 3 14 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions The OnCE circuitry as described in the User s Manual allows the user to set
384. s It does handle the notion of separate text and data sections and a possible extension would have been to define section types for the new memory areas This quickly becomes unwieldy when information internal external port A B is considered as well 22 10 1 LN The solution was to extend addressing information to include the memory and mapping with the address value itself This is done by defining a C language typedef called CORE ADDR which holds both the memory and mapping data along with the memory address For any address context in the COFF file a CORE ADDR is used rather than for example an unsigned qong A description of the CORE_ADDR format is shown in Table B 27 _ 27 CORE ADDR Format er Bytes Declaration Name Description 0 3 long 0 1 Memory address 4 7 enum 1 Memory mapping The enumeration values for the memory mapping field are shown in order in Table B 28 on page B 25 B 24 DSPADSUM AD MOTOROLA Table B 28 Memory Mapping Enumerations Motorola DSP Object File Format COFF Differences Between DSP Object Format And Standard COFF Mnemonic Value Mnemonic Value memory map 0 memory map xa 16 memory x 1 memory map xb 17 _ _ 2 memory map xe 18 _ 1 1 3 memory map xi B _ _ 4 memory map xr 20 memory map
385. s available with a particular ADS system use the command HELP periph CAUTION Some peripheral registers contain NL handshake bits that change state when _ they are read Reading these registers can interfere with the proper operation of the NY 2 peripheral within the user program MOTOROLA DSPADSUM AD 3 37 User Interface Commands Detailed Command Descriptions Example 3 17 DISPLAY Command Examples display Display all currently enabled registers and memory of the current default target DSP address display on Enable all programming model registers for display on the current default target DSP address display p 0 300 41 Display p memory addresses 0 through 300 of the current default target DSP address display on p 0 20 x 30 40 x 100 n Display enable memory address block 0 to 20 x memory address block 30 to Doma memory address hexadecimal 100 of the current default target DSP address display dv2 p 30 50 i Display p memory address block 30 to 50 of target DSP address 2 of display W Display all target DSP addresses that are currently user programs m NN display V A Display the user interface program Command Converter monitor program revision numbers display on host Display enable the host peripheral registers N display on all AN P Display enable all model a
386. s be deterministic The Program Address Bus FIFO is very useful for evaluating interrupt service routines program flow changes or code which is executed from internal RAM The FEQ is s read only and is not affected when in the Debug mode UN E A 5 4 4 Program Decoder Communication In order to communicate with the DSP user registers the OnCE port interacts with the DSP program controller unit via a Program Data Bus Register OPDBR DSP opcodes may be fed serially into the DSP program decoder unit bypassing the pipeline instruction fetch th stage Opcodes are always written first followed by operands when executing two word instructions OnCE port registers are not accessible from the DSP programming model DSP programming model and peripheral registers are accessible only through a Global Data Bus Register OGDBR This read only register is located in the user X data memory peripheral address space The OGDBR is the transfer register for passing information back to the OnCE port For example to read the RO register value the OPDBR is loaded with the opcode move RO X OGDBR An 8 bit command is then sent to read the OGDBR to retrieve the contents of the register value transferred 5 14 DSPADSUM AD MOTOROLA Functional Description OnCE Port Architecture 5 4 5 Hardware Software Breakpoints Users may halt program execution and enter the Debug mode via hardware and or software breakpoints Hardware breakpoints may be set on program opcode
387. s greater than zero the delay will be dependent upon the number of internally generated wait states Mcr ce Also if a bus arbitration unit currently does not permit the DSP to complete an external access the Debug mode cannot be entered until the arbiter permits the access to complete This same rule holds for the Transfer Acknowledge TA signal of the DSP If the TA signal is not asserted the DSP will not enter the Debug mode until the bus access is complete The debug acknowledge signal is transmitted immediately after each 8 bit command and after the proper number of clocks required to write to a register Also if an execute opcode command is given the acknowledge signal will be asserted after the DSP program controller completes execution of the opcode in the OPDBR DSCK OS1 N DSCK OS1 DSI OSO 2 DSI OSO 8 bit Command 8 01 commend Converter Data command DSO ai DSO p ail Data CUN Acknowledge Acknowledge Write Command Timing Read Command Timing Figure 5 14 OnCE Port Protocol It should be noted that the DSO normally is in a high impedance state and only drives a signal output when executing an 8 bit write command or when sending the debug acknowledge signal This signal normally has a pull up resister 5 22 DSPADSUM AD MOTOROLA Functional Description Writing Your Own OnCE Command Sequence 59 WRITING YOUR OWN OnCE COMMAND SEQUENC
388. sability an effort has been made to have the fewest possible restrictions and although some remain they are very reasonable The first restriction is that string literals are not supported in expressions This would have required allocating some portion of the DSP memory for debugging purposes possibly interfering with the user s code The other restriction is on type casts Only forms of type casting such as the following are allowed type type y Ll enum enumeration tag struct union enum structure union enumeration_tag 4 In examples type includes both basic C types and types that were defined with typedef in the C program MOTOROLA DSPADSUM AD 3 91 User Interface Commands C Debugging Commands 3 7 4 Compiling a Program for Debugging To use the C debugging features included in the ADS user interface program the C program being loaded into the DSP must have been compiled using the compile with debugging information flag available in the compiler For the Motorola Optimizing C Compilers this flag is g By default the Motorola Optimizing C Compilers compile programs with optimization turned on This will not be affected by compiling with debugging turned on Since optimization can change the order in which portions of programs execute along with eliminating variables placing variables into registers etc you may experience strange behavior when debugging programs that have be
389. se 0 for the device index parameter in a single device system If the command string begins macro execution the selected device s structure in macro flag will be set by sim ADSDSP retrieves valid commands from the macro file by calling sim gmcmd as long as the macro flag is set The commands are still executed by sim whether they come from the terminal or a macro file 4 T Some commands initiate device execution such as go or trace The target executes until execution of a breakpoint or the completion of the requested number of instruction steps VD m D 64 sim_docmd Use sim_docmd to execute device 0 from address P 40 to breakpoint at P 80 include simcom h include protocom h int devn 5 devn 0 dsp new s ey E002 Allocate structure for device 0 a 56002 sim devn change 40 Change device 0 pc register to 40 Sim devn break h P 80 Set a breakpoint for device 0 A sim docmd devn go Begin execution of device 0 MOTOROLA DSPADSUM AD D 71 C Library Functions Library Function Descriptions 0 3 65 sim gmcmd Get Command String from Macro File include simcom h include protocom h sim gmcmd device index command string int device index DSP device index to be affected by command char command string Pointer to return buffer for command lin
390. sed at present B 10 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components B 3 3 2 Relocation Information Object files have one relocation entry for each relocatable reference in the text or data The relocation information consists of entries with the format described in Table B 8 Table B 8 Relocation Entry Format Bytes Declaration Name Description 0 3 long r_vaddr Address of reference 4 7 long r symndx String table index Y 8 11 unsigned long r type Relocation type 2 The address represents the relocatable address within the section raw data where modification is needed In standard COFF the r symndx field points to an entry in the symbol table corresponding to the reference requiring modification The relocation type encodes how the raw data is to be changed to reflect the resolved symbol value In Motorola DSP COFF r symndx is an offset into the string table which points to a relocation expression The linker interprets this expression and updates the word at r_vaddr with the result of the expression evaluation The relocation type is always zero See Section B 5 Object File Data Expression Format on page B 28 for more information on relocation expressions M d 3 3 3 Line Numbers S When the compiler or assembler is invoked with the G debug option an entry is made in the object for every source line where a breakpoint can
391. seq lod csave x 10 10 newdata lod Save the contents of the default Command Converter 8 X memory addresses hex 10 through hex 1A to a file named newdata lod 3 28 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 9 CSTEP Step through OnCE Sequence 5 dev list count The CSTEP command allows the user to execute a group of OnCE serial sequences before displaying the OnCE register contents This gives the user the opportunity to write and debug a OnCE command sequence using the Command Converter i E program sequence format as described in Section 5 Functional Description Note The OPDBR and OPILR registers always display the last values stored after executing a GO STEP or TRACE command or after servicing a breakpoint The values of these registers will not reflect the changes made t to them when executing the CGO CSTEP or CTRACE when of the OnCE registers NS i Also it is important to remember that writing to the OPDBR register is in effect manipulating the DSP program controller Whenever 2 word opcodes are being written to the OPDBR it is bestto CTRACE or CSTEP 2 before displaying registers Example 3 11 Command Examples cs N cstep Execute one OnCE serial command of the default Command Converter s Y memory pointed at by its YPTR The OnCE registers will be displayed after the command is executed cste
392. ses without requiring all COFF files to reserve space for that information General utility programs can be made to work properly with any common object file This is done by seeking past the optional header using the f opthdr size field in the file header record The optional header in a Motorola DSP object file may contain two distinct types of information depending upon how the file was generated If the fileisa relocatable object file it will have an optional header containing linker information If the file is an absolute object file it will have an optional header containing runtime information The runtime header is similar to standard COFF a out optional header formats Table B 4 on page B 7 shows the linker optional header The module size field gives the size of the entire object module The data size field reflects the size of the entire raw data block within the module The endstr field points to an expression in the string table which originated with the assembler END directive see Chapter 6 of the DSP Macro assembler Manual it indicates the starting address of the module If this field is negative or zero there is no end expression The logical section count is the count of sections in the object module created via the assembler SECTION directive The counter count represents the number of COFF sections in the file analogous to the file header f_nscns field The relocation entry and line number counts hold the number of all relocat
393. set bA 52 Reset Command Converter 1 ELT include simcom h CREE finclude driver h A 2 N int devn status VT devn 0 status dspd reset devn D 14 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 8 dspd cc revision Read Command Convertor Revision Number include simcom h include driver h int dspd cc revision device index revstring 1 int device index Command Converter affected by command M 1 char revstring pointer to buffer to receive revision number string dspd revision returns a text string containing the version number of the monitor for Command Converter device index in the buffer pointed to by revstring The message is created with the format Command Converter monitor revision 4 2 The return value is DSP OK for success DSP ERROR if the reset fails Example D 8 dspd cc revision 0 5 Read CC monitor revision number 5 1 include simcom h include driver h M n M 1 int devn status 7 char rev buf devn 0 rev buf unsigned long dsp alloc 100 sizeof char status dspd cc revision devn rev buf MOTOROLA DSPADSUM AD D 15 C Library Functions Library Function Descriptions D 3 9 dspd cc write flag Write Command Converter Flag Word finclude cc h include simcom h include driver h
394. sets the device 410 WINDOWS MENU 32 NS WM lt The Windows menu provides access to the windows which allow monitoring and control of the development process These windows display information such as the contents of registers and memory are updated automatically at each break in execution and may be moved and re sized to provide a convenient working environment Many of the multi function for example the Assembly window which displays the code in the vicinity of the PC permits editing the co e with the single line Assembler and sets and clears breakpoints Some windows may be opened many times With some of the windows such as the Breakpoint window which lists the breakpoints Windows Tile Cascade Assembly Source Register Memory Stack Calls Watch List File Input Output Breakpoints Command Session which have been set in a particular DSP device a window may be opened for each device The Memory window however which displays a block of memory and may be scrolled through the entire address range of the memory space chosen may be opened as many times as desired for each device to show different memory areas at the same time MOTOROLA DSPADSUM AD 4 55 Graphical User Interface Windows Menu Table 4 3 Summary of Window Functions re submit commands Command help Error message display Window Functio
395. sp_step Execute Counted Instructions D 65 dsp_stop Force DSP Device into Debug Mode D 66 _ dsp_unlock Unlock Password Protected Device D 67 dsp_ wmem Write DSP Memory Location D 68 wmem blk Wfrite DSP Memory Block D 69 dsp_wreg Write DSP Device Register D 70 sim_docma Execute Emulator User Interface Command 0 71 sim gmcma Get Command String from Macro File D 72 sim gtcma Get Command String from Terminal D 73 EMULATOR SCREEN MANAGEMENT FUNCTIONS D 74 simw_ceol Clear to of D 74 simw ctrlbr Check for CtrL C Signal D 75 simw cursor Move Cursor to Specified Line and Column 0 75 DSPADSUM AD MOTOROLA 0 4 4 D 4 5 D 4 6 D 4 7 D 4 8 D 4 9 D 4 10 D 4 11 D 4 12 D 4 13 D 4 14 D 4 15 D 5 D 5 1 D 5 2 0 5 3 0 5 4 0 6 0 6 1 0 6 2 0 6 3 0 7 0 8 0 9 simw endwin End Emulator Window D 75 simw getch Non Translated Keyboard Input D 75 simw gkey Translated Keyboard Input D 76 simw_putc Output Character to Terminal D 76 simw_puts Output String to 0 76 simw redo Hepaint Screen with Output from Device 0 76 simw_redraw Redraw Screen after Scroll Count fec D 77 simw_refresh Screen Update after Buffering Output 9 77 simw scrnest Increase
396. splay of the currently opened log filenames The keyword OFF is used to terminate logging The C and S key characters are used to specify whether the logfile will contain only commands C or all session output S M N The suffixes cmd and log are added respectively to the commands only or session filename if no other suffix is specified The default file path for each target DSP can be changed with the PATH command If a file currently exists with the filename specified the user will be prompted for an action of either appending the data to the file overwriting the file or aborting the command The selection of the file action may be included in the command line using t overwrite append or the cancel argument a Example 3 33 LOG Command Examples log Display currently opened log files N log 5 debugger session1 Log all display filename session1 log in directory debugger log 1 L Log all commands to filename 1 log off b Terminate command logging log off Terminate all logging log c 1 Log all commands to filename macrol cmd If a file with that name currently exists cancel the execution of the command 3 54 DSPADSUM AD MOTOROLA User Interface Commands Detailed Command Descriptions 3 6 28 X MORE Enable Disable Session Paging Control More OFF The MORE command allows the user to enabl
397. splay version of the emulator The formats are the same The save function is provided as a low level entry point that saves the Emulator state for a non display version of the Emulator It is the same function that is called during execution of the high level save s command which is only available in the display version The only limitation is that the full save filename must be specified No automatic expansion is done for the working path or filename suffix as in the higher level emulator calls The save function is described in Section D 3 54 D 80 DSPADSUM AD MOTOROLA C Library Functions Non Display Emulator D 5 3 Executing Device Instructions After creating a new device as described in Section D 5 1 and loading a program or state file as described in Section D 5 2 the emulator is ready to execute the program code Execution begins at the start address specified in the load file or continues from the previous location in an emulator state file The user s code may select a new execution address by writing register pc using the dsp_wreg function or With dsp go address D 5 4 Testing Breakpoint Conditions NOR The command line interface in the display version of the provides facilities to specify breakpoint conditions When the breakpoint condition i is met during user program execution the emulator displays the enabled registers assuming the breakpoint action is halt The non displa
398. ss only uses the hardware stack temporarily Different conventions may be used 2 Assembler programs Wi 4 1 Windows Calls Assembly Source Register The Calls window tracks C procedure calls Each procedure call adds Memory another stack frame each return removes one Entry 0 is the most nested 5 procedure that is the top entry on the stack the highest number is the main procedure 4 60 DSPADSUM AD MOTOROLA Graphical User Interface Windows Menu Each entry has a nesting level number the PC return address i e the address after the procedure call and the name of the procedure The top level represents the entry to the debug monitor and so indicates the next instruction to be executed The call stack also indicates the context to use for evaluating C expressions As each procedure may have its own copy of a named variable it may be necessary to indicate which instance is required A double click on a stack level selects it as the expr ssion context for Display Evaluate See also Modify Up and Modify Shows one entry P space address is 0 instruction to for each call to address of next instr reach current instruction to execute in execute in current location calling procedure procedure NR See also Modify Up ION NN and Modity Down 0 0 ne3 1 p 0x7b 2 Double click on stack frame to 3 p 0
399. stablished for each device 4 66 DSPADSUM AD MOTOROLA Graphical User Interface Windows Menu Windows Assembly Source Register The Microsoft Windows environment has two features to arrange windows ney Tile and Cascade Tile divides the main window into roughly equal caus 4 s Watch areas and places one open window in each tile All windows visible but jr not all are large enough to be useful Cascade makes all the windows the dent same size but usually larger than Tile and staggers so that the top window Breakpoints Command can be seen and the title bar of all other windows is visible 2 1 Session 4 10 14 Windows Tile Cascade Microsoft Windows only Cascade Both of these techniques simplify the process of locating a window lost on the desktop under other windows or scrolled off the edge of the main window Sim56000 File Display Modify YN Help 1 Ki NEXT FINISH we REPEAT QC lpvoo Sessa ovo 9 Address Label wasm load C m 6 break 50051 break 50124 Mnemonic break p 04a0 0 0001 move 55 6 break p 04a6 1 0 0002 move 0 n6 list Fpr0 0003 move r6 r0 view r 0 0004 move Fpr0 0005 gt 1 a Fpr0 0007 move 0 0052 0053 Fpr0 0 0054 0 0 0055 0 0 0057 0 0 0058 0 0 0059
400. stems with multiple DSPs ME 1 Example 3 68 WWATCH Command Examples ERN wwWatch 10 57 d E Open a Watch window for the current device with the register r0 displayed If the window already exists add r0 to the list of watched items 7 NU e WWatch x 100 N Open Watch window for the current device with the memory location x 4100 displayed If the window already exists add x 100 to the list of watched items WWatch r243 OP E Open a Watch window for the current device with the expresion 1243 displayed If the window already exists add r2 3 to the list of watched items wwatch win2 A Open Watch window for the current device with window number of 2 with the register 0 displayed If the window already to the list of watched items unm 1 wWatch Close all Watch windows for current device wwWatch win3 off Close Watch window 3 for the current device WWatch 2 Remove watch element 2 from first Watch window s list of watched elements WWatch win4 2 off Remove watch element 2 from Watch window 4 s list of watched elements MOTOROLA DSPADSUM AD 3 89 User Interface Commands Debugging C Programs 3 7 DEBUGGING C PROGRAMS The ADS user interface software is capable of loading programs compiled with the Motorola Optimizing C Compiler and also has features which aid in the process of debugging such programs This sect
401. ster parameter C HELD 18 Bit field C BLOCK 100 Beginning and end of block C FCN 101 Beginning and end of function C EOS 102 End of structure C FILE 103 C language source filename C LINE 104 C ALIAS 105 Duplicated tag C HIDDEN 106 B 16 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Object File Components Table B 15 Storage Classes Continued Mnemonic Value Type A FILE 200 Assembly source filename A 5 201 Beginning and end of section A BLOCK 202 Beginning end of COFF section A MACRO 203 Macro expansion A GLOBAL 210 Global assembly language symbol A XDEF 211 XDEFed symbol A 212 XREFed symbol A_SLOCAL 213 Section local label ULOCAL 214 Underscore local label MLOCAL 215 Macro local label Table B 16 Storage Class and Value Storage Class Value C AUTO Stack offset in words C EXT Relocatable address STAT Relocatable address C REG i Register number C_LABEL Relocatable address C MOS Offset in words C Stack offset in words C STRTAG 0 C MOU 0 C UNTAG gt 0 _ C_TPDEF 0 _ C ENTAG 0 ER Enumeration value 244 REGPARAM Register number C FIELD Bit displacement C BLOCK Relocatable address C FCN Relocatable address C EOS Size of structure in words C FILE see below C ALIAS Tag index MOTOROLA DSPA
402. symbol record The structure of a symbol table entry is illustrated in Table B 12 Table 12 Symbol Table Entry Format Bytes Declaration _ Name SA Description 0 7 char 11 50 0 3 longint n zeroes Zero in this field indicates name is in string table 4 7 longint n offset Offset of name in string table 8 15 CORE ADDR n address Symbol address value A 845 unsigned long n val 2 Symbol value AN 16 19 _ int n scnum Symbol section number 1 j 20 23 unsignedlong n type Symbol basic and derived type 24 27 long int n_sclass Symbol storage class 28 31 long int n_numaux Number of auxiliary entries MOTOROLA DSPADSUM AD Motorola DSP Object File Format COFF Object File Components B 3 3 5 Symbol Name The first eight bytes in the symbol table entry are a union of a character array and two longs If the symbol name is seven characters or less the null padded symbol name is stored there If the symbol name is longer than seven characters then the entire symbol name is stored in the string table In this case the eight bytes contain two long integers the first is zero and the second is the offset relative to the beginning of the string table of the name in the string table Since there can be no symbols with a null name the zeroes on the first four bytes serve to distinguish a symbol table entry with an offset from one with a name in the first eight bytes
403. t Display the redirect list which shows each of the three streams that c can be redirected along with to where they are being redirected f NN redirect DV0 3 4 5 off b Cancel all stream redirection for specified target devices redirect stdin input Redirect the stdin standard input stream from t the file input cio cio is the default extension 4 M redirect stdout output txt SO 1 1 Redirect the stdout standard output stream to the file output txt redirect stderr errors Redirect the stderr standard error stream to the file errors cio redirect stdout output o Redirect the C stdout stream to the file output cio overwriting the file if it already exists redirect stdout output a Redirect the C stdout stream to the file output cio appending to the end of the file if it already exists 0 000 redirect stdout output c Redirect the C stdout stream to the file output cio but don t redirect if the file already exists Note No I O processing or handling of redirection occurs if the streams option has been disabled See STREAMS for more information MOTOROLA DSPADSUM AD 3 63 User Interface Commands Detailed Command Descriptions 3 6 35 SAVE Save Memory To File SAVE dev num S state address block filename 0 a C The SAVE command allows creation of an ADS state file from the current ADS state or creation of an OMF file from specified memo
404. t Functions D 4 2 simw ctrlbr Check for CtrL C Signal simw_ctrlbr This function must check for the occurrence of a Ctrl C signal from the terminal If the Ctrl C signal occurs it sets a flag for the active breakpoint DSP defined by sv_const breakdev It returns the sim var stat CTRLBR flag for the current device This allows the program to select the device that will halt in response t to the Ctrl C signal from the keyboard in a multiple device emulation 14 4 3 simw cursor Move Cursor to Specified Line and Column simw cursor line column NN NA This function must move the cursor to the specified 1ine and column and update the sim const curline and sim const curclm variables D 4 4 simw endwin End Emul ator Window simw_endwin 2 This function is normally called when returning to the operating system level from the emulator It must terminate any special processing associated with terminal I O for the emulator and clear the display D 4 5 simw getch Non Translated Keyboard Input simw getch 2 L 2 This function gets a single character in a non translated mode from the terminal It is not used much by the emulator only when returning from the execution of the system command prior to the time when the emulator s special terminal I O processing is reinitialized MOTOROLA DSPADSUM AD D 75 C Library Functions Emulator Screen Management Functions D 4 6 simw_gk
405. t only until the next instruction is executed An expression out of scope because of procedure exit can not be evaluated until the procedure is next invoked as its variables no longer exist Select window number Add Watch Expression To Window Select isplay Multiple Watch radix for _ Wind windows may Ca MIROR expression Decimal opened for each device C Fractional _ expressions O Floating Point B default to type C Hexadecimal S lt Enter expression Unsigned of expression Enclose C rM Default x r expressions in 5 brackets 2 Figure 4 75 Windows Watch Dialog Box m 4 10 8 Windows List File Assembly Source Views an ASCII file without leaving the development environment A real standard File Chooser dialog box is opened Select an ASCII file for 1 Watch viewing The List File window is opened showing the start of the file The amm line number appears at the start of each line The window may re sized Input and scrolled to view the whole file List Winl CATGUNMWORKYSESSIOND LOG no source file pc 90 pe e000 no label section global load AASDBTEST CLD Loading file A SDBTEST CLD view s sre sdbabcdefghijk asm 1 pc sdbabcdefghijk asm 5 pi 6d lab d next 5000000000000 5000000000000 a 00000000000000 b 00000000000000 000
406. te breakpoints and allows user interface commands to be entered and the display to be examined Enabling Command Converter service requests resumes Command Converter execution ws N _ ES y 2 A 1 lt 1 5 3 Display Modes The ADS supports three display modes Register Assembly and Source These modes determine the ADS display at the termination of either the GO STEP or TRACE commands The Register display mode causes the display of register and memory locations enabled by the DISPLAY command The Assembly display mode causes the display of one full screen of disassembled instructions containing the instruction at the current execution address The Source display mode causes the display of one page of the original source file which contains the source line associated with the current execution address In both the Assembly and Source display modes the position of the current execution address is marked by gt in the left margin The Source display mode requires symbol and line information in the object file that will normally be the result of assembling with the g option of the assembler See the Assembler Manual for instructions on the use of the g option A display mode can be selected either by the ADS VIEW command or by toggling among the display modes using the Ctrl W key entry hold down Ctrl and press w In addition ADS commands which display registers or memory or otherwise create d
407. te Program Execution after Device Reset include simcom h include protocom h dsp go reset device index int device index DSP device affected by command dsp go reset causes the target device specified by device index to be reset into User Mode Execution starts at the reset value for pc To place a device into debug mode see dsp reset B The function returns TRUE on success FALSE otherwise N VM Example 0 43 dsp_go_reset Initiate program execution by reset foo include simcom h No gt include protocom h int devn status char load_fname filter2 cld 1 1 devn 0 s dsp new devn 56002 Allocate structure for device 0 a 56002 status dsp_ldmem devn load_fname into memory status dsp go reset devn start program execution after device reset D 50 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 44 dsp init lnitialize a Single DSP Device Structure include simcom h include protocom h dsp init device index int device index DSP device index to be affected by command 1 dsp init initializes a device device index to the same state that existed f llowing the dsp new call which created it It is equivalent to performing the emulator FORCE S command All memory spaces are cleared the registers are reset breakpoints and input output file assign
408. ter scrolling the display up one line It also takes care of writing the text string to the proper log files specified by the emulator log s or log c commands depending on 1 D 78 DSPADSUM AD MOTOROLA C Library Functions Non Display Emulator 0 5 NON DISPLAY EMULATOR The emulator package contains object libraries which support both display and non display versions of the emulator The library nwads contains functions available to the non display version of the emulator The library wwads contains functions that may only be used in a display version of the emulator For each device type there are also display and non display device specific libraries named wwxxxxx and where the xxxxx is the device number The source code contained in anwdsp c can be linked with the nwxxxxx S dnd nwsim libraries to create a non display version of the emulator Elimination of interface functions cuts the code size of the emulator almost in half However all of the functions listed in Section and sim sim gmcmd and sim gtcmd described in Sections Section D 3 64 Section D 3 65 Section D 3 66 are sacrificed The remainder of the functions in Section D 3 are available in the non display emulator libraries y Some major features of the emulator are eliminated by the loss of the sim function In particular there are no low level entry points provided to set a breakpoint or to assign inp
409. ter Index include simcom h include protocom h dsp findreg device index reg name periph number reg number int device index DSP device index to be affected by command char reg name register name int periph number return peripheral index _ int reg number return register index dsp findreg searchesthedt var periph structures for a match to the reg name string provided in the function call If a match is found findreg returns the peripheral index through periph number register number through the reg number parameter and 1 as the function return value otherwise it just returns 0 as the function return value No You may also use the emulator help reg command to obtain a list of the valid periph num and reg num values and reg val size for each register Example 0 37 dsp Paneg Get peripheral index and register Dus ir for regist r include simcom h include protocom h N QUAM int devn int regnum pnum 72 int ok devn 0 devn 56002 Allocate structure for device 0 a 56002 ok dsp findreg devn n3 amp pnum amp regnum Get index for n3 register D 44 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions D 3 38 fmem Fill Memory Block with a Value include simcom h include protocom h include coreaddr h
410. terrupt the Command Converter 3 2 6 Miscellaneous Commands There are eleven miscellaneous task commands available which allow the user to EVALUATE expressions in five different radices select a new default DEVICE QUIT the User interface program and return to the operating system or get HELP for command 3 4 DSPADSUM AD MOTOROLA User Interface Commands Command Syntax line entry Also a default PATH may be defined for a target a new default RADIX may be selected execute SYSTEM commands or WAIT a specified number of seconds before proceeding to the next command The HOST command allows the host computer interface card address to be changed The LIST command displays a specified source file when symbolic debug is in effect The VIEW command allows selection of the simulator display mode source assembly or register 3 3 COMMAND SYNTAX The command descriptions in Section 3 6 each begin with command syntax line showing the general form of the command The command syntax line contains special punctuation to indicate command keywords required or optional fields repeated fields and implied actions The special punctuation is not used for command entry but rather to describe the forms of the command Capitalized WORDS indicate command keywords Command keywords may be entered in either upper or lower case The portion of the command keyword shown in BOLDFACE represents the minimum portion of the keyword that the user must type The
411. th Assembler instructions and one way of setting and clearing Halt breakpoints As the program executes the Assembly window automatically refreshes to display the area around the PC In addition the Memory window displays a block of memory as numeric values Windows menu Memory option You can control the radix used to display each memory location Modify menu Radix option individually So if one location is a counter it can display in decimal if another is a bit mask binary or hexadecimal might be more suitable The 4 8 DSPADSUM AD MOTOROLA Graphical User Interface Graphical Interface Functions Overview Memory window can be re sized to display more or less memory the number of columns adjusts to use the width given and scrolled to cover the whole memory address range Click on a location to modify an individual memory location Several Memory windows may be opened to display different memory areas concurrently To initialize a block of memory to the same value in each location as in clearing a buffer use the Modify menu Memory option 4 5 6 Examining and Changing Registers e The registers can also be monitored with the Register window Window menu Register option registers associated with the core or a specified peripheral can be displayed in a window scroll to view those you want Multiple windows may be opened for each device to view registers in different peripherals Registers can also be modified as with the M
412. that opens a memory window Multiple device windows may be opened for viewing and changing separate memory areas and spaces at the same time and for debugging target systems with multiple DSPs M The memory window is positioned initially to view the address specified by tl he addr field The addr field may also be used in conjunction with the space field to select the exact memory space required zs xm Example 3 62 WMEMORY Command Denge NN wmemory ow Open a memory window for the internal program pi memory space fort Be current device Xi 0 A Open a memory window for the xi memory space containing address 0 for the current device wmemory dv2 win3 4100 N E Open a memory window for memory space x with a window mimba of 3 for the current device Scroll window to display address 141007 7 wmemory Off Close memory windows for the current device 200 b wmenory win3 off 2 Close memory window 3 for the current device MOTOROLA DSPADSUM AD 3 83 User Interface Commands Detailed Command Descriptions 3 6 55 WOUTPUT GUI File Output Window WOUTPUT dev list OFF WOUTPUT is a GUI command that opens a file output window The output window displays the simulated output assignments for the specified device Multiple output windows may be opened for debugging target systems with multiple DSPs Example 3 63 WOUTPUT Command Examples je woutput ALCUN 4 2 5
413. tible Interface 2 3 INSTALLING THE PC COMPATIBLE SOFTWARE 2 5 Defining Environment Variables 2 5 All Versions of User Interface 2 6 Text Based User Interface Program Installation 2 6 2 7 Graphical User Interface GUI Program Installation 2 7 SUN 4 TO COMMAND CONVERTER INTERFACE 2 8 Installing the Sun 4 2 8 Software Installation 2 9 HP7XX COMMAND CONVERTER INTERFACE 2 10 Installing the HP 7xx 2 10 HP VUE Shutdown 2 10 HP UX COMMAND LINE SHELL SHUTDOWN 2 10 ISA Card Installation 2 11 Installing the HP 7xx Device 2 12 CONFIGURING THE COMMAND CONVERTER 2 16 Selecting the Command Converter Device Number 2 16 MOTOROLA DSPADSUM AD iii 2 6 2 2 6 3 3 1 3 2 3 2 1 3 2 2 3 2 3 3 2 4 3 2 5 3 2 6 3 9 3 4 3 5 3 6 3 6 1 3 6 2 3 6 3 3 6 4 3 6 5 3 6 6 3 6 7 3 6 8 3 6 9 3 6 10 3 6 11 3 6412 3 6 13 _ 3 6 14 3 6 15 3 6 16 3 6 17 3 6 18 3 6 19 3 6 20 3 6 21 JTAG OnCE Port Buffer 2 17 Command Convertor Monitor Firmware Upgrades 2 17 INTRODUCTION ut suede
414. tion Descriptions 0 3 18 dspd_reset Reset DSP Device to Debug or User Mode include simcom h include driver h int dspd reset device index reset mode int device index Index of affected DSP device 1 int reset mode type of reset to perform dspd_reset resets the target device device_index The device may be reset into debug mode or user mode based on the value of reset_mode Valid values for reset_mode are DSP RESET DEBUG reset device into debug mode DSP RESET USER reset device into user mode V The function returns DSP on success DSP ERROR otherwise Example D 18 df reset Place DSP device 3 into debug mode include simcom h include driver h int devn status M z devn 0 dsp new devn 56002 Allocate structure for device 0 a 56002 status dspd reset devn DSP RESET DEBUG Reset device into DEBUG mode MOTOROLA DSPADSUM AD D 25 C Library Functions Library Function Descriptions 0 3 19 dspd status Determine DSP Status include driver h include simcom h int dspd status device index mode int device index DSP device affected by command int mode address of buffer to receive device status 11 JE dspd status places the execution status of the target device device index in the int po
415. tion from the Command Converter device memory space mt ype address address and stores the value in the pointed to by value gt NS Valid values for mtype A DSP CC DSP CC XMEM DSP CC PMEM lt The return value is on 852 FALSE otherwise Example 0 31 12 4 cc rmem Read location from Command Converter memory include simcom h include protocom h include cc h include coreaddr h int devn status enum memory map read memtyp memory space to read unsigned long read address address of location to read read store location to hold read value devn 0 devn 56002 Allocate structure for device 0 a 56002 read memtyp DSP CC XMEM set memory space for read read address 0x00401 set read address read required location Status dsp cc rmem devn read memtyp read address amp read store D 38 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 32 dsp cc rmem blk HRead Command Converter Memory Block include simcom h include protocom h include cc h finclude coreaddr h M int dsp cc rmem blk device mtype address count value int device Command Converter affected by command Te enum memory map mtype Memory space to read EE unsigned long address Address of loca
416. tion to read unsigned long count number of locations to read unsigned long value Target location for read value oos dsp cc rmem blk reads count locations from the target Command Converter device memory space mt ype address address and stores the values i in the buffer pointed to by value NC Valid values for mtype are DSP_CC_YMEM D SP_CC_XMEM and DSP CC PMEM The return value is TRUE on successful FALSE otherwise E Example D 32 dep rmem blk Read memory block from Command Converter memory kf include simcom h _ include protocom h gt include cc h include coreaddr h int devn status enum memory map read memtyp memory space to read unsigned long read address address of first location to read dm read length number of locations to read 14 77 rend 10241 5 buffer to hold read values devn 0 _ set device number dsp_new devn 56002 Allocate structure for device 0 a 56002 DSP CC XMEM set memory space read addr 0x00401 start address read length 551 and block length now read the memory block into read store status dsp rmem blk devn read memtyp read addr read length read store MOTOROLA DSPADSUM AD D 39 C Library Functions Library Function Descriptions D 3 33 dsp cc wmem Write Command Converter Memory include s
417. tional Description OnCE Port Architecture m asserts RESET All HESET NEM IMS targets enter reset o JTAG instruction DEBUG nea DEB RE oaded REGISTER a 4 e o Converter releases RESET Targets exit reset in Debug mode Figure 5 8 Reset JTAG device with RESET Signal 54 OnCE PORT ARCHITECTURE This section covers a global view of the OnCE architecture To specific details on the OnCE port registers and addresses for the 16 24 2 32 bit DSPs it is best to refer to the pertinent DSP user manual To control the target DSP with minimal die area penalty the OnCE port was designed so users could interact directly with the program controller This port eliminates the need for a special debug monitor resident in the user program memory map Figure 5 9 illustrates the d port architecture 5 4 1 OnCEControler d The OnCE port controller acts as a serial slave interface which is controlled by the Command Converter To communicate with the OnCE controller the DSP must be put in the Debug mode of operation The Debug mode may be entered from a hardware or software breakpoint single stepping through opcodes or from an assertion of the Debug Request P pin A state machine decodes 8 bit commands and controls interaction with the OnCE registers The OnCE controller block also contains a clock counter and circuits for synchronizing external clocks
418. to leftmost column Click to 275 select device open pull down list and directory list order select a directory from previously visited list 22 directories 21 MAKERS Use gt and buttons m oe CLIPART to scroll horizontally MOUSE through e C3 MSOFFICE Ho Displays levels NS PCS FILTERS currently selected Directory directory May MAKERS DEMOS also click and enter path wu elect Open Cancel directly dialog box 5 Single click and Open Size for number or double click lists Single click and of columns SELECT sets path directories available in shown and length last selected directory of list to last selected directory Figure 4 5 File Path Set Add Dialog Box 4 14 DSPADSUM AD MOTOROLA 4 6 2 The File Load COFF Memory OMF menu File Load Memory COFF Memory Graphical User Interface File Menu Load Memory COFF Memory State items read object modules in OMF or COFF format into the DSP memory for the current device see Modify Device Set Default Complementary functions File 5ave Memory COFF and Memory are available to preserve memory contents in OMF or COFF files which may themselves be loaded If Memory COFF load is selected a dialog box gives the choice of loading memory debug or both Otherwise the operation is identical for both OMF
419. top the device now status ads cache registers devn cache regs on entry to debug mode D 66 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 60 dsp unlock Unlock Password Protected Device include simcom h include protocom h dsp unlock device type password char password Pointer to string containing password char device Name corresponding to DSP device type M 1 1 dsp unlock provides the password for protected device types lt must be used prior to the new function if the device type is password protected _ Example 0 60 dsp unlock 2 ct Create a device emulation of the password protected 56001 device include simcom h x nm include protocom h 2 VM int devn ads startup 100 ADSP56000 A 2 dsp startup devn 0 dsp unlock 56001 x51 234 provide password for device e E dsp new devn 56001 Create structures for prot scted devic type MOTOROLA DSPADSUM AD D 67 C Library Functions Library Function Descriptions 0 3 61 dsp wmem Write DSP Memory Location include simcom h include protocom h include coreaddr h dsp_wmem device_index memory_map address value int device_index DSP device to be affected by command enum memory_map memory_map memory designator 22 M
420. tor m M Figure 4 4 GUI Interface to ADS 4 5 2 X Starting the ADS At system start up the main window opens This provides the menu for the system and the tool bar for convenient access to frequently used operations Cher windows may also open This is controlled by the Preferences item in the File menu If checked the positions of the windows are saved on exit so the GUI starts with the required windows already open Running under Microsoft Windows the main window is the whole work area All windows are held within its bounds To use the whole File ADS56000 Display Modify Execute Windows Help 5 8 25 4900 NEXT DEVICE REPEAT n display v Command Converter monitor revision 4 56 MOTOROLA DSP56888 ADS VERSION 6 6 18 F wsession wcommand force b F1 dep dp dap 000 Assembly DvOO Source Command MOTOROLA DSPADSUM AD 4 7 Graphical User Interface Graphical Interface Functions Overview screen it is necessary to maximize the main window and similarly when the main window is minimized all the other windows go with it On other platforms the daughter windows are free to use any area of the screen An icon representing each open window appears on the main window which can be used to find a window hidden behind others or reopen a minimized window d 1 M 4 5 3 File Access Paths The debugger makes use of two types of pat
421. tputs Note 300 is the address where the DEBUG opcode is to reside Output dv2 off Close file currently open for target DSP address 2 outputs N a Output p 500 rd Open file for logging of default target DSP outputs i in 298 radix Note 500 is the address where the DEBUG opcode is to 2 Output 2 700 term S NND Open file number 2 for the current default target DSP address as the terminal Note 700 is the address where the DEBUG is to reside MOTOROLA DSPADSUM AD 3 59 User Interface Commands Detailed Command Descriptions 3 6 31 File Directory Path PATH dev list pathname PATH pathname pathname PATH The PATH command allows the user to pre define a directory path for file I O for each target DSP address This enables the user to effectively partition data files for each target DSP address in their appropriate subdirectory Once a file is opened for INPUT OUTPUT SAVE or LOGging subsequent changes to the path will not affect the opened file To change the path the file must be closed and reopened with the new path name The user may still override the default path by explicitly specifying a pathname as a prefix to the filename in any of the commands which reference a file 4 Alternate source pathnames may be specified using the PATH form of the command Each time the command is
422. ug mode It is typically used in conjunction with ENABLE ONCE to perform system debug functions It is provided as a Motorola public instruction When the DEBUG REQUEST instruction is invoked the TDI and TDO pins will be connected to the BYPASS register 5 123 Polling for Chip Status From the JTAG Port Two DSP core status bits are accessible by reading the OnCE Status Control Register or when a JTAG instruction is entered in the SHIFT IR state Table 5 3 describes the two status bits of the DSP core To insure synchronization of an external JTAG controller and the target DSP the status bits should be polled after entering commands which do external memory accesses This will insure that external accesses with wait states or bus arbitration will terminate correctly before trying to enter any new commands associated with DSP URCOSES thought the OPDBR Table 5 3 DSP Core Status Bit Description Function 051 050 Comment Normal 0 DSP core executing Instructions Stop Wait 0 1 DSP core in Stop or Wait Mode Busy 1 0 DSP doing external or peripheral access Debug 1 1 DSP core halted 5 28 DSPADSUM AD MOTOROLA SECTION 6 HOST COMPUTER CARD COMMAND CONVERTER SUPPORT INFORMATION MOTOROLA DSPADSUM AD 6 1 Host Computer Card Command Converter Support Information 6 1 6 3 6 2 HOST INTERFACE CARD BUS SIGNAL DESCRIPTION
423. uired execution start address MNT opcode opcode for long jump to required execution start address Symbolic names are defined for FUSE opcodes for the device 5 families in simcom h M operand address of long jump target execution start address L RM 5 The function returns DSP OK on successful completion DSP ERROR otherwise Example D 13 dspd go Start execution from address 0 1000 finclude simcom h include protocom h include driver h d int err status devn Cx zs devn 0 Na err dsp load lunchbrk adm reload devices and program data status dspd go devn DSP LONGJUMP 56K 0x10001 amp execute from 0 1000 D 20 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 14 dspd jtag reset Reset JTAG Communications include simcom h include driver h int dspd jtag reset device index reset type int device index device affected by command Y int reset type type of reset to perform dspd jtag reset resets the JTAG TAP controller for the device dutch p reset type may be set to p e DSP JTAG RESET HARDWARE Force reset by asserting trst pin on JTAG port e DSP JTAG RESET SOFTWARE Force reset by toggling tms pin on JTAG port until the JTAG TAP controller state machine returns to its reset state Th
424. umber and the word count which the user wishes to input data from must be in the for Perse register of the DSP prior to executing the DEBUG instruction 3 The address where the data is to be put must be in the RO R1 for DSP96000 register and the memory map type Ps 0 1 2 must be in the R1 R2 for DSP96000 register The default path for each target DSP address can be changed with the PATH command If a transfer error occurs an error message will be displayed on the screen The ADS user interface program provides a way to specify repeated input values and sequences very similar to the DSP simulator program A single data value may be repeated by specifying count following the data item A group of data items may be indicated by enclosing the group in parentheses The entire group may then be repeated by placing count immediately following the closing parenthesis The parentheses may be nested A closing parenthesis without a following repeat count will cause the data sequence within the parentheses to repeat forever T Example 3 26 Examples of Input File Data ABCF A single data item ABDF 1FF 20 Repeat the data item 1FF twenty times CC 50 5 Repeat the sequence of data pairs CC 50 five times MOTOROLA DSPADSUM AD 3 47 User Interface Commands Detailed Command Descriptions There are two levels of terminal data input capability provided by the ADS user interface If the INPUT command sp
425. unchbrk adm ADS state QM ga load m test cld Load the COFF format test cld file ignoring any symbolic debug information in it load d test cld Load the symbolic debug information from the COFF format test cld ignoring the memory contents of the file Vie N 3 7 02 load b 300 bootprog lod gt Load the bootprog lod file writing the least significant byte first and most significant byte last into each consecutive memory location of the target The 300 argument is an address offset to be added to the starting location of memory specified in the data record MOTOROLA DSPADSUM AD 3 53 User Interface Commands Detailed Command Descriptions 3 6 27 LOG Log Commands and or Session LOG dev list OFF C commands S session filename 0 a c LOG dev list OFF V source display status line The LOG command allows the user to record command entries only or record all session display output to a file Recording of commands only is useful as a method of generating macro command files Recording all session display output provides a convenient way for the user to review the results of an extended sequence of commands The user would otherwise only have access to the last 100 lines of output rm the terminal Since the output log files are in ASCII format they may easily be printed or using an editor program Entering the LOG command with no parameters will cause a di
426. unction name prefix The prefix indicates to which part of the ADS they belong and if 5 available in the display non display versions of the emulator e ads ADS specific routines both versions EN gt e dspd driver level not for use by user code both versions 9 cc Command Converter driver level not for use by us user code both dspt_ DSP device dependent routines both versions e dsp both versions 4 fe M dsp Command Converter routines both versions e sim display only user interface routines The driver level routines both those referred to above and those documented in the rest of this appendix are not intended to be called by emulator code They are designed to be directly or indirectly by the interface routines They are documented so that the user can rewrite them to drive alternate emulator hardware Other lower level functions mentioned in this appendix are not intended to be called by user code these functions are not documented and are specified by the prefixes dspl siml and dspt1_ 4 DSPADSUM AD MOTOROLA 2 2 D 2 2 1 ads cache registers devn ads startup devp devtype D 2 2 2 dspd cc architecture devn device type dspd cc read flag devn flag value dspd cc read memory devn mem addr count value dspd reset devn dspd cc revision devn revstring dspd write flag devn flag value dspd cc w
427. unction library D 3 filenames D 79 function name prefixes D 4 global variables D 85 G GUI DISPLAY menu 4 27 EXECUTE menu 4 47 FILE menu 4 13 functional overview 4 6 HELP menu 4 68 MODIFY menu 4 41 toolbar 4 69 WINDOWS menu 4 55 H hardware requirements Hewlett Packard HP7xx 1 7 1 6 4 1 7 help 3 45 host computer interface 37 pin cable pinout 6 5 cable 5 5 PC BUS connector 6 3 SBUS connector 6 4 user interface structure 5 16 HP7xx Card installation 2 10 IBM PC Card MOTOROLA jumper group locations 2 4 IBM PC software DOS4GVM default settings 2 6 2 7 installation 2 5 virtual memory capability DOS4GVM 2 6 IBM PC Card default i o address 2 5 installation 2 3 IBM PC software protected mode resources pminfo exe 2 6 IBM Pc software dos4gw exe program 2 6 initialization window parameters D 78 J JTAG reset types D 21 L library of functions D 3 Line number B 11 D 35 D 52 lower case 3 5 macro command file execution D 71 D 72 in macro D 71 D 72 invoking ADS 1 5 startup file 1 5 memory allocate D 56 allocation D 32 deallocate D 47 get map index D 43 load D 35 D 52 load state D 53 read D 13 D 23 D 38 D 39 D 58 D 59 write D 17 D 19 D 28 D 33 D 40 D 41 D 45 D 68 menu DISPLAY 4 27 EXECUTE 4 47 FILE 4 13 HELP 4 68 MODIFY 4 41 DSPADSUM AD Index 3 WINDOWS 4 55 multiple devices D 83 device index D 71 halting D 75 N non display emulation librar
428. unsigned long address DSP memory address to write unsigned long value Pointer to value to write to memory location dsp wmem writes a selected DSP memory location ZR The memory map parameter selects the appropriate dt memory structure from dt var mem for the selected device These structures are desc ribed in the simdev h file which is included with the emulator The memory map parameter can be obtained with the function dsp_findmem by using the memory name as a key Use the emulator help mem command for a list of valid memory names Valid memo ry map values are memory_map_ concatenated with a valid memory name As an example memory_map_pa refers to off chip pa memory on the 36002 device If the selected memory map requires two word values the least significant word should be at the value location and the most significant word at the value 1 location Example 61 dsp wmem Write a zero value to address P 200 in device 0 include simcom h include protocom h include coreaddr h int devn unsigned long address menval address 200L memval 0L T3 devn 0 m new devn 56002 Allocate structure for device 0 a 56002 dsp wmem devn memory_map_p address amp memval D 68 DSPADSUM AD MOTOROLA C Library Functions Library Function Descriptions 0 3 62 dsp wmem blk Write DSP Memory Block include simcom h include protoco
429. use the icons in the main window which are labelled to choose which y window to reopen Minimize with the Click with right down triangle File Display _ Modify _ Execute v mouse button to lt rop menu Icons represent minimized windows Use to reopen or bring hidden windows to front dsp dep Command Session Click on title bar with right mouse button to drop window control menu to exit window HELL LLLA Figure 4 1 Main Window for Sun SPARCstation 2 4 4 1 File Chooser ha The dialog box supplied by the platform for the purpose of selecting a file or directory varies significantly in appearance although not in overall function All have the same basic features Drive selection built into the Unix file structure Parent and sub directory selection List of files in current directory e Accept selection or cancel operation e A space to type a file name directly 4 4 DSPADSUM AD MOTOROLA Pin if required Load Memory Scroll horizontally History 7 Special View Filters through directories Graphical User Interface General Window Behavior Scroll through list of files and parents to left subs to right Select a directory in directories 1 1 one column gives list of files directories Enter file
430. ut or output files to DSP memory However the basic functions required to create a device load a program execute the code and test or modify device registers are all still available The use of these basic functions to support breakpoints is discussed in Section D 5 4 In addition the dsp save function provides the capability to save the state of the non display version The state file can later be reloaded by a display version of the emulator for visual examination of the registers and memory contents The following sections cover several that concern the non display version of the emulator Section D 5 1 deals with creating a new device Section D 5 2 describes how to load a program or state file Section D 5 3 describes how to execute device cycles Section D 5 4 describes how to test breakpoint conditions MOTOROLA DSPADSUM AD D 79 C Library Functions Non Display Emulator D 5 1 Creating a New Device The simcom h file defines the maximum number of DSP devices in the constant DSP MAXDEVICES new device can be created and numbered from 0 to DSP MAXDEVICES 1 The structures are allocated by calls to the dsp new function described in Section D 3 47 The following source code illustrates the steps necessary to create 3 DSP euch Note that the numbers used for device number 0 1 2 below reflect the device numbers set up on the target hardware and do not need to be consecutive Example D 67 Dev
431. values numeri Hexadecimal c and address Unsigned n Figure 4 51 Modify Radix Set Default Dialog Box 485 Modity Radix Set Display 1 7 Change Register Modify Radix Set Display the Yadi used when Radix Device et Display registers or memory locations are displayed Each register or memory location may have its own display radix Thus a location which contains a counter qu be set to display in decimal a bitmask may display in binary etc Click on Set Radix Select the radix to 22 4 adire m s Decimal pull down list selected Fractional Enter start oating Poin locations 5 address to C Binary set radix 4 word Select one or more Enter end registers address to from apply radix scrolling list Note that the radix may be applied to a selection of to address if required registers or a block of memory or both at once range Figure 4 52 Modify Radix Set Display Dialog Box 4 44 DSPADSUM AD MOTOROLA Graphical User Interface Modify Menu 4 8 6 Modify Device Set Default Change Register Change Memory Copy Memory Modify Device Set Default selects a DSP device as the current target device device oriented operations will be applied to this device until another device is s
432. vel 05 Active stack 80000000 00000000 level 0A 80000000 88088888 level 83 highlighted red 80000800 88888888 level 02 Figure 4 22 Display Display Stack Output i 7 4 7 5 Display Display Version Disassemble Memory List Register Evaluate Stack Call Stack Version Radix Device This menu selection displays the command converter gt revision number and the ADS version number and production date 27 500 888 5080825 Sane eset p 0044 300000 move 6 r6 display v Command Converter monitor revision 4 56 DSP56666 ADS VERSION 6 8 18 9 14 95 Figure 4 23 Display Display Version Output E 47 6 Display Display Off Display Active Disassemble Memory cM List Register This selection cancels all memory and register display at Evaluate Stack Call Stack Version the end of execution Dv00 Session Note STEP executed but 1 off no register or 83 224888 move r6 r8 step memory display 583 9 2 move Figure 4 24 Display Display Off Output 4 30 DSPADSUM AD MOTOROLA Graphical User Interface Display Menu Display Display 3 gt Disassemble Memory Block 4 7 7 Display Disassemble From PC Memory Block Display Disassemble reads the specified memory area disassembles it and writes it to the Session window
433. vides immediate access to the target and there is also a set of libraries and C language support modules for customized interfaces The C modules of source are provided to allow default values to be changed when entering the ADS and the libraries are provided to facilitate assembly and disassembly of target DSP instructions Also screen and keyboard characteristics may be changed and access to help information may be changed as well as illustrated in Figure 5 1 0 C Source Modules Expression Evaluator Main Initializer Dispatcher Command Parse Execute Screen Keyboard Drivers Help Interface Single line ASM DISASM Hardware Drivers Symbolic Debug Figure 5 10 Host Computer User Interface Program 5 16 DSPADSUM AD MOTOROLA Functional Description Command Converter Software If a user wishes to interact with the hardware directly a set of functions exist which may be called by a separate program These functions provide a means of communicating with the target DSP without having to completely understand the communications protocol The information contained in this section is made available so that users may write their own programs to communicate with the hardware The distribution diskettes which contain the software programs for the Application Development System will contain these C language modules 5 6 COMMAND CONVERTER SOFTWARE Command Converter e
434. which gives the size of a block in the target processor environment For example there are several symbol table auxiliary entries that specify the size of a structure or union for debug purposes In standard COFF these sizes ordinarily are in bytes but in Motorola DSP COFF they are given in words unless otherwise indicated The use of word sizes for debug entities should be distinguished from file pointer offset values in the object file File pointers are indeed byte offsets within t the object file that are used by utilities to process information in the file itself N B 4 4 Relocation Information In standard COFF the symndx field of any given relocation record points to an entry in the symbol table corresponding to a symbol reference requiring modification When the standard COFF linker performs symbol resolution pairing symbol definitions with matching references it updates the relocation entry to point to the symbol definition and discards the reference symbol When the relocation entries are processed the resolved B 26 DSPADSUM AD MOTOROLA Motorola DSP Object File Format COFF Differences Between DSP Object Format And Standard COFF symbol value is used to modify the raw data indicated by the relocation entry at vaddr In Motorola DSP COFF symndx is an offset into the string table which points to a relocation expression The linker interprets this expression and updates the entire wor
435. x e Ue Type Description iv 24 50 Header record for each block of S records The code data field may contain any descriptive information identifying the following block of S records The address field is normally zeroes S1 Code data record and the 2 byte address at which the code data is to reside 52 Not applicable to DSP56000 programming S3 Code data record and the 4 byte address at which the code data is to reside S4 S6 Not applicable to DSP56000 programming 57 Termination record for a block of 53 records Address may optionally contain the 4 byte address of the instruction to which control is to be passed If not specified the first entry point specification encountered in the input will be used There is no code data field S8 Not applicable to DSP56000 programming 59 Termination record for a block of 51 records Address field may optionally contain the 2 byte address of the instruction to which control is to be passed If not t specified the first entry point specification encountered in the input will be 2 used There is no code data field DSPADSUM AD MOTOROLA Motorola S record Information S Record Creation S RECORD CREATION To convert an object module formatted file to an S record formatted file a utility program SREC is provided with the DSP56000 macro assembler program A detailed description of this utility program may be found in the DSP56000 macro assembler file SREC DOC Th
436. x93 in main J select as Evaluate context Note PC address format OxHHHH is hexadecimal PN 4 74 Calls Window NW y NDS 4 4 10 7 Windows Watch Assembly Source Register Memory Stack Calls The Watch window displays the values of any expression This can be the contents of a memory location or register or any arbitrary value which need not be calculated during program execution at all C expressions may be used enclosed in braces Symbolic references may be used if symbols have been loaded from the object module The values are re calculated and output at each bi reak i in execution List File Innut AC expression refers to C variables can only be evaluated in the context in which the watch is established that is while all the variables used in the expression are in scope So if one or more of the variables in an expression goes out of scope either because a procedure call or return from a procedure the value is replaced with the message Expression out of scope When all elements of the expression are back in scope the value is again displayed MOTOROLA DSPADSUM AD 4 61 Graphical User Interface Windows Menu An expression which has gone out of scope because of procedure a call may be evaluated and displayed by selecting the stack frame for the evaluation context See Modify Up and Modify Down The stack frame assignment remains in effec
437. xamining and Changing Registers 4 9 Program Execution the Tool Bar 4 9 rites da 4 9 BIOORDOI S s td 4 10 Simulated Input and Output 4 11 Stream File Support 4 11 Command and Session 5 4 11 Command and Session Log 4 12 S ve Files PMCID 4 12 Input Conventions casses rm Y xe 4 12 DSPADSUM AD MOTOROLA 4 6 4 6 1 4 6 2 4 6 3 4 6 4 4 6 5 4 6 6 4 6 7 4 6 8 4 6 9 4 6 10 4 6 11 4 6 12 4 6 13 4 6 14 4 6 15 4 6 16 4 6 17 4 7 4 7 1 4 7 2 4 7 3 4 7 4 4 7 5 4 7 6 4 7 7 4 7 8 4 7 10 4711 4 7 12 4 7 13 4 7 14 4 7 15 4 7 16 4 7 17 4 7 9 FILE MENU arre E 4 13 File Path E a a 4 14 File Load Memory COFF Memory 4 15 File Save Memory COFF Memory 4 16 File Save State File Load State a 4 17 File Input Open 418 File Input Close 4 19 File Output Open 4 19 4 20 File IO Streams Nore 4 20 IO Regdlrecti ss cte eh 4 21 File Log Commands
438. xes for Load State and Save 5 State identical in layout and operation Only the titles differ e Enter file name MA manually if E 2 Select directories desired State from list by files use i 2 double click to extension SIM build path Load State Directories Double click on 72 advice out t c required file or 9 56000 9156000 notes Single click and OK to save On SAVE another dialog box will _ ist Fil Drives open to confirm micron existin file is to 5 be replaced Select desired type from pulldown Select drive list to specify which files are displayed from pull down in list list Figure 4 8 File Load State File Save State Dialog Box MOTOROLA DSPADSUM AD 4 17 Graphical User Interface File Menu 4 6 5 File Input Open File Input Open reads data from the terminal or a file to provide simulated input to a memory location in the default Output Pin device The input file is associated with a DEBUG instruction 7 in the code More than one input file may be associated with single DEBUG instruction When DEBUG is executed registers must be set as shown in Table 4 1 V _ Table 4 1 Register Requirements for Simulated Input PD Data Item DSP96xxx DSP56xxx Input File Number and byte count RO C X0
439. xits reset in the Bootstrap mode of operation ard boot loads its monitor program from the host interface or an 5 232 serial link The ROM loader loads a secondary loader via the SCI port This loader program loads the monitor software via the host interface The X data RAM is used as a scratch pad area information and also for information retrieved when performing OnCE port read commands X data memory locations 00 16 are used as a storage area and should not generally be changed by the user The Y data RAM is used as an overlay area for storing the commands and data sent to the OnCE port by the DSP56002 Synchronous Serial Interface Y data RAM locations 00 0 for storing OnCE command sequences Figure 5 11 the memory usage of the DSP56002 RAM 32 K Word Program SRAM 7FFF Unused Area l 4000 Once RE Reads Writes PAN Command FF FF 1 22 Monitor 7F Area 20 Storage po 0 0 Sequencer 0 Figure 5 11 Command Converter Monitor Memory MOTOROLA DSPADSUM AD 5 17 Functional Description JTAG OnCE Communications Performance 5 7 JTAG ONCE COMMUNICATIONS PERFORMANCE The performance of the JTAG OnCE link and therefore some aspects of the ADS system performance is determined by the clock speed of the SSI port on the Command Converter DSP used for the JTAG OnCE link Loading saving and examining memory and other data t
440. y an identical variable in the current function the required variable is inaccessible To evaluate the expression we need to be able to select the required stack frame as the evaluation context Modify Up shifts the evaluation context towards the main program by increasing the frame number Modify Down shifts towards the current function by decreasing it Modify Up and Down work similarly with the Watch window and Display Watch If an expression can not be evaluated because it is out of scope select the original context to evaluate the expression again Radix Device Up increases the call frame number towards the main program Down decreases the call Frames frame number towards the current function frame 0 z Apply Figure 4 56 Modify Up Dialog Box 4 46 DSPADSUM AD MOTOROLA Graphical User Interface Execute Menu 4 9 EXECUTE MENU The Execute menu controls the execution of programs on the target device e Golets the program run until a breakpoint or other event interrupts execution Options are available to specify the execution start address and the way that breakpoints if set are to be handled Step executes a specified number of instructions cycles or Breakpoints lines of code If a subroutine call is executed Step follows the execution through the subroutine N Trace executes a specified number of instructions generating 2
441. y emulator does not provide a way to specify breakpoint conditions It is up to the user s code to examine device registers or memory conditions and decide whether or not to continue execution The device registers and memory can be examined using the dsp rreg and dsp rmem functions The emulator hardware executes independen ly of the emulator control software After successfully completing a call to initiate instruction execution e g dsp go address dsp go dsp step the device executes 1 until a termination condition is encountered Termination conditions include Hardware breakpoint cohdition Satisfied e DEBUG instruction executed Specified number of instructions executed in dsp_step e Call to dsp_ reset etc When the device stops executing the function dsp_check_service_request returns TRUE tis then the responsibility of the user program to determine the reason for the service request Hardware breakpoints are described in the appropriate hardware documentation and are not covered here MOTOROLA DSPADSUM AD D 81 C Library Functions Non Display Emulator Software breakpoints are caused by executing conditional or unconditional DEBUG instructions These instructions must be inserted into the user DSP code This may be achieved in several possible ways not all of which are suitable for production code Hard coded DEBUG instructions included in the DSP code NOP instructions in code which may
442. y file D 79 library restrictions D 79 loading program code D 80 nwads D 79 O Object file auxiliary entry B 18 comment B 27 data expression B 28 differences B 24 file header B 5 format B 1 line number B 11 optional header B 6 relocation B 11 B 26 section B 8 section number B 14 storage class B 16 structure B 3 structure size B 26 symbol name B 14 symbol table B 12 symbol type B 15 symbol value B 14 transportability B 25 object module format example file A 7 record types A 3 OnCE concept 1 3 debugging custom sequences 3 29 executing custom sequences 3 26 handshake 5 20 loading custom sequences 3 27 saving custom sequences 3 28 OnCE port architecture 5 12 debug acknowledge 5 22 recommended target interface 6 6 user interface commands 5 23 P path define file directory path 3 60 R radix change default number base 3 62 registers get index D 44 read D 22 D 24 D 60 write D 27 D 29 D 70 Relocation B 11 B 26 reset target 3 42 S save target memory to a file 3 64 screen buffer D 77 Screen management functions D 74 scrmgr c D 84 Section block data B 27 header B 8 sim_gmcmd D 72 sim gtcmd 0 73 simw_ceol D 74 simw ctrlbr D 75 simw cursor 0 75 simw endwin D 75 simw getch D 75 simw gkey D 76 simw_putc D 76 simw_puts D 76 simw_redo D 76 simw_redraw D 77 simw refresh D 77 simw scrnest D 77 simw_unnest D 78 simw winit D 78 simw_wscr D 78 software breakpoints 3 18 command convert
443. y value M order of the registers is specified in the header adsregXX h The function returns DSP_OK on success DSP_F ROR otherwise Example D 22 dspd_write_once_registers Write once registers y include adsreg56 h include simcom h include driver h So int devn status unsigned long once reg values 15 devn 0 dsp new devn 56002 Allocate structure for device 0 56002 _ write all OnCE registers from buffer Status dspd writ _ registers devn OSCR 151 once reg values MOTOROLA DSPADSUM AD D 29 C Library Functions Library Function Descriptions D 3 23 dspt masm xxxxx Assemble DSP Mnemonic include proto56n h n k 1 3 8 include proto96k h int dspt_masm_xxxxx mnemonic ops error_ptr char mnemonic Pointer to assembler mnemonic string unsigned long ops Array for words of assembled code char error_ptr Will point to message if an error occurs E LAM bras dspt_masm_xxxxx invokes the single line assembler to assemble a DSP mnemonic It returns one of the following integer codes 1 occurred The user supplied error pointer error ptr r will point toa message that explains the error oes 0 Theline mnemonic provided was a comment gt pz e 1 The mnemonic assembled correctly and required 1 word Bi code T
444. y with teletypewriters V some programs may limit the number of bytes to as few as 28 56 prog y y i i printable characters in the S record Checksum 2 Least significant byte of the one s complement of the sum of the values represented by the pairs of characters making up the record length address and the code data fields Each record may be terminated with a CR LF NULL Additionally an S record may have an initial field to accommodate other data such as line numbers generated by some time sharing systems MOTOROLA DSPADSUM AD C 3 Motorola 5 Information S Record Types S RECORD TYPES Eight types of S records have been defined to accommodate the several needs of the encoding transportation and decoding functions The various Motorola upload download and other record transportation control programs as well as cross assemblers linkers and other file creating or debugging programs utilize only those S records which serve the purpose of the program For specific information on which S records are supported by a particular program consult the user manual for that program An S record may include any of record types listed in Table C 2 Only one termination record is used for each block of S records Normally only one header record is used although it is possible for multiple header records to Table C 2 S record Types 7 4 N
445. yte of Port B data word that represent the HOST ACK HOST REO and INT ACK These signals are sent from the host computer for reading and writing data INT ACK informs the monitor that the host computer has received its service request and is ready to communicate HOST is wired or control line HOST is used by the Command Converter to inform the host computer whenever the target DSP has entered the Debug mode of operation Since more than one Command Converter may be started for a user debug session more than one may hold HOST BRK active low at one time Once this signal is asserted it may only be deasserted by the host computer or by a Command Converter reset Pees 5 3 2 Command Converter Interface Connector Ae The target application must have a 14 pin connector to interface to the Command Converter controller This interface comprises nine signals and three ground connections on 7 row X 2 column male pins which are 1 10 inch center to center as illustrated in Figure 5 4 on page 5 9 Since the target system will have a resident reset circuit it is recommended to have an AND gate in series with the CC RESET signal This will insure that the DSP will be reset with a valid VOL level from either the target Meet circuit or from the Command Converter The pull down resistors are to insure that no false signals are propagated to the JTAG OnCE circuit when the Test Data Input Debug Serial Input TDI DSI and Test Data Clock
Download Pdf Manuals
Related Search
Related Contents
Yamaha 2009 V Star 1100 Classic Owner's Manual WARNER ELECTRIC FT PURMOUSS DETENTE Manuale dell`utente JVC AV-27F703 User's Manual Procédure de dépot de négociation préalable Copyright © All rights reserved.
Failed to retrieve file