Home
TMS320C6x C Source Debugger User's Guide
Contents
1. Eormat fo Octal Label window name Apply Close Help _j To change the format of the PC in the Watch window 1 Inthe Watch window select PC 2 Right click the mouse to bring up the Watch window context menu 3 From the context menu select Display Format A submenu of data formats appears 4 From the submenu select the format in which you want the PC to display ES Watch E Opo o o SC OA Allow Docking Hide New Watch Yarable Display Format Float In Main Window Character Decimal Octal C d w x Hexadecimal a u Unsigned decimal The valid combinations of data types and display formats listed for SETF also apply to the data displayed with MEM Setup Watch Variable WA and DISP For example if you want to use display format e or f the data that you are displaying must be of type float or type double Additionally you cannot use the s display format parameter with the MEM command Managing Data 7 25 Chapter 8 Profiling Code Execution The profiling environment is a special debugger environment that provides a method for collecting execution statistics about specific areas in your code These statistics give you immediate feedback on your application s perfor mance Topic Page Overview of the Profiling Environment Overview of the Profiling Process Entering the Profiling Environment Defining Areas for Profiling
2. 7 19 optimized code debugging profiling 2 2 optimizer assembly 1 7 C options debugger_ 2 10 to 2 13 emurst Index 13 Index OUTPORT keyword overwrite editing 7 5 p valid address display format p debugger option 2 12 PIR keyword P R W keyword 4 10 PIW keyword 4 10 parallel debug manager adding a processor to a group assigning processor names n option 2 9 12 51 changing the PDM prompt 12 48 checking the execution status 12 48 closing command history commands command command ALIAS command DLOG command ECHO command EVAL command HELP command IF ELIF ELSE ENDIF com mands 12 26 to 72 61 LOOP BREAK CONTINUE ENDLOOP com 12 29 PAUSE command 6 41 PDM command PESC command PHALT command PRUN command PSTEP command QUIT command RUNF command SEND command SET command STAT command TAKE command UNSET command viewing descriptions creating system variables defining a group 12 47 definition Index 14 parallel debug manager PDM parallel debug manager continued deleting a group 12 56 UNSET command description displaying text strings 12 21 finding the execution status 12 53 global halt grouping processors SET com mand 12 47 to 12 48 halting code execution 12 36 invoking listing all groups of processors 12 48 messages C 22 to C 26 overview pausing recording information from the display area 12 20 running co
3. W Enable analysis events Cancel Help 2 Selectthe event or events on which you want to set a hardware breakpoint by clicking the check box es next to that event or events If you want to enable a hardware breakpoint at a particular program ad dress you can enter the program address as a symbol or value in any for mat If you choose to enter the program address in hexadecimal format be sure to begin the address with Ox You can also select a previously entered address from the drop down list Defining the Conditions for Analysis Setting up the EMUO0 1 pins to set global breakpoints By default the EMU0 1 pins are set up as input signals however you can set them up as output signals or trigger out whenever the processor is halted by a software or hardware breakpoint This is extremely useful when you have multiple C6x processors in a system connected by their EMU0 1 pins To set the EMU0 1 pins to output select the check box next to the EMU pin on which you want to output in the Select trigger out pin s for hardware break event s field in the Set Up Hardware Breakpoints dialog box Selecting EMU0 1 does not however automatically halt all processors in the system To do so you must enable the EMU0 1 driven low condition in the Set Up Hardware Breakpoints dialog box For example if you have a system con sisting of two processors connected by their EMU1 pins and you want to halt both processors when this pin is driv
4. alias cd chdir cls dir dlog echo help if else endif loop endloop pause quit reconnect reset sound system take unalias use fet Q g gt k l k N l O CO a by ND oO o_o s a nN ee o_o NY D NO o_o s k N ee be Ql O1 D k h o_o i on O as he rh ie M she oo OD N D NO N D Oo Da on O1 N o N o_o Functional Summary of Debugger Commands Managing breakpoints Memory mapping To do this Add a software breakpoint Delete a software breakpoint Display alist of all the software breakpoints that are set Reset delete all software breakpoints To do this Initialize a block of memory word by word Initialize a block of memory byte by byte Add an address range to the memory map Enable or disable memory mapping Connect a simulated O port to an input or output file Simulator only Delete an address range from the memory map Disconnect a simulated I O port simulator only Display a list of the current memory map settings Reset the memory map delete all range defini tions Save a block of memory to a system file Connect an input file to the pin simulator only Disconnect the input file from the pin simulator only List the pins that are connected to the input files simulator only Summary of Commands Use this command ba bd bl
5. 0 cee eee Identifying a new initialization file t option 0 0 cece ees Loading without the symbol table v option 0 ccc eee eee Ignoring D OPTIONS X option n nananana cc teens 28 Debugging MOES scans eas nk oss bee bce oo bs Boe ee inre enre bene dene cane Auto mode 1 eee tent n eee n eet n teen eens PSSembply MOE seueceneesasuersme tense hease here hh vee kectens ae eeweemaase Mixed MOGE sei co ors ge oiai 555 he ea ee oan oh he ee eee awe eee ns Restrictions associated with debugging modes 0 eee eee eens 2 9 Exiting the Debugger or the PDM 0 ccc cece eee eens 3 Entering and Using Commands 000 cece eee eee eee eens Tells you how to define your own command strings enter operating system commands and enter commands using a batch file 3 1 Defining Your Own Command StringS 00 cc cece ete ees DEMING aN ANAS ses poin Bebe hie SUPE PLDI eS Mee eee ees wees aaei esa Defining an alias with parameters 0 ccc eee eee eee nena Editing or redefining an alias c22 lt 2ccdcantsadsiceact lt cue ev eens lt eenbseesd ooes eee Deleting an alias a4 ge 254 BOCAS Sando adewlian DRAG sD ORS beads needa ee dah oA Considerations for using alias definitions 0 0 0 0 cc ee eens 3 2 Entering Operating System Commands From Within the Debugger Entering a single command from the debugger command line Entering several
6. Verify the address of the port to be connected or discon nected The debugger halted program execution because you clicked the Halt icon on the toolbar you selected Halt from the Target menu or you pressed the key None required this is normal debugger behavior Alphabetical Summary of Debugger Messages Window not found Description Action The parameter supplied for the WIN command is not a valid window name Reenter the WIN command Here are the valid window names the bold letters show the smallest acceptable abbre viations Calls CPU Command Disassembly Memory Profile Watch Write conflicts with long writes at cycle cnum Description Action Your program attempted to write more than one long result in a single cycle on each side of the register file Because the S and L units share a read register port for long source oper ands and a write register port for long results only one of these operations can be issued per side in an execute packet For more information about long path conflicts see the TMS320C62x C67x CPU and Instruction Set Reference Guide Modify your source code Write not allowed for port Description Action You attempted to connect a file for output operation to an address that is not configured for write Either change the software to write a port that is configured for write or change the attributes of the port Debugger Messages C 21 Alphabetical Summary of PDM
7. command default display format operator indirection ABE pseudoregister 10 13 absolute addresses 6 16 7 8 ACE pseudoregister 10 14 active hardware events 10 6 active window definition making a window active 12 60 ADDR command description finding current PC address data profile window 8 20 addresses absolute addresses accessible locations 7 8 contents of indirection 7 9 hexadecimal notation I O address space 4 14 to 4 15 in Memory window invalid memory nonexistent memory locations 4 2 Index protected areas 4 2 symbolic addresses undefined areas ADR pseudoregister 10 13 AEN pseudoregister 10 13 aggregate types definition displaying 7 18 to 7 21 ALIAS command PDM version 11 15 to 11 16 Alias Control dialog box aliasing 11 15 to 11 16 ALIAS command 12 14 PDM version to defining an alias definition deleting an alias description to editing an alias limitations 8 4 redefining an alias 3 4 supplying parameters alternative data formats for display analysis memory system Analysis Statistics window commands counting events 9 6 defining conditions event breakpoints list of events process removing event 9 7 resetting event counters running programs viewing analysis data 9 9 Analysis Events dialog box emulator 10 5 simulator 9 5 Index 1 Index Analysis menu emulator 10 4 simulator 9 4 a
8. 6 2 Using the Basic Run Commands The debugger provides a basic set of run commands that allow you to do the following Run an entire program Run code up to a specific point in a program Run code in the current C function Run code through breakpoints Run code while disconnected from the target system O O C L L You can also use the debugger to reset the target system emulator only or simulator Running an entire program 6 4 To run the entire program use one of these methods J Click the Run icon on the toolbar _j From the Target menu select Run J Press 5 _j From the command line enter the RUN command The format for this command is run expression If you supply a logical or relational expression the RUN command be comes a conditional run see section 6 4 on page 6 11 If you Supply any other type of expression the debugger treats the expres sion as a count parameter The debugger executes count instructions halts then updates the display TTS Note The emulator cannot step into an interrupt using the conditional RUN com mand with a 1 option RUN 1 To halt on the first instruction of an interrupt service routine you must set a software breakpoint or a program address breakpoint on the first instruction of the interrupt service routine and enter a RUN command When you run the entire program using one of these methods and do not sup ply an expression the program executes u
9. ABE configure hardware breakpoints The ABE register configures hardware breakpoint events Set the bit to 1 to enable or to 0 to disable The hardware breakpoint event bits are defined as follows Bit Number Definition 0 Enable program address breakpoint 1 Enable breakpoint when EMUO is driven low 2 Enable breakpoint when EMU1 is driven low Hardware breakpoints do not halt the processor during a step If the hardware breakpoint is set on the same instruction as a software breakpoint hardware breakpoints do not halt the processor ADR program address breakpoint value The ADR register holds the 32 bit value of the program address breakpoint Monitoring Hardware Functions With the Emulator Analysis Module 10 13 Summary of Analysis Pseudoregisters ACE configure analysis counter events The ACE register configures the analysis counter to count a defined event Set the bit to 1 to enable or to 0 to disable The counter event bits are defined as follows Bit Field Value Bit Number in Hex Definition 0 1 Defines counter mode Counter disabled Reserved Performance counting Oo N O Error generated 2 4 Selects counter event Clock Execution packet Pipeline stall Interrupt context switch Interrupt acknowledge Branch taken NOP Non NOP instructions N oO fF W YS CO 5 Enable external emulator counter ICNT internal counter value The ICNT register holds the 10 bit value of the internal counter
10. SS Note The TMS320C6x simulator core does not fully model the memory system at this time The host port interface the timer and multichannel buffered serial ports are not modeled _ Counting system events 9 6 Memory system analysis allows you to count multiple system events at one time Each event has its own counter The event count accumulates with each execution of your program If you do not want the count to accumulate reset the event counters to 0 by selecting the Reset Counter button before you reex ecute your program You set up count events in the Analysis Events dialog box To define system events to count 1 2 From the Analysis menu select Set Up Analysis Events The Analysis Events dialog box appears Inthe Add Event section select the event you want to count from the Event drop list Defining the Conditions for Analysis Select Count from the Event Type drop list Click the Add button The event appears in the event list at the top of the dialog box and in the Analysis Statistics window Define more events to count or select the Close button Setting event breakpoints You can set a breakpoint on any event that is supported by the simulator core You can set breakpoints on as many events as you choose The simulator halts on the first occurrence of any event defined as a break event You set up break events in the Analysis Events dialog box To define system events on whic
11. Table 8 3 Disabling Enabling Unmarking or Viewing Areas Continued c Disabling enabling unmarking or viewing functions To identify this area By function name E E All functions in a J module E All functions every g where If the C level is selected Select a function name In the Area box select Func tions Select a module name In the Area box select Func tions In the Area box select Func tions Be sure that Function and Module are set to N A d Disabling enabling unmarking or viewing all areas To identify this area All areas in a function All areas in a module All areas everywhere CO Uo UU If the C level is selected Select a function name In the Area box select All areas Select a module name In the Area box select All areas In the Area box select All areas Be sure that Function and Module are set to N A If the Assembly level is selected Not applicable Not applicable Not applicable If the Assembly level is selected Select a function name In the Area box select All areas Select a module name In the Area box select All areas In the Area box select All areas Be sure that Function and Module are set to N A CO Ue UU If the Both level is selected Not applicable L L Select a module name In the Area box select Func tions In the Area box select Func tions Be sure that Function and Module are set
12. The RUNF command disconnects the emulator from the target system while code is executing When you enter RUNF the debugger clears all breakpoints disconnects the emulator from the target system and causes the processor to begin execution at the current PC You can quit the debugger or you can continue to enter commands However any command that causes the debugger to access the target at this time produces an error The HALT command stops a RUNF the debugger automatically executes a HALT when the debugger is invoked Add Stopping Point sa address none none basic debugger E PDM profiling The SA command adds a stopping point at address The address can be a label a function name or a memory address Summary of Commands 12 45 sconfig Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 46 Load Screen Configuration sconfig filename File Load Config none basic debugger E PDM profiling The SCONFIG command restores the display to a specified configuration This restores the window locations and sizes that were saved with the SSAVE command into filename The debugger searches for the specified file in the current directory and then in directories named with the D_DIR environment variable If you do not supply a filename the debugger looks
13. basic debugger L PDM The CALLS command displays the Calls window The debugger displays this window automatically when you are in auto C or mixed mode However you can close the Calls window the CALLS command opens the window again E profiling Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description cls Change Directory cd directory name chdir directory name none none basic debugger PDM profiling The CD or CHDIR command changes the current working directory from within the debugger You can use relative pathnames as part of the directory name If you do not use a directory name the CD command displays the name of the current directory You can also use the CD command to change the current drive For example cd c cd d csource cd c asmsre Clear Screen cls none none basic debugger E PDM profiling The CLS command clears all displayed information from the display area of the Command window Summary of Commands 12 17 cnext Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 18 Single Step C Next Statement cnext expression Target Next C Ok basic debugger L PDM The CNEXT command is similar to the CSTEP command It runs a program one C statement at a time updating the dis
14. Description Action This is an expression error the expression attempts to use pointers in a way that is not valid See section C 4 Additional Instructions for Expression Errors page C 26 Illegal structure reference Description Action This is an expression error either the item being referenced as a structure is not a structure or you are attempting to refer ence a nonexistent portion of a structure See section C 4 Additional Instructions for Expression Errors page C 26 Alphabetical Summary of Debugger Messages Illegal use of structures Description Action This is an expression error the expression parameter is not using structures according to the C language rules See section C 4 Additional Instructions for Expression Errors page C 26 Illegal use of void expression Description Action This is an expression error the expression parameter does not meet the C language rules See section C 4 Additional Instructions for Expression Errors page C 26 Integer not allowed Description Action This is an expression error the command does not accept an integer as a parameter See section C 4 Additional Instructions for Expression Errors page C 26 Invalid address Memory access outside valid range address Description Action The debugger attempted to access memory at address which is outside the memory map Check your memory map to be sure that you access val
15. The easiest way to disable an area is to click the green arrow s next to a marked line range or function When you do so the arrow s becomes white This range is still marked but it is disabled w Disassembly el x Address a KKM A OOEKX DA EDDOOD XX CXOK ROOK X DIKE KORDA Kx RAM RDORKX X KX HRXDOOKKX PE yhatas DSK ROPOOKKXKAXX WAKO X DOCKS TAN RX EKK X OPORXDREEEX DDERI A KXAN HXKEKKX AAKE KER EDDA XXX RODDOEKIKX KKM X XK ORD DEX kK KX ar om on rn BEd Rata Se PPC pret eo Qs DU ad RHR ROKK KSE Eo 3 KOXP DEA IXX ix You can also disable an area by using the Profile Marking dialog box 1 Open the Profile Marking dialog box by using one of these methods _ From the Profile menu select Select Areas J From the context menu for the Profile window select Select Areas This displays the Profile Marking dialog box 2 Inthe Level box select C Assembly or Both 3 In the Area box select Lines Ranges Functions or All areas See Table 8 3 on page 8 13 for a list of valid combinations 4 5 6 Defining Areas for Profiling Depending on what you select in step 3 do one or more of the following Next to Lines enter an absolute address C expression assembly label or line number _J Next to Ranges enter a Start and an End value as absolute address es C expressions assembly labels or line numbers J From the Module combo box select a specific filename From
16. X Po po Ol Ol O s he oo on ah Md D ioe s lt hm D ow na D oo a MY K iN Functional Summary of Debugger Commands Profiling commands All of the profiling commands can be entered from the Profile menu and associated dialog boxes In many cases using the Profile menu and dialog boxes is the easiest way to enter some of these commands For this reason and also because there are over 100 profiling commands most of these commands are not described individually in this chapter as the basic debugger commands are Listed below are some of the profiling commands that you might choose to enter from the command line these commands are also described in the alphabetical command summary The remaining profiling commands are summarized in section 12 3 Summary of Profiling Commands on page 12 62 Use this See To do this command page Run a full profiling session of 12 36 Run a quick profiling session pq Resume a profiling session or 12 39 Switch to profiling environment profile 12 39 Add a stopping point sa Delete a stopping point sd 12 46 List all the stopping points sl Delete all the stopping points sr Save all the profile data to a file vaa 12 57 Save currently displayed profile data to a file vac Reset the display in the Profile window to show all vr 12 58 areas and the default set of data Summary of Commands 12 9 Functional Summary of Debugger Commands Memory system an
17. ing data in dedicated windows The debugger also supports several general purpose commands that you can use to display or modify any type of data Determining the type of a variable If you want to know the type of a variable or function use the WHATIS com mand The syntax for this command Is whatis symbol The symbols data type is then listed in the display area of the Command win dow The symbolcan be any variable local global or static a function name a structure tag a typedef name or an enumeration constant Command Result Displayed in the Command Window whatis aal int aai 10 5 whatis xxx struct xxx int aj int b int cC int f1 2 int f2 4 struct xxx f3 int FALLOT Evaluating an expression The evaluate expression command evaluates an expression and shows the result in the display area of the Command window The syntax for this com mand is expression The expression can be any C expression including an expression with side effects However you cannot use a string constant or function call in the expression If the result of expression is scalar the debugger displays the result as a deci mal value in the Command window If expression is a structure or array the debugger displays the entire contents of the structure or array you can halt long listings by pressing sc Managing Data 7 3 Basic Commands for Managing Data 7 4 Here are some examples that use the comma
18. m Repetition to the end of simulation To repeat the same pattern throughout the simulation add the string EOS to the line For example LO 45 20 rpt EOS Interrupts are simulated at the 10th CPU cycle then the 15th 10 5 35th 15 20 40th 35 5 60th 40 20 65th 60 5 and 85th 65 20 CPU cycles continuing in that pattern until the end of simula tion Connecting your input file to the interrupt pin To connect your input file to the interrupt pin use the following command pinc pinname filename J The pinname identifies the interrupt pin Lj The filename is the name of your input file Example 4 1 shows you how to connect your input file using the PINC com mand Defining a Memory Map 4 17 Simulating External Interrupts Simulator Only Example 4 1 Connecting the Input File With the PINC Command Suppose you want to generate an external interrupt on INT4 at the 12th 34th 56th and 89th clock cycles First create a data file with an arbitrary name such as myfile 12 34 56 89 To connect the input file to the pin enter fone TNE a e a ie Connects your data file to the specific interrupt pin This command connects myfile to the pin As a result the simulator gener ates an external interrupt on at the 12th 34th 56th and 89th clock cycles Disconnecting your input file from the interrupt pin To end the interrupt simulation disconnect the pin You can do this with the following com
19. 11 6 Entering Operating System Commands 0 cece eee ene eaes 11 7 Understanding the PDM s Expression Analysis 000 cece eee ee eens 11 8 Using System Variables ci eecscresweeaddeceinacetaadnecnveteaseeaeeaeees B8 Creating your own system variables 000 an nananana naan Assigning a variable to the result of an expression 0 ce ees Changing the PDM prompt 0 0 0 0 ccc ee ene n teen ene Checking the execution status of the processors nananana nannu nann Listing system variables 0 ccc eee teen n eens Deleting system variables 0 ccc een n ene neas 11 9 Evaluating Expressions oi sos ok ict ch arise Beare He hoe ee ae ace ot Raga Ras hn jam ye aan fa Contents XV Contents 12 13 XVI Summary of Commands 0 2 cee eee eee eee eens Provides functional and alphabetical summaries of the basic debugger commands and the pro MNG COMMANGS seran eeng eee e e euunentenceteee suede senso eunas nae senecueeace 12 1 12 1 Functional Summary of Debugger Commands 00 cece een eens Managing multiple debuggers 00 ccc tenet nee neaee Changing MOdES lt 4 wate asd dse a me ace hve ea a a e a indie eee grees Seid ote a ade ae we ae ew Managing WINGOWS gettagertanniwan tow en mean new aw owen enw eo we eae ae oe aes Customizing ING screen gecivcoeut cee aweseseeseates tue ee dees ehuededes daar ce Displaying files and loading
20. 4 10 PROMPT command 12 40 PROTECT keyword protected area of memory PRUN command PRUNF command 11 7 pseudoregisters 7 1 7 16 to 7 17 10 13 3 tol 1 10 15 Index PSTEP command 12 41 restrictions with breakpoints 11 7 breakpoints ptr datatype 7 23 C expressions 13 4 pulldown menus definition debugging modes memory mapping profiling environment Ke RETURN RET command Return toolbar icon quick profile ripple carry output signal definition QUIT command ROM keyword run commands HALT command R PESC command _ 11 8 12 36 PHALT command _ 11 8 12 37 R keyword 4 10 PRUN command _ 11 7 12 40 PRUNF command 11 7 R W keyword 4 10 aie A f E LET PSTEP command 12 41 initialization mode RUN command 6 4 9 8 10 10 RAM keyword RUNF command 6 6 RECONNECT command 12 42 summary reconnecting to emulator 12 42 run cycles data recording Command window displays 3 12Ito Run to Cursor context menu option 12 20 Run toolbar icon 8 17 10 10 reference grouping operators 13 2 RUNB command registers affecting analysis 10 10 CLK pseudoregister peed eee 1245 es EG displaying modifying USING to COUNT CIOCK cycles o pseudoregisters RUNF command 12 41 12 45 referencing by name running programs reordering in the CPU window conditionally single precision floating point 7 16 continuous run 6 6 related documentation Mto i defining a starting point relational operators halting execution con
21. Be sure that the file exists as named If it does enter the USE command to identify the file s directory Cannot open new window Description Action A maximum of 127 windows can be open at once The last request to open a window would have made 128 which is not possible Close any unnecessary windows Windows that can be closed include Watch File Calls and Memory windows To close any of these windows make the desired window active and press CONTROL F4 Alphabetical Summary of Debugger Messages Cannot open object file filename Description The file specified with the LOAD SLOAD or RELOAD command is not an object file that the debugger can load Action Be sure that you are loading an actual object file Be sure that the file was linked You may want to run cl6x with the z op tion or Ink6x again to create an executable object file Cannot read processor status Description This is a fatal error for some reason pressing did not halt program execution Action Exit the debugger Invoke the autoexec bat file then invoke the debugger again If you are using the emulator check the cable connections also Cannot reset the processor Description This is a fatal error for some reason pressing did not halt program execution Action Exit the debugger Invoke the autoexec bat file then invoke the debugger again If you are using the emulator check the cable connections also Cannot restart
22. C Function 4 2638 0638 105 C Function 4 13980 oad 4 116 C Function 4 13980 ood 4 116 C Function i 1 e654 ebod 36 If the area is a function name the debugger opens a File window and displays that function ah tailrec c DODII f2fint x iila return printi f2 4dsn e f3fs 1 Profiling Code Execution 8 25 Viewing Profile Data If the area is in disassembly code the debugger displays that code in the Disassembly window To view the code associated with another area double click another area If you are attempting to show disassembly you might need to make several attempts because you can access program memory only when the target is not running 8 26 Saving Profile Data to a File 8 8 Saving Profile Data to a File You may want to run several profiling sessions during a debugging session Whenever you start a new profiling session the results of the previous session are lost However you can save the results of the current profiling session to a system file The saved file contents are in ASCII and are formatted in exactly the same manner as they are displayed or would be displayed in the Profile window The general profiling session information that is displayed in the Command window is also written to the file Saving the contents of the Profile window To save the contents of the Profile window to a system file follow these steps 1 From the Profile menu select Save View This displa
23. Inclusive maximum Exclusive Exclusive maximum Address All _j By line number address _j By line number address _j All functions in a module _ All functions everywhere In C only VFCLE filename line number VFCLF function VFCLM filename VFCLG VFCRE filename line number VECRE function VFCRM filename VFCRG VFCFE function VFCFM filename VFCFG VECAF function VFCAM filename VFCAG Use this command VDC VDI VDN VDE VDX VDA VDL In disassembly only VFALE address VFALF function VFALM filename VFALG VFARE address VFARF function VFARM filename VFARG not applicable VFAAF function VFAAM filename VFAAG c Sorting the data To sort on this data Count Inclusive Inclusive maximum Exclusive Exclusive maximum Address Data Summary of Commands In C and disassembly not applicable VFBLF function VFBLM filename VFBLG not applicable VFBRF function VFBRM filename VFBRG not applicable VFBFM filename VFBFG VFBAF function VFBAM filename VFBAG Use this command VSC VSI VSN VSE VSX VSA VSD 12 65 Chapter 13 Basic Information About C Expressions Many of the debugger commands take C expressions as parameters This allows the debugger to have a relatively small yet powerful instruction set Because C expressions can have side effects that is the evaluation of some types of expressions can affect existing values you can u
24. commands to 12 48 HALT command 6 13 12 25 Halt toolbar icon 6 13 halting batch file execution debugger emulator specific information 6 13 multiple processors 10 9 PDM 12 42 processors in parallel program execution target system temporarily See breakpoints software hardware breakpoints dialog box 10 8 help accessing 1 14 tof1 15 Index 10 HELP command ftaol tat 22a 29 Help menu Help Topics option Help toolbar icon 1 14 Help Topics toolbar cor Hl hexadecimal notation addresses data formats history of commands HISTORY command history of commands i debugger option I O memory adding to memory map _ 4 10 to connecting I O port to deleting from memory map disconnecting I O port simulating thio 15 12 31 memory batch file search order memory initializa tion invalid addresses invalid locations 4 10 to 4 18 map adding ranges mapping MA command _14 10 to nonexistent locations protected areas simulating O memory 4 14 to 4 15 simulating ports MC command 14 to 4 15 Ml command 15 undefined areas 4 2 4 8 valid types 4 5 I O switch settings definition ICNT pseudoregister 10 14 icons toolbar basic display 1 3 identifying a new board configuration file f 2 11 identifying a new simulator configuration file 2 11 identifying additional source directories i option D_DIR environment variable identifying directories containing program source
25. execute one of these commands dasm PC or addr PC Sometimes you may want to modify the PC to point to a different position in your program Choose one of these methods _j Ifyou executed some code and plan to rerun the program from the original program entry point click the Restart icon on the toolbar Alternatively you can select Restart from the Target menu _J Setthe PC to the current line in the File or Disassembly window The cur rent line is highlighted in the display Current PC Current line B driver c Iof x oog1 EEEREEEREEEEEREEHEREEREHEEKHEREBREEREBRKREEREEREBREREREEERERERREERERERERHREREREREEE a gt O00018 int maini o0019 4 O0020 int 1 novhd 00021 clock t t overhead t start t stop t stub t C BEEEEEHEHEHEXHEHHEHEHEHEHXHHHERHREHEHREHHHEEREREHERHRHREREHEHERXEHHEHE y 0P To set the PC to the current line in the File or Disassembly window follow these steps 1 Open the context menu for the window For more information see page 1 6 2 Select Set PC to Cursor from the context menu Defining the Starting Point for Program Execution J Modify the PC s contents with one of these commands PC new value or eval pc new value J Modify the value of the PC in the CPU window For more information about changing values the displayed in the CPU window see section 7 4 Basic Methods for Changing Data Values on page 7 5 Running Code 6 3 Using the Basic Run Commands
26. files D_SRC identifying new initialization file t option 2 13 IF ELIF ELSE ENDIF commands 11 10 to 12 26 to 12 61 14 14 12 26 00 SS IF ELSE ENDIF commands conditions creating initialization batch file description predefined constants ignoring D_OPTIONS x option 2 13 inclusive data inclusive maximum data increment operator indirection operator init clr file init cmd file definition during invocation init pdm file 2 8 initialization batch files creating using IF ELSE ENDIF emuinit cmd example init cmd 4 11 init odm 8 naming an alternate file t option 2 13 siminit cmd INPORT keyword int data type 7 23 internal counter disabling 10 6 internal counter value pseudoregister ICNT 10 14 interpreting profile data 8 25 interrupt pins 4 16 interrupt simulation ending initiating interrupts ignored while single stepping invalid memory addresses invoking debugger reeks standalone under PDM control P 8 to 2 g parallel debug manager IOPORT keyword ISA definition Index key sequences halting actions 12 40 12 47 limits breakpoints 6 15 customized prompt length paths LINE command 12 28 linker 1 8 little endian defined little endian format Load Breakpoint File dialog box 6 19 LOAD command load instructions displayed by the emulator 7 2 Load List menu option breakpoints 16 19 Load Program dialog bo
27. make the appropriate modifications for UNIX Creating and Executing a Batch File if SEMUSS echo Invoking initialization batch file for emulator use emu6x take emuinit cmd endif if SSSIMS echo Invoking initialization batch file for simulator use Simox take siminit cmd endif In this example the debugger executes only the initialization commands that apply to the debugger tool that you invoke The IF ELSE ENDIF command works with the following conditions You can use conditional and looping commands only in a batch file _j You must enter each debugger command on a separate line in the batch file _J You cannot nest conditional and looping commands within the same batch file See Controlling PDM command execution page 11 10 for more information about the PDM versions of the IF and LOOP commands Looping command execution in a batch file To set up a looping situation to execute debugger commands in a batch file use the LOOP ENDLOOP commands The syntax is loop expression debugger commands endloop These looping commands evaluate using the same method as the conditional RUN command expression See Chapter 13 Basic Information About C Ex pressions for more information Entering and Using Commands 3 9 Creating and Executing a Batch File 3 10 If you use an expression that is not Boolean the debugger evaluates the ex pression as a loop count For example if you wanted to execute a sequen
28. mands for the PC to execute A second type of batch file contains debug ger commands for the debugger to execute The PC does not execute debugger batch files and the debugger does not execute PC batch files benchmarking A type of program execution that allows you to track the number of CPU cycles consumed by a specific section of code big endian An addressing protocol in which bytes are numbered from left to right within a word More significant bytes in a word have lower numbered addresses Endian ordering is hardware specific and is deter mined at reset See also ittle endian D 1 Glossary D 2 breakpoint A point within your program where execution will halt because of a previous request from you Calls window A window that lists the functions called by your program casting A feature of C expressions that allows you to use one type of data as if it were a different type of data cl6x A shell utility that invokes the C6x compiler assembler and linker to create an executable object file version of your program click To press and release a mouse button without moving the mouse code display windows Windows that show code text files or code specific information This category includes the Disassembly File and Calls windows command line The portion of the Command window where you can enter commands Command window A window that provides an area for you to enter com mands and for the debugger to
29. or command output Table 1 1 summarizes the purpose of each window how each window is created and in which debugging mode each window is visible About the C Source Debugger Interface Table 1 1 Summary of Debugger Window Descriptions Window Calls Command CPU Disassembly File Memory Profile Watch Purpose Lists the current function its caller and the caller s caller etc for C functions _ Provides a command line for entering commands _ Provides a display area for echoing commands and dis playing command output er rors and messages Shows the contents of the C6x reg isters Displays the disassembly or re verse assembly of memory con tents Displays C source files Displays assembly source files Displays text files Displays serial assembly files assembly optimized with g option DUO Displays the contents of memory Reference addresses determined by the size of the window are listed in the first column Displays statistics collected during a profiling session Displays the values of selected ex pressions structures arrays or pointers Overview of the Code Development and Debugging System Created E E Automatically when you are dis playing C code With the CALLS command if you previously closed the Calls win dow Automatically Automatically Automatically E E E With the File gt Open menu option Automatically when your pro gr
30. 26 to 12 61 LOOP BREAK CONTINUE ENDLOOP com mands 11 11 to 11 22 12 28 to 12 29 PAUSE command RECONNECT command summary SYSTEM command PDM version 11 16 TAKE command PDM version atsl UNALIAS command PDM ver sion 11 15 tof11 16 system reset 6 7 system shell 3 5 to 3 13 t debugger option description during debugger invocation A 1 in defining a memory map TAKE command defining a memory map description 12 55 executing log file 11 10 identify new initialization file t option 2 13 PDM version 11 9 reading new memory map 4 13 returning to the original memory map 4 12 Target menu Continuous Run option 6 6 Continuous Step option 6 10 Halt option 6 5 Next C option Next option Reset Target option Restart option Return option Run Free option 6 6 Run option Step C option Step option 11 15 11 10 11 12 toj11 16 Index 19 Index target system C6x definition describing to the debugger B 1 to B 6 creating the board configuration file B 2 to B 6 specifying the file pa translating the file disconnected from emulator 6 6 memory definition ra Ne oid resetting 6 7 12 43 terminating the debugger text files displaying 5 6 TMS320C6x device type B 3 Toggle Breakpoint context menu option toolbar in basic display totem pole output definition type casting 13 4 type checking 7 3 u unsigned decimal display format uchar dataty
31. 5 8 Memory window 7 7 to 7 12 moving 12 34 Profile window 8 20 to sizing 12 50 summary table debugger Watch window 7 18 to 7 21 WOM keyword WR command 12 61 Index x hexadecimal display format x debugger option X Window System displaying debugger on a differ ent machine XCNT pseudoregister 10 14 ZOOM command 12 61 zooming a window 12 61 Index 21
32. A What the Debugger Does During Invocation In some circumstances you may find it helpful to know the steps that the debugger goes through during the invocation process These are the steps in order that the debugger performs If you are using PDM to run multiple de buggers PDM executes the first step For more information on the environ ment variables mentioned below see Chapter 2 Getting Started With the Debugger The debugger 1 Reads options from the operating system s command line 2 Reads any information specified with the D_OPTIONS environment variable 3 Reads information from the D_DIR and D_SRC environment variables 4 Looks for the init clr screen configuration file The debugger searches for the screen configuration file in directories named with D_DIR 5 Initializes the debugger screen and windows 6 Finds the batch file that defines your memory map by searching in directo ries named with D_DIR The debugger expects this file to set up the memory map and follows these steps to look for the batch file _ When you invoke the debugger it checks to see if you have used the t debugger option If it finds the t option the debugger reads and executes the specified file _j If you have not used the t option the debugger looks for the default initialization batch file The batch file name differs for each version of the debugger m For the emulator this file is named emuinit cmd m For the
33. C Pom profiling The VAC command saves all statistics currently displayed in the Profile window Statistics that are not displayed are not saved The data is stored in a system file E basic debugger Summary of Commands 12 57 version version Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 58 Display the Current Debugger Version version none none basic debugger E PDM profiling The VERSION command displays the debugger s copyright date and version number as well as the device name Reset Profile Window Display vr none none C Pom profiling The VR command resets the display in the Profile window so that all marked areas are listed and statistics are displayed with default labels and in the default sort order a basic debugger Add Item to Watch Window wa expression label display format window name Setup Watch Variable none basic debugger L PDM The WA command displays the value of expression in a Watch window If a Watch window is not open executing WA opens a Watch window The expres sion parameter can be any C expression including an expression that has side effects E profiling Syntax Menu selection Toolbar selection Environments Description wd WA is most useful for watching
34. Calls window TEM TAKE and ALIAS Windowing commands such as SIZE MOVE and ZOOM Chapter 12 Summary of Commands summarizes all of the debugger commands and tells you whether a command is valid in the profiling envi ronment Debugging mode commands such as Commands related to the Watch Defining Areas for Profiling 8 4 Defining Areas for Profiling Within the profiling environment you can collect statistics on three types of areas _j Individual lines in C or disassembly J Ranges in C or disassembly Functions in C only To identify any of these areas for profiling mark the line range or function You can disable areas so that they do not affect the profile data and you can reen able areas that have been disabled You can also unmark areas that you are no longer interested in Using the mouse is the simplest way to mark disable enable and unmark areas A dialog box also supports these and more complex tasks The following subsections explain how to mark disable reenable and unmark profile areas by using the mouse or the dialog box For restrictions on profiling areas see page 8 12 Marking an area with a mouse Marking an area qualifies it for profiling so that the debugger can collect timing statistics about the area Remember to display C code use the File Open menu option or the FUNC command to display disassembly use the DASM command DT Notes 1 Marking an area i
35. File window definition description ption 4 B 6 to 5 8 displaying any text file displaying assembly language source 5 5 running code to a specific point setting a breakpoint setting current PC file load commands 12 4 files batch files 8 7 connecting to I O ports 4 14 gan creating executable object ie 2 2 debugger executable disconnecting from I O at 4 15 12 33 executable emulator loading object files E log files 8 12 to 3 13 11 saving memory to a file tof7 11 12 35 FILL command 12 24 Fill Memory dialog box FILLB command 12 24 float data type 7 23 floating a window definition floating point double precision registers 7 17 floating point operations 13 4 floating point single precision registers floating point simulator debugger features not supported 1 11 description flow diagram analysis process emulator 10 3 analysis process simulator 9 3 code development debugging process profiling process full profile 7 16 Index 9 Index FUNC command description effect on debugging modes function calls displaying functions executing function onl 7 5 in expressions 7 5 12 35 stepping over 12 18 tracking in Calls window g assembler option displaying assembly language source g shell option global breakpoints GO command green arrow 8 6 8 10 grouping reference operators 13 2 groups adding a processor 11 4 12 48
36. Files D_SRC Setting Up Default Debugger Options D_OPTIONS Resetting the Emulator Invoking the Debuggers and the PDM Summary of Debugger Options Debugging Modes Exiting the Debugger or the PDM 2 1 Preparing Your Program for Debugging 2 1 Preparing Your Program for Debugging Before you use the debugger you must create an executable object file To do so start with C source assembly optimizer source and or assembly language code You can use the cl6x shell program to compile assemble and link your source code creating an executable object file To be able to debug the object file you must use the g shell option The g option generates symbolic de bugging directives that are used by the debugger If you want to profile the execution of the object file you must use the as shell option The as option puts labels in the symbol table Label definitions are written to the COFF symbol table for use with symbolic debugging For more information about the cl6x shell program and its options and about creating an executable object file for use with the debugger see the TMS320C6x Optimizing C Compiler User s Guide Debugging optimized code If you intend to debug optimized code use the g shell option with the o shell option The g option generates symbolic debugging directives that are used by the debugger for C source debugging but it disables many compiler opti mizations When you use the o opt
37. List PDM Commands PDM Environment help command none none PDM C profiling The HELP command provides a brief description of the requested PDM command If you omit the command parameter the PDM lists all of the avail able PDM commands a basic debugger List the Last 20 PDM Commands history none none L basic debugger PDM profiling The HISTORY command displays the last 20 PDM commands that you have entered Conditionally Execute PDM Commands if expression PDM commands elif expression PDM commands else PDM commands endif none none PDM C profiling These commands allow you to execute PDM commands conditionally in a batch file or from the command line a basic debugger if else endif Syntax Menu selection Toolbar selection Environments Description if else endif _j Ifthe expression for the IF is nonzero the PDM executes all commands between the IF and ELIF ELSE or ENDIF J The ELIF is optional If the expression for the ELIF is nonzero the PDM executes all commands between the ELIF and ELSE or ENDIF J The ELSE is optional If the expressions for the IF and ELIF if present are false zero the PDM executes the commands between the ELSE and ENDIF The IF ELIF ELSE ENDIF can be entered interactively or included in a batch file that is executed by the TAKE command When you enter IF from the PDM command line a question mark prompts you for the next entry The P
38. Menu selection Toolbar selection Environments Description file The g option specifies the group or processor that EVAL should be sent to If you don t use this option the command is sent to the default group dgroup _ When you send the EVAL command to more than one processor the PDM takes the variable name that you supply and appends a suffix for each processor The suffix consists of the underscore character _ followed by the name that you assigned the processor _j The expression can be any expression that uses the symbols described in section 11 7 Understanding the PDM s Expression Analysis on page 11 17 i When you use the optional format parameter the value that the variable is set to will be in one of the following formats Parameter Result Parameter Result F Default for the data type O Octal Cc ASCII character bytes p Valid address d Decimal S ASCII string e Exponential floating point u Unsigned decimal f Decimal floating point X Hexadecimal Display Text File file filename File gt Qpen basic debugger E PDM profiling The FILE command displays the contents of any text file in the File window This command is intended primarily for displaying C source code You can view as multiple text files at the same time using multiple File windows Summary of Commands 12 23 fill Syntax Menu selection Toolbar selection Environments Environments Description Syntax Menu sele
39. Messages C 3 Alphabetical Summary of PDM Messages C 22 This section contains an alphabetical listing of the error messages that the PDM might display Each message contains both a description of the situation that causes the message and an action to take Note lf errors are detected in a TAKE file the PDM aborts the batch file execution and the file line number of the invalid command is displayed along with the error message a Cannot communicate with name Description The PDM cannot communicate with the named debugger because the debugger either crashed or was exited Action Spawn the debugger again Cannot communicate with the child debugger Description This error occurs when you are spawning a debugger The PDM was able to find the debugger executable file but the debugger could not be invoked for some reason and the communication between the debugger and PDM was never established This usually occurs when you have a problem with your target system Action Exit the PDM and go back though the installation instructions in the installation guide Reinvoke the PDM and try to spawn the debugger again Cannot create mailbox Description The PDM was unable to create a mailbox for the new debug ger that you were trying to spawn the PDM must be able to create a mailbox in order to communicate with each debug ger This message usually indicates a resource limitation you have more debuggers invoked than
40. TI officer Questions concerning potential risk applications should be directed to TI through a local SC sales office In order to minimize risks associated with the customer s applications adequate design and operating safeguards should be provided by the customer to minimize inherent or procedural hazards Tl assumes no liability for applications assistance customer product design software performance or infringement of patents or services described herein Nor does TI warrant or represent that any license either express or implied is granted under any patent right copyright mask work right or other intellectual property right of TI covering or relating to any combination machine or process in which such semiconductor products or services might be or are used Copyright 1998 Texas Instruments Incorporated About This Manual Preface Read This First This book tells you how to use the TMS320C6x C source debugger with the following debugging tools to test and refine your code J Emulator Lj Simulator _ Fast simulator Each tool has its own version of the debugger These versions operate almost identically however the executable files that invoke them are very different Separate commands are provided for invoking each version of the debugger There are two debugger environments the basic debugger environment and the profiling environment _j The basic debugger environment is a general purpose debugging envi
41. after displaying the results of the operating system command The flag parameter can be 0 or 1 0 The debugger immediately returns to the debugger environment after the last item of information is displayed 1 The debugger does not return to the debugger environment until you enter exit This is the default Entering and Using Commands 3 5 Entering Operating System Commands From Within the Debugger In the preceding example the debugger would open a system shell to display the following message 1 File s copied The message would be displayed until you entered exit at the command prompt in the system shell If you wanted the debugger to display the message and then return immediate ly to the debugger environment you could enter the command in this way system copy a backup sample c sample c 0 Entering several commands from a system shell 3 6 If you need to enter several commands enter the SYSTEM command without parameters The debugger opens a system shell and displays the operating system prompt You can enter any number of operating system commands one at atime following each with a return When you are finished entering commands and are ready to return to the debugger environment enter exit For information about the PDM version of the SYSTEM command see page 11 16 Creating and Executing a Batch File 3 3 Creating and Executing a Batch File You can create a batch file for several commands
42. and C to learn the number of cycles between points A and C This situation occurs because of pipeline filling and flushing The value in CLK is valid only after using a Run Benchmark command that is terminated by a software breakpoint When programming in C avoid using a variable named CLK The RUNB command accesses the analysis module to count CPU clock cycles If you have set up an instruction breakpoint the debugger halts on that breakpoint in addition to your software breakpoints eee eee ee eee Halting Program Execution 6 6 Halting Program Execution Whenever you are running or single stepping code program execution halts automatically if the debugger encounters a breakpoint or if it reaches a particular point where you told it to stop by supplying a count or an address with the RUN GO or any of the single step commands If you want to halt program execution explicitly you can use one of these methods J Click the Halt icon on the toolbar From the Target menu select Halt _j Press sc After halting execution you can continue program execution from the current PC by reissuing any of the run or single step commands What happens when you halt the emulator If you are using the emulator version of the debugger any of the above meth ods halts the target system after you have commanded the debugger to run code while disconnected from the target run free When you invoke the debugger it automatical
43. any C expression Here are some examples m Absolute address Suppose that you want to display data memory beginning from the very first address You might enter this command mem 0x0 Memory window addresses are shown in hexadecimal format If you want to specify a hex address be sure to prefix the address number with 0x otherwise the debugger treats the number as a decimal ad dress m Symbolic address You can use any defined C symbol as an expres sion parameter For example if your program defined a symbol named SYM you could enter this command mem amp SYM Prefix the symbol with the amp operator to use the address of the symbol m C expression If you use aC expression as a parameter the debug ger evaluates the expression and uses the result as a memory ad dress mem SP AO label mem SP ARO label _j The display format parameter is optional When used the data is dis played in the selected format as shown in Table 7 3 on page 7 22 _ Use the window name parameter to name the additional Memory window The debugger appends the window name to the Memory window label If you do not supply a name the debugger does not open a new window it simply updates the default Memory window to reflect the changes Managing Data in Memory Displaying memory contents while you are debugging C If you are debugging C code in auto mode you do not see a Memory window the debugger does not show the Memory wi
44. beep is associated with error messages SOUND OFF The beep is helpful if the Command window is hidden behind other windows If you are using the debugger with Windows 95 or Windows NT you must be sure that you have sound enabled in the control panel C 2 Alphabetical Summary of Debugger Messages C 2 T expected Description This is an expression error it means that the parameter contained an opening bracket symbol but did not contain a closing bracket symbol Action See section C 4 Additional Instructions for Expression Errors page C 26 Y expected Description This is an expression error it means that the parameter contained an opening parenthesis symbol but did not contain a closing parenthesis symbol Action See section C 4 Additional Instructions for Expression Errors page C 26 Aborted by user Description The debugger halted a long Command display listing because you pressed the key Action None required this is normal debugger behavior Alphabetical Summary of Debugger Messages Breakpoint already exists at address Description Action During single step execution the debugger attempted to set a breakpoint where one already existed This is not neces sarily a breakpoint that you set it may have been an internal breakpoint that the debugger set for single stepping None should be required you may want to reset the program entry point Target Restart and reenter the single step c
45. code in a parallel processing environment point To move the mouse cursor until it overlays the desired object on the screen port address The PC I O memory space that the debugger uses for communicating with the emulator The port address is selected via switches on the emulator board and communicated to the debugger with the p debugger option pulldown menu A command menu that is accessed by name or with the mouse from the menu bar at the top of the debugger display ripple carry output signal An output signal from a counter indicating that the counter has reached its maximum value scalartype ACtypeinwhich the variable is asingle variable not composed of other variables scroll bar A bar on the right side or bottom of a window that allows you to adjust the contents of the window to display hidden information scroll bar handle The rectangular box in the center of the right scroll bar in the Disassembly or Memory window that marks the center of disas sembled code or memory contents scrolling A method of moving the contents of a window up down left or right to view contents that were not originally shown section A relocatable block of code or data that will ultimately occupy contiguous space in the memory map side effects A feature of C expressions in which using an assignment operator in an expression affects the value of one of the components used in the expression simulator A development tool that si
46. command to display the register s contents For example if you want to know the contents of A3 you could enter A3 The debugger displays A3 s current contents in the display area of the Command window Managing Register Data _j If you want to observe a register over a longer period of time you can use Setup Watch Variable to display the register in a Watch window For example if you want to observe the control status register CSR you could enter Watch Add Fi Value Expression C2 Global variables Format Label Contro Status Register window name OK a Close Help This adds the CSR to the Watch window in hexadecimal format and labels it as Control Status Register The register s contents are continuously up dated just as if you were observing the register in the CPU window When you are debugging C in auto mode the command and Setup Watch Variable menu option are useful because the debugger does not show the CPU window in the C only display Managing Data 7 15 Managing Register Data Accessing single precision floating point registers The debugger allows you to display the registers in the two general purpose register files A and B in single precision floating point format Table 7 1 lists the pseudoregister name for each general purpose register Table 7 1 Pseudoregister Names for Single Precision Floating Point Registers 7 16 Pseudoregist
47. commands By default the debugger echoes the commands to the display area of the Command window and updates the display as it reads the commands from the batch file To suppress the echoing and updating enter a 0 as the suppress echo flag parameter If you omit the suppress echo flag parameter or enter a nonzero value for that parameter the debugger behaves in the default manner Display Abort Prompt take_abort on off none none basic debugger E PDM profiling The TAKE_ABORT feature prompts you before continuing a take file when a target error is detected When the take abort feature is OFF you do not get an abort prompt The default is OFF Summary of Commands 12 55 unalias Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 56 Delete Alias Definition unalias alias name Setup Alias Commands none basic debugger PDM The UNALIAS command deletes defined aliases profiling _j Todelete a single alias enter the UNALIAS command with an alias name For example to delete an alias named NEWMAP enter unalias NEWMAP _j To delete all aliases enter an asterisk instead of an alias name unalias The symbol does not work as a wildcard Delete Group unset group name unset none none PDM The UNSET command deletes a group of processors You can use this command in conjunction wit
48. commands endif Entering PDM Commands m If the expression for the IF is nonzero the PDM executes all com mands between the IF and the ELIF ELSE or ENDIF m The ELIF is optional If the expression for the ELIF is nonzero the PDM executes all commands between the ELIF and the ELSE or ENDIF Mm The ELSE is optional Ifthe expressions for the IF and ELIF if present are false zero the PDM executes the commands between the ELSE and the ENDIF _ To set up a looping situation to execute PDM commands use the LOOP BREAK CONTINUE ENDLOOP commands The syntax is loop Boolean expression PDM commands break continue endloop The PDM version of the LOOP command is different from the debugger version of this command described on page 12 29 Instead of accepting any expression the PDM version of the LOOP command evaluates only Boolean expressions If the Boolean expression evaluates to true 1 the PDM executes all commands between the LOOP and the BREAK CON TINUE or ENDLOOP If the Boolean expression evaluates to false 0 the loop is not entered m The optional BREAK command allows you to exit the loop without hav ing to reach the ENDLOOP This is helpful when you are testing a group of processors and want to exit if an error is detected m The CONTINUE command which is also optional acts as a goto and returns command flow to the enclosing LOOP command CONTINUE is useful when the part of the loop that follows is
49. commands from a system shell 00 000 c cee eee 3 3 Creating and Executing a Batch File 0 0 co eens ECHOING SIninGS Il a DACNTE ta evass pine oe oe erae ee pan ae bake aa Executing commands conditionally in a batch file 0 cc eee Looping command execution ina batch file 0 0 eee Pausing the execution of a batch file 0 0 0 eee ees Executing a pateh We t st5ecstpeoaduboses aa 3 4 Creating a Log File to Reexecute a Series of Commands 000005 Contents 4 Defining a Memory Map 0 cece ees 4 1 Contains instructions for setting up a memory map that enables the debugger to access target memory correctly includes hints about using a batch file to set up a memory map 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 5 Loading and Displaying Code 20 c cece eee eens The Memory Map What It Is and Why You Must Define It 4 Potential memory Map ProbleMS lt 024 lt iccccivedeceadadsse eunsaeeee cass de ae Creating or Modifying the Memory Map 0 00 c cece eee ee eee nee Adding a range of memory co esac eat co dye vio ms deesa annann amp hw ee etd eclerd oom arene bok Seed ek arB eich rd Creating a customized memory type 0 ee eee eens Deleting a range of memory suit aee twee ee oat es ened an et hee eK een end ene nek wenes Modifying a defined range Of memory ce eee eee eens Enabling Memory Mapp
50. complicated and re turning to the top of the loop avoids further nesting You can enter the flow control commands interactively or include the com mands in a batch file that is executed by the TAKE command When you enter LOOP or IF from the PDM command line a question mark prompts you for the next entry PDM 11 gt gt if i gt 10 echo ERROR IN TEST CASE endif ERROR IN TEST CASE PDM 12 gt gt Using the Parallel Debug Manager 11 11 Entering PDM Commands The PDM continues to prompt you for input using the until you enter ENDIF for an IF command or ENDLOOP for a LOOP command After you enter ENDIF or ENDLOOP the PDM immediately executes the IF or LOOP com mand If you are in the middle of interactively entering a LOOP or IF statement and want to abort it type You can use the IF ENDIF and LOOP ENDLOOP commands together to per form a series of tests For example within a batch file you can create a loop like the following the SET and commands are described in section 11 8 beginning on page 11 18 set i 10 Set the counter i to 10 loop Si gt 0 Loop while i is greater than 0 test commands if Sk gt 500 Test for error condition echo ERROR ON TEST CASE 8 Display an error message endif i i 1 Decrement the counter endloop You can record the results of this loop in a log file refer to page 11 10 to examine which test cases failed during the testing session Echoing strin
51. debugger Using the Parallel Debug Manager 11 3 Identifying Processors and Groups To define and manipulate software groupings of named processors use the SET and UNSET commands _j Defining a group of processors To define a group use the SET command The format for this command is set group name list of processor names This command allows you to specify a group name and the list of proces sors you wantin the group The group name can consist of up to 128 alpha numeric characters or underscore characters For example to create the GROUP1 group illustrated in Figure 11 1 b you could enter the following on the PDM command line set GROUP1 CPU A CPU C The result is a group called GROUP 1 that contains the processors named CPU_Aand CPU _ C The order in which you add processors to a group is the same order in which commands will be sent to the members of that group Setting the default group Many of the PDM commands can be sent to groups if you often send com mands to the same group and you want to avoid typing the group name each time you can assign a default group To set the default group use the SET command with a special group name called dgroup For example if you want the default group to contain the processors called CPU_B CPU_D and CPU_E enter set dgroup CPU_B CPU_D CPU_E The PDM automatically sends commands to the default group when you do not specify a group name Modifying an exis
52. defined as the most recent address or function name that you entered with the DASM command or in the Disas sembly window s Address field You can scroll up or down to see 1K bytes of reverse assembly on either side of the most recent address or function that you entered I 8 Dicseamnbly iy E nie m bs PETTI H Tee be Banden ates kkabotbk m Pagar itt io You can scroll l ee eee hE eB Be Bat i a i SHt l MODSI BEHN ETHIO eI l through 1K bytes of MIPIR Ppa Keay ME Pristine reverse assembly Ch Glit pad Mace aaae a eiin above or below the scroll bar handle Displaying assembly source code If you assemble your code with the g assembler option the debugger dis plays the contents of your assembly source file in the File window in addition to displaying the reverse assembly of memory contents in the Disassembly window This allows you to view all assembly source comments and true as sembly statements nagos OOO10 fibonacei OO011 CMPEQ 1 44 Al1 OOO12 Al B fib ret I m 1 return 1 OOO01S HOP 5 Ooo14 00015 CMPEQ 2 A4 Al O0016 41 E fib ret fi 1 m 2 return 1 ap Loading and Displaying Code ao Displaying C Code 5 2 Displaying C Code Unlike the assembly language code displayed in the Disassembly window C code is not reconstructed from memory contents the C code that you view is your original C source You can display C code explicitly or implicitly _J You c
53. disconnected from the target sys tem 12 41 executing code while disconnected from the target system executing commands to 3 13 execution pausing 11 13 exiting the debugger expressions addresses analysis description evaluating by the PDM evaluation with command with DISP command with EVAL command V 4 with LOOP command 3 9 12 29 operators 11 17 13 2 to 13 3 restrictions 13 4 void expressions i with side effects 7 5 to 7 6 external counter value pseudoregister XCNT 10 14 external event counter 10 7 to external interrupts connect input file sag re ging g list pins 14 18 PINC A rent PIND command cae PINL command programming aas setting up input file relative clock cycle 16 repetition setting up input files absolute clock cycle W 16 7 f decimal floating point display format f debugger option F1 key accessing online help F5 key running a profiling session 8 17 running code 6 4 9 8 10 10 F8 key single stepping F9 key changing the File window display 5 7 F10 key single stepping over function calls 6 10 faster simulator debugger features not supported description 1 10 features not supported by limited simulators 1 11 Index FILE command description 12 23 effect on debugging modes 2 17 File menu Load Program option Load Symbols en Log File option E Open option 5 6 Reload Program option 5 3 Take option esl
54. echo command entry show command output and list progress or error messages common object file format COFF A binary object file format that pro motes modular programming by supporting the concept of sections All COFF sections are independently relocatable in memory space you can place any section into any allocated block of target memory CPU window A window that displays the contents of C6x on chip registers including the program counter status register A file registers and B file registers cursor Aniconon the screen such as an arrow or a horizontal line that is used as a pointing device The cursor is usually under mouse or keyboard control D_ DIR An environment variable that identifies the directory containing the commands and files necessary for running the debugger D OPTIONS Anenvironmentvariable that you can use for identifying often used debugger options D_ SRC An environment variable that identifies directories containing program source files Glossary data display windows Windows for observing and modifying various types of data This category includes the Memory CPU and Watch windows debugger A window oriented software interface that helps you to debug C6x programs running on a C6x emulator or simulator disassembly Assembly language code formed from the reverse assembly of the contents of memory Disassembly window A window that displays the disassembly reverse assembly of mem
55. file in the current directory If you use a filename that already exists the debugger overwrites the file with the current configuration Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description step Find the Execution Status of Processors stat g group processor name none none PDM The STAT command tells you whether a processor is running or halted If a processor is halted when you execute this command then the PDM also lists the current PC value for that processor If you do not use the g option the PDM displays the status of the processors in the default group dgroup basic debugger E profiling Single Step step expression Target Step H C PDM The STEP command single steps through assembly language or C code If you are in C code the debugger executes one C statement at a time In assembly or mixed mode the debugger executes one assembly language statement at a time basic debugger E profiling If you are single stepping through C code and encounter a function call the STEP command shows you the single step execution of the called function assuming thatthe function was compiled with the compiler s g option When function execution is complete single step execution returns to the caller If the function was not compiled with the g option the debugger executes the function but d
56. for init clr When you use SCONFIG to restore a configuration that includes multiple File Watch or Memory windows the additional windows are not opened automati cally However when you open an additional window and use a window name that matches a window name that you used before you saved the configura tion the window is placed in the saved location Delete Stopping Point sd address none none PDM The SD command deletes the stopping point at address basic debugger profiling Send Debugger Command to Individual Debuggers send r g group processor name debugger command none none PDM C profiling The SEND command sends any debugger command to an individual processor or to a group of processors If the command produces a message itis displayed in the COMMAND window for the appropriate debugger s and also in the PDM window basic debugger set _ The g option specifies the group or processor that the debugger command should be sent to If you do not use this option the command is sent to the default group dgroup _j The r return option determines when control returns to the PDM command line m Without r control is not returned to the command line until each debugger in the group finishes running code Any results that are printed in the COMMAND window of the individual debuggers is also echoed in the PDM command window These results are displayed by processor If you want
57. format for this option is d machine_name 0 Summary of Debugger Options The 0 must follow the name of the machine on which you want to view the de bugger You can also specify a different machine by using the DISPLAY environment variable see your getting started guide for more information If you use both the DISPLAY environment variable and the d option d overrides DISPLAY Identifying a new configuration file f option If you are using the emulator the f option allows you to specify a board config uration file to be used instead of board dat The format for this option is f filename dat See Appendix B Describing Your Target System to the Debugger for infor mation about creating a board configuration file Identifying additional directories i option The i option identifies additional directories that contain your source files You can specify as many pathnames as necessary use the i option with each pathname in this format i pathname i pathname i pathname3 Using i is similar to using the D_ SRC environment variable see the informa tion about setting up the D_SRC environment variable in section 2 3 on page 2 4 If you name directories with both i and D_SRC the debugger first searches through directories named with i The debugger can track a cumu lative total of 20 paths including paths specified with i D_ SRC and the de bugger USE command Selecting b
58. if the memory map is not correctly defined and enabled i Accessing invalid memory addresses If you do not supply a batch file containing memory map commands the debugger is initially unable to ac cess any target memory locations Invalid memory addresses and their contents are displayed in red in the data display windows by default _ Accessing an undefined or protected area When memory mapping is enabled the debugger checks each of its memory accesses against the memory map If you attempt to access an undefined or protected area the debugger displays an error message _j Loading a COFF file with sections that cross a memory range Be sure that the map ranges you specify in a COFF file match those that you de fined in a batch file or with the Memory Map Control dialog box Alterna tively you can turn memory mapping off during a load by disabling memory mapping described in section 4 3 on page 4 7 When mapping is off you can still access memory locations Note If the emulator accesses an illegal or reserved memory location it posts an error in the EMIF external memory interface control register and returns 0 as the data eee eee Creating or Modifying the Memory Map 4 2 Creating or Modifying the Memory Map To identify valid ranges of target memory select Mapping from the Memory menu This displays the Memory Map Control dialog box Memory Map Control Fa sUUO0U00 SOUT OOOTOU00 RAM OOcOOO00
59. large as possible Customizing the screen To do this Change the command line prompt Load and use a previously saved custom screen configuration Save a custom screen configuration Displaying files and loading programs 12 4 To do this Display a text file in a File window Load an object file and its symbol table Load only the object code portion of an object file Load only the symbol table portion of an object file Use this command asm C mix Use this command move size win zoom Use this command prompt sconfig SSave Use this command file load reload sload O ee page as 2 4 a ma D OI IO o_o oO NO Functional Summary of Debugger Commands Displaying and changing data Use this See To do this command page Evaluate and display the result of a C expression 12 11 Display C and or assembly language code ata addr 12 13 specific point Display the Calls window calls 12 16 h ho ai Display assembly language code at a specific dasm address ak ho un Ke Display the values in an array or structure or disp display the value that a pointer is pointing to Evaluate a C expression without displaying the eval 12 22 results Display a specific line in the File window line 12 28 Display a specific C function func 12 24 Change the range of memory displayed in the mem 12 32 Memory window or display an addit
60. log file by using the File Execute Take File menu option For information about creating a log file in PDM see page 11 10 You can view the log file with any text editor To begin a recording session follow these steps 1 From the File menu select Open Log File This displays the Open Log File dialog box Files of type Log Files log Cancel File access O Append Overvarite Help Select whether to append or overwrite an existing log file 2 Select the directory where you want the file to be saved Creating a Log File to Reexecute a Series of Commands 3 Inthe File name field enter a name for the log file Use a log extension to identify the file as a log file 4 Click Open 5 If the file that you want to use already exists select that file then select one of the following actions in the File access field _j Append to add the log information to an existing file _J Overwrite to write over the contents of an existing file 6 Click Open The debugger records all commands that you enter from the command line from the toolbar from the menus or with function keys To end the recording session from the File menu select Close Log File Entering and Using Commands 3 13 Chapter 4 Defining a Memory Map Before you begin a debugging session you must supply the debugger with a memory map The memory map tells the debugger which areas of memory it can and cannot access Topic Page 4 1
61. parameter matches the I O address de fined by your switch settings For information about the switch set tings see the XDS51x Emulator Installation Guide m Check to ensure that the address you entered as the p option s pa rameter does not conflict with the address space with another bus set ting If you have a conflict change the switches on your board to one of the alternate settings Modify the p option s parameter to reflect the change in your switch settings Invoking the Debuggers and the PDM 2 6 Invoking the Debuggers and the PDM If you are using an emulator there are two ways to invoke the debugger _J You can invoke a stand alone debugger that is not controlled by the paral lel debug manager PDM You can invoke several debuggers that are under control of the PDM If you are using a simulator you can invoke only a standalone debugger This section describes how to invoke any version of the debugger and how to invoke the PDM Invoking a stand alone debugger To invoke the debugger on a PC use one of the following methods Double click the shortcut icon for the debugger _j From the Start menu select Run Enter the path for the debugger executable file You can specify debugger options at invocation by modifying the command line in the property sheet for your debugger icon To invoke the debugger on a SPARCstation enter the following command from a command shell sim6x emu6x sim67x
62. processor name must match one of the names defined in your board configuration file see Appendix B Describing Your Target System to the Debugger Summary of Commands 12 51 Si Syntax Menu selection Toolbar selection Environments Description ssave Syntax Menu selection Toolbar selection Environments Description 12 52 Reset Stopping Point Si none none C Pom profiling The SR command resets deletes a currently set stopping points basic debugger Save Screen Configuration ssave filename File gt Save As Config none basic debugger PDM profiling The SSAVE command saves the current screen configuration to a file This saves the window locations and window sizes for all debugging modes includ ing the size and location for multiple File Watch and Memory windows However the debugger does not save docking information about docked win dows If you have one or more docked windows and you save and reload the screen configuration the debugger does not display any windows as docked If you want the windows docked you must follow the docking procedure again The filename parameter names the screen configuration file You can include path information including relative pathnames if you do not supply path information the debugger places the file in the current directory If you do not supply a filename the debugger saves the current configuration into a file named init clr and places the
63. read Cannot spawn child debugger Description The PDM couldn t spawn the debugger that you specified because the PDM couldn t find the debugger executable file emu6x The PDM will first search for the file in the current directory and then search the directories listed with the PATH statement Action Check to see if the executable file is in the current directory or in a directory that is specified by the PATH statement Modify the PATH statement if necessary or change the current direc tory Debugger Messages C 23 Alphabetical Summary of PDM Messages C 24 Command error Description Action The syntax for the command that you entered was invalid for example you used the wrong options or arguments Reenter the command with valid parameters Debugger spawn limit reached Description Action The PDM spawned the maximum number of debuggers that it can keep track of in its internal tables The maximum number of debuggers that the PDM can track is 2048 However your system may not have enough resources to support that many debuggers Before trying to spawn an additional debugger close any debuggers that you don t need to run Illegal flow control Description Action One of the flow control commands IF ELIF ELSE ENDIF or LOOP BREAK CONTINUE ENDLOOP has an error This error usually occurs when there is some type of imbalance in one of these commands Check the flow command construct for such pro
64. sim6xfast filename options sim6x invokes the debugger for the fixed point simulator emu6x invokes the debugger for the emulator sim67x invokes the debugger for the floating point simulator sim6xfast invokes the fast version of the fixed point simulator filename is an optional parameter that names an object file that the debugger loads into memory during invocation The debug ger looks for the file in the current directory if the file is not in the current directory you must supply the entire path name If you do not supply an extension for the filename the debugger assumes that the extension is out options supply the debugger with information on how to handle files manage the display and input information Getting Started With the Debugger 2 7 Invoking the Debuggers and the PDM Invoking multiple debuggers emulator only 2 8 Before you can invoke multiple debuggers in a multiprocessing environment you must first invoke the parallel debug manager PDM The PDM is invoked and PDM commands are executed from a command shell window within the host windowing system The format for invoking the PDM is pdm t filename Once the PDM is invoked you will see the PDM command prompt PDM 1 gt gt and can begin entering commands When you invoke the PDM it searches for a file called init odm This file con tains initialization commands for the PDM The PDM searches for the init podm file in the current directory and
65. starting at address or at function name as the first line of code in the File window In mixed mode ADDR affects both the File and Disassembly windows Chapter 6 Running Code To debug your programs you must execute them on a debugging tool the emulator or simulator The debugger provides two basic types of commands to help you run your code J Basic run commands run your code without updating the display until you explicitly halt execution _ Single step commands execute assembly language or C code one state ment at a time and update the display after each execution This chapter describes the basic run commands and the single step com mands tells you how to halt program execution and discusses using software breakpoints Topic Page Defining the Starting Point for Program Execution Using the Basic Run Commands Single Stepping Through Code Running Code Conditionally Benchmarking Halting Program Execution Using Software Breakpoints 6 1 Defining the Starting Point for Program Execution 6 1 6 2 Defining the Starting Point for Program Execution All run and single step commands begin executing from the current PC When you load an object file the PC is automatically set to the starting point for pro gram execution You can easily identify the current PC by QO Finding its entry in the CPU window _j Finding the line in the File or Disassembly window that has a yellow arrow next to it To do this
66. switch settings and replace port address with one of these values If your Switch 1 is and your Switch 2 is Use this p option On default On default 240 optional On Off 280 Off On 320 Off Off 340 If you did not note your I O switch settings you can use a trial and error ap proach to find the correct p setting If you use the wrong setting you will see an error message when you invoke the debugger See the XDS51x Installa tion Guide for more information If you are using a UNIX workstation the p option specifies the SCSI port the debugger uses for communicating with the emulator For more information see the XDS51x Installation Guide Entering the profiling environment profile option This option is valid only when you are using the simulator The profile option allows you to bring up the debugger in a profiling environment so that you can collect statistics about code execution Only a subset of the basic debugger features is available in the profiling environment For more information about the profiling environment see Chapter 8 You can also enter the profiling environment after invoking the debugger by using the debugger s Profile Profile Mode menu option or PROFILE com mand within the debugger environment Summary of Debugger Options Loading the symbol table only s option The s option allows you to load only a file s symbol table without the file s ob ject code This op
67. that you want to enter at one time A batch file is useful for tasks such as defining aliases that you want to reuse defining your memory map setting up your screen configuration load ing object code or any other task that you want to do each time you invoke the debugger You can create the batch file in any text editor For each debugger command that you include in the batch file use the same syntax that you would use if you were entering the command from the debugger s command line Example 3 1 shows a sample batch file that you can create You can set up a batch file to call another batch file they can be nested in this manner up to ten deep Example 3 1 Sample Batch File for Use With the Debugger echo Loading object code load testcode out echo Loading screen configuration sconfig mycontig clr echo Defining aliases alias restrun restart run alias wavars wa pc wa i wa jJ Echoing strings in a batch file When executing a batch file you can display a string to the Command window by including the ECHO command in your batch file The syntax for the com mand Is echo string This displays the string in the display area of the Command window For example you might want to document what is happening during the execution of a certain batch file To do this you could use a line such as the following one in your batch file to indicate that you are creating anew memory map for your device echo Creatin
68. the TMS320C6701 The fixed point simulator provides you with full debugger functionality The lim ited versions of the simulator allow you to do specialized tasks but do not sup port the full range of debugger capabilities The limited versions of the simula tor are separate executables available on the following platforms J UNIX m Sun SPARC m HP Lj PC E Windows NT Mm Windows 95 Floating point version of the simulator Use the floating point version of the simulator with the TMS320C6701 The floating point version of the simulator supports the TMS320C67 x instruction set and is a separate executable For information on invoking the floating point version of the simulator execut able see page 2 7 Fast version of the fixed point simulator The fast version of the fixed point simulator simulates at almost 50 times the rate of the standard fixed point simulator The fast simulator supports the com plete C6x instruction set as well as both big endian and little endian modes Use the fast simulator to quickly validate code when information such as cycle count accuracy is not critical For information on invoking the floating point version of the simulator execut able see page 2 7 Limited Versions of the Simulator Debugger features not supported by the limited versions of the simulator The floating point version of the simulator and the fast version of the fixed point simulator do not support the following featu
69. the command repeatedly as long as the expression is true Summary of Commands 12 29 ma Syntax Menu selection Toolbar selection Environments Description 12 30 The LOOP ENDLOOP commands work under the following conditions _J You can use LOOP ENDLOOP commands only in a batch file You must enter each debugger command on a separate line in the file _ You cannot nest LOOP ENDLOOP commands within the same file Add Block to Memory Map ma address length type Memory Mapping none basic debugger L PDM profiling The MA command identifies valid ranges of target memory A new memory range must not overlap an existing entry if you define a range that overlaps an existing range the debugger ignores the new range J The address parameter defines the starting address of a range in memory This parameter can be an absolute address any C expression the name of a C function or an assembly language label The length parameter defines the length of the range This parameter can be any C expression _j The type parameter identifies the read write characteristics of the memory range The type must be one of these keywords Use this keyword as the type To identify this kind of memory parameter Read only memory R or ROM Write only memory W or WOM Read write memory R W or RAM Read only program memory PROM Read write program memory PRAM No access memory PROTECT Input port INPORT or P R Output port O
70. the number of occurrences of each count event The syn tax for the event_list command Is event_list event_number Or use the predefined alias el event_number You also can view the configuration of all analysis events from the debugger interface in the Analysis Statistics window Entering Analysis Commands Through a Batch File 9 8 Entering Analysis Commands Through a Batch File You can use the memory system analysis commands to set up a batch file that automatically sets up your most frequently used analysis settings when the de bugger is invoked Example 9 1 is a sample batch file that loads the program to be analyzed sets up events to count enables analysis runs the program logs the analysis results to a log file and lists the analysis results to the Com mand window For more information on creating and executing a batch file see Section 3 3 on page 3 7 Example 9 1 Sample Memory System Analysis Batch File ie Ae ee ee ee A a ee A a a A A A a A A A et A A A A A A a A et A A A a A A A A A A A a et A A A A A ee A A Sample Command File A me ae ee ee et a A a a A a A A A a A A A A A A A A A A A A A A A A A A A A A A ee ee A A A A A ee A E G load test_prog Load the program to analyse Perform any other setup event_counter_start 10 Count program memory accesses event_counter_start 3 Count program cache hits event_counter_start 4 Count program cache misses event_enable gt Enable memory system analy
71. the program entry point SLOAD closes any Watch windows Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description spawn Enable Error Beeping sound on off none none basic debugger E PDM profiling You can cause a beep to sound every time a debugger error message is displayed This is useful if the Command window is hidden because you would not see the error message By default sound is off Invoke the C6x Debugger spawn emu6x n processor name invocation options none none PDM You must invoke a debugger for each processor that you want the PDM to control To invoke a debugger use the SPAWN command T basic debugger profiling _jJ emu x is the executable that invokes the debugger The PDM associates the processor name with the actual processor according to which executable you use To invoke a debugger the PDM must be able to find the executable file for that debugger The PDM first searches the current directory and then searches the directories listed with the PATH statement _ n processor name supplies a processor name You must use the n option since the PDM uses processor names to identify the various debug gers that are running The processor name can consist of up to eight alphanumeric or underscore characters and must begin with an alphabetic character The name is not case sensitive The
72. tit edu tw pub TI Japan Product Information Center 0120 81 0026 in Japan Fax 0120 81 0036 in Japan 03 3457 0972 or INTL 813 3457 0972 Fax 03 3457 1259 or INTL 813 3457 1259 DSP Hotline 03 3769 8735 or INTL 813 3769 8735 Fax 03 3457 7071 or INTL 813 3457 7071 DSP BBS via Nifty Serve Type Go TIASP Documentation When making suggestions or reporting errors in documentation please include the following information that is on the title page the full title of the book the publication date and the literature number Mail Texas Instruments Incorporated Email dsoh ti com Technical Documentation Services MS 702 P O Box 1443 Houston Texas 77251 1443 Note When calling a Literature Response Center to order documentation please specify the literature number of the book Read This First vil Contents Overview of the Code Development and Debugging System 000ee eens 1 1 Provides an overview of the C source debugger describes the code development environment and provides a brief overview of the debugging process Also tells you how to access online help 1 1 Key Features of the Debugger 22405 ccacenaddeuearee qede tenes tne gaces ea haste he 1 2 About the C Source Debugger Interface 0 0 eee Descriptions of the debugger windows and their contents 000 ee aee 1 3 Developing Code for the TMS320C6X nananana nananana 1 4 Limited Versions of the Simulato
73. to N A If the Both level is selected CO OU UU Select a function name In the Area box select All areas Select a module name In the Area box select All areas In the Area box select All areas Be sure that Function and Module are set to N A Bull 104 seas Buluyag Defining a Stopping Point 8 5 Defining a Stopping Point Before you run a profiling session you must identify the point where the debug ger should stop collecting statistics By default C programs contain an exit label and this is defined as the default stopping point when you load your pro gram You can delete exit as a stopping point if you choose If your program does not contain an exit label or if you prefer to stop at a different point you can use a software breakpoint to define another stopping point You can set multiple breakpoints the debugger stops at the first one it finds Even though no statistics can be gathered for areas following a breakpoint the areas will be listed in the Profile window ccc acca Note You cannot set a software breakpoint on a statement that has already been defined as a part of a profile area ee Setting and clearing a software breakpoint in the profiling environment is simi lar to setting and clearing a software breakpoint in the basic debugging envi ronment For more information about setting and clearing software breakpoints see section 6 7 on page 6 14 Setting a software breakpoint To set
74. to set hardware break points 10 1 Major Functions of the Analysis Module 0 0 ccc eee eee 10 2 Overview of the Analysis Process 0 0 ccc eee eee nea 10 3 Enabling the Analysis Module 0 0 teen ene nes 10 4 Defining the Conditions for Analysis 0 0 0 ee eee een ees Counting CVEUIS each aus enw ia eiee beans sense bernecen ae usw eeurwee nts Enabling the external counter 0 ccc eee eee eens Setting hardware breakpoints 0 ccc eee en ee eee eens Setting up the EMU0 1 pins to set global breakpoints 0 000 e eee 10 9 R nnNng YOUR PIOGIAN c eevtice ues ectiy tiga eta eae nat ceviw an ee nae How to run the entire program 0 ccc eee eee e eee e eae How the Run Benchmarks RUNB command affects analysis 10 6 Viewing the Analysis Data 0 0 ccc ence teen neenees Interpreting the information in the Analysis Statistics window 11 Contents 10 7 Creating Customized Analysis Commands 10 8 Summary of Analysis Pseudoregisters 0 02 AEN enable analysis 2 cteqeuwseueitaeeacated sede tears canes caneeceueedanes ABE configure hardware breakpoints 0 0 0 e cece eee eee eee eens ADR program address breakpoint value ACE configure analysis counter events nananana nananana eee eens ICNT internal counter value 0 00 cc eee ete nee een enee XCNT external counter value 0 c ccc
75. you can still access memory locations However the debugger does not prevent you from acces sing memory locations that you have not defined as valid in the memory map Defining a Memory Map 4 7 Enabling Memory Mapping When you disable memory mapping with the emulator only memory linked to the text section is downloaded over the program bus Note When memory mapping is enabled you cannot 1 Access memory locations that are not listed in the Memory Control dia log box Modify the contents of memory areas that are defined as read only or protected If you attempt to access memory in these situations the debugger displays this message in the display area of the Command window Error in expression 4 8 A Sample Memory Map 4 4 A Sample Memory Map Because you must define a memory map before you can run any programs it is convenient to define the memory map in the initialization batch files Figure 4 1 a shows the memory map that is defined in the initialization batch file that accompanies the C6x simulator You can use the file as is edit it or create your own memory map batch file to match your own configuration You can also define the memory map after you have invoked the debugger with the Memory Map Control dialog box see section 4 2 on page 4 3 If you are defining the memory map in a batch file you can use MA map add commands to define valid memory ranges and identify the read write charac teris
76. 0x18 0x1122 In this example the first value 0x808020 is substituted for the first FILL pa rameter and the MEM parameter 1 The second and third values are sub stituted for the second and third FILL parameters 2 and 3 Editing or redefining an alias Deleting an alias To edit or redefine an alias follow these steps 1 From the Setup menu select Alias Commands This displays the Alias Control dialog box 2 From the list of aliases at the top of the dialog box select the alias that you want to edit or redefine 3 Inthe Name and Command string fields make the appropriate changes 4 Click Apply 5 Click OK to close the Alias Control dialog box To delete an alias follow these steps 1 From the Setup menu select Alias Commands This displays the Alias Control dialog box 2 From the list of aliases at the top of the dialog box select the alias that you want to delete 3 Click Delete 4 Click OK to close the Alias Control dialog box Considerations for using alias definitions 3 4 Alias definitions are lost when you exit the debugger If you want to reuse aliases define them in a batch file Use the ALIAS command as described on page 12 14 Individual commands within a command string are limited to an expanded length of 132 characters The expanded length of the command includes the length of any substituted parameter values Entering Operating System Commands From Within the Debugger 3 2 En
77. 1 i 5 i fori j gogogaga puzzl itd jt d ki false fort 1 UO 1 typemax i DOO08sbo plij m false pogano fori i O i 3 i fori j OOOO8EED DLO i d iitd ki l true DOWN ese OO000001 OO000000 00001800 00000000 Address gooodds8o TETE 00000000 eee i 00000010 Se OOO0041e4 OO0041e0 OO0041lec OOO041 0 OOOU41 4 OOO0041fa 20000013 Puzzle h4s6 0 eU0se05a BO 0x01 50 OO0c3655 AU A3 1 20000012 Puzzle h4s 0 OO0c3654 AQ A3 1 OO00c3654 AN AG 1 ooooooo0 ooooooo0 00000040 000058ec Memory Puzzlef Address time_cl maint Loading C cbxGUI puzzle out 00000000 O63e14 6 OSbd22f4 0 bd f4 197 symbols loaded 0000000c 073d82f4 063d42 5 05900058 Tian For Help press F1 Context sensitive status bar QOOO0O018 OOLOES11 bac z 4 O22c0265 00000024 Olbda2t6 053d0 f4 O535de2f6 QOOOCOOS0 OUesce2ft O1e802acbh OOOOOOOL T arget Halted Z Interactive command entry Scrolling data displays Function call with command history with on screen editing traceback Overview of the Code Development and Debugging System 1 3 About the C Source Debugger Interface Descriptions of the debugger windows and their contents The debugger can show several types of windows Each type of window serves a specific purpose and has unique characteristics Every window is identified by a name in its upper left corner For the File window the debugger d
78. 10 B11 B10 DB10 A13 A12 DA12 B13 B12 DB12 A15 A14 DA14 B15 B14 DB14 You can display the contents of these registers by using the evaluate ex pression command or Setup Watch Variable menu option E For example if you want to evaluate the A11 A10 register pair enter the command with the DA10 pseudoregister name da10 The debugger shows the result in the display area of the Command win dow da10 1 0933371e 309 To modify the A11 A10 register pair DA10 and set it equal to 25 75 enter da10 25 75 The debugger displays the following in the display area of the Command window rdal0 25 75 225 5000EF00L Managing Data 7 17 Managing Data in a Watch Window 7 7 Managing Data in a Watch Window 7 18 The debugger does not maintain a dedicated window that tells you about the status of all the symbols defined in your program Such a window might be so large that it would not be useful Instead the debugger allows you to open a Watch window that shows you how program execution affects specific expres sions variables registers or memory locations You can choose which ones you want to observe You can also use the Watch window to display members of complex aggregate data types such as arrays and structures Label 000i adc Current value 000058d4 Oo008sbo OO00e918 The debugger displays a Watch window only when you specifically request a Watch window Remember you can use the data management comm
79. 10 respectively You cannot evaluate string variables with the PDM expression analyzer You can evaluate only constant expressions Table 11 1 summarizes the PDM operators The PDM interprets the operators in the order in which they are listed in Table 11 1 left to right top to bottom PDM Operators Operator Definition Operator Definition take highest precedence multiplication division modulo addition binary subtraction binary lt lt left shift e complement lt less than gt gt right shift gt greater than lt less than or equal to 2E is equal to greater than or equal to amp bitwise AND is not equal to bitwise OR bitwise exclusive OR logical OR amp amp logical AND Using the Parallel Debug Manager 11 17 Using System Variables 11 8 Using System Variables You can use the SET and UNSET commands to create modify and delete system variables In addition you can use the SET command with system defined variables Creating your own system variables 11 18 The SET command lets you create system variables that you can use with PDM commands The syntax for the SET command is set variable name string The variable name can consist of up to 128 alphanumeric characters or under score characters For example suppose you have an array that you want to examine frequently You can use the SET command to define a system variable that represents that array value
80. 5 systems 2 3 changing current directory 12 17 to 12 63 directories conintued identifying additional source directories 12 57 for HPUX systems for SPARC systems for Windows 95 systems identifying alternate directories D_DIR identifying current directory identifying directories with program source files D_SRC listing contents of current directory relative pathnames_ 12 17 search algorithm tolA 3 USE command disabling analysis disabling areas for profiling 8 10 to 8 12 disabling memory mapping 4 7 to 4 8 disassembly definition description displaying to 5 5 Disassembly window Address field definition description 1 4 modifying the display running code to a specific point 6 5 scrolling through the contents setting a breakpoint setting current PC viewing disassembly to DISP command description 12 19 display formats 12 20 effect on debugging modes display basic debugger 1 3 display area clearing 12 17 definition recording information from to 3 13 11 10 2 20 2 20 display customization commands 12 4 display formats command 12 12 data types 7 23 description 7 22 to 7 25 DISP command 7 24 12 20 EVAL command 11 2112 23 MEM command resetting types Index display formats continued SETF command za 7 26 112 49 table WA command Display Rate frequency bar Profile window 8 17 displaying assembly language code 5 2 disassembl source batch
81. 6 using to change display format of data 7 24 defining conditions 9 5 memory event breakpoints 9 7 not supported by fast simulator batch file search order process command summar data formats 7 22Ito removing event 9 7 displaying in different numeric format resetting event counters filling running programs byte by byte viewing analysis data 9 9 word by word 11 to 12 24 memory system analysis commands 2 35 2 35 saving entering through a batch file 9 13 saving values to a file 7 10 to 7 11 event_break simulating I O memory 12 31 12 33 event_counter_reset 9 12 simulating ports event_counter_start_ 9 11 MC command event disable MI command 12 33 event_enable memory contents See data management memory event_list window event_reset Memory Map Control dialog box 4 3 memory types memory mapping customizing 4 4 adding ranges 4 3 to 4 5 4 10 12 30 list of basic types 4 5 checking memory accesses against Memory window command summary 12 7 Address field creating a map to changing range of memory displayed default map definition defining a map seinen Dy defining and executing a map in a batch displaying memory contents td 7 26 file editing memory contents definition memory map _ D 4 modifying display deleting ranges naming Index 12 Memory window continued opening additional windows scrolling through the contents menu context menus 1 6 definition pulldown menu D 5 menu bar bas
82. All ranges everywhere E E E LI E E If the C level is selected Select a module name In the Area box select Ranges Next to Ranges specify a Start line number and an End line number Select a function name In the Area box select Ranges Select a module name In the Area box select Ranges In the Area box select Ranges Be sure that Function and Module are set to N A If the Assembly level is selected E E CO Uo UU In the Area box select Ranges Next to Ranges specify a Start and an End value as absolute ad dresses C expressions or as sembly labels Select a function name In the Area box select Ranges Select a module name In the Area box select Ranges In the Area box select Ranges Be sure that Function and Module are set to N A T You cannot specify line numbers or addresses when using the Profile View dialog box If the Both level is selected Not applicable CO Ue UU Select a function name In the Area box select Lines Select a module name In the Area box select Lines In the Area box select Lines Be sure that Function and Module are set to N A If the Both level is selected Not applicable CO OO UU Select a function name In the Area box select Ranges Select a module name In the Area box select Ranges In the Area box select Ranges Be sure that Function and Module are set to N A ulJijJOId 104 Seay Buluyag VL 8
83. All ranges in a function All ranges in a module All ranges everywhere Functions LI By function name _j All functions in a module _j All functions everywhere All areas E E 12 64 All areas in a function All areas in a module _j All areas everywhere In C only UCLE UCLF UCLM UCLG UCRE UCRF UCRM UCRG UCFE UCFM UCFG UCAF UCAM UCAG filename line number function filename filename line number function filename function filename function filename In disassembly only UALE UALF UALM UALG address function filename UARE UARF UARM UARG address function filename not applicable UAAF function UAAM filename UAAG In C and disassembly not applicable UBLF function UBLM filename UBLG not applicable UBRF function UBRM filename UBRG not applicable UBFM filename UBFG UBAF function UBAM filename UBAG Summary of Profiling Commands Table 12 5 Changing the profile window display a Viewing specific areas To view this area Lines g All lines in a function _j All lines in a module _j All lines everywhere Ranges _j All ranges in a function _j All ranges in a module _j All ranges everywhere Functions _j By function name All areas _j All areas in a function _j All areas in a module _j All areas everywhere b Viewing different data To view this information Count Inclusive
84. Area box select Functions Be sure that Function and Module are set to N A If Assembly level is selected E E L L In the Area box select Lines Next to Lines specify an absolute address a C expression or an assembly label Select a function name In the Area box select Lines If Assembly level is selected LI LI In the Area box select Ranges Next to Ranges specify a Start and an End value Use an absolute address a C expression or an assembly label for each If Assembly level is selected Not applicable Not applicable Not applicable Profiling Code Execution Defining Areas for Profiling Disabling an area 8 10 At times itis useful to identify areas that you do not want affecting profile statis tics Todo this disab ethe appropriate area Disabling effectively subtracts the timing information of the disabled area from all profile areas that include or call the disabled area Areas must be marked before they can be disabled For example if you have marked a function that calls a standard C function such as malloc you may not want malloc to affect the statistics for the call ing function You could mark the line that calls malloc and then disable the line This way the profile statistics for the function would not include the statis tics for malloc ooe Note If you disable an area after you have already collected statistics on it that information will be lost
85. B is running contains variables j and k j is equal to 12 and k is equal to 22 set dgroup CPU_A CPU _B eval val j k set dgroup CPU_A CPU B val_CPU_A 22 val_CPU_B 34 Notice that the PDM created a system variable for each processor val CPU_A for CPU_A and val CPU _B for CPU B Using the Parallel Debug Manager 11 21 Chapter 12 summary of Commands This chapter describes the basic debugger and PDM commands and profiling commands Topic Page 12 1 Functional Summary of Debugger Commands 12 2 Alphabetical Summary of Debugger and PDM Commands 12 3 Summary of Profiling Commands 12 1 Functional Summary of Debugger Commands 12 1 Functional Summary of Debugger Commands This section summarizes the debugger commands according to these catego ries E Managing multiple debuggers These commands allow you to group debuggers run code on multiple processors and send commands to a group of debuggers Changing modes These commands listed on page 12 4 allow you to switch freely between the debugging modes auto mixed and assembly Managing windows These commands listed on page 12 4 allow you to make a window active and move or resize the active window Displaying and changing data These commands listed on page 12 5 allow you to display and evaluate a variety of data items Performing system tasks These commands listed on page 12 6 al low you to perform several system functions an
86. DM continues to prompt you for input using the until you enter ENDIF After you enter ENDIF the PDM immediately executes the IF command If you are in the middle of interactively entering an IF statement and want to abort it type Conditionally Execute Debugger Commands Batch File Only if expression debugger commands else debugger commands endif none none basic debugger _ PDM profiling These commands allow you to execute debugger commands conditionally in a batch file If the expression if nonzero the debugger executes the com mands between the IF and the ELSE or ENDIF The ELSE portion of the com mand sequence is optional You can substitute a keyword for the expression Keywords evaluate to true 1 or false 0 You can use the following keywords with the IF command I EMU tests for the emulator version of the debugger Li SIM tests for the simulator version of the debugger The conditional commands work with the following provisions 4 You can use conditional commands only in a batch file _ You must enter each debugger command on a separate line in the file _ You cannot nest conditional commands within the same batch file Summary of Commands 12 27 line Syntax Menu selection Environments Description Syntax Menu selection Toolbar selection Environments Description loop break continue endloop Syntax Menu selection Environments Description 12 28 Di
87. Debugger Readable Format Step 3 Specify the Configuration File When Invoking the DEBUGGER oo cece ante as o oe vie ce ven s oe er sues oy scp ween Fat ane B 1 Step 1 Create the Board Configuration Text File B 1 Step 1 Create the Board Configuration Text File Example B 1 A Sample TMS320C6x Device Chain B 2 To describe the emulation scan path of your target system to the debugger you must create a board configuration file Each entry of the file describes one device on your scan path and the entries follow the order of the devices in the scan path The text version of the configuration file is referred to as board cfg in this book Example B 1 shows a board cfg file that describes a possible C6x device chain It lists six octals named A1 A6 followed by five C6x devices named CPU_A CPU_B CPU_C CPU_D and CPU _ a A sample board cfg file Device Name Al m Ao A3 ag a5 aG GPU CEPU CPU CPU CPU b A sample C6x device chain _A ee an m on Device Type BYPASSO08 BYPASSO8 BYPASSO8 BYPASSO8 BYPASSO8 BYPASSO8 TMS320C6x TMS 320C ox TMS320C6X TMS320C 6X TMS320C6x Comments the first device nearest TDO test data out the next device nearest TDO the first Cox the last C6x nearest TDI test data in Step 1 Create the Board Configuration Text File The order in which you list each device is important The emulator scan
88. Defining a Stopping Point Running a Profiling Session Viewing Profile Data Saving Profile Data to a File 8 1 Overview of the Profiling Environment 8 1 Overview of the Profiling Environment 8 2 The profiling environment builds on the same intuitive interface available in the basic debugging environment and has these additional features E More efficient code Within the profiling environment you can quickly identify busy sections in your programs This helps you to direct valuable development time toward optimizing the sections of code that most dra matically affect program performance Statistics on multiple areas You can collect statistics about individual statements in disassembly or C about ranges in disassembly or C and about C functions When you are collecting statistics on many areas you can choose to view the statistics for all the areas or a subset of the areas Comprehensive display of statistics The profiler provides all the infor mation you need for identifying bottlenecks in your code m The number of times each area was entered during the profiling session m The total execution time of an area including or excluding the execu tion time of any subroutines called from within the area m The maximum time for one iteration of an area including or excluding the execution time of any subroutines called from within the area Statistics may be updated continuously during the profiling session or at sel
89. Description None disable internal counter Do not count any events disable internal counter CPU clock cycles Pipeline stall clock cycles Interrupt taken Execute packet Count the number of CPU clock cycles Count the number of CPU clock cycles during a pipeline stall Count the number of interrupts detected Count the number of execution packets Interrupt context switch clock cycles Count the number of CPU clock cycles during an interrupt context Branch taken NOP 10 6 switch Count the number of branches taken Count the number of NOPs detected To watch the progress of the event counter view the status of the event in the Analysis Statistics window If you do not want to count any events select None to disable the internal counter Defining the Conditions for Analysis Enabling the external counter The emulator s external counter keeps track of the internal counter The inter nal counter is a 10 bit decremental counter that can keep track of amaximum of 1024 events The external counter however is a 32 bit counter Each time the internal counter overflows a signal sent through the EMUO pin increments the external counter To enable the emulator s external counter simply select the external counter checkbox in the Count CPU Events dialog box Analysis Events x Count CPU Events Set Up Hardware Breakpoints Select an Event to Count O None Disable extemal counter 2 Execute packet CPU clock cy
90. Errors If you continue to receive the messages that send you to this section this indi cates persistent hardware problems _ Ifa bus fault occurs the emulator may not be able to access memory J The C6x must be reset before you can use the emulator Most target sys tems reset the C6x at power up your target system may not be doing this C 26 Appendix D Glossary active window The window that is currently selected for moving sizing editing closing or some other function aggregate type A C data type such as a structure or array in which a vari able is composed of multiple variables called members aliasing A method of customizing debugger commands aliasing provides a shorthand method for entering often used command strings ANSI C A version of the C programming language that conforms to the C standards defined by the American National Standards Institute assembly mode A debugging mode that shows assembly language code inthe Disassembly window and does not show the File window no matter what type of code is currently running autoexec bat A batch file that contains DOS commands for initializing your PC auto mode A context sensitive debugging mode that automatically switches between showing assembly language code in the Disassembly window and C code in the File window depending on what type of code is Currently running batch file One of two different types of files One type contains DOS com
91. LE MCLF MCRE MCFE MCFM MCFG filename line number function filename line number line number function filename Table 12 2 Disabling marked areas In C only In disassembly only In disassembly only MALE address MALF function MARE address address not applicable In C and disassembly To disable this area Lines _j By line number address _j All lines in a function _j All lines in a module _j All lines everywhere Ranges _j By line number address All ranges in a function All ranges in a module C O wu 12 62 DCLE DCLF DCLM DCLG DCRE DCRF DCRM DCRG filename line number function filename filename line number function filename DALE DALF DALM DALG DARE DARF DARM DARG address not applicable function DBLF function filename DBLM filename DBLG address not applicable function DBRF function filename DBRM filename DBRG All ranges everywhere To disable this area Functions _j By function name _j All functions in a module _j All functions everywhere All areas Jg All areas in a function Jg All areas ina module _j All areas everywhere In C only DCFE function DCFM filename DCFG DCAF function DCAM filename DCAG Table 12 3 Enabling disabled areas To enable this area Lines _j By line number address _j All lines in a function _j All lines in a module _j All lines everywhere Ranges _j By
92. N command The format for this command is run expression You can use any of the debugger run commands STEP CSTEP NEXT etc described in Chapter 6 Viewing the Analysis Data 9 6 Viewing the Analysis Data You can monitor the status of the analysis events by checking the Analysis Sta tistics window This window displays an ongoing progress report of memory system analysis activity Through this window you can monitor the status of the break events and the number of occurrences of each count event that you defined If you change any of the analysis options in the Analysis Events dialog box the Analysis Statistics window updates to reflect the changes you made Interpreting the information in the Analysis Statistics window You can watch the progress of the events that you defined in the Analysis Events dialog box in the Analysis Statistics window From this window you can also reset the event counters Figure 9 3 illustrates the Analysis Statistics window Figure 9 3 Analysis Statistics Window Displaying an Ongoing Status Report EH Analysis Statistics Routine in Memory Stall Data Bank Conflict List of events defined to monitor which this break event occurs Reset all Reset Counters the event counters to 0 Event type Number of Address on times the which this event occurs break event occurs Resetting the event counters The event counters count each occurrence of a defined event until you re
93. O007c88 OO01S810 OO007 c8c OOOOADOO Olbedcea A green right arrow tells you that a Oo00 c94 0180006a this line is marked and enabled O0007 c98 0528808 OO0O0 c9c fffe4i OO00 cad OOOD4000 8 6 Defining Areas for Profiling _j To mark a range click the last line of the range that you want to mark This changes the mouse icon on the first line of the range into a green arrow The entire range is marked with two green right arrows that are connected This range is marked and enabled w Disassembly Sal x Address 00007 che O0007cec0 O0007 ecd O0007 ec8 OO000 Fece O0007 cd0 O0007 cd4 OO00 eds O000 cde OOO04000 O1be6s2h 02648028 020000649 O1S0006a OO28s0f5 OO00cs10 OOscHvt4 HOP 3 HVE 52 0x7cd BS HVE Si Oxtttrcy4o Ad HVEH S1 Ox0000 Ad HVEH S2 Ox0000 B3 SUB L1 A4 A10 A0 Bol printf AO BH15 3 You can also use the mouse to mark a function in C code To do so follow these steps 1 In the File window click next to the statement that declares the function that you want to mark 2 When you see the mouse icon click again to mark and enable the C func tion A green arrow appears indicating that the function is marked FO Note In Profile mode if you try to mark a line or function by double clicking next to the statement that you want to mark the debugger sets a software breakpoint instead of marking the line or function To mark a function click o
94. OOcUrttt OOOIOO00 RAM List of defined 2 OOSUS000 OUSOSOUr OOOU00IO RAM memory ranges oogst 0OSOJFFI OOOU0S00 RAM OOSU8020 00S0SAHF OOOU0400 FAM S OOO00000 OODDETE OOOTOU00 RAM Edit entry Start Length Attribute ox000000 ox00007 4 RAM lt Clear Fields _ amw Disable mapping OF Cancel Help Enter the starting address of a memory range Select a memory type to identify the read write characteristics of the Enter the length of the memory range NOY range Adding a range of memory To add a range of memory follow these steps 1 From the Memory menu select Mapping This displays the Memory Map Control dialog box 2 In the Start field enter the starting address for a memory range This parameter can be an absolute address any C expression the name of a C function or an assembly language label If you want to specify a hex ad dress be sure to prefix the address number with 0x otherwise the debug ger treats the number as a decimal address 3 Inthe Length field enter the length of the memory range The length can be any C expression Defining a Memory Map 4 3 Creating or Modifying the Memory Map In the Attribute field select a memory type to identify the read write char acteristics of the memory range Click Apply Click OK The following restrictions apply to identifying usable memory ranges E A new memory range cannot overlap an existing entry If you define a range th
95. S command 12 17 CNEXT command _ 6 10 12 18 code debugging 1 13 debugging optimized code 2l preparing for debugging al profiling ened profiling optimized code 2 2 code development 1 7 to 1 9 code display windows definition description Disassembly window _ 1 4 EE L E m E File window Ae dors COFF in code development loading comma operator 13 4 command history PDM version 11 13 to 11 14 12 12 command line changing the prompt 12 40 definition Command window definition description display area clearing 112 17 Index 4 display during profiling 8 27 ee information from the display area 3 12 2 to l 13 12 20 Command window TA commands alphabetical summary 12 11 to 12 61 available during profiling available with analysis module hoia available with memory system ana em 9 10 breakpoint commands summary code execution ie Sole tras su command strings a 24 Ht E conditional commands 11 10 10 12 26 to controlling el execution conditional commands 11 10 to 11 14 12 26 to 12 61 looping commands 11 11 to 11 22 12 28 to customizing tols 4 1 0 124 11 15 tof11 16 data management commands summary entering and using B 1 to entering from a batch file entering operating system commands file display commands 12 4 functional summary debugger 12 2 to help online access load commands summary looping commands _ 3 9 to 3 10 11 11 to 11 22 memory commands s
96. TMS320C6x C Source Debugger User s Guide Literature Number SPRU188D January 1998 v3 j PRINTED WITH TEXAS D SOYINK INSTRUM ENTS Printed on Recycled Paper gt IMPORTANT NOTICE Texas Instruments Tl reserves the right to make changes to its products or to discontinue any semiconductor product or service without notice and advises its customers to obtain the latest version of relevant information to verify before placing orders that the information being relied on is Current Tl warrants performance of its semiconductor products and related software to the specifications applicable at the time of sale in accordance with Tl s standard warranty Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty Specific testing of all parameters of each device is not necessarily performed except those mandated by government requirements Certain applications using semiconductor products may involve potential risks of death personal injury or severe property or environmental damage Critical Applications TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED INTENDED AUTHORIZED OR WARRANTED TO BE SUITABLE FOR USE IN LIFE SUPPORT APPLICATIONS DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS Inclusion of TI products in such applications is understood to be fully at the risk of the customer Use of TI products in such applications requires the written approval of an appropriate
97. The Memory Map What It ls and Why You Must Define It 4 2 Creating or Modifying the Memory Map 4 3 Enabling Memory Mapping 4 4 A Sample Memory Map 4 5 Defining and Executing a Memory Map in a Batch File 4 6 Returning to the Original Memory Map 4 7 Using Multiple Memory Maps for Multiple Target Systems 4 8 Simulating I O Space Simulator Only 4 9 Simulating External Interrupts Simulator Only 4 4 The Memory Map What It Is and Why You Must Define It 4 1 The Memory Map What It ls and Why You Must Define It A memory map tells the debugger which areas of memory it can and cannot access Memory maps vary depending on the application Typically the map matches the MEMORY definition in your linker command file Note When the debugger compares memory accesses against the memory map it performs this checking in software not hardware The debugger cannot prevent your program from attempting to access nonexistent memory A special default initialization batch file included with the debugger package defines a memory map for your version of the debugger This memory map may be sufficient when you first begin using the debugger However the de bugger enables you to modify the default memory map or define a new memory map interactively as described in section 4 2 on page 4 3 or by defining the memory map in a batch file see section 4 5 on page 4 10 Potential memory map problems 4 2 You may experience these problems
98. The specification of variables and functions can be qualified with context information Local variables including local statics can be referenced with the expression form function name local name Using Expression Analysis in the Debugger This expression format is useful for examining the automatic variables of a function that is not currently being executed Unless the variable is static however the function must be somewhere in the current call stack If you want to see local variables from the currently executing function you need not use this form you can simply specify the variable name just as in your C source File scoped variables such as statics or functions can be referenced with the following expression form filename function name or filename variable name This expression format is useful for accessing a file scoped static variable or function that may share its name with variables in other files In this expression form filename does not include the file extension the debugger searches the object symbol table for any source filename that matches the input name disregarding any extension Thus if the variable ABC is in file sSource c you can specify it as source ABC These expression forms can be combined into an expression of the form filename function name variable name Any integral or void expression can be treated as a pointer and used with the indirection operator Here are several examples of
99. UTPORT or P W Input output port IOPORT or P R W You can use the INPORT OUTPORT and IOPORT type parameters in conjunction with the MC command to simulate I O ports Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description mc Enable Disable Memory Mapping map on off Memory Mapping none basic debugger PDM profiling The MAP command enables or disables memory mapping Disabling memory mapping can cause bus fault problems in the target because the debugger may attempt to access nonexistent memory When you disable memory mapping with the simulator you can still access memory locations However the debugger does not prevent you from acces sing memory locations that you have not defined as valid in the memory map Connect Simulated I O Port to a File Simulator Only mc port address length filename none none basic debugger E PDM profiling The MC command connects to an input or output file Before you can connect the port you must add it to the memory map with the MA command The port address parameter defines the address This parameter can be an absolute address any C expression the name of a C function or an assembly language label The address must be the starting address of a block J The length parameter defines the length of the range This parameter can be any C expression _j The filename parameter c
100. XCNT external counter value The XCNT register holds the 32 bit value of the internal counter AST analysis status The AST register records the occurrence of enabled events Set the bit to 1 to enable or to 0 to disable The status bits are defined as follows Bit Number Definition 0 Program address breakpoint 1 EMUO driven low breakpoint 2 EMU1 driven low breakpoint Run commands do not interfere with the status bits because the status bits are cleared before command execution 10 14 Chapter 11 Using the Parallel Debug Manager The TMS320C6x emulation system is a true multiprocessing debugging system It allows you to debug your entire application by using the parallel debug manager PDM The PDM is a command shell that controls and coordi nates multiple debuggers This chapter describes the functions that you can perform with the PDM See Chapter 2 Getting Started With the Debugger for information about invoking the PDM and debuggers Topic Page 11 1 Identifying Processors and Groups 11 2 Sending Debugger Commands to One or More Debuggers 11 3 Running and Halting Code 11 4 Entering PDM Commands 11 5 Defining Your Own Command Strings 11 6 Entering Operating System Commands 11 7 Understanding the PDM s Expression Analysis 11 8 Using System Variables 11 9 Evaluating Expressions Identifying Processors and Groups 11 1 Identifying Processors and Groups You can send commands to an individual process
101. _http www ti com sc docs pic home htm DSP Solutions http www ti com dsps 320 Hotline On line http www ti com sc docs dsps support htm North America South America Central America Product Information Center PIC 972 644 5580 TI Literature Response Center U S A 800 477 8924 Software Registration Upgrades 214 638 0333 Fax 214 638 7742 U S A Factory Repair Hardware Upgrades 281 274 2285 U S Technical Training Organization 972 644 5580 DSP Hotline 281 274 2320 Fax 281 274 2324 Email dsph ti com DSP Modem BBS 281 274 2323 DSP Internet BBS via anonymous ftp to ftp ftp ti com pub tms320bbs Europe Middle East Africa European Product Information Center EPIC Hotlines Multi Language Support 33 1 30 70 11 69 83 1 30 70 10 32 Email epic ti com Deutsch 49 8161 80 33 11 or 33 1 30 70 11 68 English 33 1 30 70 11 65 Francais 33 1 30 70 11 64 ltaliano 33 1 30 70 11 67 EPIC Modem BBS 33 1 30 70 11 99 European Factory Repair 33 4 93 22 25 40 Europe Customer Training Helpline 49 81 61 80 40 10 Asia Pacific Literature Response Center 852 2956 7288 Fax 852 2 956 2200 Hong Kong DSP Hotline 852 2956 7268 Fax 852 2 956 1002 Korea DSP Hotline 82 25512804 Fax 822 551 2828 Korea DSP Modem BBS 82 2 551 2914 Singapore DSP Hotline Fax 65 390 7179 Taiwan DSP Hotline 886 2 377 1450 Fax 886 2 377 2718 Taiwan DSP Modem BBS 886 2 376 2592 Taiwan DSP Internet BBS via anonymous ftp to ftp dsp ee
102. a breakpoint double click next to the statement in the Disassembly or File window where you want the breakpoint to occur You can also set a breakpoint using the Breakpoint Control dialog box 1 Open the Breakpoint Control dialog box by using one of these methods _j Click the Breakpoint Dialog icon on the toolbar zo _j From the Setup menu select Breakpoints 2 Inthe Address field of the Breakpoint Control dialog box enter an absolute address any C expression the name of a C function or an assembly language label 3 Click Add The new breakpoint appears in the breakpoint list 4 Click Close to close the Breakpoint Control dialog box Profiling Code Execution 8 15 Defining a Stopping Point Clearing a software breakpoint 8 16 To clear a breakpoint double click the breakpoint symbol in the File or Disassembly window You can also clear a breakpoint by using the Breakpoint Control dialog box 1 Open the Breakpoint Control dialog box by using one of these methods _j Click the Breakpoint Dialog icon on the toolbar z0 From the Setup menu select Breakpoints 2 Select the address of the breakpoint that you want to clear 3 Click Delete The breakpoint is removed from the breakpoint list 4 Click Close to close the Breakpoint Control dialog box Running a Profiling Session 8 6 Running a Profiling Session Once you have defined profile areas and a stopping point you can run a profil ing
103. able to the result of an expression The substitute command is similar to the SET command You can use the command to assign the result of an expression to a variable The syntax for the command is variable name expression The following series of commands illustrates the differences between the command and the SET command Assume that mask1 equals 36 and mask2 equals 47 set mask3 mask1 Smask2 Set mask3 to the contents of mask1 plus the contents of mask2 echo mask3 Show the contents of mask3 36447 Q mask3 mask1 Smask2 Set mask3 to the result of the expression mask1 mask2 echo mask3 Show the contents of masks 83 Notice the difference between the two commands The SET command lets you create system variables that you can use with PDM commands The com mand evaluates the expression and assigns the result to the variable name The command is useful in setting loop counters For example you can ini tialize a counter with the following command j 0 Inside the loop you can increment the counter with the following statement j j 1 Changing the PDM prompt The PDM recognizes a system variable called prompt You can change the PDM prompt by setting the prompt variable to a string For example to change the PDM prompt to 3PROCs enter set prompt 3PROCs After entering this command the PDM prompt will look like this 3PROCs x gt gt Using the Parallel Debug Manager 11 19 Using Sys
104. akpoints FE adding 16 7411 ne a fr RUNE EAE clearing 6 17 1 command a definition description 6 14 to 6 19 listing set breakpoints 6 15 12 loading breakpoint settings maximum number 6 15 multiple or single statement 6 15 restrictions 6 15 saving breakpoint Fo 6 18 setting 6 15 to 6 16 setting profile cant F ints 8 15 to 8 16 with conditional run Breakpoints toolbar icon clearing a breakpoint 6 17 clearing all software breakpoints 17 loading breakpoint settings saving breakpoint settings setting a breakpoint 6 15 2 10 Oss section clearing c ASCII character display format C ASCII ma format aa C compiler 1 8 c debugger a ae C expressions to 7 6 13 1 1 to 13 6 C optimizer a C source displaying managing memory data c6xtools directory for HPUX systems 2 3 for SPARC systems for Windows 95 systems 2 3 CALLS command effect on debugging modes 2 17 Calls window definition description displaying code for a function casting definition description Je Index 3 Index Change View context menu option 8 23 char data type CHDIR CD command 12 17 cl6x shell definition clearing software breakpoints debugger only 6 17 profiler only clearing the bss section c 2 10 clearing the display area 12 17 clicking definition CLK pseudoregister description restrictions in C code validity of value in closing Watch mindy 7 20 12 61 CL
105. all fields gt Quick no exclusive fields To clear out previously l collected profile data Display Rate 4 or 1 1 POr boroan select Clear data Often Hever Start Point Click this arrow to choose Cancel Help from a list of starting points In the Run Method box select Resume lf you want to clear out the previously collected data select Clear data in the Run Method box Slide the Display Rate scale to specify how often the display is updated You can choose a Display Rate from Often to Never A Display Rate of Never causes the profiler to display profiling information only when the profiling session is complete In the Start Point field enter the starting point for the profiling session The starting point can be a label a function name ora memory address If you specify a memory address be sure to prefix the address with Ox You can choose from a list of starting points by clicking on the arrow at the end of the Start Point field Click OK Profiling Code Execution 8 19 Viewing Profile Data 8 7 Viewing Profile Data The statistics collected during a profiling session are displayed in the Profile window Figure 8 1 shows an example of this window Figure 8 1 An Example of the Profile Window Pin Profile Count Inclusive Incl Max Exclusive Fzucl Maxz C Function C Function C Function C Function ST ___ __ Profile areas Profile data The example
106. alting on that event The syntax for the event_disable command is event_disable event_number Or use the predefined alias ed event_number To disable analysis through the debugger interface from the Analysis menu deselect Enable Analysis To disable a particular event through the debugger interface follow the steps for removing a defined event on page 9 7 event_break set breakpoint on specified event The event_break command instructs the processor to halt whenever it en counters the specified event The syntax for the event_break command is event_break event_number Or use the predefined alias eb event_number To seta breakpoint on a particular event through the debugger interface follow the steps for defining an event as a break event on page 9 7 event_counter_start count each occurrence of specified event The event_counter_start command instructs the processor to count each oc currence of the specified event The syntax for the event_counter_start com mand is event_counter_start event_number Or use the predefined alias ecs event number To count the occurrences of a particular event through the debugger interface follow the steps for defining an event as a count event on page 9 6 Using Simulator Memory System Analysis 9 11 Summary of Memory System Analysis Commands event_counter_reset reset counter for specified event If used without a parameter the event_counter_reset command resets all even
107. aluates to false 0 the loop is not entered The optional BREAK command allows you to exit the loop without having to reach the ENDLOOP This is helpful when you are testing a group of proces sors and want to exit if an error is detected The CONTINUE command which is also optional acts as a goto and returns command flow to the enclosing LOOP command CONTINUE is useful when the part of the loop that follows is complicated returning to the top of the loop avoids further nesting The LOOP BREAK CONTINUE ENDLOOP commands can be entered inter actively or included in a batch file that is executed by the TAKE command When you enter LOOP from the PDM command line a question mark 7 prompts you for the next entry The PDM continues to prompt you for input using the until you enter ENDLOOP After you enter ENDLOOP the PDM immediately executes the LOOP command If you are in the middle of interactively entering an LOOP statement and want to abort it type Loop Through Debugger Commands Batch File Only loop expression debugger commands endloop none none basic debugger E PDM profiling The LOOP ENDLOOP commands allow you to set up a looping situation in a batch file These looping commands evaluate in the same method as in the run conditional command expression _j Ifyou use an expression that is not Boolean the debugger evaluates the expression as a loop count _j Ifyou use a Boolean expression the debugger executes
108. alysis commands simulator only 12 10 Most of the memory system analysis commands can be entered from the anal ysis menu and dialog box However you might want to create a batch file that sets up your most frequently used analysis settings when the debugger is in voked Listed below are the memory system analysis commands that are available for you to enter either on the command line or in a batch file To do this cian Seeks Enable memory system analysis ee Disable memory system analysis or a specified event ed Configure an event as a break event eb Configure an event as a count event ecs Reset the counters for all events or for a specified event ecr List the configuration for a specified event or all events el in the Command window P o_o nN Disable all events and remove any event configurations er that are set 12 2 Alphabetical Summary of Debugger and PDM Commands Syntax Menu selection Toolbar selection Environments Description There are three types of debugger commands _j Basic debugger commands _j Parallel Debug Manager PDM commands that allow you to control multiple debuggers _j Profiler commands that allow you to control the debugger profiling environment Most of the commands can be used in the basic debugger environment and or the profiling environment Other commands can be used only by the parallel debug manager PDM Some commands can be used in more than one envi ronment other command
109. am executes C code assembly code or serial assembly code as sembled with the g assembler option Automatically for the default Memory window only With the MEM command and a unique window name for addi tional Memory windows By entering the profiling environment Profile Profile Mode E E With the Setup gt Watch Variable menu option With the WA and DISP com mands Mode _ Auto __ Mixed All All All _ Auto Mixed All Mixed All About the C Source Debugger Interface All of the windows have context menus that allow you to display or hide information in a window and control how a window is displayed To display a context menu follow these steps 1 Move your pointer over a debugger window 2 Click the right mouse button This displays a context menu like the follow ing example FA Calls e Allow Docking Hide maini Context menu Float In Main Window Each context menu option that is currently selected has a check mark pre ceding it and those that are unselected do not Clicking an option toggles be tween selected and unselected Developing Code for the TMS320C6x 1 3 Developing Code for the TMS320C6x The C6x is well supported by a complete set of hardware and software devel opment tools including a C compiler an assembly optimizer an assembler and a linker Figure 1 2 illustrates the basic C6x code development flow Figure 1 2 TMS320C6
110. an be any filename If you connect a port to read from a file the file must exist or the MC command will fail Summary of Commands 12 31 md Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 32 Delete Block From Memory Map md address Memory Mapping none basic debugger PDM profiling The MD command deletes a range of memory from the debugger s memory map The address parameter identifies the starting address of the range of memory If you supply an address that is not the starting address of a range the debugger displays this error message in the display area of the Command window Specified map not found Note If you want to use the MD command to remove a simulated I O port you must first disconnect the port with the MI command Modify Memory Window Display mem expression display format window name none none basic debugger L PDM The MEM command identifies a new starting address for the block of memory displayed in the Memory window The optional window name parameter opens an additional Memory window allowing you to view a separate block of memory The debugger displays the contents of memory at expression in the first data position in the Memory window The end of the range is defined by the size of the window The expression can be an absolute address a symbolic address or any C ex
111. an example of a debugger device type TMS320C6x describes the C6x m SPL specifies the scan path linker and must be followed by four sub paths as in this syntax device name SPL subpath0 subpath1 subpath2 subpath3 Each subpath can contain any number of devices However an SPL subpath cannot contain another SPL A subpath that contains no de vices must still be listed Describing Your Target System to the Debugger B 3 Step 1 Create the Board Configuration Text File Example B 2 A board cfg File Containing an SPL B 4 Example B 2 shows a file that contains an SPL Device Name mayen aon CPU_A 7 AUB pq por OPO B cq noon RUC mp por OPO Dr CPU R Device Type BYPASS08 BYPASSO8 TMS320C6x SPL BYPASSO8 BYPASSO8 IMS320C6x BYPASSO8 BYPASSO8 TMS320C6x BYPASSO8 BYPASSO8 IMS320C6x TMS 320C6x Comments the first device nearest TDO the first Cox the scan path linker the first subpath the second C 6x the second subpath the third C6x the third subpath contains noth ing the fourth subpath the fourth C 6x the last C6x nearest TDI Note The indentation in the file is for readability only Step 2 Translate the Configuration File to a Debugger Readable Format B 2 Step 2 Translate the Configuration File to a Debugger Readable Format After you have created the board cfg fi
112. an expression whose value changes over time constant expressions serve no useful function in the watch window The abel parameter is optional When used it provides a label for the watched entry If you do not use a abel the debugger displays the expression in the label field When you use the optional display format parameter data is displayed in one of the following formats Parameter Result is displayed in Parameter Result is displayed in i Default for the data type O Octal C ASCII character bytes p Valid address d Decimal S ASCII string e Exponential floating point u Unsigned decimal f Decimal floating point X Hexadecimal If you want to use a display format parameter without a label parameter be sure to include an extra comma For example wa PC o You can open additional Watch windows by using the window name parame ter When you open an additional Watch window the debugger appends the window name to the Watch window label You can create as many Watch windows as you need If you omit the window name parameter the debugger displays the expression in the default Watch window labeled Watch Delete Item From Watch Window wd expression window name Setup Watch Variable none basic debugger E PDM E profiling The WD command deletes a specific item from the Watch window The WD command s expression parameter must correspond to one of the variable names listed in the Watch window The optional windo
113. an force the debugger to show C source by opening a C file or by entering the FUNC or ADDR command _j In auto and mixed modes the debugger automatically opens a File window if you are currently running C code Displaying the contents of a text file To display the contents of any text file follow these steps 1 Use one of these methods to open the Open File dialog box _j Click the Open icon on the toolbar J From the File menu select Open This displays the Open File dialog box You can change the directory that you want to search EJ srcfiles Look irr Select from a list of files File name se Cancel Files of type Source Files c am hl Select the type of file you want to open 5 6 Displaying C Code 2 Select the file that you want to open To do so you might need to do one or more of the following actions J Change the working directory _J Select the type of file that you want to open for example c h 3 Click Open The debugger opens a File window that contains the file that you selected Al though this command is most useful for viewing C code you can use the Open File dialog box for displaying any text file You might for example want to ex amine system files such as autoexec bat or an initialization batch file You can also view your original assembly language source files in the File window if you assemble your code with the g assembler option Fo
114. ands or the debugger s overwrite editing capability to modify the contents of any value displayed in the Watch window For more information see section 7 4 Basic Methods for Changing Data Values on page 7 5 Managing Data in a Watch Window Displaying data in a Watch window To display a value in the Watch window follow these steps 1 Fromthe Setup menu select Watch Variable This displays the Watch Add dialog box Watch Add Ei Enter the item that Value you want to watch Expression fe SI Select a global Global variables variable to watch Local variables Select a local variable to watch Static variables Select a static Registers variable to watch Select a register to watch Select a data format for the watched item optional TT tana Hexadecim Assign a label forthe watched item optional Label Control Status Register Wind l o Enter a name to open SAA aes a new Watch window optional OK a flac Help 2 Inthe Expression field enter the item that you want to watch The expres sion can be any C expression including an expression that has side ef fects Or you can select a global variable local variable static variable or register to watch If you want to use the contents of an address as a parameter be sure to prefix the address with the C indirection operator For example you could enter this value in the Expression field 0x26 3 If
115. apped port reads or writes to the associated file Disconnecting an I O port Before you can delete an I O port from the memory map you must use the MI command to disconnect the address To disconnect a port from an input or out put file follow these steps 1 Inthe commandline enter mi This displays the Disconnecting port dialog box Disconnect port from file x Fort Address Read rite Cancel Help 2 In the Port Address field enter I O port memory address that is to be closed 3 In the Read Write field enter the characteristic used when the port was connected 4 Click OK Defining a Memory Map 4 15 Simulating External Interrupts Simulator Only 4 9 Simulating External Interrupts Simulator Only Note Simulating external interrupts is not supported by the fast version of the fixed point simulator or the floating point version of the simulator The C6x allows you to simulate interrupts using the pin connect to file com mand PINC You can use any of the pins NMI INT4 INT5 INT6 and INT7 acca Note The time interval is expressed as a function of CPU clock cycles Simulation begins at the first clock cycle ee Setting up your input file 4 16 To simulate interrupts you must first set up an input file that lists interrupt inter vals Your file must contain a clock cycle in the following format _J The clock cycle parameter represents the CPU clock cycle where you
116. at overlaps an existing range the debugger ignores the new range Be sure that the map ranges that you specify in a COFF file match those that you define with the Memory Map Control dialog box The origin and length values for a range that you define with the MEMORY directive in your linker command file must match the Start and Length val ues for the same range in the Memory Map Control dialog box The debugger caches memory that is not defined as a port type INPORT OUTPORT or IOPORT For ranges that you do not want cached be sure to map them as ports Creating a customized memory type 4 4 The Attribute drop list in the Memory Map Control dialog box allows you to se lect from several predefined memory types such as RAM or ROM If the prede fined memory types do not apply to your memory range you can create a cus tomized memory type To create a customized memory type 1 2 From the Memory menu select Mapping This displays the Memory Map Control dialog box In the Start field enter the starting address for the memory range you want to customize This parameter can be an absolute address any C expres sion the name of a C function or an assembly language label If you want to specify a hex address be sure to prefix the address number with Ox otherwise the debugger treats the number as a decimal address In the Length field enter the length of the memory range The length can be any C expression 4 L
117. at you want to modify and press 9 2 Type the new information If you make a mistake or change your mind press this resets the field to its original value 3 When you finish typing the new information press or click on another data value This replaces the original value with the new value Editing data using expressions that have side effects Using the overwrite editing feature to modify data is straightforward However data management methods take advantage of the fact that C expressions are accepted as parameters by most debugger commands and that C expressions can have side effects When an expression has a side effect the value of some variable in the expression changes as the result of evaluating the expression Side affects allow you to coerce many commands into changing values for you Specifically it is most helpful to use and EVAL to change data as well as display it For example if you want to see what is in register A3 you can enter A3 A3 Side effect increments the contents of A3 by 1 eval A3 Side effect decrements the contents of A3 by 1 A3 8 Side effect sets A3 to 8 eval A3 2 Side effect divides contents of A3 by 2 Managing Data 7 5 Basic Methods for Changing Data Values 7 6 Not all expressions have side effects For example if you enter A3 4 the debugger displays the result of adding 4 to the contents of A3 but does not modify A3 s contents Expressions that have side eff
118. ata Values on page 7 5 Changing the memory range displayed in a Memory window To change the memory range displayed in a Memory window enter a new starting address in the Address field of the Memory window as shown in Figure 7 1 If you want to specify a hex address be sure to prefix the address number with Ox otherwise the debugger treats the number as a decimal ad dress You can also change the display of any data display window including the Memory window by scrolling through the window s contents In the Memory window the scroll bar handle is displayed in the middle of the scroll bar see Figure 7 1 The middle of memory contents is defined as the most recent starting address that you entered in the Address field of the Memory window or with the MEM command described on page 12 32 You can scroll up or down to see 1K bytes of memory on either side of the current starting address Managing Data 7 7 Managing Data in Memory Opening an additional Memory window 7 8 To open an additional Memory window use the MEM command The syntax for this command is mem expression display format window name The expression represents the address of the first entry in the Memory window The end of the range is defined by the size of the window to show more memory locations make the window larger to show fewer locations make the window smaller The expression can be an absolute address a symbolic address or
119. ave created a group you can add processors to it by using the SET command and preceding the existing group name with a dollar sign in the list of processors You can also use a group as part of another group by preceding the existing group s name with adollar sign The dollar sign tells the PDM to use the processors listed previously in the group as part of the new list of processors _j List all groups of processors You can use the SET command without any parameters to list all the processors that belong to a group in the order in which they were added to the group You can also use the SET command with system defined variables to _j Change the prompt for the PDM To change the PDM prompt use the SET command with the system variable called prompt For example to change the PDM prompt to 3PROCs enter set prompt 3PROCs J Check the execution status of the processors In addition to displaying the execution status of a processor or group of processors the STAT command described on page 12 53 sets a system variable called status If all of the processors in the specified group are running the status vari able is set to 1 If one or more of the processors in the group is halted the status variable is set to 0 You can use this variable when you want an instruction loop to execute until a processor halts the LOOP ENDLOOP command is described on page 12 29 _j Create your own system variables You can use the SET comman
120. blems as an IF without an ENDIF a LOOP without an ENDLOOP or a BREAK that does not appear between a LOOP and an ENDLOOP Edit the batch file that contains the problem flow command or interactively reenter the correct command Input buffer overflow Description Action The PDM is trying to execute or manipulate an alias or shell variable that has been recursively defined Use the SET and or ALIAS commands to check the defini tions of your aliases and system variables Modify them as necessary Alphabetical Summary of PDM Messages Invalid command Description The command that you entered was not valid Action Refer to the command summary in Chapter 12 Summary of Commands and Special Keys for a complete list of com mands and their syntax Invalid expression Description The expression that you used with a flow control command or the command is invalid You may see specific messages before this one that provide more information about the prob lem with the expression The most common problem is the failure to use the character when evaluating the contents of a system variable Action Check the expression that you used Refer to section 11 7 Understanding the PDM s Expression Analysis page 11 17 for more information about expression analysis Invalid shell variable name Description The system variable name that you used the SET command to assign is invalid Variable names can contain any alphanu meric chara
121. br Use this command fill fill ma map mc md ms pinc pind pinl TW 9 D Q Oo D h N i o ho O1 ak ho ae oO h N Si O O ee h T NO N h Da NO N ook i W O o_o ie oo o_o 1 Oo h A P P r i 0 Aj 10 IN h Da oo D _ te oo on as py oo o_o pe oo oo ooh N w O page 12 7 Functional Summary of Debugger Commands Running programs 12 8 To do this Single step through assembly language or C code one C statement at a time step over function calls Single step through assembly language or C code one C statement at a time Run a program up to a certain point Halt the target system Single step through assembly language or C code step over function calls Reset the target system Reset the program to its entry point Execute code in a function and return to the func tion s caller Run a program Run a program with benchmarking count the number of CPU clock cycles consumed by the ex ecuting portion of code Disconnect the emulator from the target system and run free Single step through assembly language or C code Execute commands from a batch file Use this command cnext cstep go halt next reset restart return run runb runt step take D P Q Oo g gt k Dw ar es ok eek a mM
122. breakpoint from a C statement the breakpoint is also cleared from the associated statement in the disassembly To clear a breakpoint click the breakpoint symbol in the File or Disassem bly window Another way to clear a breakpoint is to use the context menu for the File or Dis assembly window 1 Select the line in the File or Disassembly window from which you want to remove the breakpoint 2 From the context menu for the window select Toggle Breakpoint You can also clear a breakpoint by using the Breakpoint Control dialog box see the illustration on page 6 16 1 Open the Breakpoint Control dialog box by using one of these methods _j Click the Breakpoint Dialog icon on the toolbar zo _J From the Setup menu select Breakpoints 2 Select the address of the breakpoint that you want to clear 3 Click Delete The breakpoint is removed from the breakpoint list 4 Click Close to close the Breakpoint Control dialog box Clearing all software breakpoints To clear all software breakpoints follow these steps 1 Open the Breakpoint Control dialog box by using one of these methods _j Click the Breakpoint Dialog icon on the toolbar From the Setup menu select Breakpoints 2 Click Delete All 3 Click Close to close the Breakpoint Control dialog box Running Code 6 17 Using Software Breakpoints Saving breakpoint settings Software breakpoint settings are lost when you exit the debugger However you
123. c command for running an entire program You enter the command from the PDM command line to begin execution at the same real time for an individual processor or a group of processors The g option identifies the group or processor that the command should be sent to If you do not use this option then code runs on the default group dgroup You can use the PHALT command to stop a global run a basic debugger The r return option for the PRUN command determines when control returns to the PDM command line J Without r control is not returned to the command line until each debugger in the group finishes running code If you want to to break out of asynchronous command and regain control of the PDM commandline press in the PDM window This returns control to the PDM command line However no debugger executing the command is inter rupted J With r control is returned to the command line immediately even if a debugger is still executing acommand You can type new commands but the processors cannot execute the commands until they finish with the current command however you can perform PHALT PESC and STAT commands when the processors are still executing Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description pstep Run Free in Parallel prunf g group processor name none none PDM The PRUNF command starts the pro
124. can save the list of breakpoints that you have set by following these steps 1 Open the Breakpoint Control dialog box by using one of these methods _j Click the Breakpoint Dialog icon on the toolbar From the Setup menu select Breakpoints 2 Click Save List This displays the Save Breakpoint File dialog box Savein E source 4 Ed oe EEE Cancel Enter a name for the breakpoint file Use a bpt extension Save as type Breakpaint Files bpt 3 Select the directory where you want the file to be saved 4 Inthe File name field enter a name for the breakpoint file You can use a bpt extension to identify the file as a breakpoint file 5 Click Save 6 Inthe Breakpoint Control dialog box click Close TT Notes 1 The breakpoint file is editable 2 Youcan execute the breakpoint file with the TAKE command to automati cally set up the breakpoints that are defined in the file 3 You can include the breakpoint file in your initialization batch file eee eee eee ee 6 18 Using Software Breakpoints Loading saved breakpoint settings To load a list of saved breakpoints follow these steps 1 Open the Breakpoint Control dialog box by using one of these methods _j Click the Breakpoint Dialog icon on the toolbar ES _j From the Setup menu select Breakpoints 2 Click Load List This displays the Load Breakpoint File dialog box Lookin E source el EE E testse
125. ce of debugger commands ten times you would use the following code se quence loop 10 Step endloop The debugger treats the 10 as a counter and executes the debugger com mands ten times If you use a Boolean expression the debugger executes the commands re peatedly as long as the expression is true This type of expression uses one of the following operators as the highest precedence operator in the expres sion gt gt lt lt amp amp For example if you want to trace some register values continuously you can set up a looping expression like this one Looe 20 Step PG AO endloop The LOOP ENDLOOP command works with the following conditions You can use conditional and looping commands only in a batch file _j You must enter each debugger command on a separate line in the batch file _J You cannot nest conditional and looping commands within the same batch file See Controlling PDM command execution page 11 10 for more information about the PDM versions of the IF and LOOP commands Creating and Executing a Batch File Pausing the execution of a batch file You can pause the debugger or PDM while running a batch file or executing a flow control command Pausing is especially helpful in debugging the commands in a batch file To do so include the PAUSE command in the batch file pause When the debugger or PDM reads this command in a batch file or during a flow control command
126. cessors running free which means they are disconnected from the emulator RUNF synchronizes the debuggers to cause the processors to begin execution at the same real time The g option identifies the group or processor that the command should be sent to If you do not use this option then code runs on the default group dgroup T basic debugger profiling The PHALT command stops a PRUNF note that the debugger automatically executes a PHALT when the debugger is invoked Single Step in Parallel pstep g group processor name count none none z basic debugger PDM E profiling The PSTEP command single steps synchronously through assembly language code with interrupts disabled RUNF synchronizes the debuggers to cause the processors to begin execution at the same real time The g option identifies the group or processor that the command should be sent to If you do not use this option then code runs on the default group dgroup You can use the PHALT command to stop a global run You can use the count parameter to specify the number of statements that you want to single step ooe Note If the current statement that a processor is pointing to has a breakpoint that processor will not step synchronously with the other processors when you use the PSTEP command However that processor will still single step sss SS Summary of Commands 12 41 quit Syntax Menu selection Toolbar selection Environments Des
127. ches Hardware switches on the emulator that identify the PC I O memory space used for emulator debugger or EVM debugger commu nications ISA ndustry Standard Architecture A subset of the EISA standard little endian An addressing protocol in which bytes are numbered from right to left within a word More significant bytes in a word have higher num bered addresses Endian ordering is hardware specific and is deter mined at reset See also big endian memory map A map of memory space that tells the debugger which areas of memory can and cannot be accessed Memory window A window that displays the contents of memory menu bar A row of pulldown menu selections found at the top of the debug ger display mixed mode A debugging mode that simultaneously shows both assembly language code in the Disassembly window and C code in the File window open collector output An output circuit that actively drives both high and low logic levels PC Personal computer or program counter depending on the context and where it is used in this book 1 In installation instructions or information relating to hardware and boards PC means personal computer 2 In general debugger and program related information PC means program counter which is the register that identifies the current statement in your program Glossary PDM Parallel Debug Manager A program used for creating and controlling multiple debuggers for the purpose of debugging
128. cles Interrupt contest switch clock cycles Pipeline stall clack cycles Branch taken Interrupts taken NOP W Enable analysis events Cancel Help Note Enabling the external counter in the Count CPU Events dialog box carries the following restrictions You can enable only one external counter when you have multiple pro cessors that are connected by their EMU0 1 pins in a system _J No other external devices can actively drive the EMUO pin The EMUO pin option is disabled in the Set Up Hardware Breakpoints dialog box Monitoring Hardware Functions With the Emulator Analysis Module 10 7 Defining the Conditions for Analysis Setting hardware breakpoints 10 8 You can set a hardware breakpoint which halts the processor on three types of events _1 A specified program address OJ EMUO detected low J EMU1 detected low You can select as many events as you want To specify an event or events on which to halt the processor follow these steps 1 From the Analysis menu select Hardware Breakpoints The Set Up Hardware Breakpoints dialog box appears Analysis Events Fi Count CPU Events Set Up Hardware Breakpoints External counter is in use EMUO pin ts unavailable Select hardware break event s M Enable breakpoint at program address mair W Break when EMU is driven low T Break when EMU is driven low Select tigger out pin s for hardware break events s TC EMO
129. counting off chip memory accesses and tracking data memory bank conflicts etc To do this you must open the Analysis Events dialog box delete any previously defined events that you do not want to monitor and define the new events you want to track Besides the Analysis menu you can use the Analysis Events dialog box to en able and disable analysis by selecting and deselecting the Enable analysis events check box For more information about the Analysis Events dialog box see section 9 4 on page 9 5 DC Note lt is not necessary to enable the analysis module each time you run your pro gram es Defining the Conditions for Analysis 9 4 Defining the Conditions for Analysis Memory system analysis detects system events according to the parameters you define for counting events or halting the processor To track a particular event you must define the conditions for analysis To do this select the events you want to track by enabling the appropriate conditions in the Analysis Events dialog box To bring up the Analysis Events dialog box select the Set Up Analysis Events option on the Analysis menu Figure 9 2 illustrates the Analysis Events dialog box Figure 9 2 Analysis Events Dialog Box Analysis Events x List of events you Delete selected defined to monitor event from list of N E Delete events to monitor Specifies whether events are defined as count or break events Off Chip Program blemon Access com Selec
130. cription Syntax Menu selection Toolbar selection Environments Description reload Syntax Menu selection Toolbar selection Environments Description 12 42 Exit Debugger quit File gt Exit none basic debugger PDM profiling The QUIT command exits the debugger and returns to the operating system If you enter this command from the PDM the PDM and all debuggers running under the PDM are exited Reset Communication With Emulator Emulator Only reconnect none none basic debugger PDM profiling The RECONNECT command reinitializes communication between the debugger and the emulator This command can be used after an unrecover able fatal error Any software breakpoints set before a reconnect may still reside in memory after the reconnect However the debugger does not recognize that the break points are set You should reload memory in order to clear out any residual breakpoints Reload Object Code reload object filename File gt Reload Program none basic debugger E PDM profiling The RELOAD command loads only an object file without loading its associated symbol table This is useful for reloading a program when target memory has been corrupted If you enter the RELOAD command without specifying a filename the debugger reloads the file that you loaded last Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments D
131. cription You attempted to connect a file for input operation to an address that is not configured for read Action Remap the port of correct the access in your source code Register access error Description Either the processor is receiving a bus fault or there are problems with target system memory Action See section C 5 Additional Instructions for Hardware Errors page C 26 Alphabetical Summary of Debugger Messages Specified map not found Description Action The MD command was entered with an address or block that is not in the memory map Use the ML command to verify the current memory map When using MD you can specify only the first address of a defined block Structure member name required Description Action This is an expression error a symbol name is followed by a period but no member name See section C 4 Additional Instructions for Expression Errors page C 26 Structure member not found Description Action This is an expression error an expression references a non existent structure member See section C 4 Additional Instructions for Expression Errors page C 26 Structure not allowed Description Action This is an expression error the expression is attempting an operation that cannot be performed on a structure See section C 4 Additional Instructions for Expression Errors page C 26 Take file stack too deep Description Action Batch files can be neste
132. cription You tried to disconnect the input file from a pin that was not previously connected to that pin Action Use the PINL command to list all of the pins and the files con nected to them Use the PIND command to reenter the correct pinname and filename Pinname not valid for this chip Description You attempted to connect or disconnect an input file to an invalid interrupt pin Action Reconnect or disconnect the input file to an unused interrupt pin Debugger Messages C 17 Alphabetical Summary of Debugger Messages Pointer not allowed Description This is an expression error Action See section C 4 Additional Instructions for Expression Errors page C 26 Processor is already running Description One of the RUN commands was entered while the debugger was running free from the target system Action Enter the HALT command to stop the free run then reenter the desired RUN command Read conflicts with long operand at cycle cnum Description Your program attempted to write more than one long result in a single cycle on each side of the register file Because the L and S units share their long read port with the store port op erations that read a long value cannot be issued on the L and or S units in the same execute packet as a store For more information about long path conflicts see the TMS320C62x C67x CPU and Instruction Set Reference Guide Action Modify your source code Read not allowed for port Des
133. cs window This chapter explains how to count various CPU events and set up breakpoints on events by using the Analysis menu and the Analysis Events dialog box SS Note Memory system analysis is not supported by the fast version of the fixed point simulator or by the floating point version of the simulator Topic Page Major Functions of Simulator Memory System Analysis Overview of the Analysis Process Enabling Memory System Analysis Defining the Conditions for Analysis R nNiINgYOUr Program tyres ee ee acre eres eee eee Viewing the Analysis Data Summary of Memory System Analysis Commands Entering Analysis Commands Through a Batch File 1 Major Functions of Simulator Memory System Analysis 9 1 Major Functions of Simulator Memory System Analysis The C6x memory system analysis functionality allows you to set breakpoints on or count any event that is supported by the simulator core These events are added to the Analysis Events dialog box by polling the simulator core to determine which events it can support The C6x memory system analysis interface allows you to set breakpoints on or count the following events which are supported by the C6x _ Program memory accesses _ _ Off chip program memory accesses _j Program cache hits L Off chip data memory accesses _ Program cache misses J Data memory bank conflicts J Memory stalls You can set breakpoints on or count multiple events Set up
134. ct file then it was probably corrupted recompile assemble and link with cl6x Invalid watch delete Description Action The debugger cannot delete the parameter supplied with the WD command Reenter the WD command Be sure to specify the symbol name that matches the item you want to delete Alphabetical Summary of Debugger Messages Invalid window position Description Action The debugger cannot move the window to the XY position specified with the MOVE command Either the XY parame ters are not within the screen limits or the active window may be too large to move to the desired position Reenter the MOVE command Enter the X and Y parameters in pixels Invalid window size Description Action Load aborted Description Action The width and length specified with the SIZE or MOVE com mand may be too large or too small If valid width and length were specified then the active window is already at the far right or bottom of the screen and so cannot be made larger Reenter the SIZE command Enter the width and length in pixels This message always follows another message Refer to the message that preceded Load aborted Lost power or cable disconnected Description Action Either the target cable is disconnected or the target system is faulty Check the target cable connections If the target seems to be connected correctly see section C 5 Additional Instructions for Hardware Errors
135. ct the field you want to dis play To do so follow these steps 1 Open the Profile View dialog box by using one of these methods _j From the Profile menu select Change View _j From the context menu for the Profile window select Change View This displays the Profile View dialog box 2 Inthe Display Field box select the data field that you want to display Display Field al fields id Incluse masiman Esclusive Exclusive maximum Address All fields 3 Click OK Sorting profile data Viewing Profile Data By default the data displayed in the Profile window is sorted according to the memory addresses of the displayed areas The area with the least significant address is listed first followed by the area with the next least significant address etc When you view fields individually the data is automatically sorted from highest cycle count to lowest instead of by address To sort the data on any of the data fields follow these steps 1 Open the Profile View dialog box by using one of these methods _j From the Profile menu select Change View _j From the context menu for the Profile window select Change View This displays the Profile View dialog box 2 Inthe Sort Field box select the data field that you want to sort on Sort Field Data Inclusive masimu Esclusive Escluswe masimum Address Data 3 Click OK For example to sort all the data on the ba
136. cters or underscore characters Action Use a different name Maximum loop depth exceeded Description The LOOP ENDLOOP command that you tried to execute had more than 10 nested LOOP ENDLOOP constructs LOOP ENDLOOP constructs can be nested up to 10 deep Action Edit the batch file that contains the LOOP ENDLOOP construct or reenter the LOOP ENDLOOP command inter actively Maximum take file depth exceeded Description The batch file that you tried to execute with the TAKE com mand called or nested more than 10 other batch files The TAKE command can handle batch files that are nested up to 10 deep Action Edit the batch file Debugger Messages C 25 Additional Instructions for Expression Errors Additional Instructions for Hardware Errors Unknown processor name name Description The processor name that you specified with the g option ora processor name within a group that you specified with the g option does not match any of the names of the debuggers that were spawned under the PDM Action Be sure that you ve correctly entered the processor name C 4 Additional Instructions for Expression Errors Whenever you receive an expression error you should reenter the command and edit the expression so that it follows the C language expression rules If necessary refer to a C language manual such as The C Programming Language by Brian W Kernighan and Dennis M Ritchie C 5 Additional Instructions for Hardware
137. ction Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 24 Fill Memory Word by Word fill address length data Memory gt Fill Word none basic debugger E PDM E profiling basic debugger L PDM profiling The FILL command fills a block of memory word by word with a specified value _j The address parameter identifies the first address in the block _j The ength parameter defines the number of words to fill J The data parameter is the value that is placed in each word in the block Fill Memory Byte by Byte fillb address length data Memory Fill Byte none basic debugger E PDM E profiling The FILLB command fills a block of memory byte by byte with a specified value The address parameter identifies the first address in the block OJ The length parameter defines the number of bytes to fill _j The data parameter is the value that is placed in each byte in the block Display Function func function name address none none basic debugger E PDM profiling The FUNC command displays a specified C function in the File window You can identify the function by its name or by an address in the function FUNC works the same way FILE works but with FUNC you do not need to identify the name of the file that contains the function Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Too
138. d In addition to setting global breakpoints you can set up the EMUO pin to take advantage of the emulator s external counter Each time the 10 bit in ternal counter overflows a signal is sent through the EMUO pin incre menting the 32 bit external counter Overview of the Analysis Process 10 2 Overview of the Analysis Process Completing an analysis session consists of four simple steps Step 1 Enable the analysis module See Enabling the Analysis Module page 10 4 Step 2 Identify the events you want to See Defining the Conditions for track Analysis page 10 5 Step 3 Run your program See Running Your Program page 10 10 Step 4 View the analysis data See Viewing the Analysis Data page 10 11 Monitoring Hardware Functions With the Emulator Analysis Module 10 3 Enabling the Analysis Module 10 3 Enabling the Analysis Module When the debugger comes up analysis is disabled by default To begin track ing system events you must explicitly enable analysis by selecting Enable Analysis on the Analysis menu When you select Enable Analysis a check mark appears next to the menu item indicating that analysis is enabled To dis able analysis select Enable Analysis Events again and the check mark disap pears indicating that analysis is disabled Figure 10 1 Enabling Disabling the Analysis Module EME window Help ENTE window Heb Enable Analysis Events Enable Analysis Events Set Up Analy
139. d pinname none basic debugger L PDM The PIND command disconnects an input file from an interrupt pin The pinname parameter identifies the interrupt pin and must be one of the external interrupt pins pins 4 7 E profiling List Pin pinl none basic debugger L PDM The PINL command displays all of the pins unconnected pins first followed by the connected pins For a connected pin the simulator displays the name of the pin and the absolute pathname of the file in the Command window _ profiling Profile Quick pq starting point update rate Profile Run ae C Pom profiling The PQ command initiates a RUN command and collects a subset of the avail able statistics on the defined areas between the starting point and the first stopping point encountered PQ is similar to PF except that PQ does not collect exclusive or exclusive max data a basic debugger The update rate parameter is the same as for the PF command Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description profile Resume Profiling Session pr clear data update rate Profile Run a C Pom profiling The PR command resumes the last profiling session initiated by PF or PQ starting from the current program counter basic debugger The optional clear data parameter tells the debugger whether or not it should clear out th
140. d provide you with some control over the target system Managing breakpoints These commands listed on page 12 7 provide you with a command line method for controlling software breakpoints Displaying files and loading programs These commands listed on page 12 4 allow you to change the displays in the File and Disassembly windows and to load object files into memory Customizing the screen These commands listed on page 12 4 allow you to customize the debugger display then save and later reuse the customized displays Memory mapping These commands listed on page 12 7 allow you to define the areas of target memory that the debugger can access Running programs These commands listed on page 12 8 provide you with a variety of methods for running your programs in the debugger environment Profiling commands These commands listed on page 12 9 allow you to collect execution statistics for your code Memory system analysis commands simulator only These com mands listed on page 12 10 allow you to set up analysis for events sup ported by the simulator core Functional Summary of Debugger Commands Managing multiple debuggers To do this Use the command history Assign a variable to the result of an expression Define a custom command string Record the information shown in the PDM display area Display a string to the PDM display area Evaluate an expression in a debugger or group of debuggers and set a var
141. d to create your own system variables that you can use with PDM commands For more information about creating your own system variables see page 11 18 Syntax Menu selection Toolbar selection Environments Description sett Set Default Data Display Format setf data type display format none none basic debugger PDM E profiling The SETF command changes the display format for a specific data type If you enter SETF with no parameters the debugger lists the current display format for each data type J The data type parameter can be any of the following C data types char short uint ulong double uchar int long float ptr The display format parameter can be any of the following characters Parameter Result is displayed in Parameter Result is displayed in Default for the data type Octal ASCII character bytes Valid address Decimal ASCII string Exponential floating point Unsigned decimal ODO a O lt x C amp C nf BD O Hexadecimal Decimal floating point Only a subset of the display formats can be used for each data type Listed below are the valid combinations of data types and display formats Valid Display Formats Valid Display Formats _ Data a Data Type c d oxe f p s U Type cdoxefpsu char c Vv Vv 4 V liong Vv vvY WV uchar d V v vV y ffulong d Vy v4 short d Vv V V V vV float e Vv vv int d Vv Vv Vv V double e Vv VV uint d Vv VV V V pt
142. d up to ten levels deep The batch file that you tried to execute with File Take or the TAKE com mand calls batch files that are nested more than ten levels deep Edit the batch file that caused the error Instead of calling another batch file from within the offending file you can to copy the contents of the second file into the first This will re moves a level of nesting Debugger Messages C 19 Alphabetical Summary of Debugger Messages C 20 Too many breakpoints Description Action 200 breakpoints are already set and there was an attempt to set another The maximum limit of 200 breakpoints includes internal breakpoints that the debugger may set for single stepping Under normal conditions this should not be a problem it is rarely necessary to set this many breakpoints Open the Breakpoint Control dialog box by selecting Breakpoints from the Setup menu Delete individual software breakpoints Too many paths Description Action More than 20 paths have been specified cumulatively with the USE command D_SRC environment variable and i debug ger option Do not enter the USE command before entering another com mand that has a filename parameter Instead enter the sec ond command and specify full path information for the file name Undeclared port address Description Action User halt Description Action You attempted to do a connect disconnect on an address that is not declared as a port
143. de sending commands to debug gers 12 46 to 12 47 setting the default group single stepping through code supported operating systems using with UNIX 11 1 to 11 21 adding a processor to a group assigning processor names n option 11 2 changing the PDM prompt checking the execution status command history 11 13 to 11 14 commands command to 11 14 command ALIAS command 11 15 to creating system variables deleting system variables DLOG command ECHO command EVAL command HISTORY command IF ELIF ELSE ENDIF com mands 11 10 to LOOP BREAK CONTINUE ENDLOOP com mands 11 17 to PAUSE command PESC command PHALT command PRUN command PRUNF command to 11 19 parallel debug manager PDM continued commands PSTEP command SEND command SET command STAT command creating system variables concatenating strings deleting system variables displaying text strings expression analysis finding the execution status 11 8 global halt grouping processors 11 2 to 11 5 example SET command halting code execution 11 8 listing all groups of processors 11 5 listing system variables 11 20 pausing 11 13 recording information from the display running code running free sending commands to debuggers 11 6 single stepping through code system variables Fi ta to parameters emu command emu6x command in alias definition notation sim6x command SPAWN comma
144. de and Assembly Mode 2 2 Typical C Display for Auto Mode Only 00 ccc een eee nee 2 3 Typical Mixed Display for Mixed Mode Only 0 0 c cece eee eee 4 1 Sample Memory Map for Use With a TMS320C6x Simulator 0008 7 1 The Default Memory Window 0 ccc cece nent n tenn nnees 7 2 Reordering Registers in the CPU Window Using the Drag and Drop Method 8 1 An Example of the Profile Window n nnan aanan nannaa anaa 8 2 Cycling Through the Profile Window Fields 0 0 ccc cece ee eee eens 9 1 Enabling Disabling the Analysis Interface 00 c cece eee e cece ees 9 4 9 2 Analysis Events Dialog BOX 0 0 cece cece eeaeee aerer 9 5 9 3 Analysis Statistics Window Displaying an Ongoing Status Report 10 1 Enabling Disabling the Analysis Module 0 0 ccc eee eens 10 2 Analysis Events Dialog BoxeS 0 0 0 ccc eee eens 10 3 EMU1 Pin Set Up to Trigger Out on Hardware Break Events 08 10 4 Analysis Statistics Window Displaying an Ongoing Status Report 11 1 Grouping Processors 2c de meccteetoticoesdetetes beta renteveedeee eiescoeeedes Contents xvii Tables 1 1 Summary of Debugger Window Descriptions 0 00 cece eee eens 2 1 Summary of Debugger Options 0 ccc eee teen teens 3 1 Predefined Constants for Use With Condi
145. debugger commands For example the ML debugger command lists the memory ranges that are currently defined To make a PDM version of the ML com mand to list the memory ranges of all the debuggers in a particular group enter alias ml send g 1 ml Using the Parallel Debug Manager 11 15 Defining Your Own Command Strings Entering Operating System Commands You could then list the memory maps of a group of processors such as those in group GROUPA ml GROUPA J The ALIAS command can be helpful if you frequently change the default group For example suppose you plan to switch between two groups You can set up the following alias alias switch set dgroup 1 set prompt 1 The 1 parameter will be filled in with the group information that you enter when you execute SWITCH Notice that the 1 parameter is preceded by a dollar sign to set up the default group The dollar sign tells the PDM to evaluate take the list of processor names defined in the group instead of the actual group name However to change the prompt you do not want the PDM to evaluate use the processors associated with the group name as the prompt you just want the group name As a result you do not need to use the dollar sign when you want to use only the group name Assume that GROUPS contains CPU_A CPU_B and CPU_D To make GROUPS the current default group and make the PDM prompt the same name as your default group enter switch GROUP3 This ca
146. debugger to fill a block of memory byte by byte by using the Memory Fill Byte command 1 From the Memory menu select Fill Byte This displays the Fill Memory Byte dialog box 2 Inthe Address field enter the first address in the block that you want to fill To specify a hex address prefix the address number with 0x other wise the debugger treats the number as a decimal address 3 Inthe Length field enter a length in bytes of the block 4 Inthe Data field enter a value that you want placed in each byte in the block 5 Click OK Managing Register Data 7 6 Managing Register Data In mixed and assembly modes the debugger maintains a CPU window that displays the contents of individual registers EEEEEEEE BO OUO0Lftc OoOogogoooL Bi oOoogdgoog ooo00000 B2 00000000 ooo00000 B3 00008548 fffffftt BA 00000000 00000000 BS 00000000 g0ogpggg B6 oOooggoog 00000000 B7 00000000 Register contents oooo0000 Be 00000000 00000000 B9 00008538 ooo00000 Bio 00000000 00000000 B11 00000000 oo000000 B12 00000000 0DDOODOOO B13 00000000 00000000 Bid 00008878 00000000 B15 0000e948 00007c68 ISTPO000O00OO Register name The debugger provides commands that allow you to display and modify the contents of specific registers You can use the data management commands or the debugger s overwrite editing capability to modify the contents of any reg ister displayed in the CPU or Watch window For more information s
147. depending on whether you are single stepping through C code or assembly language code E Note If you use the STEP command or Target menu Step option to single step through assembly language code the debugger ignores interrupts Each of the single step commands in this section has an optional expression parameter that works like this _j If you do not supply an expression the program executes a single state ment then halts _j If you supply a logical or relational expression this becomes a conditional single step execution see section 6 4 on page 6 11 _j Ifyou supply any other type of expression the debugger treats the expres sion as a count parameter The debugger single steps count assembly language statements unless you are currently in C code If you are cur rently in C code the debugger single steps count C statements Single stepping through assembly language or C code 6 8 The debugger has a basic single step command that allows you to single step through assembly language or C code If you are currently in assembly lan guage code the debugger executes one assembly language statement at a time If you are currently in C code the debugger executes one C statement at a time If you are in mixed mode the debugger executes one assembly language statement at a time Single Stepping Through Code To use the basic single step command choose one of these methods J Click the Step icon on the toolbar
148. dialog box use one of these methods _j Click the Breakpoint Dialog icon on the toolbar Running Code 6 15 Using Software Breakpoints _ From the Setup menu select Breakpoints This displays the Breakpoint Control dialog box Breakpoint Control Puzzle At line 99 File c source puzele c List of set eaten 4 OOOO cO4 time_cll At line 62 File c source driver c DOO chs o main At lne 18 File c sourcedriver c Edit breakpoint Address To set a breakpoint enter an absolute Add Save List Delete Load List address any C expression the name of a C function or the name of an assembly language label and click Add Delete All Help To set a breakpoint follow these steps 1 Inthe Address field of the Breakpoint Control dialog box enter an absolute address any C expression the name of a C function or the name of an assembly language label If you want to specify a hex address be sure to prefix the address number with 0x otherwise the debugger treats the number as a decimal address 2 Click Add The new breakpoint appears in the breakpoint list 3 Click Close to close the Breakpoint Control dialog box 6 16 Using Software Breakpoints Clearing a software breakpoint There are several ways to clear a software breakpoint If you clear a breakpoint from an assembly language statement the breakpoint is also cleared from any associated C statement if you clear a
149. displayed in Parameter Result is displayed in i Default for the data type o Octal C ASCII character bytes p Valid address d Decimal s ASCII string e Exponential floating point u Unsigned decimal f Decimal floating point x Hexadecimal You can use the display format parameter only when you are displaying a scalar type an array of scalar type or an individual member of an aggregate type You can also use the DISP command with a typecast expression to display memory contents in any format Here are some examples disp 0 disp Lloat 123 disp char JOXI This shows memory in the Watch window as an array of locations the location that you specify with the expression parameter is member 0 and all other locations are offset from that location Record Display Area dlog filename a w or dlog close File gt Log File none basic debugger PDM profiling The DLOG command allows you to record the information displayed in the Command window or in the PDM display area into a log file and to record all commands that you enter from the command line from the toolbar from the menus or with function keys To begin a recording session or in the display area of the PDM use Syntax Menu selection Toolbar selection Environments Description Description elif dlog filename To end the recording session enter dlog close You can write over existing log files or append additional i
150. ditional execution 6 11 program entry point 6 2 to 6 3 running code in current C function description 13 2 l P 13 2 running entire program to 6 5 relative pathnames single stepping 6 8lto RELOAD command through breakpoints repeating commands 11 13 to 11 14 12 12 up to a specific point 6 5 RESET command 12 43 while disconnected from the target system with analysis enabled resetting emulator memory map 12 34 rogram entry point 12 43 Saucier 671 ee s ASCII string display format target system s debugger option RESTART REST command 12 43 SA command Restart toolbar icon Save Breakpoint File dialog box 6 18 Index 17 Index Save List menu option breakpoints 6 18 shell options debugger Save Memory to COFF File dialog box shell program cl6x Save Profile File dialog box 8 28 short data type Save Profile View File dialog box 8 27 side effects definition description to 7 6 13 3 valid operators 7 6 saving breakpoint settings 6 18 saving memory contents to a COFF file 7 10 saving profile data 8 27 to SSSIM constant scalar type definition sim6x command options 2 7 2 to to scan path linker sim6x cfg changing from the default file device type siminit cmd file example simulating interrupts SCONFIG command 12 46 simulator screen customization commands 12 4 definition scroll bar definition external interrupts 4 16 to 4 18 fast version scroll bar handle de
151. ditions In either case you can accomplish these tasks by accessing the analysis registers through the debugger By manipulating the analysis registers you can customize commands for more complex instructions that do not exist on the Hardware Breakpoints or Count CPU Events dialog boxes Use the ALIAS and EVAL commands to create your own commands The basic syntax for creating customized analy sis commands is alias command_name eval register name bit value For example to create a new command for turning on the analysis module enter alias analysis_on eval AEN 3 To create a new command to enable the external emulator counter enter alias xcount eval ACE 0x22 Summary of Analysis Pseudoregisters 10 8 Summary of Analysis Pseudoregisters To create your own analysis commands you must familiarize yourself with the seven analysis registers and how they work The following subsections dis cuss the analysis registers briefly AEN enable analysis You can enable and disable the analysis module and set the EMU0 1 pins to trigger out by using the AEN register Set the bit to 1 to enable or to 0 to disable Bit Field Value Bit Number in Hex Definition 0 1 Enable disable analysis module 0 Disable analysis module 1 Reserved 2 Reserved 3 Enable analysis module 2 Reserved 3 Select EMUO trigger out 4 Select EMU1 trigger out When you disable analysis all registers except AEN retain their previous state
152. during execution of your pro gram How to run the entire program To run the entire program use one of these methods J Click the Run icon on the toolbar _j From the Target menu select Run Press 65 L From the command line enter the RUN command The format for this command is run expression You can use any of the debugger run commands STEP CSTEP NEXT etc described in Chapter 6 except the RUNB run benchmarks or RUNF run free command How the Run Benchmarks RUNB command affects analysis 10 10 Running your program by selecting the Run Benchmarks option from the Tar get menu or entering the RUNB command from the command line disables the current analysis settings and configures the counter to count CPU clock cycles When the processor is halted after a RUNB the analysis registers are restored to their original states The analysis module provides capabilities in addition to those provided by the RUNB command With the RUNB command you can count the number of CPU clock cycles only during the execution of a specific section of code However the analysis module not only allows you to count CPU clock cycles it also al lows you to count other events Viewing the Analysis Data 10 6 Viewing the Analysis Data You can monitor the status of the analysis module by checking the Analysis Statistics window This window displays an ongoing progress report of the analysis module s activity Throug
153. e n op tion because the PDM uses processor names to identify the various de buggers that are running The processor name must match one of the names defined in your board configuration file see Appendix B Describing Your Target System to the Debugger For example to invoke a debugger for a C6x that you had de fined as CPU_A you would enter spawn emu6x n CPU_A The processor name can consist of up to eight alohanumeric characters or underscore characters and must begin with an alphanumeric character Note that the name is not case sensitive _j filename is an optional parameter that names an object file that the debug ger loads into memory during invocation The debugger looks for the file in the current directory if the file is not in the current directory you must supply the entire pathname If you do not supply an extension for the filename the debugger assumes that the extension is out unless you are using multiple extensions You must specify the entire filename if the filename has more than one exten sion _ options supply the debugger with additional information See section 2 7 page 2 10 for a summary table of debugger options Getting Started With the Debugger 2 9 Summary of Debugger Options 2 7 Summary of Debugger Options Table 2 1 summarizes the debugger options that you can use when invoking a debugger see section 2 6 on page 2 7 for information on how to invoke the debugger with debugger
154. e execution time of any subroutines called from within the profile area In general the exclusive data provides the best statistics for comparing the execution time of one profile area to another area The maximum exclusive time for one iteration of a profile area The memory address of the line If the area is a function or range the Address field shows the memory address of the first line in the area In addition to viewing this data in the default manner you can view each of these statistics individually The benefit of viewing them individually is that in addition to a cycle count you are also supplied with a percentage indication and a histogram To view the fields individually click the Area Name column heading in the Pro file window Click the Area Name column heading in the Profile window to change the type of data displayed Area Name Inclusive maint j 26547 fee 13980 3i 13980 fli 0638 Profiling Code Execution 8 21 Viewing Profile Data When you click the Area Name column heading in the Profile window fields are displayed individually in the order shown in Figure 8 2 Figure 8 2 Cycling Through the Profile Window Fields 8 22 Count Inclusive ine tie Exclusive ees eE Default Note Exclusive and Excl Max are shown only when you run a full profile One advantage of using the mouse is that you can change the display while you are profiling You can also use the Profile View dialog box to sele
155. e last item of information is displayed 1 If you supply a value of 1 for flag the debugger does not return to the debugger environment until you enter exit This is the default Enter Operating System Command PDM Environment system operating system command none none basic debugger PDM E profiling Description Syntax Menu selection Toolbar selection Environments Description take_abort Syntax Menu selection Toolbar selection Environments Description take_abort The PDM version of the SYSTEM command allows you to enter a single oper ating system command without explicitly exiting the PDM environment You cannot enter more than one operating system command with the PDM version of the SYSTEM command Execute Batch File Basic debugger take batch filename suppress echo flag PDM take batch filename File gt Take none basic debugger PDM profiling The TAKE command tells the debugger or the PDM to read and execute commands from a batch file The batch filename parameter identifies the file that contains commands If you do not supply a pathname as part of the file name the debugger PDM first looks in the current directory and then searches directories named with the D_ DIR environment variable The batch filename for the PDM version of this command must have a pdm extension or the PDM will not be able to read the file In addition the batch file that the PDM reads can contain only PDM
156. e of the C6x processors CPU_B you would use the following command to invoke the debugger spawn emu6x n CPU_B From this point on whenever you needed to identify this debugger you could identify it by its processor name CPU_B The processor name that you supply can consist of up to eight alohanumeric characters or underscore characters and must begin with an alphabetic char acter The name is not case sensitive The processor name must match one of the names defined in your board configuration file refer to Appendix B De scribing Your Target System to the Debugger Identifying Processors and Groups Organizing processors into groups You can organize processors into groups by using the SET command to group processors under one name Each processor can belong to any group all groups or a group of its own Figure 11 1 a shows an example of processors in a system and Figure 11 1 b illustrates three examples of named groups GROUP1 contains two processors GROUP2 contains four processors and GROUPS contains five processors Figure 11 1 Grouping Processors a All possible processors in a system CPU_A CPU_B CPU_C CPU_D CPU_E debugger debugger debugger debugger debugger _ b Examples of how processors could be grouped a T GROUP1 a F CPU_A CPU_A CPU_A debugger debugger debugger CPU_C CPU_B CPU_B debugger debugger debugger CPU_D CPU_C debugger debugger CPU_E CPU_D debugger debugger CPU_E
157. e previously collected data The clear data parameter can have one of these values Value Description 0 This is the default The profiler continues to collect data adding the data to the existing data for the profiled areas and to use the previous internal profile stacks nonzero All previously collected profile data and internal profile stacks are cleared The update rate parameter is the same as for the PF and PQ commands Switch to Profiling Environment profile Profile Profile Mode none basic debugger PDM profiling The PROFILE command toggles between the basic debugger and profiling environments If you enter PROFILE from the basic debugger environment the debugger switches to the profiling environment If you enter PROFILE from the profiling environment the debugger switches to the basic debugger en vironment Summary of Commands 12 39 prompt Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 40 Change Command Line Prompt prompt new prompt none none basic debugger E PDM profiling The PROMPT command changes the command line prompt The new prompt can be any string of characters a semicolon or comma ends the string The new prompt cannot be longer than 132 characters Run Code in Parallel prun r g group processor name none none PDM C profiling The PRUN commandis the basi
158. e when you invoke the debugger For more information see page 2 13 Use the TAKE command For more information see section 3 3 Creating and Executing a Batch File on page 3 7 When you invoke the debugger it follows these steps to find the batch file that defines your memory map 1 lt checks to see whether you have used the t debugger option The t op tion allows you to specify a batch file other than the initialization batch file shipped with the debugger If it finds the t option the debugger reads and executes the specified file If you do not use the t option the debugger looks for the default initializa tion batch file The batch filename for the simulator is called siminit cmd The batch filename for the emulator is called emuinit cmd If the debugger finds the proper initialization batch file it reads and executes the file If the debugger does not find the t option or the initialization batch file it looks for a file called init cmd This search mechanism allows you to have a single initialization batch file that works for more than one debugger tool To set up this file you can use the IF ELSE ENDIF commands for more information see Executing commands conditionally in a batch file on page 3 8 to indicate which memory map applies to each tool If the debugger finds the file it reads and executes the file Defining a Memory Map 4 11 Returning to the Original Memory Map 4 6 Returning to the Origi
159. ected intervals Configurable display of statistics Display the entire set of data or display one type of data at a time Display all the areas you are profiling or display a selected subset of the areas Visual representation of statistics When you choose to display one type of data at a time the statistics are accompanied by histograms for each area showing the relationship of each area s statistics to those of the other profiled areas Disabled areas In addition to identifying areas that you can collect Statistics on you can also identify areas that you do not want to affect the Statistics This removes the timing impact from code such as a standard library function or a fully optimized portion of code Overview of the Profiling Process 8 2 Overview of the Profiling Process A profiling strategy Profiling consists of five simple steps Step 1 Enter the profiling environment See Entering the Profiling Envi ronment page 8 4 Step 2 Identify the areas of code where See Defining Areas for Profiling you want to collect statistics page 8 5 Step 3 Identify the profiling session See Defining a Stopping Point stopping points page 8 15 Step 4 Begin profiling See Running a Profiling Ses sion page 8 17 Step 5 View the profile data See Viewing Profile Data page 8 20 Note When you compile a program that will be profiled you must use the g and the as compiler shell options The g o
160. ects must contain an as signment operator or an operator that implies an assignment Operators that can cause a side effect are a p amp A lt lt gt gt Managing Data in Memory 7 5 Managing Data in Memory The main way to observe memory contents is to view the display in a Memory window In mixed and assembly modes the debugger displays the default Memory window automatically labeled Memory You can open any number of additional Memory windows to display different memory ranges Figure 7 1 shows the default Memory window Figure 7 1 The Default Memory Window Address PC OOO08S00 OOO08S0c OOO0851 8 OOO08524 OOO08530 OOO08S3c OOO0854 8 Ovedadea OO00g0dba Orvd4d435c2a Of7f f fes Oic2dcva oo004000 Jttt se LU OF 80006a OF bcOlee OF7O00006a Offfd410 0180006a Oicevadea ooo004000 O00ffeza OFbtoraz O27f f fae ooo004000 Offec910 O180006a Qicvaeza Enter an address here to change the range shown in the window Scroll bar handle Addresses Data The amount of memory that you can display ina Memory window is limited by the size of the window which is limited only by your monitor s screen size The debugger allows you to change the memory range displayed in the Memory window and to open additional Memory windows The debugger also allows you to change the values at individual locations for more information see section 7 4 Basic Methods for Changing D
161. ee sec tion 7 4 Basic Methods for Changing Data Values on page 7 5 Displaying register contents The main way to observe register contents is to view the display in the CPU window However you may not be interested in all of the registers if you are interested in only a few registers you might want to make the CPU window small and use the extra screen space for the Disassembly or File window You can also reorder the registers in the CPU window and display the ones that you are most interested in at the top of the CPU window To do so use the drag and drop method as shown in Figure 7 2 Managing Data 7 13 Managing Register Data Figure 7 2 Reordering Registers in the CPU Window Using the Drag and Drop Method 7 14 OOO00000 OOOO0000 OOO0s8e878 OOOOdO00 OO00e946 OOO08S00 oooog000 oogodoogag To move a register point to a register and hold down the left mouse button OOOO0000 00998A oapooa OO00e946 OOO0SS00 OOOO0000 ooooooo0 gt Drag the register to its new location anaoot OOOO0000 OOOO0000 OOOO0000 oopgaan OOOO0000 0000878 OOO0sS00 When you release the mouse button the register moves to its new location In addition to the CPU window you can observe the contents of selected regis ters by using the evaluate expression command or Setup gt Watch Variable menu option E If you have only a temporary interest in the contents of a register you can use the
162. en low you must enable the EMU1 driven low option in the Set Up Hardware Breakpoints dialog box of one of the proces sors aS Shown in Figure 10 3 Figure 10 3 EMU1 Pin Set Up to Trigger Out on Hardware Break Events Hardware breakpoints set Analysis Events x Count CPU Events Set Up Hardware Breakpoints Select hardware break events M Enable breakpoint at program address main T Break when EMUO is driven low Break when EMUT is driven low EMUO pin Select tigger out pin s for hardware break events s disabled external M EMO i EMU counter in use External counter is in use EMUO pin i unavailable EMU1 pin set to trigger out on set hard ware break T events When processor 1 halts its EMU1 signal halts processor 2 Setting up each processor in this way creates a global breakpoint so that any processor that reaches a breakpoint halts all other processors in the system Monitoring Hardware Functions With the Emulator Analysis Module 10 9 Running Your Program 10 5 Running Your Program Once you have defined your parameters the analysis module can begin col lecting data as soon as you run your program It stops collecting data when the defined conditions are met The analysis module monitors the progress of the defined events while your program is running ooe Note The conditions for the analysis session must be defined before your analysis session begins you cannot change conditions
163. ent command however you can perform PHALT PESC and STAT commands when the processors are still executing You can specify a count for the PSTEP command so that each processor in the group will step for count number of times Note If the current statement that a processor is pointing to has a breakpoint that processor will not step synchronously with the other processors when you use the PSTEP command However that processor will still single step Using the Parallel Debug Manager 11 7 Running and Halting Code Halting processors at the same time Sending ESCAPE to You can use the PHALT command after you enter a PRUNF command to stop an individual processor or a group of processors global halt Each processor in the group is halted at the same real time The syntax for the PHALT com mand Is phalt g group processor name all processors Use the PESC command to send the escape key to an individual processor or to a group of processors after you execute a PRUN command Entering PESC is essentially like typing an escape key in all of the individual debuggers However the PESC command is asynchronous the processors do not halt at the same real time When you halt a group of processors the individual pro cessors are halted in the order in which they were added to the group The syntax for this command is pesc g group processor name Finding the execution status of a processor or a group of process
164. ents dialog boxes select the Set Up Analysis Events option on the Analysis menu Figure 10 2 Analysis Events Dialog Boxes Analysis Events x Set Up Set Count CPU Count CPU Events Set Up Hardware Breakpoints Up Events Hardware dialog box Breakpoints Enable external counter External counter uses EMUO pin dialog box Select an Event to Count O None Disable external counter Execute packet i CPU c lock cycles Interrupt context switch clock cycles O Pipeline stall clock cycles Branch taken O nterupts taken NOP Enables and l disables Enable analysis events Cancel analysis Applies changes and Closes the dialog Brings up online closes the dialog box box without making help for the dialog any changes box Monitoring Hardware Functions With the Emulator Analysis Module 10 5 Defining the Conditions for Analysis Counting events The analysis module s internal counter counts bus events and detects other internal events This counter keeps track of how many times an event occurs The Count CPU Events dialog box allows you to count one of the seven types of events until the processor halts These events are listed and described in Table 10 1 To count any of the events simply select that event in the Count CPU Events dialog box You can count only one event at a time Table 10 1 describes the available events Table 10 1 Description of Analysis Counter Events Event
165. er Pseudoregister Register Name Name Register Name Name AO FAO BO FBO A FAY B1 FB1 A2 FA2 B2 FB2 A3 FA3 B3 FB3 A4 FA4 B4 FB4 A5 FA5 B5 FB5 A6 FAG B6 FB6 A7 FA7 B7 FB7 A8 FA8 B8 FB8 A9 FA9 B9 FB9 A10 FA10 B10 FB10 A11 FA11 B11 FB1 A12 FA12 B12 FB12 A13 FA13 B13 FB13 A14 FA14 B14 FB14 A15 FA15 B15 FB15 You can display the contents of these registers by using the evaluate ex pression command or Setup Watch Variable menu selection _j For example assume B15 OxE908 If you want to evaluate the FB15 pseudoregister enter b15 The debugger shows the result in the display area of the Command window fb15 8 3595861e 041 To modify the FA15 pseudoregister and set it equal to 15 75 enter fa15 15 75 The debugger displays the following in the display area of the Command window tals 15 275 14579000e 001 Managing Register Data Accessing double precision floating point registers The debugger allows you to access double precision floating point values in even odd register pairs There are 16 sets of general purpose register pairs Table 7 2 lists the pseudoregister name for each general purpose register pair Table 7 2 Pseudoregister Names for Double Precision Floating Point Registers Pseudoregister Pseudoregister Register Pair Name Register Pair Name A1 A0 DAO B1 B0 DBO A3 A2 DA2 B3 B2 DB2 A5 A4 DA4 B5 B4 DB4 A7 A6 DAG B7 B6 DB6 A9 A8 DAB B9 B8 DBE A11 A10 DA
166. escription Syntax Menu selection Toolbar selection Environments return Reset Target System reset Target Reset Target none basic debugger E PDM profiling The RESET command resets the target system emulator only or simulator This is a software reset If you are using the simulator and execute the RESET command the simulator simulates the processor and peripheral reset operation putting the processor in a known state Reset PC to Program Entry Point restart rest Target Restart Ej basic debugger E PDM profiling The RESTART or REST command resets the program to its entry point This assumes that you have already used one of the load commands to load a program into memory Return to Function s Caller return ret Target Return P basic debugger E PDM E profiling Summary of Commands 12 43 run Description Syntax Menu selection Toolbar selection Environments Description 12 44 The RETURN or RET command executes the code in the current C function and halts when execution reaches the caller Breakpoints do not affect this command but you can halt execution by doing one of the following actions J Click the Halt icon on the toolbar E From the Target menu select Halt J Press sc Run Code run expression Target gt Run basic debugger L PDM L profiling The RUN command is the basic command for running an entire program The command s behav
167. ese steps 1 Make the window or the dialog box active 2 Press D For all dialog boxes you can also click the Help button in that dialog box to view context sensitive help Help Accessing Online Help Accessing help for debugger commands To find out about a specific debugger command use the HELP command The syntax for this command is help debugger command The HELP command opens a help topic that describes the debugger com mand Overview of the Code Development and Debugging System 1 15 Chapter 2 Getting Started With the Debugger Before or after you install the debugger you can define environment variables that set certain debugger parameters you normally use When you use envi ronment variables default values are set making each individual invocation of the debugger simpler because these parameters are automatically speci fied When you invoke the debugger you can use command line options to override many of the defaults that are set with environment variables These options are summarized in this chapter Once you have set up the environment variables and invoked the debugger you must select the correct debugging mode for your program This chapter describes these debugging modes and provides an overview of the debugging process Topic Page Preparing Your Program for Debugging Identifying Alternate Directories for the Debugger to Search D_DIR Identifying Directories That Contain Program Source
168. et breakpoints in program memory RAM only the address param eter is treated as a program memory address Delete Software Breakpoint bd address Setup Breakpoints basic debugger PDM profiling The BD command clears a software breakpoint at a specific address The address can be an absolute address any C expression the name of a C func tion or the name of an assembly language label List Software Breakpoints bl Setup Breakpoints basic debugger E PDM profiling The BL command lists all the software breakpoints that are currently setin your program It displays a table of breakpoints in the display area of the Command window BL lists all the breakpoints that are set in the order in which you set them Summary of Commands 12 15 br Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 16 Reset Software Breakpoint br Setup Breakpoints EL PDM The BR command clears all software breakpoints that are set basic debugger profiling Enter Auto Mode c Mode gt C Auto none basic debugger L PDM The C command changes from the current debugging mode to auto mode If you are already in auto mode the C command has no effect E profiling Opens Calls Window calls View Call Stack Window none
169. event breakpoints C6x memory system analysis enables you to set breakpoints on system events These events are called break events You can break on any of the events supported by the C6x core and you can set a breakpoint on one or more of these events Break events are automatically counted by the event counter Each break event is displayed in the Analysis Statistics window along with the number of times that break event occurred during each execution of the program the pro gram address on which the last breakpoint occurred and the name of the rou tine in which the breakpoint occurred Count system events 9 2 You can set up memory system analysis to count occurrences of system events during the execution of your program You can count any single event or any combination of events supported by the C6x Each event that you select to count is displayed in the Analysis Statistics window along with the number of times that event occurs during the execution of your program You can use all of the basic debugger step and run commands to determine the number of occurrences of each selected event that you want to count The event counters keep incrementing with each execution of your program unless you select the Reset Counter button on the Analysis Statistics window When you select the Reset Counter button each of the event counters resets to 0 immediately Overview of the Analysis Process 9 2 Overview of the Analysis Proces
170. ewood Cliffs New Jersey This equipment is intended for use in a laboratory test environment only It gen erates uses and can radiate radio frequency energy and has not been tested for compliance with the limits of computing devices pursuant to subpart J of part 15 of FCC rules which are designed to provide reasonable protection against radio frequency interference Operation of this equipment in other en vironments may cause interference with radio communications in which case the user at his own expense will be required to take whatever measures may be required to correct this interference 320 Hotline On line is a trademark of Texas Instruments Incorporated PC is a trademark of International Business Machines Corporation SunOS and OpenWindows are trademarks of Sun Microsystems Inc SPARCstation is trademark of SPARC International Inc but licensed exclu sively to Sun Microsystems Inc UNIX is a registered trademark in the United States and other countries licensed exclusively through X Open Company Limited Windows Windows 95 and Windows NT are registered trademarks of Micro soft Corporation XDS XDS510 XDS510PP XDS510WS XDS511 are trademarks of Texas In struments Incorporated X Window System is a trademark of the Massachusetts Institute of Tech nology If You Need Assistance If You Need Assistance _ World Wide Web Sites TI Online http www ti com Semiconductor Product Information Center PIC
171. file use the MA command The syntax for the MA command is ma address length type E The address parameter defines the starting address of a range This parameter can be an absolute address any C expression the name of a C function or an assembly language label If you want to specify a hex ad dress be sure to prefix the address number with 0x otherwise the debugger treats the number as a decimal address The ength parameter defines the length of the range This parameter can be any C expression The type parameter identifies the read write characteristics of the memory range The type must be one of these keywords To identify this kind of memory Read only memory Write only memory Read write memory Read only program memory Read write program memory No access memory Input port Output port Input output port Use this keyword as the type parameter R or ROM W or WOM R W or RAM PROM PRAM PROTECT INPORT or P R OUTPORT or P W IOPORT or P R W The memory ranges that you define have the same restrictions as those de fined for the Memory Mapping menu option described in section 4 2 on page 4 3 4 10 Defining and Executing a Memory Map in a Batch File Executing a memory map batch file To execute the batch file use one of these methods LI E E Use the File Execute Take File menu option from within the debugger environment Use the t debugger option to specify the batch fil
172. files D A code at a specific point data for load and store instructions emula tor 7 2 data in nondefault formats 7 22 to 7 25 debugger on a different machine d op pointer data register contents structure data text files text when executing a batch file watched values 7 19 to 7 20 DLOG command ending recording session PDM version starting recording session 11 10 docking a window definition double data type 7 23 double precision floating point registers 7 17 dragging definition e exponential floating point display format 12 22 E command ECHO command PDM version editing data values expression side effects overwrite method EISA definition to 11 12 12 21 ELIF command 11 10 12 26 to ELSE command PDM version EMU constant 12 26 to 12 61 Index 7 Index EMU pins 10 9 description 10 2 external counter 10 9 restrictions 10 7 setup for external counter au iS Ashod setup for global Pahoa emu6x P 2 8 12 E e A 2 10 to 2 13 unae A 2 3 A 1 emulator definition describing the target system to the debug ger B t t0 B 65 creating the board configuration file B 2 to B 4 specifying the file translating the file H displaying data for load and store instruc tions EMU constant external counter 10 7 halting on the first instruction of an interrupt ser vice routine invoking the debugger standalone under PDM co
173. finition about description 5 51 Pie E not supported h t scrolling definition oating point version about 0 SD command debugger c tues nol SY oported section definition O memory 4 14 to 4 1 Select Areas context menu option baba invoking the aa ger selecting big endian format me option _ standalone g 17 limited versions SEND command 11 6 12 46 to 12 47 resetting serial ports connecting an I O port aol SSSIM PA n 3 8 SET command 11 4 to 11 5 simulator configuration naming an alternate adding processors to a group inalia file changing the PDM prompt single precision floating point registers 7 16 12 48 Single Step C toolbar icon single step commands creating system variables BER concatenating strings i substituting a Te sing a group fi ONKI command ae hy dla group 12 47 NEXT command 6 10 12 35 g a group PSTEP command 12 41 listing system nS STEP command Set Up Hardware Breakpoints dialog box 10 8 single step execution SETF command 7 22 to 7 2 12 49 and function calls 12 18 12 35 12 53 setting a hardware breakpoint 10 8 assembly language code _ 6 8 to 6 9 12 53 setting a software breakpoint 6 15 to 6 16 C code 6 8 td 6 20 12 18 Setup menu definition D 6 Alias Commands option description 6 8 to Breakpoints option in parallel 12 41 clearing a breakpoint single step loading breakpoint settings 6 19 commands PSTEP command 11 7 saving breakp
174. ful to know the steps that the debugger goes through during the invocation process this appendix lists these steps Describing Your Target System to the Debugger 0cc cece eee eee ee eeaee Explains how to supply the information about your target configuration to the debugger B 1 Step 1 Create the Board Configuration Text File 0 0 0 c cece eee eee B 2 Step 2 Translate the Configuration File to a Debugger Readable Format B 3 Step 3 Specify the Configuration File When Invoking the Debugger DEDUGGEr MESSAGES sc sicee esc s eteeaeneee dae ewaawnerseunadsemen cee emcene nee ssan Describes progress and error messages that the debugger may display C 1 Associating Sound With Error Messages 0 ete ee eens C 2 Alphabetical Summary of Debugger Messages 000 een eee ees C 3 Alphabetical Summary of PDM Messages 0000 cece eee nents C 4 Additional Instructions for Expression Errors 0 cc eee ees C 5 Additional Instructions for Hardware Errors 0 00 cece ee eee ee GIOSSAY E ee de tan eae E needs meee A E E E EE E Defines acronyms and key terms used in this book Figures 1 1 The Basic Debugger Display 0 0 ccc eee ee eens 1 2 TMS320C6x Software Development FIOW 0 cc ccc eee eens 1 3 The PDM Environment 22 0 cae oo ceu ae swad oes oGene aeeesaueres eases esce ed ames gets 2 1 Typical Assembly Display for Auto Mo
175. g a symbol table only 20ss lt ascceesavedeeesdweersneeeeu se eaucae kona ees Loading code while invoking the debugger 0 e cece eee tenes Displaying portions of disassembly aana c cece ce eee eee enna Displaying assembly Source code 1 eee eee eee nee DISDIAVING CG COde L geo et seed E E nese tease rans A cae eee Displaying the contents of a text file 0 0 eee enna Displaying a specific C function 6 20240452202 etunesneces Reeds kaere tes ne neeae Ke Displaying code beginning at a specific point 0 0 cee eee Contents xi Contents 6 Running COdG cic cout cu eine oun eunGe cence eens tena eens eeedeeende caeemeeeee an gee 6 1 Describes the basic run commands and single step commands tells you how to halt program execution and discusses software breakpoints 6 1 Defining the Starting Point for Program Execution 0 0 00 ccc eee 6 2 Using the Basic Run Commands 0 0 0 ccc een ene Running an entire program 1 6 cece teen eee ee eeenee Running code up to a specific point ina program cee eee Running the code in the current C function 0 0 c cece eee Running code while disconnected from the target system emulator only Running code through DEAKOOINIS ooicuccckecasteteeesieeeweneedelieaedanaesas Resetting the simulator anaana pect anaana deeb edebe pene teete neues t Resetting the emulator 2200 0 sande aeeew dames asweweseby ouee ead ee
176. g new memory map Notice that the string is not enclosed in quotes Entering and Using Commands 3 7 Creating and Executing a Batch File When you execute the batch file the following message appears Creating new memory map Any leading blanks in your string are removed when the ECHO command is executed For more information about the PDM version of the ECHO command see page 11 12 Executing commands conditionally in a batch file To execute debugger commands conditionally in a batch file use the IF ELSE ENDIF commands The syntax is if Boolean expression debugger commands else debugger commands endif If the Boolean expression evaluates to true 1 the debugger executes all commands between the IF and ELSE or ENDIF The ELSE portion of the com mand is optional See Chapter 13 Basic Information About C Expressions for more information The debugger includes some predefined constants for use with IF These constants evaluate to 0 false or 1 true Table 3 1 shows the constants and their corresponding tools Table 3 1 Predefined Constants for Use With Conditional Commands 3 8 Constant Debugger Tool SEMUSS Emulator SIM Simulator One way you can use these predefined constants is to create an initialization batch file that works for any debugger tool This is useful if you are using for example both the emulator and the simulator To do this you can set up a batch file such as the following
177. g the Conditions for Analysis 0 00 c ccc cee eee ens Description of available system events 0 ccc eee een nee Counting system events nananana nananana ee een teen ee een teen eens Setting event breakpoints nan anaana eee ae en ea eS RES Ow REE RAR Removing a defined count or break event 0 c cc eee eens 99 IAG YOURT OOM scxn vaneowene swaneewaeean oonewanamasaeeateewes seaweed 9 6 Viewing the Analysis Data 0 cc ccc eee teen ene nees Interpreting the information in the Analysis Statistics window 0 Resetting the event Counters 0 cc eee teen eee eee eaee 9 7 Summary of Memory System Analysis Commands 0000 eee eee eee event_enable enable specified event 0 cee eens event_disable disable specified event 0 cc eee eens event_break set breakpoint on specified event 0 0 cece eens event_counter_start count each occurrence of specified event event_counter_reset reset counter for specified event 0 00 eee eee event_reset disable and clear configuration for all events 00000 event_list list configuration of all events 0 0 0 ccc eee eee 9 8 Entering Analysis Commands Through a Batch File 00 0 annann Monitoring Hardware Functions With the Emulator Analysis Module Describes the analysis environment for the emulator and tells you how
178. g4d000 0ic 9c2a OLS0006a Ofteedg10 Disassembly of object code in memory Contents of memory object code Addresses IO x OOO08S00 OFfedatbea c int MVE S2 Det fftic9SO BLS OOO08S504 OF 800064e MVEH 5S2 O20000 B15 QOOO08S08 oOO0ffeza MVE S2 Oxlffc BO OOO08 amp S50c OOO000ba MVEH 52 0x000 B80 Ll QOOOO08S10 OF beDle ADD S2 BO B15 B15 4 gt When you invoke the debugger it comes up in auto mode If you load an object file when you invoke the debugger the Disassembly window displays the re verse assembly of the object file that is loaded into memory If you do not load an object file the Disassembly window shows the reverse assembly of what ever is in memory which may not be useful To display code beginning at a specific point enter a new starting address in the Address field of the Disassembly window Enter an address here to display code at a specific point w Disassembly 0 EI Address Mittet Behe aL BG If you want to specify a hex address be sure to prefix the address number with 0x otherwise the debugger treats the number as a decimal address 5 4 Loading and Displaying Assembly Language Code You can also move through the contents of the Disassembly window by using the scroll bar Because the Disassembly window shows the reverse assembly of memory contents the scroll bar handle is displayed in the middle of the scroll bar The middle of the reverse assembly is
179. ge of memory Register values CPU window Displays the contents of C6x registers Pointer data variables ag Watch window Displays selected data gregate types and specific memory locations or registers The three dedicated windows are referred to as data display windows 7 2 How the Emulator Displays Data for Load and Store Instructions 17 2 The C6x emulator allows you to view the register file on pipeline cycle bound aries When the emulator is halting and resuming execution it maintains pipe line and memory synchronization however the CPU and Memory windows do not necessarily reflect this synchronization when displaying the data from load and store instructions While halting the emulator completes the store instructions that have passed the E1 phase of the pipeline The emulator immediately updates the Memory window with the data from the completed store instructions to reflect what the next load instruction reads from memory Unlike store instructions load instructions shown in the register file displayed in the CPU window reflect the latency of the pipeline When halting the emula tor completes the load instructions that are currently in the pipeline The data from these load instructions is saved by the emulator and restored to the pipe line when execution is resumed Basic Commands for Managing Data 7 3 Basic Commands for Managing Data The debugger provides special purpose commands for displaying and modify
180. ger separates code data and commands into manageable portions The graphical user interface is intuitive and follows the conventions used by your windowing system Comprehensive data displays You can easily create windows for dis playing and editing the values of variables arrays structures pointers any kind of data in their natural format float int char enum or pointer You can even display entire linked lists On screen editing You can change any data value displayed in any win dow just click and type Automatic update The debugger automatically updates information on the screen highlighting changed values Dynamic profiling In addition to the basic debugging environment a se cond environment the profiling environment is available The profiling environment provides a method for collecting execution statistics about specific areas in your code This gives you immediate feedback on your application s performance and helps you identify bottlenecks within the code Analysis module In addition to the basic debugger features the C6x has an analysis module on the chip that allows the emulator to monitor the op erations of your target system This expands your debugging capabilities beyond simple software breakpoints All the standard features you expect in a world class debugger The debugger provides you with complete control over program execution with features like conditional execution and single stepp
181. ger version of the EVAL command The PDM has a similar com mand called EVAL that you can send to a processor or a group of processors The EVAL command evaluates an expression in a debugger and sets a vari able to the result of the expression The syntax for the PDM version of the EVAL command is eval g group processor name variable name expression format _j The g option specifies the group or processor that EVAL should be sent to If you do not use this option the command is sent to the default group dgroup _ When you send the EVAL command to more than one processor the PDM takes the variable name that you supply and appends a suffix for each pro cessor The suffix consists of the underscore character _ followed by the name that you assigned the processor That way you can differentiate be tween the resulting variables _ The expression can be any expression that uses the symbols described in section 11 7 I When you use the optional format parameter the value that the variable is set to will be in one of the following formats Parameter Format Parameter Format Default for the data type o Octal C ASCII character bytes p Valid address d Decimal s ASCII string e Exponential floating point u Unsigned decimal f Decimal floating point X Hexadecimal Suppose the program that CPU_A is running has two variables defined j is equal to 5 and k is equal to 17 Also assume that the program that CPU_
182. gommanas 11 10 to 11 12 12 26 to looping an B 9 to 11 11 to 11 22 12 28 to definition displaying 6 eel text when executing B 7 11 12 12 21 echoing rer Be 3 7 11 12 12 21 emuinit cmd ren entering memor Et sis commands executing 3 11 halting execution 3 11 init clr 12 46 A 1 init cmd definition during invocation 11 A g init odm initialization ee ek 1 A 1 init cmd init pdm sample mee map TE siminit cmd 9 13 batch files continued mem map memory pas pausing R file sim6x cfg siminit cmd TAKE command 4 13 12 55 PDM version BD command 12 15 benchmarking CLK pseudoregister 6 12 constraints definition description RUNB command 12 45 big endian defined big endian format selecting me option 2 11 bitwise operators 13 3 BL command 12 15 board configuration creating the file B 2 to B 6 naming an alternate file 2 1 2 11 B 6 specifying the file translating the file board cfg file device names device types SPL TMS320C6x translating B 5 types of entries B 3 to B 51 board dat changing from the default file board dat ie 1 to B 6 default B 1 bpt extension 6 18 BR command a rT BREAK command 12 28 to 12 29 break events a Breakpoint Control dialog box breakpoint symbol breakpoints event 9 7 breakpoints hardware 10 8 definition global TODS types of events 10 2 Index bre
183. gs to the PDM display area 11 12 You can display a string in the PDM display area by using the ECHO command This command Is especially useful when you are executing a batch file or run ning a flow control command such as IF or LOOP The syntax for the command iS echo string This displays the string in the PDM display area You can also use ECHO to show the contents of a system variable system variables are described in section 11 8 echo var_procl 34 The PDM version of the ECHO command works in exactly the same way as the debugger version described on page 12 21 works except that you can use the PDM version outside of a batch file Entering PDM Commands Pausing command execution Sometimes you may want the PDM to pause while it is running a batch file or when it is executing a flow control command such as LOOP ENDLOOP Paus ing is especially helpful in debugging the commands in a batch file The syntax for the PAUSE command is pause When the PDM reads this command in a batch file or during a flow control com mand segment the PDM stops execution and displays the following message lt lt pause LYS Leluri 32 gt To continue processing press Using the command history The PDM supports a command history that is similar to the UNIX command history The PDM prompt identifies the number of the current command This number is incremented with every command For example PDM 12 gt gt indi cates that e
184. h de bugger in the group finishes running code Any results that would be printed in the COMMAND window of the individual debuggers will also be echoed in the PDM command window These results will be dis played by the processor For example send pc CPU_C 0x200A CPU_D 0x2008 If you want to break out of asynchronous command and regain control of the PDM commandline press in the PDM window This will return control to the PDM command line However no debugger executing the command will be interrupted m With t control is returned to the commandline immediately even if a debugger is still executing a command When you use r you do not see the results of the commands that the debuggers are executing The r option is useful when you want to exit from a debugger but not from the PDM When you send the QUIT command to a debugger or group of debuggers without using the r command you will not be able to enter another PDM command until all debuggers that QUIT was sent to finish quitting the PDM waits for a response from all of the debuggers that are quitting By using r you can gain immediate con trol of the PDM and continue sending commands to the remaining debuggers The SEND command is useful for loading a common object file into a group of debuggers For example to load a file called test out into the debuggers contained in GROUP_A you could use the following command send g GROUP_A load test out Running and Halting C
185. h the SET command to remove a particular processor from a group L basic debugger E profiling To delete all groups enter an asterisk instead of a group name unset The symbol does not work as a wildcard _ _ _ _ _ _ _ _ _ _ _ __ Note When you use UNSET to delete all of your system variables and processor groups variables such as prompt status and dgroup are also deleted Syntax Menu selection Toolbar selection Environments Description Vaa Syntax Menu selection Toolbar selection Environments Description vac Syntax Menu selection Toolbar selection Environments Description vac Use Additional Directory use directory name none none basic debugger E PDM profiling The USE command allows you to name an additional directory that the debugger can search when looking for source files You can specify only one directory at a time If you enter the USE command without specifying a directory name the debugger lists in the display area of the Command window all of the current directories Save All Profile Data to a File vaa_ filename Profile gt Save All none C Pom profiling The VAA command saves all statistics collected during the current profiling session The data is stored in a system file E basic debugger Save Displayed Profile Data to a File vac filename Profile Save View none
186. h this window you can monitor the status of the break events the value of both the internal and external event counters and the status of the EMU0 1 events Interpreting the information in the Analysis Statistics window You can watch the progress of the events that you defined in the Analysis Events dialog box in the Analysis Statistics window From this window you can also change the display rate of the information in the window If you change any of the analysis options in the analysis dialog boxes the Analysis Statistics window updates to reflect the changes you made Figure 10 4 illustrates the Analysis Statistics window Figure 10 4 Analysis Statistics Window Displaying an Ongoing Status Report EH Analysis Statistics Break Address Routine Branches Taken EMOD List of events Event type Numberof Address on Routine in defined to times the which this which this monitor event occurs break event break event occurs occurs Monitoring Hardware Functions With the Emulator Analysis Module 10 11 Creating Customized Analysis Commands 10 7 Creating Customized Analysis Commands 10 12 The interface to the C6x emulator analysis module is register based You can set up hardware breakpoints or counter events through the Analysis menu dia log boxes In some cases however you may want to define more complex conditions for the processor to detect Or you may want to write a batch file that defines breakpoint and or counter con
187. h to set a breakpoint 1 From the Analysis menu select Set Up Analysis Events The Analysis Events dialog box appears In the Add Event section select the event on which you want to set a breakpoint from the Event drop list Select Break from the Event Type drop list Click the Add button The event appears in the event list at the top of the dialog box and also in the Analysis Statistics window Define more events on which to break or click the Close button Removing a defined count or break event If you decide that you no longer want to count or break on an event access the Analysis Events dialog box and complete the following steps From the event list in the Event section at the top of the dialog box click on the event you want to remove Select the Delete button The event disappears from the event list Add or remove other events or select the Close button Using Simulator Memory System Analysis 9 7 Running Your Program 9 5 Running Your Program 9 8 Once you have defined your parameters analysis can begin collecting data as soon as you run your program It stops collecting data when the defined conditions are met Memory system analysis monitors the progress of the de fined events while your program is running To run the entire program use one of these methods J Click the Run icon on the toolbar J From the Target menu select Run Press 5 L From the command line enter the RU
188. halts any program execution whether you are running or single stepping through code Software breakpoints are especially useful in combination with conditional execution described in section 6 4 on page 6 11 When you set a software breakpoint the debugger highlights the breakpointed line with this prefix If you set a breakpoint in the disassembly the debugger also highlights the associated C statement if the debugger has access to the C source If you set a breakpoint in the C source the debugger also highlights the associated statement in the disassembly If more than one assembly language statement is associated with a C statement the debugger highlights the first of the asso ciated assembly language statements B driver_c Of x ooo19 4 A breakpoint i tat OO0020 int i novhd reakpoint is set a oo021 clock_t tloverhead t_start t_stop t_stub t_c this C statement A breakpoint is also set at the associated assembly language 6 14 statement 00022 1 4 al DISASSEMBLY O x Address a U000 chs Olbd14t6 main STW D2 B3 B15 8 OO00 chc OS3ec2t4 STW D2 A10 B15 6 OO00 cr O0 OSbcezt4 STW D2 All B15 7 OO00 cer4 OO015c10 B S5Si clock 0007c ooo04000 3 PIFI Using Software Breakpoints a Notes 1 After execution is halted by a breakpoint you can continue program execution by reissuing any of the run or single step commands 2 You can setup to 200 breakpoi
189. he context menu Running Code 6 5 Using the Basic Run Commands Running the code in the current C function You can execute the code in the current C function and halt when execution returns to the function s caller To do so use one of these methods 4 Click the Return icon on the toolbar p _j From the Target menu select Return Breakpoints do not affect this command but you can halt execution by doing one of the following J Click the Halt icon on the toolbar From the Target menu select Halt _j Press sc Running code while disconnected from the target system emulator only Use the RUNF command to disconnect the emulator from the target system while code is executing When you use the RUNF command the debugger clears all breakpoints dis connects the emulator from the target system and causes the processor to begin execution at the current PC You can quit the debugger or you can con tinue to enter commands However any command that causes the debugger to access the target at this time produces an error Run Free is useful in a multiprocessor system It is also useful in a system in which several target systems share an emulator the Run Free option enables you to disconnect the emulator from one system and connect it to another Running code through breakpoints 6 6 You can use the debugger to execute code and run through breakpoints This is referred to as a continuous run When a b
190. hname pathnameg _ For Bourne or Korn shells D SRC pathname export D_ SRC Be sure to enclose the path names within one set of quotes 2 4 Setting Up Default Debugger Options D_OPTIONS 2 4 Setting Up Default Debugger Options D_OPTIONS Use the D_OPTIONS environment variable to set the debugger invocation options that you want to use regularly When you use the D_OPTIONS envi ronment variable the debugger uses the default options and or input file names that you name with D OPTIONS every time you invoke the debugger Setting up D_OPTIONS for Windows operating systems To set the D_OPTIONS environment variable for Windows operating systems use this syntax SET D_OPTIONS filename options Be careful not to precede the equal sign with a space The filename identifies the optional object file for the debugger to load and options lists the options you want to use at invocation Section 2 7 on page 2 10 summarizes the options that you can identify with D OPTIONS Setting up D_OPTIONS for SPARC and HPUX operating systems To set the D_OPTIONS environment variable for SPARC and HPUX operating systems use this syntax setenv D_OPTIONS filename options If you are using SunOS _j For C shells setenv D_OPTIONS filename options For Bourne or Korn shells D_ OPTIONS filename options export D_ OPTIONS Be sure to enclose the filename and options within one set
191. i _J From the Target menu select Step Press 8 L From the command line enter the STEP command The format for this command is step expression When you use the basic single step command in C code and encounter a func tion call the step command shows you the single step execution of the called function assuming that the function was compiled with the compiler s g option When function execution completes single step execution returns to the caller If the function was not compiled with the g option the debugger executes the function but does not show single step execution of the function For more information about the compiler s g option see the TMS320C6x Op timizing C Compiler User s Guide Single stepping through C code The basic single step command described in the Single stepping through as sembly language or C code section always executes one statement at a time no matter whether you are in assembly language code or in C code If you want to single step in terms of a C statement and execute all assembly language statements associated with a single C statement before updating the display use the C single step command To use the C single step command choose one of these methods J Click the Single Step C icon on the toolbar ce _j From the Target menu select Step C Press CONTROL F8 L From the command line enter the CSTEP command The format for this command is c
192. iable to the result List available PDM commands View the description of a PDM command List the last twenty commands Conditionally execute PDM commands Loop through PDM commands Pause the PDM Halt code execution Global halt Run code globally Run free globally Single step globally Exit any debugger and or the PDM Send a command to an individual processor or a group of processors Change the PDM prompt Create your own system variables Define or modify a group of processors List all system variables or groups of processors Set the default group Invoke an individual debugger Find the execution status of a processor or a group of processors Enter an operating system command Execute a batch file Delete an alias definition Delete a group or system variable Use this See command page 12 12 12 13 alias 12 14 dlog 12 20 echo 12 21 eval 12 22 help 12 25 help 12 25 history 12 26 if elif else endif 12 26 loop break con 12 28 tinue endloop pause 12 36 pesc 12 36 phalt 12 37 prun 12 40 prunf pstep quit send 12 46 set set 12 47 set 12 47 set 12 47 set spawn stat system take unalias 12 56 Summary of Commands unset 12 56 12 3 Functional Summary of Debugger Commands Changing modes Managing windows To put the debugger in Assembly mode Auto mode for debugging C code Mixed mode To do this Reposition a window Resize a window Make a window active Make a window as
193. ic displa definition messages C 1 to C 26 mg shell option MI command MIX command 112 33 mixed mode definition description 6 MIX command 112 33 restrictions typical display ML command 12 34 mode commands 12 4 modifying current directory 12 17 data values memory map 4 2 mouse icon MOVE command moving a window 12 34 MR command 12 34 MS command 12 35 multiple debuggers invoking 2 8 n debugger option natural format Next C Statement toolbar icon 6 10 NEXT command Next toolbar icon 6 10 nonexistent memory locations 4 2 notational conventions ivitoM Index o octal display format o shell option obj extension 7 10 object code v option loading global symbols only v option 12 13 loading symbol table only s option 2 13 s option 5 3 object files creating loading after invoking the debugger 5 4 LOAD command 12 28 symbol table only 12 50 while invoking the debugger_P 7 B 9 with global symbols only 2 13 with symbol table without symbol Ta OAD online help accessing 1 14 tof1 15 Open File dialog box Open Take File dialog box 3 11 Open toolbar icon open collector output definition operating system entering commands from the debug ger 3 5 to 3 13 12 54 entering commands from the PDM exiting from system shell operators 11 17 amp operator 7 8 operator indirection Boolean precedence causing side effects
194. id memory Invalid argument Description Action One of the command parameters does not meet the require ments for the command Reenter the command with valid parameters Refer to the appropriate command description in Chapter 12 Sum mary of Commands Debugger Messages C 13 Alphabetical Summary of Debugger Messages Invalid memory attribute Description Action The third parameter of the MA command specifies the type or attribute of the block of memory that is added to the memory map The parameter entered did not match one of the valid attributes Reenter the MA command Use one of the following valid parameters to identify the memory type R ROM R W RAM read only memory read write memory W WOM write only memory PROM read only program memory PRAM read write program memory PROTECT no access memory OUTPORT P W output port INPORT P R input port IOPORT P R W input output port Invalid object file Description Action Either the file specified with File Load Program File Re load Program File Load Symbols the LOAD the SLOAD or the RELOAD command is not an object file that the debug ger can load or it has been corrupted Be sure that you are loading an actual object file Be sure that the file was linked You may want to run cl6x with the z op tion or Ink6x again to create an executable object file If the file you attempted to load was a valid executable obje
195. ig endian format me option The me option tells the debugger that the object file to be loaded is in big endian format The default is little endian format Identifying the processor to be debugged n option The n option is valid only when you are using the emulator The n option al lows you to specify which particular C6x to debug when you are using the Spawn command to invoke multiple debuggers The processor name must match one of the names defined in your board cfg file The format for this op tion is n device_name Getting Started With the Debugger a ti Summary of Debugger Options Device names can be any string less than 32 characters long however they cannot contain double quotes a line feed or a newline character For more information about the board cfg file see Appendix B Describing Your Target System to the Debugger Identifying the port address p option The p option specifies which port the debugger uses to communicate with the emulator The p option is valid only when you are using the emulator The for mat for the p option is p port address The p option identifies the I O port address that the debugger uses for communicating with the emulator If you used the default switch settings you do not need to use the p option If you use nondefault switch settings you must use p For information on switch settings see the XDS51x Installation Guide determine your
196. ile for the emurst exe command Execute this command after powering up the target board See section 2 5 on page 2 6 For more information on setting up the D OPTIONS environment vari able see page 2 5 Debugger Messages C 5 Alphabetical Summary of Debugger Messages C 6 Cannot map into reserved memory Description Action The debugger tried to access unconfigured reserved nonex istent memory Remap the reserved memory accesses Cannot map port address Description Action You attempted to do a connect disconnect on an illegal port address Be sure that you are connecting to or disconnecting from an address that is mapped in as an input output or I O port Cannot open config file Description Action Cannot open Description Action The SCONFIG command cannot find the screen customiza tion file that you specified The debugger also displays this message when you try to load a screen customization file that was saved by an older version of the debugger J Be sure thatthe filename was typed correctly If it was not reenter the command with the correct name If it was re enter the command and specify full path information with the filename Be sure that the screen customization file was saved us ing the current version of the debugger rather than an older version of the debugger filename The debugger attempted to show filename in the File window but could not find the file
197. ile is named filename x The general format of this file s contents is mr Reset the memory map MA commands Define the new memory map map on Enable mapping This sequence of commands resets the memory map defines a new memory map and enables mapping Of course you can include any oth er appropriate commands in this batch file Invoke the debugger as usual The debugger reads the initialization batch file during invocation Before you begin debugging read in the commands from the new batch file using the File Execute Take File menu option This redefines the memory map for the current debugging session You can also use the t option when you invoke the debugger instead of the File Execute Take File menu option The t option allows you to specify a new batch file to be used instead of the default initialization batch file Defining a Memory Map 4 13 Simulating I O Space Simulator Only 4 8 Simulating I O Space Simulator Only Note In the fixed point simulator sim62x only external memory can be used for simulating I O space Simulating I O space is not supported by the fast ver sion of the fixed point simulator sim62xfast or the floating point version of the simulator sim67x In addition to adding memory ranges to the memory map you can use the Memory Mapping menu option to add I O ports to the memory map Then by connecting to the port address the debugger simulates external I O cycle read
198. in Figure 8 1 shows the Profile window with some default condi tions _j Column headings show the labels for the default set of profile data including Count Inclusive Incl Max Exclusive and Excl Max _j The data is sorted on the address of the first line in each area _ All marked areas are listed including disabled areas You can modify the Profile window to display selected profile areas or different data you can also sort the data differently The following subsections explain how to do these things 8 20 Viewing Profile Data Viewing different profile data By default the Profile window shows a set of statistics labeled as Count Inclu sive Incl Max Exclusive and Excl Max The Address field which is not part of the default statistics can also be displayed Table 8 4 describes the statistic that each field represents Table 8 4 Types of Data Shown in the Profile Window Label Count Inclusive Incl Max inclusive maximum Exclusive Excl Max exclusive maximum Address fin Profile Type C Function C Function C Function C Function Profile Data The number of times a profile area is entered during a session The total execution time cycle count of a profile area including the execution time of any subroutines called from within the profile area The maximum inclusive time for one iteration of a profile area The total execution time cycle count of a profile area excluding th
199. in the directories you specify with the D_DIR environment variable If the PDM cannot find the initialization file you will see this message Cannot open take file acca Note The PDM environment uses the interprocess communication IPC features of UNIX shared memory message queues and semaphores to provide and manage communications between the different tasks If you are not sure whether the IPC features are enabled see your system administrator To use the PDM environment you should be familiar with the IPC status ipcs and IPC remove ipcrm UNIX commands If you use the UNIX task kill kill com mand to terminate execution of tasks you will also need to use the ipcrm command to terminate the shared memory message queues and sema phores used by the PDM When you debug a multiprocessing application each processor must have its own debugger These debuggers can be invoked individually from the PDM command line To invoke a debugger use the SPAWN command The syntax for SPAWN is spawn emu6x n processor_name_ filename options _jJ emu x is the executable that invokes the debugger To invoke a debugger the PDM must be able to find the executable file for that debugger The PDM first searches the current directory and then searches the directories listed with the PATH statement or path environ ment variable Invoking the Debuggers and the PDM n processor name supplies a processor name You must use th
200. in the expression Running Code 6 11 Benchmarking 6 5 Benchmarking The debugger allows you to keep track of the number of CPU clock cycles consumed by a particular section of code The debugger maintains the count in a pseudoregister named CLK This process is referred to as benchmarking Benchmarking code is a multiple step process Step 1 Seta software breakpoint at the statement that marks the beginning of the section of code that you want to benchmark For more in formation about setting software breakpoints see section 6 7 on page 6 14 Step 2 Seta software breakpoint at the statement that marks the end of the section of code that you want to benchmark Step 3 Enter any run command to execute code up to the first breakpoint Step 4 From the Target menu select Run Benchmark When the processor halts at the second breakpoint the value of CLK is valid To display it use the command or enter it into the Watch window with the Setup Watch Variable menu option This value is valid until you enter another run command OO E_ _ _ _E_E_ _ _ _ _ E_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ____ Notes 1 Run Benchmark or RUNB command counts CPU clock cycles from the current PC to the breakpoint This count is not cumulative You cannot add the number of clock cycles between points A and B to the number of cycles between points B
201. information shown in the PDM display area use dlog filename This command opens a log file called filename that the information is recorded into If you plan to execute the log file with the TAKE command the filename must have a pdm extension _j To end the recording session enter dlog close lf necessary you can write over existing log files or append additional informa tion to existing files The extended format for the DLOG command is dlog filename a w The optional parameters control how the log file is created and or used _ Appending to an existing file Use the a parameter to open an existing file and append the information in the display area J Writing over an existing file Use the w parameter to open an existing file and write over the current contents of the file This is the default action if you specify an existing filename without using either the a or w options you will lose the contents of an existing file if you do not use the append a option Controlling PDM command execution 11 10 You can control the flow of PDM commands in a batch file or interactively With the IF ELIF ELSE ENDIF or LOOP BREAK CONTINUE ENDLOOP flow control commands you can conditionally execute debugger commands or set up a looping situation respectively _j To conditionally execute PDM commands use the IF ELIF ELSE ENDIF commands The syntax is if expression PDM commands elif expression PDM commands else PDM
202. ing 0 00 cee eee eee ee eens A Sample Memory Map 00600000 c eee eee eee ee eee eee een en en eees Defining and Executing a Memory Map in a Batch File 08 Defining a memory map in a batch file 0 0 ccc eens Executing a memory map batch file 0 0 0 cee eens Returning to the Original Memory Map 0 0 0 cece eee ees Using Multiple Memory Maps for Multiple Target Systems 0 0005 Simulating I O Space Simulator Only 0 0 00 0c eee eee Connecting an VO port o2 cicd a sadn oc hs caren amp ed weekend diner Seaion me we ee emves amp Di connecung an VO DON 424224 pgi eiaa a a a a E cae cume EE eee cae Simulating External Interrupts Simulator Only 0 0 ccc eee Setting Up your NDULTIE x cnc0xenevenady vende hes een ey da Raw a ed neds Paw na keka Connecting your input file to the interrupt PIN 0 0 0 c ee ee eee Disconnecting your input file from the interrupt pin 0 0 0 ccc eee Listing the interrupt pins and connecting input files 0 0 0 c cence ees Tells you how to use the debugger modes to view the source files and how to load source files and object files zA 5 2 Loading and Displaying Assembly Language Code 0 cc cee eee ees Loading an object file and its symbol table 0 ccc cece eee Loading an object file without its symbol table 0 0 0 0 cece eee Loadin
203. ing including single stepping into or over function calls You can set or clear a breakpoint with a click of the mouse You can define a memory map that identifies the por tions of target memory that the debugger can access The debugger can execute commands from a batch file providing you with an easy method for entering often used command sequences About the C Source Debugger Interface 1 2 About the C Source Debugger Interface The C source debugging interface improves productivity by allowing you to de bug a program in the language it was written in You can choose to debug your programs in C assembly language serial assembly or all three The Texas Instruments advanced programmer s interface follows the conven tions used by your windowing system reducing learning time and eliminating the need to memorize complex commands A shortened learning curve and increased productivity reduce the software development cycle so you can get to market faster Figure 1 1 identifies several features of the debugger display Figure 1 1 The Basic Debugger Display Pulldown menus are available for most tasks File Edt View Toolbar icons let you select com C source display Disassembly Natural format mands quickly display data displays Setup Memory Target Mode Profile Analysis Window Help S 2 2 ee e puzzle_c OO105 a Disassembly for i m O m size m 3 puzzl m true OOOU1SSs8 fori i
204. ing as you like as long you separate them with semicolons and enclose the entire string of commands in quotation marks Also you can identify command parameters by a percent sign followed by a number 1 2 etc The total number of characters for an individual command expanded to include parameter values is limited to 132 This restriction applies to the debugger version of the ALIAS command only Previously defined alias names can be included as part of the definition for a new alias You can find the current definition of an alias by entering the ALIAS command with the alias name only To see a list of all defined aliases enter the ALIAS command with no parameters Enter Assembly Mode asm Mode Assembly none basic debugger E PDM E profiling The ASM command changes from the current debugging mode to assembly mode If you are already in assembly mode the ASM command has no effect Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description bl Add Software Breakpoint ba address Setup Breakpoints HO basic debugger E PDM profiling The BA command sets a software breakpoint at a specific address The address can be an absolute address any C expression the name of a C func tion or the name of an assembly language label You can s
205. ining Areas for Profiling Unmarking an area If you want to stop collecting information about a specific area unmark it The easiest way to unmark an area is to double click the green or white ar row s next to marked line range or function This unmarks the line range or function You can also unmark an area by using the Profile Marking dialog box 1 5 6 Open the Profile Marking dialog box by using one of these methods _ From the Profile menu select Select Areas J From the context menu for the Profile window select Select Areas In the Level box select C Assembly or Both In the Area box select Lines Ranges Functions or All areas See Table 8 3 for a list of valid combinations Depending on what you select in step 3 do one or more of the following _j Next to Lines enter an absolute address C expression assembly label or line number J Next to Ranges enter a Start and an End value as absolute address es C expressions assembly labels or line numbers J From the Module combo box select a specific filename From the Function combo box select a specific function name See Table 8 3 for a list of valid combinations Click Unmark Click Close to close the dialog box Restrictions on profiling areas 8 12 The following restrictions apply to profiling areas E E An area cannot begin or end in the delay slot of a load instruction emulator only An area cannot begi
206. ion Toolbar selection Environments Description eval Syntax Menu selection Toolbar selection Environments Description Execute Alternative Commands Batch File Only ELSE provides an alternative list of or PDM commands in the IF ELSE ENDIF or IF ELIF ELSE ENDIF command sequences respectively See pages 12 26 and 12 27 for more information about these commands Terminate Conditional Sequence Batch File Only ENDIF identifies the end of a conditional execution command sequence begun with an IF command See pages 12 26 and 12 27 for more information about these commands Terminate Looping Sequence Batch File Only ENDLOOP identifies the end of the LOOP ENDLOOP command sequence See pages 12 28 and 12 29 for more information about the LOOP ENDLOOP commands Evaluate Expression eval expression e expression none none basic debugger L PDM profiling The EVAL command evaluates an expression like the command does but does not show the result in the display area of the Command window EVAL is useful for assigning values to registers or memory locations in a batch file where it is not necessary to display the result Evaluate Expression and Set to Variable PDM Environment eval g group processor name variable name expressior format none none PDM C profiling The EVAL command evaluates an expression in a debugger and sets a vari able to the result of the expression a basic debugger Syntax
207. ion which invokes the optimizer with the g option you turn on the maximum amount of optimization that is compatible with debugging The o option applies only to C code not to assembly If you have trouble debugging loops in your code you can use the mu shell option to turn off software pipelining Software pipelined loops are sometimes difficult to debug because the code is not presented serially Profiling optimized code 2 2 If you intend to profile optimized code use the mg shell option with the g and o options The mg option allows you to profile optimized code by turning on the maximum amount of optimization that is compatible with profiling When you combine the g and o options with the mg option all of the line directives are removed except for the first one and the last one Identifying Alternate Directories for the Debugger to Search D_DIR 2 2 Identifying Alternate Directories for the Debugger to Search D_DIR The debugger uses the information you provide via the D_DIR environment variable to locate the directory that contains the auxiliary files Such as siminit cmd or emuinit cmd that it needs Setting up D_DIR for Windows operating systems To set the D_ DIR environment variable for Windows operating systems use this syntax SET D_DIR pathname pathnames For example to set up a directory named tools dir for auxiliary files on your hard drive enter SET D DIR c too
208. ional Memory window Change the format for displaying data values sett 12 49 Display the current debugger version version 12 58 Continuously display the value of a variable wa 12 58 register or memory location within the Watch window Delete a data item from the Watch window wd 12 59 Show the type of a data item whatis 12 60 2 61 Delete all data items from the Watch window wr 1 Summary of Commands 12 5 Functional Summary of Debugger Commands Performing system tasks 12 6 To do this Define your own command string Change the current working directory from within the debugger environment Clear all displayed information from the display area of the Command window List the contents of the current directory or any other directory Record the information shown in the display area of the Command window Display a string to the Command window while executing a batch file Display a help topic for a debugger command Conditionally execute debugger commands in a batch file Loop debugger commands in a batch file Pause the execution of a batch file Exit the debugger Reset communication with the emulator Reset the target system Associate a beeping sound with the display of error messages Enter any operating system command or exit to a system shell Execute commands from a batch file Delete an alias definition Name additional directories that can be searched when you load source files Use this command
209. ior depends on the type of parameter you supply _j If you do not supply an expression the program executes until it encoun ters a breakpoint or until you do one of the following actions mM Click the Halt icon on the toolbar Es m From the Target menu select Halt Mm Press Sc _jJ If you supply a logical or relational expression the run becomes conditional Section 6 4 Running Code Conditionally page 6 11 discusses this in detail _j Ifyou supply any other type of expression the debugger treats the expres sion as a count parameter The debugger executes count instructions halts and updates the display Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description sa Benchmark Code runb Target gt Run Benchmark none basic debugger E PDM E profiling The RUNB command executes a specific section of code and counts the number of CPU clock cycles consumed by the execution For RUNB to operate correctly execution must be halted by a software breakpoint After RUNB execution halts the debugger stores the number of cycles into the CLK pseudoregister For a complete explanation of the RUNB command and the benchmarking process read section 6 5 Benchmarking on page 6 12 Run Free Emulator Only runf none none basic debugger PDM profiling
210. isplays the name of the file shown in the window instead of the word File There are eight different windows divided into these general categories _j Code display windows display assembly language or C code There are three code display windows m A File window displays any text file that you want to display its main purpose however is to display C source code You can display multi ple File windows at one time m Ihe Disassembly window displays the disassembly assembly lan guage version of memory contents m The Calls window identifies the current function and previous function calls if you are debugging a C program _ The Profile window displays statistics about code execution _j Data display windows are for observing and modifying various types of data There are three data display windows m A Memory window displays the contents of a range of memory You can display multiple Memory windows to allow you to view different sections of memory at one time m The CPU window displays the contents of C6x registers m A Watch window displays selected data such as variables specific registers or memory locations You can display multiple Watch win dows to allow you to view multiple variables register or memory loca tions at one time J The Command window provides an area for typing in commands and re entering commands and an area for displaying various types of informa tion such as progress messages error messages
211. ist of defined memory types 5 6 7 Creating or Modifying the Memory Map From the Attribute drop list select Custom The Memory Attributes dia log box appears Hemor Attributes x Combination Types RAM OPORT O ROM O PRAM O WOM O PROM PROTECT List of basic memory types INPORT OUTPORT From the Basic Types column select the individual memory attributes that you want to apply to the memory range that you are adding Mnemonic Basic Memory Type R Readable W Writable P I O port EX External TX Text SH Shared Click OK This closes the Memory Attributes dialog box and applies the customized memory attributes to the memory range in the Memory Map Control dialog box Add other memory ranges as needed then click OK to close the Memory Map Control dialog box Defining a Memory Map 4 5 Creating or Modifying the Memory Map Deleting a range of memory To delete a range of memory follow these steps 1 Select Mapping from the Memory menu This displays the Memory Map Control dialog box From the list of defined ranges at the top of the dialog box select the range that you want to delete Click Delete Click OK Before you can delete a memory address used as a simulated I O port from the memory map you must disconnect the address See the Disconnecting an I O port section on page 4 15 for information Modifying a defined range of memory 4 6 To modify a defined ra
212. it does enter the USE command to identify the file s directory Files must be disconnected from ports Description Action You attempted to delete a memory map that has files con nected to it You must disconnect a port with the MI command before you can delete it from the memory map File not found Description Action The filename specified for the FILE command was not found in the current directory or any of the directories identified with D_SRC Be sure that the filename was typed correctly If it was reenter the FILE command and specify full path information with the filename Alphabetical Summary of Debugger Messages File not found filename Description Action The filename specified for the LOAD RELOAD SLOAD or TAKE command was not found in the current directory or any of the directories identified with D_ SRC Be sure that the filename was typed correctly If it was reenter the command and specify full path information with the filename File too large filename Description Action You attempted to load a file that exceeded the maximum loadable COFF file size Loading the file without the symbol table SLOAD or use cl6x with the z option or Ink6x to relink the program with fewer modules Float not allowed Description Action This is an expression error a floating point value was used incorrectly See section C 4 Additional Instructions for Expression Err
213. laying a aa 8 21 to 8 22 marking areas 8 8 resetting 18 25 sorting data viewing associated code to Profile window 2 8 24 profiling areas description _8 5 to 8 12 disabling 8 10 to 8 12 12 62 to 12 6 enabling o B 121 12 63 marking restrictions unmarking 12 12 64 valid breakpoints software clearing setting 513 changing display 8 24 to lB 25 12 65 collecting ae Ee full statistics 1 aa 8 A 12 12 36 subset of statistics 8 17 to 8 18 12 38 commands debugger commands available during profil ing MA command summary for batch files 12 62 to summary for debugger command line 12 9 compiling a program for profiling 8 3 description 8 1 to 8 28 entering environment 2 12 8 4 highlighting marked areas 8 6 to 8 7 Index 16 profiling continued key features overview resetting Profile window restrictions resuming a session running a session saving statistics all views current view stopping pore listing resetting strategy switching to profile mode 12 39 viewing data associated code to description to displaying areas 8 24 to displaying different data to sorting data program debugging 1 13 entry point finding resetting halting execution 6 13 12 42 preparation for debugging running 6 4 to program address breakpoint value pseudoregister ADR 10 13 program memory adding to memory map 4 10 to 4 18 PROM keyword
214. lbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description help Run to Specified Address go address none none basic debugger PDM profiling The GO command executes code up to a specific point in your program If you do not supply an address then GO acts like a RUN command without an expression parameter Halt Target System halt Target Halt E basic debugger E PDM _ profiling The HALT command halts your program if you are using a simulator or halts the target system after you have entered a RUNF command if you are using an emulator When you invoke the debugger it automatically executes a HALT command If you enter a RUNF quit the debugger and later reinvoke the debugger you will effectively reconnect the emulator to the target system and run the debugger in its normal mode of operation Display Help Topic for Debugger Command help debugger command none none basic debugger E PDM profiling The HELP command opens a help topic that describes the debugger command lf you omit the debugger command the debugger displays a list of help topics Summary of Commands 12 25 help Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description if elif else endif Syntax Menu selection Toolbar selection Environments Description 12 26
215. le none basic debugger L PDM The WR command deletes all items from a Watch window and closes the window E profiling To close the default Watch window enter wr _ To close one of the additional Watch windows use this syntax wr window name _j To close all Watch windows enter wr Zoom a Window zoom window name none none basic debugger E PDM profiling The ZOOM command makes the window as large as possible To unzoom a window enter the ZOOM command a second time this returns the window to its prezoom size and position You can spell out the entire window name but you really need to specify only enough letters to identify the window Summary of Commands 12 61 Summary of Profiling Commands 12 3 Summary of Profiling Commands The following tables summarize the profiling commands that are used for marking enabling disabling and unmarking areas and for changing the display in the Profile window These commands are easiest to use from the Profile menu and associated dialog boxes so they are not included in the alphabetical command summary The syntaxes for these commands are provided here so that you can include them in batch files Table 12 1 To mark this area Lines _j By line number address _ All lines in a function Ranges _j By line numbers Functions _j By function name _j All functions in a module Marking areas _j All functions everywhere In C only MC
216. le you must translate it from text to a binary conditioned format so that the debugger can understand it To translate the file use the composer utility that is included with the emulator kit At the system prompt enter the following command composer input file output file _J The input file is the name of the board cfg file that you created in step 1 if the file is not in the current directory you must supply the entire path name If you omit the input filename the composer utility looks for a file called board cfg in your current directory _J The output file is the name that you can specify for the resulting binary file ideally use the name board dat If you want the output file to reside in a directory other than the current directory you must supply the entire path name lf you omit an output filename the composer utility creates a file called board dat and places it in the current directory To avoid confusion use a cfg extension for your text filenames and a dat ex tension for your binary filenames If you enter only one filename on the com mand line the composer utility assumes that it is an input filename Describing Your Target System to the Debugger B 5 Step 3 Specify the Configuration File When Invoking the Debugger B 3 Step 3 Specify the Configuration File When Invoking the Debugger B 6 When you invoke a debugger either from the PDM or at the system prompt the debugger must be able to find the b
217. lect in step 3 do one or more of the following E E E Next to Lines enter an absolute address C expression assembly label or line number If you are entering an absolute address be sure to prefix it with Ox Next to Ranges enter a Start and an End value as absolute address es C expressions assembly labels or line numbers From the Module combo box select a specific filename From the Function combo box select a specific function name See Table 8 2 for a list of valid combinations Click Mark Click Close to close the dialog box Table 8 2 Using the Profile Marking Dialog Box to Mark Areas a Marking lines To mark this area By line number address All lines in a function b Marking ranges To mark this area By line numbers addresses c Marking functions To mark this area By function name All functions in a module All functions everywhere If C level is selected LI LI E E E Select a module name In the Area box select Lines Next to Lines specify a line number Select a function name In the Area box select Lines If C level is selected LI LI E Select a module name In the Area box select Ranges Next to Ranges specify a Start line number and an End line number If C level is selected CO Uo UU Select a function name In the Area box select Functions Select a module name In the Area box select Functions In the
218. leven commands have previously been entered and the PDM is now ready to accept the twelfth command The PDM command history allows you to re enter any of the last twenty com mands _ To repeat the last command that you entered type _j To repeat any of the last twenty commands use the following command number number is the number of the PDM prompt that contains the command that you want to re enter For example PDM 100 gt gt echo hello hello PDM 101 gt gt echo goodbye goodbye PDM 102 gt gt 100 echo hello hello Notice that the PDM displays the command that you are re entering Using the Parallel Debug Manager 11 13 Entering PDM Commands 11 14 E E An alternate way to repeat any of the last twenty commands is to use Istring This command tells the PDM to execute the last command that began with string For example PDM 103 gt gt pstep g GROUPA PDM 104 gt gt send g GROUPA pc CPU C Uxz000 CPU_D 0x2004 PDM 103 gt gt pstep g GROUPB PDM 104 gt gt send g GROUPB pc CPU_A 0x201A CPU_E 0x2014 PDM 105 gt gt p pstep 9 GROUPB To see a list of the last twenty commands that you entered type history The command history for the PDM works differently from that of the debugger the and keys have no commana history meaning for the PDM Defining Your Own Command Strings 11 5 Defining Your Own Command Strings The ALIAS command provides a shorthand method of entering often u
219. line number address _j All ranges in a function _j All ranges in a module _j All ranges everywhere Functions _j By function name _j All functions in a module _j All functions everywhere All areas Jg All areas in a function Jg All areas in a module _j All areas everywhere In C only ECLE ECLF ECLM ECLG ECRE ECRF ECRM ECRG ECFE ECFM ECFG ECAF ECAM ECAG filename line number function filename filename line number function filename function filename function filename Summary of Profiling Commands In disassembly only not applicable DAAF function DAAM filename DAAG In disassembly only EALE EALF EALM EALG address function filename EARE EARF EARM EARG address function filename not applicable EAAF function EAAM filename EAAG Summary of Commands In C and disassembly not applicable DBFM DBFG filename DBAF DBAM DBAG function filename In C and disassembly not applicable EBLF function EBLM filename EBLG not applicable EBRF function EBRM filename EBRG not applicable EBFM EBFG filename EBAF EBAM EBAG function filename 12 63 Summary of Profiling Commands Table 12 4 Unmarking areas To unmark this area Lines LI I E E By line number address All lines in a function All lines in a module All lines everywhere Ranges E E E E By line number address
220. ll cases you can use relative pathnames such as csource or code The debugger can recognize a cumulative total of 20 paths specified with D_ SRC i and USE What the Debugger Does During Invocation A 3 Appendix B Describing Your Target System to the Debugger For the debugger to understand how you have configured your target system you must supply the target configuration information in a file for the debugger to read i If you are using an emulation scan path that contains only one C6x and no other devices you can use the board dat file that comes with the C6x emulator kit This file describes to the debugger the single C6x in the scan path and gives the C6x the name CPU_A Because the debugger auto matically looks for a file called board dat in the current directory and in the directories specified with the D_ DIR environment variable you can skip this appendix J If you plan to use a target system that has multiple C6x devices or that includes devices other than the C6x you must follow these steps Step 1 Create the board configuration text file Step 2 Translate the board configuration text file to a binary structured format so that the debugger can read it Step 3 Specify the formatted configuration file when invoking the debugger These steps are described in this appendix Topic Page Step 1 Create the Board Configuration Text File Step 2 Translate the Configuration File to a
221. llow the steps described below and then restart your emulator Action Check the emulator board to be sure it is installed snugly Check the cable connecting your emulator and target system to be sure it is not loose Check your target board to be sure it is getting the correct voltage _ Check your emulator scan path to be sure it is uninter rupted _ Ensure that your port address is set correctly m Check to be sure the p option used with the D OPTIONS environment variable matches the I O address defined by your switch settings See page 2 5 for more information on the D_OPTIONS envi ronment variable m Check to see if you have a conflict in address space with another bus setting If you have a conflict change the switches on your board to one of the alter nate settings listed in the installation guide Modify the p option of the D_ OPTIONS environment vari able to reflect the change in your switch settings Cannot edit field Description Expressions that are displayed in the Watch window cannot be edited Action If you attempted to edit an expression in the Watch window you may have actually wanted to change the value of a sym bol or register used in the expression Use the or EVAL command to edit the actual symbol or register The expres sion value is automatically updated C 4 Alphabetical Summary of Debugger Messages Cannot find open initialization file Description Action The deb
222. lock of memory word by word using the Memory Fill Word command 1 From the Memory menu select Fill Word This displays the Fill Memory dialog box Fill memory Ei Address Enter the first address of the block that you want to fill Length Enter a length in words of the block Data Enter the data value that you want to use Cancel Help 2 Inthe Address field enter the first address in the block that you want to fill To specify a hex address prefix the address number with 0x other wise the debugger treats the number as a decimal address Managing Data 7 11 Managing Data in Memory 3 Inthe Length field enter a length in words of the block 4 Inthe Data field enter a value that you want placed in each word in the block 5 Click OK For example to fill memory locations 0x1100 0x113B with the value OxABCD you could enter Fill memory X Address ox 100 Length g Data Oxabod Cancel Help If you want to check whether memory has been filled correctly you can change the Memory window display to show the block of memory beginning at memory address 0x1100 Sit MEMORY OE x Address Ox 1100 Change the Memory display ADDO ARK KIKIA OOK KXXXXXKAXX a by entering a new address KERR RODIKX KIOOOOAKX KAKKAXKKKX RA KXXXXXX RURIKDKDOQEIKX XK ROKK KKK KOK KAXAXXXAXXX DC HRIOEKX KAKOA KKK KK WKN TT OXDKDA BORK X KAXA A MEK KKK KKK KICK MADAM KX tI You can also use the
223. ls dir Be careful not to precede the equal sign with a space Setting up D_DIR for SPARC and HPUX operating systems Tosetthe D_ DIR environment variable for Sparc and HPUX operating sys tems use this syntax setenv D_DIR pathname If you are using SunOS _j For C shells setenv D_DIR pathname _ For Bourne or Korn shells D_ DIR pathname export D_DIR Be sure to enclose the directory name within quotes Getting Started With the Debugger 2 3 Identifying Directories That Contain Program Source Files D_SRC 2 3 Identifying Directories That Contain Program Source Files D_ SRC The debugger uses the information you provide via the D_SRC environment variable to locate the directories that contain program source files that you want to access from the debugger Setting up D_SRC for Windows operating systems To set the D_SRC environment variable for a Windows operating system use this syntax SET D_SRC pathname pathnameo For example if your C6x programs were in a directory named source on drive C the D_SRC setup would be SET D_ SRC c source Be careful not to precede the equal sign with a space Setting up D_SRC for SPARC and HPUX operating systems To set the D_SRC environment variable for a Solaris or HPUX operating sys tem use this syntax setenv D_SRC pathname pathname2 If you are using SunOS _j For C shells setenv D_SRC pat
224. ly Language Code page 5 2 Run the loaded file You can run See Chapter 6 Running Code the entire program run parts of the program or single step through the program Stop the program at critical See section 6 7 Using Software points and examine important Breakpoints and Chapter 7 information Managing Data Step 6 Once you have decided what changes must be made to your program exit the debugger edit your source file and return to Step 1 Overview of the Code Development and Debugging System 1 13 Accessing Online Help 1 7 Accessing Online Help Online help is available to provide information about menu options dialog boxes debugger windows and debugger commands Accessing a list of help topics To display a list of help topics follow these steps 1 Open the list of help topics by using one of these methods J Click the Help Topics icon on the toolbar 7 _ From the Help menu select Help Topics _ From the command line enter help 2 Double click the topic that you want to view Accessing context sensitive help You can access context sensitive help using the following methods _ To find out about an item in the debugger display follow these steps 1 Click the Help icon on the toolbar hi This changes the pointer to a question mark 2 Select the menu option or click on the item that you want more in formation about J To find out about a dialog box or a window follow th
225. ly executes a HALT command Thus if you use the RUNF command quit the debugger and later reinvoke the debugger you effectively reconnect the emulator to the target system and run the debugger in its normal mode of operation When you invoke the debug ger use the s option to preserve the current PC and memory contents To provide memory visibility the emulator completes load and store instruc tions that are already in the pipeline while halting After halting the emulator provides visibility to the register file on pipeline cycle boundaries The memory state provided by the emulator reflects the data that the next memory opera tion accesses The emulator saves the data read from the load instructions and restores this data to the pipeline when the emulator resumes execution Also when the emulator halts all the memory controllers that are internal to the processor halt This allows the memory controllers pipeline to remain syn chronized with the processor s pipeline Running Code 6 13 Using Software Breakpoints 6 7 Using Software Breakpoints During the debugging process you may want to halt execution temporarily so that you can examine the contents of selected variables registers and memory locations before continuing with program execution You can do this by setting software breakpoints at critical points in your code You can set soft ware breakpoints in assembly language code and in C code A software break point
226. mand pind pinname The pinname parameter identifies the interrupt pin and must be one of the ex ternal interrupt pins pins INT4 7 NMI The PIND command detaches the file from the input pin After executing this command you can connect another file to the same pin Listing the interrupt pins and connecting input files 4 18 To verify that your input file is connected to the correct pin use the PINL com mand The syntax for this command is pinl The PINL command displays all of the unconnected pins first followed by the connected pins For a pin that has been connected it displays the name of the pin and the absolute pathname of the file in the Command window Chapter 5 Loading and Displaying Code The main purpose of a debugging system is to allow you to load and run your programs in a test environment This chapter tells you how to load your pro grams into the debugging environment run them on the target system and view the associated source code Topic Page 5 1 Loading and Displaying Assembly Language Code 5 2 Displaying C Code 5 1 Loading and Displaying Assembly Language Code 5 1 Loading and Displaying Assembly Language Code To debug a program you must load the program s object code into memory You create an object file by compiling assembling and linking your source files see section 2 1 Preparing Your Program for Debugging on page 2 2 After you invoke the debugger you can load objec
227. mbly reverse assembly of the memory contents If you load object code into memory the assembly language code in the Disas sembly window is the disassembly of that object code If you do not load an object file the disassembly will not be very useful Some commands are valid only in certain modes especially if a command ap plies to a window that is visible only in certain modes In this case entering the command causes the debugger to switch to the mode that is appropriate for the command The following commands are valid only in the modes listed O The CALLS DISP FUNC and FILE commands are valid only in auto and mixed modes _J The MEM command is valid only in assembly and mixed modes Getting Started With the Debugger 2 17 Exiting the Debugger or the PDM 2 9 Exiting the Debugger or the PDM 2 18 To exit the debugger use one of these methods J From File menu at the top of the debugger display select Exit _j Close the application window for the debugger _ From the command line enter quit You can also enter QUIT from the command line of the PDM to quit all of the debuggers and also close the PDM Chapter 3 Entering and Using Commands The debugger provides you with several methods for entering commands _ From the toolbar J From the menu bar _j With function keys _ From the command line J From a batch file This chapter describes how you can create aliases for commands and com mand sequences
228. med with the D_ DIR environment variable The TAKE command is similar to the debugger version of this command de scribed on page 12 55 However there are some differences when you enter TAKE as a PDM command instead of a debugger command _ Similarities As with the debugger version of the TAKE command you can nest batch files up to 10 deep _j Differences Unlike the debugger version of the TAKE command m There is no suppress echo flag parameter Therefore all command output is echoed to the PDM window and this behavior cannot be changed m To halt batch file execution you must press instead of ESC m The batch file must contain only PDM commands no debugger com mands The TAKE command is advantageous for executing a batch file in which you have defined often used aliases Additionally you can use the SET command in a batch file to set up group configurations that you use frequently and then execute that file with the TAKE command You can also put your flow control commands described in Controlling PDM command execution on page 11 10 in a batch file and execute the file with the TAKE command Using the Parallel Debug Manager 11 9 Entering PDM Commands Recording information from the PDM display area By using the DLOG command you can record the information shown in the PDM display area into a log file This command is identical to the debugger DLOG command described on page 12 20 _ To begin recording the
229. memory ranges that are defined for the debugger s memory map The ML command lists the starting address ending address and read write characteristics of each defined memory range Move a Window move window name X position Y position width length none none basic debugger E PDM profiling The MOVE command moves the upper left corner of the window to the speci fied XY position repositioning the rest of the window relative to that corner If you choose you can resize the window while you move it see the SIZE command for valid width and length values Specify the X position Y position width and length parameters in pixels If you omit these parameters the MOVE command defaults to the window s current position and size You can spell out the entire window name but you need to specify only enough letters to identify the window Reset Memory Map mr none none basic debugger E PDM profiling The MR command resets the debugger s memory map by deleting all defined memory ranges from the map Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description next Save Memory Block to File ms address length filename Memory Save none basic debugger E PDM profiling The MS command saves the values in a block of memory to a system file files are saved in COFF format _j The address parameter ide
230. mulates the operation of the C6x and lets you execute and debug applications programs by using the C source debugger Glossary D 5 Glossary D 6 single step A form of program execution that allows you to see the effects of each statement The program is executed statement by statement the debugger pauses after each statement to update the data display windows status bar An area atthe bottom of the debugger application window that displays context sensitive help and the status of the processor symbol table A file that contains the names of all variables and functions in your program target system A C6x board that works with the emulator the emulator doesn t contain a C6x device so it must use a C6x target board Usually the target system is a board that you have designed you use the emula tor and debugger to help you debug your design totem pole output An output circuit that actively drives both high and low logic levels Watch window A window that displays the values of selected expressions symbols addresses and registers window A defined rectangular area of space on the display software breakpoints defining command strings memory contents halting temporarily D 7 command 11 13 to 11 14 12 12 command description display formats 7 24 12 12 examining register contents modifying PC side effects 7 5 to 7 6 amp operator SEMUSS SIM 3 8 in alias parameter
231. n none none basic debugger PDM _ profiling The PDM supports a command history that is similar to the UNIX command history The PDM prompt identifies the number of the current command This number is incremented with every command The PDM command history allows you to reenter any of the last twenty commands J The numberparameter is the number of the PDM prompt that contains the command that you want to reenter J The string parameter tells the PDM to execute the last command that began with string J The command tells the PDM to execute the last command that you entered Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description addr Substitute Result of an Expression variable name expression none none PDM Unlike the SET command the commandfirst evaluates the expression and then sets the variable name to the result The expression can be any expression that uses the symbols described in section 11 7 Understanding the PDM s Expression Analysis on page 11 17 The variable name can consist of up to 128 alphanumeric characters or underscore characters basic debugger E profiling Display Code at Specified Address addr address function name none none basic debugger L PDM Use the ADDR command to display C code or the disassembly at a specific point ADDR s behavior changes depending o
232. n C does notmark the associated code in disassembly 2 Areas can be nested for example you can mark a line within a marked range The debugger reports statistics for both the line and the function 3 Ranges cannot overlap and they cannot span function boundaries a Profiling Code Execution 8 5 Defining Areas for Profiling To mark an area with the mouse follow these steps 1 Inthe File or Disassembly window click once to the left of the line that you want to mark or to the left of the first line of the range that you want to mark Click next to the line that you want to mark w Disassembly ofj x Addr ss OOO00 ce8s OO00 coec OO00 c30 OO00 co4 OOO00 c9s 0000cc OO00 cad 00015810 oooog4000 Olbedcea 01800068 O528680f8 Offfe410 OOoOou4000 MY L1 B S HOF MVE 52 HVEH S2 SUB L1 B S1 HOP Omycdd B3 Ox0000 B3 A4 A10 A10 time stub 3 When you click once next to a line a mouse icon appears telling you that you need to click one more time w Disassembly Address 0000F cg4 05100058 O000 c88 00015810 OO007c8c 40 Olbedcva A mouse icon tells you that you need to click one more time OO007 c94 OLS0006e OO007 c98 O52880f6 0000cc Offfe4io OO00 caO OOUO4000 2 Choose to mark a single line or a range J To mark a single line click the mouse icon This turns the mouse icon into a green right arrow w Disassembly Address OOO00 ce84 05100058 OO
233. n example of a list sound on off This provides two choices sound on or sound off Unless the list is enclosed in square brackets you must choose one item from the list Related Documentation From Texas Instruments The following books describe the TMS320C6x and related support tools To obtain a copy of any of these TI documents call the Texas Instruments Litera ture Response Center at 800 477 8924 When ordering please identify the book by its title and literature number TMS320C6x Assembly Language Tools User s Guide literature number SPRU186 describes the assembly language tools assembler linker and other tools used to develop assembly language code assembler directives macros common object file format and symbolic debugging directives for the C6x generation of devices TMS320C6x Optimizing C Compiler User s Guide literature number SPRU187 describes the C6x C compiler and the assembly optimizer This C compiler accepts ANSI standard C source code and produces as sembly language source code for the C6x generation of devices The as sembly optimizer helps you optimize your assembly code TMS320C62x C67x CPU and Instruction Set Reference Guide literature number SPRU189 describes the C62x C67x CPU architecture instruc tion set pipeline and interrupts for these digital signal processors TMS320C6201 C6701 Peripherals Reference Guide literature number SPRU190 describes common peripherals a
234. n in the delay slot of a branch instruction An area can end in the last delay slot of a branch instruction but cannot end in any other delay slot of a branch instruction UOIINIAXF apoy bullljOsg l 8 Table 8 3 Disabling Enabling Unmarking or Viewing Areas a Disabling enabling unmarking or viewing lines To identify this area By line number Lj addresst gJ J All lines in a function All lines in a module All lines everywhere LI E E E E E If the C level is selected Select a module name In the Area box select Lines Next to Lines specify a line number Select a function name In the Area box select Lines Select a module name In the Area box select Lines In the Area box select Lines Be sure that Function and Module are set to N A If the Assembly level is selected E E LI E LI E E LI In the Area box select Lines Next to Lines specify an abso lute address a C expression or an assembly label Select a function name In the Area box select Lines Select a module name In the Area box select Lines In the Area box select Lines Be sure that Function and Module are set to N A T You cannot specify line numbers or addresses when using the Profile View dialog box b Disabling enabling unmarking or viewing ranges To identify this area By line numbers J addressest g J All ranges in a function All ranges in a module
235. n the current debugging mode E profiling In assembly mode ADDR works like the DASM command positioning the code starting at address or at function name as the first line of code in the Disassembly window _j In aC display ADDR works like the FUNC command displaying the code starting at address or at function name as the first line of code in the File window _j In mixed mode ADDR affects both the Disassembly and File windows by displaying code starting at address or at function name as the first line of code in the Disassembly and File window Note ADDR affects the File window only if the specified address is in a C function Summary of Commands 12 13 alias Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 14 Define Custom Command Siring alias alias name command string Setup Alias Commands none basic debugger PDM profiling You can use the ALIAS command to associate one or more debugger or PDM commands with a single alias name J The debugger version of the ALIAS command allows you to associate one or more debugger commands with a single alias name _ The PDM version of the ALIAS command allows you to associate one or more PDM commands with a single alias name or associate one or more debugger commands with a single alias name You can include as many commands in the command str
236. nal Memory Map If you modify the memory map during a debugging session you may want to go back to the original memory map without quitting and reinvoking the debug ger You can do this by resetting the memory map and then using the File Execute Take File menu option to read in your original memory map from a batch file Suppose for example that you set up your memory map in a batch file named mem map You can enter these commands to go back to this map 1 From the command line enter mr to reset the memory map 2 From the File menu select Execute Take File 3 From the Open Take File dialog box select mem map to reread the default memory map The MR command resets the memory map You could put the MR command in the batch file preceding the commands that define the memory map The File Execute Take File menu option tells the debugger to execute commands from the specified batch file Using Multiple Memory Maps for Multiple Target Systems 4 7 Using Multiple Memory Maps for Multiple Target Systems If you are debugging multiple applications you may need a memory map for each target system Here is the simplest method for handling this situation 1 2 Let the initialization batch file define the memory map for one of your appli cations Create a separate batch file that defines the memory map for the addition al target system The filename is unimportant but for the purposes of this example assume that the f
237. nalysis module allows you to _j Count events The analysis module has an internal counter that can count seven types of events You can count the number of times a defined bus event or other internal event occurs during execution of your program Events that can be counted include CPU clock cycles WE Execute packets W Pipeline stalls W Interrupt context switches W Interrupts taken W Branches taken E NOPs You can count only one event at a time Set hardware breakpoints You can also set up the analysis module to halt the processor during execution of your program The events that cause the processor to stop are called break events You can define a break event as one or more of the following conditions m Any program address m A low level on the EMUO pin EMUO driven low m A low level on the EMU1 pin EMU1 driven low Hardware break events allow you to set breakpoints in ROM and program memory In addition any of the debugger s basic features available with software breakpoints can also be used with hardware breakpoints As a result you can take advantage of all the step and most of the run com mands i Set global breakpoints with EMU0 1 pins In a system of multiple C6x processors connected by EMU0 1 emulation event pins setting up the EMU0 1 pins allows you to create global breakpoints Whenever one pro cessor in your system reaches a breakpoint software or hardware all processors in the system can be halte
238. nalysis module to 10 14 Analysis Statistics window 10 11 10 6 counting events dialog box EMU pins customized analysis commands 10 12 defining conditions to EMU pins restrictions _ 10 7 enabling 10 4 functions 10 2 global breakpoints hardware breakpoints EMU pins_ 10 2 10 7 list of 10 2 10 8 internal counter major functions process 10 3 running programs 10 10 viewing analysis data 10 9 i analysis pseudoregisters summary 10 13 to 10 14 Analysis Statistics window emulator 10 11 simulator 9 9 analysis status pseudoregister AST 10 14 ANSI C definition arithmetic operators 13 2 arrays displaying 7 18 to member operators 13 2 as shell option ASM command 12 14 assembler 1 8 assembly language code displaying in Disassembly window 2 15 displaying object code to displaying source code assembly mode ASM command definition description Index 2 assembly mode continued restrictions typical display assembly optimizer assignment operators to assistance from TI fvii AST pseudoregister auto mode C command definition description restrictions typical ony janga 2 15 typical C display 2 16 autoexec bat file definition BA command 12 15 basic data management commands basic run commands l 4 to 6 9 batch files board cfg B 1 to B 6 sample _B 2 z board dat B 1 to B 6 controlling ET ade 11 10 to 11 12 conditional
239. nce If you are marking a line and you see the mouse icon click again If you are not in profile mode single clicking next to a line or function sets a software breakpoint Laaa Profiling Code Execution 8 7 Defining Areas for Profiling Marking an area with a dialog box You can use a dialog box to mark areas for profiling To do so follow these steps 1 Open the Profile Marking dialog box by using one of these methods From the Profile menu select Select Areas J From the context menu for the Profile window select Select Areas This displays the Profile Marking dialog box If you select Lines enter an absolute address C expression assembly label or line number If you select Ranges enter a start and end value as absolute addresses C expressions assembly labels or line numbers Select to mark a single line a range or a C function Profile Marking Area Marking Level Select C or fC Assembly level ini C Assembly Both Skat DO Ranges Start f Functions O All areas Module Function ty dy ae Unmark Disable Close Help You can select a specific filename You can select a specific function name 2 Inthe Level box select C or Assembly 3 Inthe Area box select Lines Ranges or Functions See Table 8 2 for a list of valid combinations 8 8 4 5 6 Defining Areas for Profiling Depending on what you se
240. nd Command Result Displayed in the Command Window 7 aai aai O 0 1 aai 0 1 23 aai 0 2 45 24 4194425 j 0x5a 90 The EVAL evaluate expression command behaves like the command but does not show the resultin the display area of the Command window The syn tax for this command is eval expression or e expression EVAL is useful for assigning values to registers or memory locations in a batch file where it is not necessary to display the result For information about the PDM version of the EVAL command refer to section 11 9 Evaluating Expressions on page 11 21 Basic Methods for Changing Data Values 7 4 Basic Methods for Changing Data Values The debugger provides you with a great deal of flexibility in modifying various types of data You can use the debugger s overwrite editing capability which allows you to change a value simply by typing over its displayed value You can also use the data management commands for more complex editing Editing data displayed in a window Use overwrite editing to modify data in a data display window you can edit _j Registers displayed in the CPU window O Memory contents displayed in a Memory window _ Values or elements displayed in a Watch window To modify data in a data display window follow these steps 1 Select the data item that you want to modify Choose one of these methods _J Double click the data item that you want to modify _J Select the data item th
241. nd _ 2 8 to path environment variable PATH statement PAUSE command Index PC program counter definition finding the current PC modifying PDM invocation PDM command PESC command PF command 12 36 PHALT command PINC command PIND command PINL command pointers natural format 13 5 typecasting pointing definition port address 2 12 4 14 to 4 15 definition ports simulating 4 14 to 4 15 12 31 12 33 PQ command 12 38 PR command 12 39 PRAM keyword 4 10 predefined constants for conditional com mands prf extension processor name 2 11 processors assigning names 11 2 organizing into groups f1 3 toj11 5 PROFILE command profile cycles data 8 25 profile debugger option 2 12 Profile Marking dialog box disabling areas description 8 10 ta 8 11 valid areas 8 13 to 8 14 enabling areas description B 11 valid areas to marking areas description 8 to g g valid areas 8 9 unmarking areas description 8 valid areas to Index 15 Index Profile menu Change View option Profile Mode option Run option Save All option Save View option Select Areas option resuming a session running a session 8 17 Y Profile Run dialog box Profile View dialog box areas for viewing 8 13 Profile View dialog box changing profile display 8 22 8 24 sorting profile data changing profile displey description 1 4 6 20 O to 8 T displaying areas 8 24 to 8 8 25 disp
242. ndow in the C only display How ever there are several ways to display memory in this situation Hint If you want to use the contents of an address as a parameter be sure to prefix the address with the C indirection operator E If you have only a temporary interest in the contents of a specific memory location you can use the command to display the value at this address For example if you want to know the contents of memory location 26 hex you could enter 0x26 The debugger displays the memory value in the display area of the Com mand window If you want to observe a specific memory location over a longer period of time you can display it in a Watch window Use the Setup Watch Variable menu option to do this 1 Inthe Expression field enter 0x26 2 Inthe Format combo box enter x Hexadecimal 3 Click OK The debugger displays the memory value in the Watch window You can also use the DISP command to display memory contents in a Watch window The Watch window shows memory in an array format with the specified address as member 0 In this situation you can also use casting to display memory contents in a different numeric format disp float 0x26 Managing Data 7 9 Managing Data in Memory Saving memory values to a file 7 10 Sometimes it is useful to save a block of memory values to a file You can use the Memory Save menu option to do this the files are saved in COFF format 1 F
243. nds 7 22lto 7 25 editing data in a window editing data with expressions that have side ef fects 7 5lto 7 25 evaluating an expression in a Watch window in memory 7 7 to 7 12 in registers debugger commands alphabetical summary emu command emu6x command 2 7 options 10 tol2 sim6x command P 7 standalone ae task ordering ae under PDM control 2 8 to 2 9 key features messages C 1 Capea setting up fant options D_OPTIONS 2 5 debugging modes assembly mode auto mode command summar default mode 12 4 description 2 14 to 2 17 mixed mode Index 6 restrictions 2 restrictions on validity decrement operator 13 3 debugging modes continued AH 7 default data formats 7 22 to 7 25 debugging mode stopping point for profiling defining an alias defining areas for profiling description s SIt0 disabling areas enabling areas marking areas 8 restrictions unmarking areas defining command strings See aliasing commands command strings deleting watched values determining type of a variable 7 3 developing code 1 7 to device name device types debugger devices SPL TMS320C6x_ B 3 dgroup dialog boxes accessing online help enabling parameters 10 8 DIR command 12 19 directories i debugger option 2 11 auxiliary files for HPUX systems for SPARC systems for Windows 95 systems c6xtools for HPUX systems for SPARC systems for Windows 9
244. nee eee eens AST analysis status occccosedednaeidncea ease da coe etend organ gehen eedeas Using the Parallel Debug Manager 0000 cece eee eee eee eens Describes the parallel debug manager PDM for the TMS320C6x system tells you how to in voke the PDM and individual debuggers and describes execution related commands Also in cludes information about describing your target system in a configuration file 11 1 Identifying Processors and Groups 00 ccc cette nen ees Assigning names to individual processors 0 ccna Organizing processors into QrOUPS ccc teen teens 11 2 Sending Debugger Commands to One or More Debuggers 2 005 11 3 Running and Halting Code 0 tne n enna Halting processors at the Same time eee ens Sending ESCAPE to all processors 1 eee tenes Finding the execution status of a processor or a group of processors 11 4 Entering PDM Commands 00 eet n ene nen Executing PDM commands from a batch file 0 0 00 cece eee Recording information from the PDM display area 2 0 2 0 ce eee Controlling PDM command execution 0 00 eee eens Echoing strings to the PDM display area 0 ccc eee eens Pausing command execution 0 eect teen ne nenne Using the command history o 422 2atcee6ecn2eeseecuiesawsee dete dieser ketenes 11 5 Defining Your Own Command Strings 0 0 cece teens
245. nformation to existing files The optional parameters of the DLOG command control how existing log files are used _ Appending to an existing file Use the a parameter to open an existing file and append the information in the display area to the information al ready in the file J Writing over an existing file Use the w parameter to open an existing file and write over the current contents of the file This is the default action if you specify an existing filename without using either the a or w options you will lose the contents of an existing file if you do not use the append a option Echo String to Display Area Batch File Only echo string none none basic debugger PDM profiling The ECHO command displays string in the display area of the Command win dow or in the display area of the PDM You cannot use quote marks around the string and any leading blanks in your command string are removed when the ECHO command is executed _ You can execute the debugger version of the ECHO command only ina batch file _j You can execute the PDM version of the ECHO command in a batch file or from the command line Test for Alternate Condition Batch File Only ELIF provides an alternative test by which you can execute PDM commands in the IF ELIF ELSE ENDIF command sequence See page 12 26 for more information about these commands Summary of Commands 12 21 Description Description Description eval Syntax Menu select
246. ng ANSI C compiler and assembly language programs The debugger is the in terface to the C6x simulator and the scan based emulator This chapter gives an overview of the C source debugger describes the code development environment and explains how you must prepare your program for debugging This chapter also describes the parallel debug manager PDM for use with the C6x emulator You can access context sensitive online help at any time during the debugging process to explain the functions of the windows dialog boxes and menus of the debugger interface This chapter also explains how to access online help and how to exit the debugger when you have completed your debugging ses sion Topic Page Key Features of the Debugger About the C Source Debugger Interface Developing Code for the TMS320C6x Limited Versions of the Simulator Description of the Parallel Debug Manager Emulator Only Overview of the Debugging Process Accessing Online Help Key Features of the Debugger 1 1 Key Features of the Debugger E Multilevel debugging The debugger allows you to debug both C and as sembly language code If you are debugging a C program you can choose to view only the C source the disassembly of the object code created from the C source or both You can also use the debugger as an assembly lan guage debugger and view the original assembly source code Fully configurable graphical user interface The C source debug
247. nge of memory follow these steps 1 2 Select Mapping from the Memory menu This displays the Memory Map Control dialog box From the list of defined ranges at the top of the dialog box select the range that you want to modify In the Memory Type Start Length Attribute and or Wait states fields make the appropriate changes Click Apply Click OK Enabling Memory Mapping 4 3 Enabling Memory Mapping By default mapping is enabled when you invoke the debugger In some instances you may want to explicitly enable or disable memory To do so open the Memory Map Control dialog box From the Memory menu select Mapping In the lower left corner of the dialog box there is an option for disabling memory mapping Hemor Map Control Fi SUOUOU00 SOQ FFFF OOOTOU00 RAM OOcOOO00 AOc FFF OOOIOOO0 RAM OOSUE000 OUSUSOUr OOOU00IO RAM OOS03s00 Oslo OOOU0S00 FAM OOSU8020 O0e0s41f OOOU0400 FAM OOOUO000 OOOO OOOTOU00 RAM Edit entry Start Length Attribute o 000000 ox00007q RAM lt Clear Fields amw Delete Disable mapping OF Cancel Help Click here to enable disable memory mapping Memory mapping is enabled when the box is empty Disable mapping Memory mapping is disabled when the box is checked Disabling memory mapping can cause bus fault problems in the target be cause the debugger may attempt to access nonexistent memory When you disable memory mapping with the simulator
248. nguage code the debugger automatically displays a Memory window the Disassembly window the CPU register win dow and the Command window In addition to these windows you can open Watch windows and additional Memory windows When you are running C code the debugger automatically displays the Com mand Calls and File windows In addition to these windows you can open Watch windows Debugging Modes Assembly mode Assembly mode is for viewing assembly language programs only In this mode you see a display similar to the one shown in Figure 2 1 When you are in assembly mode you always see the assembly display regardless of wheth er C or assembly language is currently running In assembly mode the debugger automatically displays a Memory window the Disassembly window the CPU register window and the Command win dow In addition to these windows you can open Watch windows and addi tional Memory windows Figure 2 1 Typical Assembly Display for Auto Mode and Assembly Mode Ay File Edit View Setup Memory Target Mode Profile Window Help S 2 f eee e Disassembly OOOOO000 a OOOO0000 oo0000000 OOOO0000 oo0000000 OOOO0000 o0000000 OOOO0000 a Command Debugger Version BL Etta by Texas Instruments TIARA Copyright ic MADEX SKODA K Version BHK BOBS F573 CVSS Tia TAPETE OSG Ma OG Pes ag Mpa CO EEA CVSS Bats SL Se Sond Loading m rti cut 197 Symbols Done For Help press F1 l
249. ntifies the first address in the block _J The length parameter defines the length in words of the block This parameter can be any C expression J The filename is a system file If you do not supply an extension the debugger adds a obj extension Single Step Next Statement next expression Target Next P basic debugger L PDM The NEXT command is similar to the STEP command If you are in C code the debugger executes one C statement at a time In assembly or mixed mode the debugger executes one assembly language statement at a time Unlike STEP NEXT never updates the display when executing called functions NEXT always steps to the next consecutive statement Unlike STEP NEXT steps over function calls rather than stepping into them you do not see the single step execution of the function call E profiling The optional expression parameter specifies the number of statements that you want to single step You can use a conditional expression for conditional single step execution Section 6 4 Running Code Conditionally page 6 11 discusses this in detail Summary of Commands 12 35 pause Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 36 Pause Execution Batch File Only pause none none basic debugger PDM E p
250. ntifying Directories That Contain Program Source Files D_SRC Setting up D_SRC for Windows operating SySteMS 0 0 eee Setting up D_SRC for SPARC and HPUX operating systems 000 2 4 Setting Up Default Debugger Options D_OPTIONS 0 0006 Setting up D OPTIONS for Windows operating systems 0000 eee e eae Setting up D OPTIONS for SPARC and HPUX operating systems Contents 2 5 Resetting the Emulator sic2 tegecnege tava den dnote ohne Sedma heed ee eee eeu es 2 6 Invoking the Debuggers and the PDM 0 ccc eens Invoking a stand alone debugger 0c cece teen een eee nes Invoking multiple debuggers emulator Only 0 0 0 ccc eee eens 24 Summary of Debugger Options lt 2 s0icetace eee be y lees oinsosdsee nd abe peeneed ese Clearing the bss section c Option 0 eee een eee Displaying the debugger on a different machine d option Identifying a new configuration file f option 0 0 ee eee Identifying additional directories i option 0 0 0 cee ees Selecting big endian format me option 0 cee nes Identifying the processor to be debugged n option 0c eee eens Identifying the port address p option 0 ccc ccc eens Entering the profiling environment profile Option 200 c eee ee eee Loading the symbol table only s option
251. ntil one of the following actions occurs _ The debugger encounters a breakpoint For more information about how breakpoints affect a conditional run see section 6 4 on page 6 11 Using the Basic Run Commands _j You click the Halt icon on the toolbar E J You select Halt from the Target menu _j You press SO Running code up to a specific point in a program You can execute code up to a specific point in your program by using the GO command The format for this command is go address If you do not supply an address parameter the program executes until one of the following actions occurs _ The debugger encounters a breakpoint _j You click the Halt icon on the toolbar E _j You select Halt from the Target menu _j You press O You can also execute code from the current PC to the current line in the File or Disassembly window The current line is highlighted in the display Current PC Current line B driver_c O x O01 ASHE EHH KEKE EKER EKER EKER EKER EKER ERK E KERR REREER a D0018 ant maint o0019 4 C 00020 int i novhd OO021 clock t t overhead t start t stop t stub t C 00022 BEEEEEHEHEHEXEHHEHEHEHEXHHEHEREREHEHREHHEHEERHREHEHRHRHREEHEHERXEHHEHE y vl 4 To run code from the current PC to the current line in the File or Disassembly window follow these steps _j Open the context menu for the window For more information see page 1 6 _j Select Run to Cursor from t
252. ntrol reconnecting to debugger resetting 2 6 running code while disconnected from target sys tem specifics in halting 6 13 using conditional RUN command emurst command emurst file definition enable analysis pseudoregister AEN 110 13 enabling analysis enabling areas for profiling 8 11 to 8 12 enabling memory mapping 4 7 to 4 8 ENDIF command PDM version 11 10jto 11 12 12 26 to 12 61 ENDLOOP command _ 3 9 to PDM version 11 11 entering commands from the PDM 2 8 entering operating system commands entering profiling environment menu option profile option Index 8 entry point of program environment variables D_OPTIONS _ 2 5 2 10 to 2 13 D_DIR 2 8 D_ SRC definition D effects on debugger invocation for debugger options 2 10 to error messages to beeping 12 51 C 2 description C 1 escape key halting execution 6 13 EVAL command description display formats modifying PC PDM version side effects evaluating an expression event counting emulator counting simulator definition emulator definition simulator event break command event _counter_reset command event_counter_ start command 9 11 event disable command event_enable command event _list command event_number parameter determining 9 10 event_reset command exclusive data 8 17 exclusive maximum data executing code checking execution status 11 20 12 48 finding execution status 11 8 12 53 while
253. nts If you are using the emulator you can set only one software breakpoint per set of parallel instructions that execute in the same cycle 3 You cannot set multiple breakpoints at the same statement a Setting a software breakpoint To set a breakpoint click next to the statement in the Disassembly or File win dow where you want the breakpoint to occur When you click next to a state ment in the Disassembly or File window a breakpoint symbol is shown A breakpoint is set on this statement B driver c of x oo023 PP RREREEEEEEREREREREREEEEEREHRAEEEERERRKKREEEREERRRKREREREREREERERRERREERERERRHRREES a 0004 COMPUTE THE OVERHEAD OF CALLING CLOCK TWICE TO GET TIMIN oo025 SHEER EXEXEREREEEE EEE HH EHHKHHHHHHEHREERE HEH HEHRERKRHHREEREER EEE ERE ERERHHHHEHEES OO026 clock clockl t overhead t stop t_start CEE EE ia i aiiaiiiaia iii i i akiitieiiaiiaa Another way to set a breakpoint is to use the context menu for the File or Disas sembly window You can set a breakpoint on the current line in the File or Dis assembly window The current line is highlighted in the display To seta breakpoint on the current line in the File or Disassembly window follow these steps _j Open the context menu for the window For more information see page 1 6 J Select Toggle Breakpoint from the context menu You can also set a breakpoint by using the Breakpoint Control dialog box To open the Breakpoint Control
254. oaded OoOo00000 OOO00000 OOo00000 OOOOU0000 oo0000000 OOOO0000 oo0000000 OOOOO000 Co S O O O OC x Address Ebdpok kbar Roaesr ak ERS iMidhbk barhan Oo IHd Boden Peas ROMEOK PANES MOR PODOR COOK ROOK eet PPEETH Shwesk Pd TOME BaRDGs Hiab DORK HOR DORDEE PORQUE yee eke wee xl LF J 2 l l T arget Halted 4A Getting Started With the Debugger 2 15 Debugging Modes Figure 2 2 Typical C Display for Auto Mode Only File View Setup Memory Target Mode Profile Window Help Sle e ee Ej driver c all 00012 clock_t time_stub fint 13 00013 clock_t time_c fint 1 padl 00016 7 TOP LEVEL DRIVER FOR THE TEST 00018 aint maint o0019 4 OO020 int i novhd oodi clock_t t_overhead t_start t_stop t_atub t_c O0022 OO0024 COMPUTE THE OVERHEAD OF CALLING CLOCE TWICE TO GET TIMING INFO 00026 t_start clock 00027 t_stop clock j O00286 t_ overhead t_stop t_start a gt Command H Cals _ O ix Loading puzzle out 197 Symbols loaded main Done go main Command go main For Help press F1 T arget Halted NUM Mixed mode Mixed mode is for viewing assembly language and C code at the same time Figure 2 3 shows the default display for mixed mode In mixed mode the debugger displays all windows that can be displayed in auto and assembly modes regardless of whether you are currently running assembly language or C code This i
255. oard dat file so that it knows how you have set up your scan path The debugger looks for the board dat file in the current directory and in the directories named with the D_DIR environment variable If you used a name other than board dat or if the board dat file is not in the cur rent directory or in a directory named with D_ DIR you must use the f option when you invoke the debugger The f option allows you to specify a board configuration file and pathname to be used instead of board dat The format for this option is f filename Appendix C Debugger Messages This appendix contains an alphabetical listing of the progress and error mes sages that the debugger or PDM might display in the display area of the Com mand window or in the PDM display area Each listing contains both a description of the situation that causes the message and an action to take if the message indicates a problem or error Topic Page Associating Sound With Error Messages Alphabetical Summary of Debugger Messages Alphabetical Summary of PDM Messages Additional Instructions for Expression Errors Additional Instructions for Hardware Errors C 1 Associating Sound With Error Messages Alphabetical Summary of Debugger Messages C 1 Associating Sound With Error Messages You can associate a beeping sound with the display of error messages To do this use the SOUND command The format for this command is sound on off By default no
256. ode 11 3 Running and Halting Code The PRUN PRUNF and PSTEP commands synchronize the debuggers to cause the processors to begin execution at the same real time 1 PRUNF starts the processors running free which means they are discon nected from the emulator J RUN starts the processors running under the control of the emulator J PSTEP causes the processors to single step synchronously through as sembly language code with interrupts disabled The formats for these commands are prunf g group processor name prun r g group processor name pstep g group processor name count _J The g option identifies the group or processor that the command should be sent to If you do not use this option the command is sent to the default group dgroup _J The r return option for the PRUN command determines when control returns to the PDM command line m Without r control is not returned to the command line until each debugger in the group finishes running code If you want to break out of a synchronous command and regain control of the PDM command line press in the PDM window This will return control to the PDM command line However no debugger executing the com mand will be interrupted m With r control is returned to the commandline immediately even if a debugger is still executing acommand You can type new commands but the processors cannot execute the commands until they finish with the curr
257. oes not show single step execution of the function The expression parameter specifies the number of statements that you want to single step You can use a conditional expression for conditional single step execution Section 6 4 Running Code Conditionally page 6 11 discusses this in detail Summary of Commands 12 53 system Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments 12 54 Enter Operating System Command system _ operating system command flag none none basic debugger E PDM profiling The debugger version of the SYSTEM command allows you to enter operat ing system commands without explicitly exiting the debugger environment If you enter SYSTEM with no parameters the debugger opens a system shell and displays the operating system prompt At this point you can enter any op erating system command When you finish enter exit If you prefer you can supply the operating system command as a parameter to the SYSTEM command If the result of the command is a message or other display the debugger blanks the top of the debugger display to show the infor mation In this case you can use the flag parameter to tell the debugger whether or not it should hesitate after displaying the information The flag can be O or 1 0 If you supply a value of 0 for flag the debugger immediately returns to the debugger environment after th
258. of quotes The filename identifies the optional object file for the debugger to load and options list the options you want to use at invocation Section 2 7 summarizes the options that you can identify with D_OPTIONS Getting Started With the Debugger 2 5 Resetting the Emulator 2 5 Resetting the Emulator 2 6 You must reset the emulator before invoking the debugger Reset can occur only after you have powered up the target board You can reset the emulator by adding the following command to the autoexec bat file emurst x p number The x option tells the emurst utility to ignore any options specified with the D OPTIONS environment variable For more information about x see page 2 13 The p option number identifies the I O port address that the debugger uses for communicating with the emulator For more information about p see page 2 12 If the following message appears after the emulator is reset you have a hard ware error CANNOT DETECT TARGET POWER One of several problems can cause this error message to appear Answer each of the following questions about your system and restart your PC Check Is the emulator board installed snugly Is the cable connecting your emulator and target system loose Is the target power on Is your target board getting the correct voltage Is your emulator scan path uninterrupted Is your port address set correctly O O C C L L m Ensure that the p option s
259. oint settings 6 18 execution in parallel 11 7 setting a breakpoint 6 16 single stepping interrupts ignored Watch Variable option 7 15 7 19 SIZE command 12 50 Index 18 sizeof operator sizing a window description 12 50 while moving it SL command SLOAD command description 12 50 effect on Watch window s debugger option software breakpoints See breakpoints software software reset sorting profile data 8 23 SOUND command space key displaying data in structures or ar rays SPAWN command to 2 9 12 51 SPL device type B 3 SR command 12 52 SSAVE command 12 52 starting point for program execution 6 2 to 6 3 STAT command status bar definition STEP command 6 9 12 53 Step toolbar icon 6 9 stopping point for profiling eure store instructions displayed by the emulator strategy for profiling 8 3 structures direct reference operator indirect reference operator switch settings I O address space symbol table definition loading object code with global symbols only v 2 43 loading object code without v 5 3 loading object code without EAE ne 42 loading without object code PE 5 3 ie 12 50 Index symbolic addresses SYSTEM command _ 3 5 to PDM version 11 16 system commands ALIAS command PDM version DLOG command PDM version ECHO command PDM version entering from command line entering several from system shell 8 6 IF ELIF ELSE ENDIF com mands _ 11 10 to 11 12 12
260. olbar selection Environments Description disp Display Disassembly at Specific Address dasm_ address function name none none basic debugger PDM profiling The DASM command displays code beginning at a specific point within the Disassembly window List Directory Contents dir directory name none none The DIR command displays a directory listing in the display area of the Com mand window If you use the optional directory name parameter the debugger displays a list of the specified directory s contents If you do not use the param eter the debugger lists the contents of the current directory Add Structure Array or Pointer to Watch Window disp expression display format none none basic debugger E PDM E profiling The DISP command opens a Watch window to display the contents of one of the following _j An array _j A structure Pointer expressions to a scalar type of the form pointer If the expression is not one of these types then DISP acts like a command When the Watch window is open you can display the data pointed to by a pointer or display the members of the array or structure by clicking the box icon next to watched item A Summary of Commands 12 19 dlog Syntax Menu selection Toolbar selection Environments Description 12 20 When you use the optional display format parameter data is displayed in one of the following formats Parameter Result is
261. ommand Breakpoint table full Description Action 200 breakpoints are already set and there was an attempt to set another The maximum limit of 200 breakpoints includes internal breakpoints that the debugger may set for single stepping Under normal conditions this should not be a problem it is rarely necessary to set this many breakpoints Open the Breakpoint Control dialog box by selecting Breakpoints from the Setup menu Delete individual software breakpoints Cannot allocate host memory Description Action This is a fatal error it means that the debugger is running out of memory You can invoke the debugger with the v option so that fewer symbols may be loaded or you can relink your program and link in fewer modules at a time Cannot allocate system memory Description Action This is a fatal error it means that the debugger is running out of memory You can invoke the debugger with the v option so that fewer symbols may be loaded or you can relink your program and link in fewer modules at a time Debugger Messages C 3 Alphabetical Summary of Debugger Messages Cannot connect file to program memory Description An attempt has been made to connect a file to program memory using the MC command Action You cannot connect a file to any location in program memory using the MC command Cannot detect target power Description This hardware error occurs after the emurst command is re set Fo
262. option tells the debugger to ignore any information supplied with the D OPTIONS environment variable described in section 2 4 on page 2 5 Getting Started With the Debugger 2 13 Debugging Modes 2 8 Debugging Modes Auto mode The debugger has three debugging modes auto assembly and mixed Each mode changes the debugger display by adding or hiding specific windows This section shows the default displays and the windows that the debugger au tomatically displays for these modes These modes cannot be used within the profiling environment the Command Profile Disassembly and File windows are the only available windows in the profiling environment In auto mode the debugger automatically displays whichever type of code is currently running assembly language or C This is the default mode Auto mode has two types of displays When the debugger is running assembly language code you see an as sembly display similar to the one in Figure 2 1 The Disassembly window displays the reverse assembly of memory contents When you first invoke the debugger you see a display similar to this J When the debugger is running C code or serial assembly compiled with the g option you see a C display similar to the one in Figure 2 2 This assumes that the debugger can find your C source file to display in the File window If the debugger cannot find your source it displays the disassem bly code only When you are running assembly la
263. options for your particular operating system The rest of this section describes these options in more detail You can also specify file name and option information with the D OPTIONS environment variable by following the instructions in section 2 4 on page 2 5 Table 2 1 Summary of Debugger Options Option Brief Description Debugger Tools Clear the bss section All d machine name Display the debugger on different ma All X Window chine System only f filename Identify a new board configuration file Emulator i pathname Identify additional directories All me Select big endian format All n device_name Identify device for debugging Emulator p port_address Identify the port address Emulator profile Enter the profiling environment All s filename Load the symbol table only All t filename Identify a new initialization file All V Load without the symbol table All X Ignore D_OPTIONS All Clearing the bss section c option The c option clears the bss section when the debugger loads code Use this option when you have C programs that use the RAM initialization model speci fied with the cr linker option described in the TMS320C6x Assembly Lan guage Tools User s Guide Displaying the debugger on a different machine d option 2 10 If you are using the X Window System you can use the d option to display the debugger on a different machine than the one the program Is running on The
264. or or to a group of proces sors To do this you must assign names to the individual processors or to groups of processors Individual processor names are assigned when you in voke the individual debuggers you can assign group names with the SET command after the individual processor names have been assigned Note Each debugger that runs under the PDM must have a unique processor name The PDM does not keep track of existing processor names When you send acommand to a debugger the PDM will validate the existence of a de bugger invoked with that processor name Assigning names to individual processors You must associate each debugger within the multiprocessing system with a unique name referred to as a processor name The processor name is used for _j Identifying a processor to send commands to _ Assigning a processor to a group _ Setting the default prompts for the associated debuggers For example if you invoke a debugger with the processor name CPU_A that debug ger s prompt will be CPU_A gt _j Identifying the individual debuggers on the screen Sun systems only The processor name that you assign will appear at the top of the operating system window that contains the debugger Additionally if you turn one of the windows into an icon the icon name is the same as the processor name that you assigned To assign a processor name you can use the n option when you invoke a de bugger For example to name on
265. ors The STAT command tells you whether a processor is running or halted If a pro cessor Is halted when you execute this command then the PDM also lists the current PC value for that processor The syntax for the command is stat g group processor name For example to find the execution status of all of the processors in GROUP_A after you have executed a global PRUN enter stat g GROUP_A After entering this command you will see something similar to this in the PDM window CPU_C Running CPU_D Halted PC 201A CPU_E Running Entering PDM Commands 11 4 Entering PDM Commands The PDM provides a flexible command entry interface that allows you to Execute PDM commands from a batch file Record the information shown in the PDM display area Conditionally execute or loop through PDM commands Echo strings to the PDM display area Pause command execution Repeat previously entered commands use the command history O O C C L L This section describes the PDM commands that you can use to perform these tasks Executing PDM commands from a batch file The TAKE command tells the PDM to execute commands from a batch file The syntax for the PDM version of this command is take batch filename The batch filename must have a pdm extension or the PDM will not be able to read the file If you do not supply a pathname as part of the filename the PDM first looks in the current directory and then searches directories na
266. ors page C 26 Function required Description Action Illegal cast Description Action The parameter for the FUNC command must be the name ofa function in the program that is loaded Reenter the FUNC command with a valid function name This is an expression error the expression parameter uses a cast that does not meet the C language rules for casts See section C 4 Additional Instructions for Expression Errors page C 26 Debugger Messages C 11 Alphabetical Summary of Debugger Messages C 12 Illegal left hand side of assignment Description Action This is an expression error the left hand side of an assign ment expression does not meet C language assignment rules See section C 4 Additional Instructions for Expression Errors page C 26 Illegal memory access Description Action Your program tried to access unmapped memory Modify your source code Alternatively you can check and modify your memory map Illegal operand of amp Description Action This is an expression error the expression attempts to take the address of an Item that does not have an address See section C 4 Additional Instructions for Expression Errors page C 26 Illegal pointer math Description Action This is an expression error some types of pointer math are not valid in C expressions See section C 4 Additional Instructions for Expression Errors page C 26 Illegal pointer subtraction
267. ory contents display area The portion of the Command window or PDM window where the debugger PDM echoes command entry shows command output and lists progress or error messages dock a window To anchor a floating window to an outer edge of the debugger application window A docked window has no title bar and cannot be moved However a docked window can be resized drag To move an object on the debugger display by pressing one of the mouse buttons and moving the mouse EISA Extended Industry Standard Architecture A standard for PC buses emulator A debugging tool that is external to the target system and pro vides direct control over the C6x processor that is on the target system emurst A utility that resets the emulator environment variable A special system symbol that the debugger uses for finding directories or obtaining debugger options File window Awindowthat displays the contents of the current C code The File window is intended primarily for displaying C code but can be used to display any text file float a window To cause a debugger window to sit on top of the debugger application window outside the edges of the debugger application window A floating window always appears active Glossary D 3 Glossary D 4 init cmd A batch file that contains debugger initialization commands If this file is not present when you first invoke the debugger then all memory is invalid I O swit
268. owing J From the Module combo box select a specific filename From the Function combo box select a specific function name See Table 8 3 on page 8 13 for a list of valid combinations 5 Click OK 8 24 Viewing Profile Data If you wantto reset the Profile window to its default characteristics use the Pro file View dialog box Profile Change View Click the Defaults button then click OK Interpreting session data General information about a profiling session is displayed in the Command window during and after the session This information identifies the starting and stopping points It also lists statistics for three important areas _j Run cycles shows the number of execution cycles consumed by the program from the starting point to the stopping point _ Profile cycles equals the run cycles minus the cycles consumed by disabled areas _ Hitsshows the number of internal breakpoints encountered during the pro filing session Viewing code associated with a profile area You can view the code associated with a displayed profile area The debugger updates the display so that the associated C or disassembly statements are shown in the File or Disassembly window To select the profile area in the Profile window and display the associated code double click the area that you want to display Double click an area to display the associated code Pin Profile Type sds Area fane Count Inclusive Incl Haz Exclusive
269. ows you to perform symbolic debugging and ex amine the values of C variables To load only asymbol table select Load Symbols from the File menu This dis plays the Load Symbols from File dialog box The File gt Load Symbols menu option clears the existing symbol table before loading the new one but does not modify memory or set the program entry point Loading code while invoking the debugger You can load an object file when you invoke the debugger This has the same effect as using the File Load Program menu option described on page 5 2 To do this enter the appropriate debugger invocation command along with the name of the object file If you want to load only a file s symbol table when you invoke the debugger use the s option This has the same effect as using the File Load Symbols menu option To do this enter the appropriate debugger invocation command along with the name of the object file and specify s see page 2 13 for more information Loading and Displaying Code 5 3 Loading and Displaying Assembly Language Code Displaying portions of disassembly The assembly language code in the Disassembly window is the reverse assembly of program memory contents This code does not come from any of your text files or from the intermediate assembly files produced by the compiler E MEMORY Address pd OO00SS00 Ovedadea 0780006a OO0ffecza OYbcOlee OYOO00b8a Orftfid410 OF bf O0 az O27tffas ooog
270. page C 26 Lost processor clock Description Action Either the target cable is disconnected or the target system is faulty Check the target cable connections If the target seems to be connected correctly see section C 5 Additional Instructions for Hardware Errors page C 26 Debugger Messages C 15 Alphabetical Summary of Debugger Messages Lval required Description Action This is an expression error an assignment expression was entered that requires a legal left hand side See section C 4 Additional Instructions for Expression Errors page C 26 Memory access error at address Description Action Either the processor is receiving a bus fault or there are problems with target system memory See section C 5 Additional Instructions for Hardware Errors page C 26 Memory map table full Description Action Too many blocks have been added to the memory map This rarely happens unless blocks are added word by word which is inadvisable Stop adding blocks to the memory map Consolidate any adjacent blocks that have the same memory attributes More than 4 reads to register register at cycle cnum Description Action Your program issued more than four reads of the same regis ter in the same cycle which is illegal However conditional registers are not included in this count For more information about register read constraints see the T MS320C62x C67x CPU and Instruction Set Reference G
271. pe 7 23 uint data type ulong data type 7 23 UNALIAS command ae PDM version 11 15 toj11 16 UNIX using with the PDM unmarking areas 8 12 UNSET command 12 56 deleting system variables 11 20 USE command v debugger option VAA command 12 57 VAC command variables aggregate values in Watch win dow 7 18 to 7 21 12 19 assigning to the result of an expression 11 19 213 determining type displaying in different numeric format 13 5 Index 20 variables continued AAEE TEIE ino e scalar MBE in oft 20 window 7 18 to 7 21 VERSION command 12 58 viewing profile ier description displaying areas 8 24 AA 2 65 LET displaying ian data 8 21 12 65 to sorting data 12 65 to viewing associated code 8 25 to void expressions 13 4 VR command 12 58 W keyword WA command description display formats WA command 12 61 Watch window Watch add dialog box watch commands WD command WR command 7 20 adding items Z t 7 20 12 58 closing displaying additional data editing values effect of load comands labeling watched data 12 58 naming opening 20 12 58 WD in WHATIS aware TA WIN command windows Analysis Statistics window analysis interface emulator 10 11 Analysis ore window simulator Calls window 5 7 commands anan CPU elle aie definition 12 60 windows continued description 1 4 to 1 6 Disassembly window _ 5 4 to 5 5 File window 5 6 to
272. play after executing each state ment If you are using CNEXT to step through assembly language code the debugger does not update the display until it has executed all assembly language statements associated with a single C statement Unlike CSTEP CNEXT steps over function calls rather than stepping into them you do not see the single step execution of the function call E profiling The expression parameter specifies the number of statements that you want to single step You can use a conditional expression for conditional single step execution Section 6 4 Running Code Conditionally page 6 11 discusses this in detail Single Step C cstep expression Target Step C E basic debugger L PDM The CSTEP single steps through a program one C statement at a time updating the display after executing each statement If you are using CSTEP to step through assembly language code the debugger does not update the display until it has executed all assembly language statements associated with a single C statement L profiling The expression parameter specifies the number of statements that you want to single step You can use a conditional expression for conditional single step execution Section 6 4 Running Code Conditionally page 6 11 discusses this in detail Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Description Syntax Menu selection To
273. pression E profiling Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description mix When you use the optional display format parameter memory is displayed in one of the following formats Parameter Result is displayed in Parameter Result is displayed in Default for the datatype o Octal C ASCII character bytes p Valid address d Decimal u Unsigned decimal e Exponential floating point x Hexadecimal f Decimal floating point Disconnect I O Port Simulator Only mi port address none none basic debugger PDM profiling The MI command disconnects a simulated I O port from its associated system file The port address parameter identifies the address of the I O port which must be defined previously with the MC command Enter Mixed Mode mix Mode Mixed none basic debugger L PDM The MIX command changes from the current debugging mode to mixed mode If you are already in mixed mode the MIX command has no effect E profiling Summary of Commands 12 33 ml Syntax Menu selection Toolbar selection Environments Description move Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 34 List Memory Map ml Memory Mapping none basic debugger E PDM profiling The ML command lists the
274. processor Description The debugger attempted to reset the PC to the program entry point but the program does not seem to have an entry point Action Do not use Target Restart or RESTART if your program does not have an explicit entry point Cannot set verify breakpoint at address Description Either you attempted to set a breakpoint in read only or protected memory or there are hardware problems with the target system This may also happen when you enable or dis able on chip memory while using breakpoints Action Check your memory map If the address that you wanted to breakpoint was not in ROM see section C 5 Additional Instructions for Hardware Errors page C 26 Debugger Messages C 7 Alphabetical Summary of Debugger Messages C 8 Cannot step Description There is a problem with the target system Action See section C 5 Additional Instructions for Hardware Errors page C 26 Cannot take address of register Description This is an expression error C does not allow you to take the address of a register Action See section C 4 Additional Instructions for Expression Errors page C 26 Command command not found Description The debugger did not recognize the command that you typed Action Reenter the correct command See Chapter 12 Sum mary of Commands Command timed out emulator busy Description There is a problem with the target system Action See section C 5 Additional Instructions for Hardware Er
275. processor from a group For example suppose GROUPB contained CPU_A CPU_C CPU_D and CPU_E If you wanted to remove CPU_E you could enter unset GROUPB set GROUPB CPU_A CPU_C CPU_D If you want to delete all of the groups you have created use the UNSET command with an asterisk instead of a group name unset The asterisk does not work as a wild card TS Note When you use UNSET to delete all of your groups the default group dgroup is also deleted As a result if you issue a command such as PRUN and do not specify a group or processor the command will fail because the PDM cannot find the default group name dgroup Using the Parallel Debug Manager 11 5 Sending Debugger Commands to One or More Debuggers 11 2 Sending Debugger Commands to One or More Debuggers The SEND command sends a debugger command to an individual processor or to a group of processors The command is sent directly to the command in terpreter of the individual debuggers You can send any valid debugger com mand string The syntax for the SEND command is send r g group processor name debugger command _j The g option specifies the group or processor that the debugger com mand should be sent to If you do not use this option the command is sent to the default group dgroup _J The r return option determines when control returns to the PDM com mand line E Without r control is not returned to the command line until eac
276. prograMS 0 00 cece eee nee Displaying and changing data 62 lt 2 icedquv edu pcaiousecaddeesaeeende curds ceads Performing system taSkS 0c ccc eee een teen n eens MANAGING breakpoints aie aon niin usana ac ace itt hal cl An el Shine rien lew WALA ne tle wa Memory mapping a 6 s 20x o heres thee ion ie oe Hie ee eee od bee eee hs RunNNO PrograMS a5 catasede a ead ee meme ec E E om E E E ee ee ren ees PrOMmMd COMMANGS seiateg roetine ror nEn Crn E couse yen se nea se sense re a2 lt Memory system analysis commands simulator only 000 cee eee eee 12 2 Alphabetical Summary of Debugger and PDM Commands 12 3 Summary of Profiling Commands a n nannaa annaa annaa Basic Information About C Expressions 00 2c eee eee eee eee ees Many of the debugger commands accept C expressions as parameters This chapter provides general information about the rules governing C expressions and describes specific imple mentation features related to using C expressions as command parameters 13 1 C Expressions for Assembly Language Programmers 00 cece eee nnan 13 2 Using Expression Analysis in the Debugger 2 0 60 c eee eee ees Restrictions ccensdnese cues aueete pentaee soeeeose ue sterschentesucecuae Additional fatures ccs csssi serre weet gw cea red Ga wes nae d Sues ne Pes What the Debugger Does During Invocation 000 e cece eee eee In some circumstances you may find it helo
277. ption includes symbolic debugging information the as option ensures that you will be able to include ranges as profile areas For more information on these options see the TMS320C6x C Compiler User s Guide eee ee eee ee Here is a Suggestion for a basic approach to profiling the performance of your program 1 Mark all the functions in your program as profile areas Run a profiling session find the busiest functions 3 Unmark all the functions Mark the individual lines in the busy functions and run another profiling session Profiling Code Execution 8 3 Entering the Profiling Environment 8 3 Entering the Profiling Environment Table 8 1 Debugger Commands That Can Cannot Be Used in the Profiling Environment Can be used Cannot be used 8 4 To enter the profiling environment select Profile Mode from the Profile menu Some restrictions apply to the profiling environment J The debugger is always in mixed mode _j Command Disassembly File and Profile are the only windows available additional windows such as a Watch window cannot be opened _jJ The profiling environment supports only a subset of the debugger commands Table 8 1 lists the debugger commands that can and cannot be used in the profiling environment Data evaluation commands such as All run commands and EVAL Breakpoint commands ASM C and MIX Memory mapping commands System commands such as SYS Memory or
278. r 0 0 0 0 cc ccc tee eee eas Floating point version of the simulator 0 0 0 ccc ee eens Fast version of the fixed point Simulator 0 0 0 0 ccc ee eee ees Debugger features not supported by the limited versions of the simulator 1 5 About the Parallel Debug Manager Emulator Only 0 0 0 0 cea 1 6 Overview of the Debugging ProceSS 0 ccc cee eee nes 1 7 Accessing Online Help 0 0 cc tenet eee n teenies Accessing a list of help TOPICS oi caccteneexenyetecdatnsds faeuaveude Caeen ese ee Accessing context sensitive help 0 0 cc eee eee eens Accessing help for debugger commands 0 0 eee eens Getting Started With the Debugger 0 cece eee eee eens Explains how to prepare your program for debugging and explains what you need to do before invoking the debugger Explains how to invoke the debugger and summarizes the debugger options Describes the debugging modes and explains how to exit the debugger 2 1 Preparing Your Program for Debugging 0 cece eee eee eens Debugging optimized code ac22 3 ceca sev eneee ede ceenees O4e ead eese ree ses ew ee ead Profiling optimized code 1 anaana 2 2 Identifying Alternate Directories for the Debugger to Search D_DIR Setting up D_DIR for Windows operating systemMS 00 nannan eens Setting up D_DIR for SPARC and HPUX operating systems 0005 2 3 Ide
279. r p V v V v To return all data types to their default display format enter setf Summary of Commands 12 49 size Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 50 Size a Window size window name width length none none basic debugger E PDM profiling The SIZE command changes the size of the window Specify the width and length parameters in pixels If you omit these parameters the SIZE command defaults to the window s current size You can spell out the entire window name but you need to specify only enough letters to identify the window List Stopping Point sl none none C ppm The SL command lists all of the currently set stopping points basic debugger profiling Load Symbol Table sload object filename File Load Symbols none basic debugger E PDM profiling The SLOAD command loads the symbol table of the specified object file SLOAD is useful in an emulation environment in which the debugger cannot or need not load the object code for example if the code is in ROM In such an environment loading the symbol table allows you to perform symbolic de bugging and examine the values of C variables SLOAD clears the existing symbol table before loading the new one but does not modify memory or set
280. r determines how often the Profile window is updated The update rate parameter can have one of these values Value Description 0 This is the default Statistics are not updated until the session is halted although you can force an update by clicking the mouse in the window gt Statistics are updated during the session A value of 1 means that data is updated as often as possible Halt Processors in Parallel phalt g group processor name none basic debugger PDM E profiling The PHALT command halts one or more processors If you send a PRUN or PRUNF command to a group or to an individual processor you can use PHALT to halt the group or the individual processor Each processor in a group is halted at the same real time If you do not use the g option to specify a group or a processor name the PHALT command is sent to the default group dgroup Connect Pin pinc pinname filename none basic debugger E PDM E profiling The PINC command connects an input file to interrupt pin J The pinname parameter identifies the interrupt pin and must be one of the external interrupt pins pins 4 7 _j The filename parameter is the name of your input file Summary of Commands 12 37 pind Syntax Menu selection Environments Description Syntax Menu selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 38 Disconnect Pin pin
281. r each data type enter the SETF command with no parameters setf Managing Data 7 23 Displaying Data in Alternative Formats The display should look something like this aA Command Type Format Defaults gt Unsigned decimal Decimal gt Unsigned decimal Decimal gt Unsigned decimal gt Decimal gt Unsigned decimal Exponential floating point Hexadecimal Command Ee _j To reset all data types back to their default display formats enter setf Changing the default format with data management commands 7 24 You can also use the Setup Watch Variable menu option the Watch window context menu and the MEM WA and DISP commands to show data in al ternative display formats The and DISP commands use alternative formats only for scalar types arrays of scalar types and individual members of aggre gate types Each of these commands has an optional display format parameter that works in the same way as the display format parameter of the SETF command When you do not use a display format parameter data is shown in its natural format unless you have changed the format for the data type with SETF Here are some examples _j To display memory contents in octal enter mem 0x0 0 Displaying Data in Alternative Formats _ To watch the PC in octal enter Watch Add x Value Expression PC Global variables Local variables Static wanables Registers
282. r every file that you open the debugger displays the file in a new File window Displaying a C file does not load that file s object code If you want to be able to run the program you must load the file s associated object code as de scribed in section 5 1 Loading and Displaying Assembly Language Code on page 5 2 Displaying a specific C function To display a specific C function use the FUNC command The syntax for this command is func function name address FUNC modifies the display so that the code associated with the function or address that you specify is displayed within a File window If you supply an address instead of a function name the File window displays the function con taining address and places the cursor at that line You can also use the functions in the Calls window to display a specific C func tion This is similar to the FUNC or ADDR command but applies only to the functions listed in the Calls window Choose one of these methods to display a function listed in the Calls window _j Single click the name of the C function J Select the name of the C function and press 9 Loading and Displaying Code 5 7 Displaying C Code Displaying code beginning at a specific point 9 8 To display C or assembly code beginning at a specific point use the ADDR command The syntax for this command is addr address function name In a C display ADDR works like the FUNC command positioning the code
283. r the file in the current directory You may however have your files in several different directories _ If you are using LOAD RELOAD or SLOAD you have only two choices for supplying the path information Mm Specify the path as part of the filename m Alternatively you can use the CD command before you enter the LOAD RELOAD or SLOAD command to change the current directory from within the debugger The format for this command is cd directory name _j If you are using the FILE command you have several options m Within the operating system environment you can name additional directories with the D_ SRC environment variable The format for this environment variable is SET D_SRC pathname pathname For PCs setenv D_SRC pathname pathname For SPARCstations You can name several directories for the debugger to search Where the debugger looks for files m When you invoke the debugger you can use the i option to name additional source directories for the debugger to search The format for this option is i pathname You can specify multiple pathnames by using several i options one pathname per option The list of source directories that you create with i options is valid until you quit the debugger m Within the debugger environment you can use the USE command to name additional source directories The format for this command is use directory name You can specify only one directory at a time In a
284. r to display profiling information only when the profiling session is complete Inthe Start Point field enter the starting point for the profiling session The starting point can be a label a function name or a memory address If you specify a memory address be sure to prefix the address with 0x You can choose from a list of starting points by clicking on the arrow at the end of the Start Point field Click OK After you click OK your program restarts and runs to the defined starting point You can tell that the debugger is profiling because the status bar changes to Target Profiling as shown here For Help press F1 Target Frofiling I I lg Profiling begins when the starting point is reached and continues until a stop ping point is reached or until you halt the profiling session by doing one of the following J Click the Halt icon on the toolbar Ed _ From the Target menu select Halt _j Press sc Running a Profiling Session Resuming a profiling session that has halted To resume a profiling session that has halted select Resume Slide the scale bar to specify how often the display is updated To resume a profiling session that has halted follow these steps 1 Open the Profile Run dialog box by using one of these methods J Click the Run icon on the toolbar _ From the Profile menu select Run _j Press 5 This displays the Profile Run dialog box Profile Run Fa Aun Method Full
285. r was invoked with the p option and an invalid port address was used Action For valid port address values see page 2 12 EOF reached connected at port lt memory addr gt Description The last data of the input file has been read Action You can disconnect the file with the MI command and connect anew file with the MC command If you do not do anything and resume execution then the input file automatically rewinds and input data is read from the beginning of the file Error in expression Description This is an expression error Action See section C 4 Additional Instructions for Expression Errors page C 26 Execution error Description There is a problem with the target system Action See section C 5 Additional Instructions for Hardware Errors page C 26 Debugger Messages C 9 Alphabetical Summary of Debugger Messages File already tied to port Description Action You attempted to connect to an address that already has a file connected to it Connect the file to a mapped port that is not connected to a file File already tied to this pin Description Action You attempted to connect an input file to an interrupt pin that already has a file connected to it Use the PINC command to connect the file to another inter rupt pin that is not connected to a file File does not exist Description Action The port file could not be opened for reading Be sure that the file exists as named If
286. reakpoint is encountered during a continuous run execution does not halt Instead the debugger updates the display when a breakpoint is encountered To execute a continuous run select Continuous Run from the Target menu To halt a continuous run use one of the methods described in section 6 6 on page 6 13 Using the Basic Run Commands Resetting the simulator You can use the debugger to reset the simulator by using a reset command This is a software reset To execute a reset select Reset Target from the Target menu If you are using the simulator and execute a software reset the simulator simu lates the C6x processor and peripheral reset operation putting the processor in a Known state Resetting the emulator You can use the debugger to reset the target system by using a reset com mand To execute a reset select Reset Target from the Target menu Running Code 6 7 Single Stepping Through Code 6 3 Single Stepping Through Code Single step execution is similar to running a program that has a breakpoint set on each line The debugger executes one statement updates the display and halts execution You can supply a parameter that tells the debugger to single step continuously the debugger updates the display after each state ment is executed You can single step through assembly language code or C code The debugger supports several commands for single stepping through a pro gram Command execution can vary
287. res of the debugger E Internal memory map checks The simulator core for the limited simulators do not perform dynamic map checks The limited simulators assume that all memory is available Therefore if your code accesses unmapped memory locations the limited simulators do not give you an error message Internal program RAM as cache The limited simulators do not allow you to configure Internal program RAM as cache On chip data memory conflicts The limited simulators cannot detect memory bank conflicts in on chip data memory Simulation of memory mapped I O through file connects to memory The limited simulators do not support the MC and MI commands Random interrupts The limited simulators do not allow you to generate random interrupts On chip peripheral registers The limited simulators do not model any of the C6x peripherals Accurate cycle count The cycle count of the limited simulators do not account for stalls due to external accesses and memory bank conflicts Analysis The limited simulators do not support analysis capability You cannot count system events or set up breakpoints on system events while using either of the limited versions of the simulator Overview of the Code Development and Debugging System 1 11 About the Parallel Debug Manager Emulator Only 1 5 About the Parallel Debug Manager Emulator Only The TMS320C 6x emulation system is a true multiprocessing debugging sys tem It allow
288. rofiling The PAUSE command allows you to pause the debugger or PDM while running a batch file or executing a flow control command Pausing is especially helpful in debugging the commands in a batch file When the debugger or PDM reads this command in a batch file or during a flow control command segment the debugger PDM stops execution and displays a dialog box To continue processing click OK or press Send ESC Key to Debuggers pesc g group processor name none none L basic debugger PDM profiling The PESC command sends the key to an individual debugger or to a group of debuggers PESC halts program execution but all processors in a group do not halt at the same real time individual processors halt in the order in which they were added to the group The g option identifies the group or processor that the command should be sent to If you do not use this option the key is sent to the default group dgroup Profile Full pf starting point update rate Profile Run ae L basic debugger E PDM profiling The PF command initiates a RUN and collects a full set of statistics on the defined areas between the starting point and the first stopping point encoun Syntax Menu selection Environments Description Syntax Menu selection Environments Description pinc tered The starting point parameter can be a label a function name or a memory address The optional update rate paramete
289. rom the Memory menu select Save This displays the Save Memory to COFF File dialog box Save Memory to COFF File Fi Address Enter the first address of the block that you want to save Length Enter a length in words of the block Filename Enter a file name for the saved block Cancel Help 2 Inthe Address field enter the first address in the block that you want to save To specify a hex address prefix the address number with Ox other wise the debugger treats the number as a decimal address 3 Inthe Length field enter a length in words of the block This parameter can be any C expression 4 Inthe Filename field enter a name for the saved block of memory If you do not supply an extension the debugger adds a obj extension 5 Click OK Managing Data in Memory For example to save the values in data memory locations 0x0000 0x003F to a file named memsave obj you could enter Save Memory to COFF File x Address foxo Length g 0 Filename memsave obj Cancel Help The value of the Length field is measured in words and data memory locations are measured in bytes For this example you must enter a length of 0x10 words to equal 0x40 bytes Ox0000 0x0040 To reload memory values that were saved ina file use the File Load Program menu option Filling a block of memory Sometimes it is useful to fill an entire block of memory at once with a particular value You can fill a b
290. ronment You can use standard data management commands and run type commands to test and evaluate your code _J The profiling environment is a special environment for collecting statistics about code execution You can use the profiling environment to identify areas in your code where you want to improve performance In addition to the debugger environment in the emulator version of the debug ger you can use the parallel debug manager PDM The PDM allows you to control and coordinate multiple debuggers giving you the flexibility and power to debug your entire application for your multiprocessing system The PDM and its functions and features are described in this book Before you use this book you should install the C source debugger and any necessary hardware This book is meant to be used with the online help included with the C source debugger The online help provides you with information about the windows menu items icons and dialog boxes of the debugger interface For informa tion on how to access the online help see section 1 7 on page 1 14 Notational Conventions Notational Conventions This document uses the following conventions LJ The TMS320C6x family of devices is referred to as C6x Debugger commands are not case sensitive you can enter them in lower case uppercase or a combination To emphasize this fact commands are shown throughout this user s guide in both uppercase and lowercase Program lis
291. rors page C 26 Conflicting map range Description A block of memory specified with the Memory Mapping menu option or the MA command overlaps an existing memory map entry Blocks cannot overlap Action Use Memory Mapping or the ML command to list the exist ing memory map this helps you find that existing block that the new block would overlap If the existing block is not neces sary delete it with the Memory Map Control dialog box or with the MD command Use the Memory Map Control dialog box or the MA command to redefine the block of memory If the exist ing block is necessary use the Memory Map Control dialog box or the MA command to define a range that does not over lap the existing block Alphabetical Summary of Debugger Messages Corrupt call stack Description The debugger tried to update the Calls window and could not This message is displayed in the following situations A function was called that did not return J The program stack was overwritten in target memory _ You are debugging code that has optimization enabled for example you did not use the g compile option if this is the case ignore this message code execution is not affected Action If your program called a function that did not return then this is normal behavior as long as you intended for the function not to return Otherwise you may be overwriting program memory Emulator I O address is invalid Description The debugge
292. s Completing an analysis session consists of four simple steps Step 1 Enable the analysis module See Enabling Memory System Analysis page 9 4 Step 2 Identify the events you want to See Defining the Conditions for track Analysis page 9 5 Step 3 Run your program See Running Your Program page 9 8 Step 4 View the analysis data See Viewing the Analysis Data page 9 9 Using Simulator Memory System Analysis 9 3 Enabling Memory System Analysis 9 3 Enabling Memory System Analysis When the debugger comes up analysis is disabled by default To begin track ing system events you must explicitly enable analysis by selecting Enable Analysis on the Analysis menu When you select Enable Analysis a check mark appears next to the menu item indicating that analysis is enabled To dis able analysis select Enable Analysis Events again and the check mark disap pears indicating that analysis is disabled Figure 9 1 Enabling Disabling the Analysis Interface 9 4 EMI window Help EXE window Heb Enable Analysis Events Enable Analysis Events Set Up Analysis Events Set Up Analysis Events When analysis is disabled all events you previously enabled remain un changed You can simply reenable analysis and use the events already de fined During a single debugging session you may want to change the analysis pa rameters several times For example you may want to define new parameters such as
293. s similar to the C single step command choose one of these meth ods Mm Click the Next C Statement icon on the toolbar i m From the Target menu select Next C M Press CONTROL FiO mM From the command line enter the CNEXT command The format for this command is cnext expression Running Code Conditionally 6 4 Running Code Conditionally The RUN STEP CSTEP NEXT and CNEXT commands all have an optional expression parameter that can be a relational or logical expression This type of expression uses one of the following operators as the highest precedence operator in the expression gt gt lt amp amp When you use this type of expression with these commands the command becomes a conditional run The debugger executes the command repeatedly for as long as the expression evaluates to true You must use software breakpoints with conditional runs the expression is evaluated each time the debugger encounters a breakpoint Breakpoints are described in section 6 7 on page 6 14 For single step commands the ex pression is evaluated at each statement Each time the debugger evaluates the conditional expression it updates the screen Generally you should set the breakpoints on statements that are related in some way to the expression For example if you are observing a particular variable in a Watch window you may want to set breakpoints on statements that affect that variable and to use that variable
294. s and writes by allowing you to read data in from a file and or write data out to a file Connecting an I O port To connect a port to an input or output file follow these steps 1 On the command line enter mc This displays the Connect port to file dialog box 2 Inthe Port Address field enter the address where you want to simulate an I O port This parameter can be an absolute address any C expression the name of a C function or an assembly language label If you want to specify a hex address be sure to prefix the address number with Ox other wise the debugger treats the number as a decimal address 3 Inthe Length field enter the length of the memory range The length can be any C expression 4 Ifyou are connecting a port to be read from a file in the Filename field enter the name of the file to which you want to connect If you connect a port to read from a file the file must exist or the MC command will fail 5 Inthe Read Write field enter how the file will be used for input or output respectively The keywords for the read write characteristics are avail able on page 4 10 Simulating I O Space Simulator Only 6 Click OK Any port in I O space can be connected to a file A maximum of one input and one output file can be connected to a single port multiple ports can be con nected to a single file Memory mapped ports can also be connected to files any instruction that reads or writes to the memory m
295. s can be used in only one of the environments Each command description identifies the applicable environments for the command Commands are not case sensitive to emphasize this command names are shown in both uppercase and lowercase throughout this book Evaluate Expression expression display format none none basic debugger E PDM profiling The evaluate expression command evaluates an expression and shows the result in the display area of the Command window The expression can be any C expression including an expression with side effects however you cannot use a string constant or function call in the expression If the result of expression is not an array or structure then the debugger displays the results in the Command window If expression is a structure or array displays the entire contents of the structure or array you can halt long listings by pressing Esc Summary of Commands 12 11 Syntax Menu selection Toolbar selection Environments Description 12 12 When you use the optional display format parameter data is displayed in one of the following formats Parameter Result is displayed in Parameter Result is displayed in Default for the datatype o Octal C ASCII character bytes p Valid address d Decimal S ASCII string e Exponential floating point u Unsigned decimal f Decimal floating point X Hexadecimal Use the PDM Command History Horompt number string
296. s final value the parameters they are used with have side effects Basic Information About C Expressions 13 3 Using Expression Analysis in the Debugger 13 2 Using Expression Analysis in the Debugger Restrictions Additional features 13 4 The debugger s expression analysis is based on C expression analysis This includes all mathematical relational pointer and assignment operators However a few limitations as well as a few additional features are not described in K amp R C The following restrictions apply to the debugger s expression analysis features E E The sizeof operator is not supported The comma operator is not supported commas are used to separate parameter values for the debugger commands Function calls and string constants are currently not supported in expres sions The debugger supports a limited capability of type casts the following forms are allowed basic type basic type structure union enum structure union enum tag structure union enum structure union enum tag You can use up to six characters in a cast All floating point operations are performed in double precision using stan dard widening This is transparent Floats are represented in IEEE floa ting point format All registers can be referenced by name The C6x auxiliary registers are treated as integers and or pointers Void expressions are legal treated like integers
297. s the devices assuming that the data from one device is followed by the data of the next device on the chain Data from the device that is closest to the emulation header s TDO test data out reaches the emulator first The device whose data reaches the emulator first is listed first in the board cfg file the device whose data reaches the emulator last is listed last in the board cfg file The board cfg file can have any number of each of these three types of entries E E Debugger devices such as the C6x These are the only devices that the debugger can recognize The Tl ACT8997 scan path linker or SPL The SPL allows you to have up to four secondary scan paths that can each contain debugger devices C6xs and other devices Other devices These are any other devices in the scan path These de vices cannot be debugged and must be worked around or bypassed when trying to access the C6xs Each entry in the board cfg file consists of at least two pieces of data E The name of the device The device name always appears first and is enclosed in double quotes device name This is the same name that you use with the n debugger option which tells the debugger the name of the C6x The device name can consist of up to eight alohanumeric characters or underscore characters and must begin with an alphabetic character The type of the device The debugger supports the following device types m TMS320C6x is
298. s to 0 If parameter is used resets the counter for the specified event el If no parameter is used lists the configuration for all events in the Command window If parameter is used lists the configuration for the specified event er Disables analysis and resets all event counters to 0 S Note Determining the number assigned to each event Some commands have a event_number parameter To determine what num ber your simulator core has assigned to each event use the event_list com mand discussed on page 9 12 a event_enable enable specified event 9 10 The event_enable command enables memory system analysis When memory system analysis is enabled the processor tracks the events that you define for the processor to monitor The syntax for the event_enable command IS event_enable Or use the predefined alias ee To enable analysis through the debugger interface from the Analysis menu select Enable Analysis Summary of Memory System Analysis Commands To enable a particular event through the debugger interface follow the steps for defining an event as a count event on page 9 6 or defining an event as a break event on page 9 7 event_disable disable specified event lf used without a parameter the event_disable command disables memory system analysis and resets all event counters If used with the event_number parameter the event_disable command disables the specified event prevent ing you from counting or h
299. s useful for finding bugs in C programs that exploit specific architectural features of the target device If you assemble your code with the g assembler option the debugger dis plays in the File window the contents of the assembly source file in addition to displaying the reverse assembly of memory contents in the Disassembly window 2 16 Debugging Modes Figure 2 3 Typical Mixed Display for Mixed Mode Only As THS320C8e Debugger File Edit Yew Setup Memory Target Mode Profle Window Help Bel A Bem ole e r puzzle c DOQ HHHHHHHHHHHRHHHEHEHREHHEHEERERHHHEEEHHHEEEERHEE 0004s 00050 A compute bound program from Forest Baskett nagsi 00052 short Fit 1 J short 1 j 0005 short k 00054 for f k 0 k piecemax i k OOOOO000 OOOOO000 OOOOO000 oo000000 ooooo000 ooo000000 ooodg0000 ooogdo000 ooodgdo00 OoOogoo00 a Disassembly Address nain E A a MocniEiT ats eae CTS Ta BORG Fey CDRS PCE DEDERETE CEG Mhan ooo00000 00000000 00000000 00000000 00000000 00000000 ooooooo0 RROK SXRRDStSY Version 1 00 HEHOWUH SREGRSRME SSS SSE ESS Loadi ng bee out AAAAAAAA Bipi 147 Sy mbol loaded KRARRARS ERARE ARARRAAR THEE SoG POCCUEEe secs AGB BOG OGG ets ROR WO gt For Help press F1 Target Halted Restrictions associated with debugging modes The assembly language code that the debugger shows you in the Disassem bly window is the disasse
300. s you to debug your entire application by using the parallel debug manager PDM The PDM is a command shell that controls and coordinates multiple debuggers providing you with the ability to Create and control debuggers for one or more processors Organize debuggers into groups Send commands to one or more debuggers Synchronously run step and halt multiple processors in parallel Gather system information in a central location O O C L L The PDM is invoked and PDM commands are executed from a command shell window under the host windowing system From the PDM you can invoke and control debuggers for each of the processors in your multiprocessing system As Figure 1 3 shows you can run multiple debuggers under the control of the PDM Figure 1 3 The PDM Environment CPU_A CPU_B CPU_C CPU_D CPU_E debugger debugger debugger debugger debugger PDM CPU x debugger Overview of the Debugging Process 1 6 Overview of the Debugging Process Debugging a program is a multiple step process These steps are described below with references to parts of this book that help you accomplish each step Step 1 Prepare a C program or assem See section 2 1 Preparing Your bly language program for de Program for Debugging page bugging 2 2 Step 2 Ensure that the debugger has a See Chapter 4 Defining a valid memory map Memory Map Step 3 Load the program s object file See section 5 1 Loading and Displaying Assemb
301. sceewssacu cee buses eu eee kuas eee Gat keane xx Running a full or a quick profiling SESSION 1 0 0 cee eee eens Resuming a profiling session that has halted 0 cece ee ees Viewing Profile Data 0 0 ccc een n ene neeas Viewing different profile data 0 0 ccc cette tenn eens Sorting profile data annaa aana ee een nent n teen ene eens Viewing different profile areas 0 2 e enna Interpreting session data ccc ee eet enn een ne nnes Viewing code associated with a profile area 0 0 nes Saving Profile Data toa File 0 ene teen enes Saving the contents of the Profile window 0 0 00 cece cee eee eens Saving all data for currently displayed areas 0 ccc eee nes Contents xiii Contents 9 10 XIV kx Using Simulator Memory System Analysis 000c cece eee eee eee Explains how to count or set breakpoints on various CPU events by using the analysis menu and dialog box Also describes the memory system analysis commands and provides a sample batch file using these commands 9 1 Major Functions of Simulator Memory System Analysis 00 cece eens Set up event breakpoints 0 0 cc ee een ee eee teen eee Count system events 0 ccc ee ne nent teen n eee n eee 9 2 Overview of the Analysis Process 0 c cece eee eee teens 9 3 Enabling Memory System Analysis 0000 c cece eee teens 9 4 Definin
302. se the same com mand to display or to change a value This reduces the number of commands in the command set This chapter contains basic information that helps you use C expressions as debugger command parameters Topic Page 13 1 C Expressions for Assembly Language Programmers 13 2 Using Expression Analysis in the Debugger 13 1 C Expressions for Assembly Language Programmers 13 1 C Expressions for Assembly Language Programmers 13 2 It is not necessary for you to be an experienced C programmer to use the debugger However to use the debugger s full capabilities you should be fa miliar with the rules governing C expressions You should obtain a copy of The C Programming Language first or second edition by Brian W Kernighan and Dennis M Ritchie published by Prentice Hall Englewood Cliffs New Jersey This book is referred to in the C community and in Texas Instruments docu mentation as K amp R Note A single value or symbol is a legal C expression K amp R contains a complete description of C expressions to get you started here is a Summary of the operators that you can use in expression parameters Reference operators gt indirect structure reference direct structure reference array reference i indirection unary amp address unary J Arithmetic operators addition binary subtraction binary multiplication division modulo negation unary type type ca
303. sed commands or command sequences The UNALIAS command deletes one or more ALIAS definitions The syntax for the PDM version of each of these com mands is alias alias name command string unalias alias name The PDM versions of the ALIAS and UNALIAS commands are similar to the debugger versions of these commands You can _j Include several commands in the command string by separating the indi vidual commands with semicolons J Define parameters in the command string by using a percent sign and a number 1 2 etc to represent a parameter whose value will be sup plied when you execute the aliased command J List all currently defined PDM aliases by entering ALIAS with no parame ters _J Find the definition of a PDM alias by entering ALIAS with only an alias name parameter Nest alias definitions L _j Redefine an alias _j Delete a single PDM alias by supplying the UNALIAS command with an alias name or delete all PDM aliases by entering UNALIAS Like debugger aliases PDM alias definitions are lost when you exit the PDM However individual commands within a PDM command string do not have an expanded length limit For more information about these features see section 3 1 Defining Your Own Command Strings The PDM version of the ALIAS command is especially useful for aliasing often used command strings involving the SEND and SET commands J You can use the ALIAS command to create PDM versions of
304. segment the debugger PDM stops execution and displays a dialog box To continue processing click OK or press Executing a batch file Once you create a batch file you can tell the debugger to read and execute or take its commands from the batch file also known as a take file To do so follow these steps 1 Fromthe File menu select Execute Take File This displays the Open Take File dialog box Lookin E source 4 el EE E E setup cmd A siminit cmd Files of type Take Files cmd Cancel 2 Selectthe file that you want to execute To do so you might need to change the working directory 3 Click Open This causes the debugger to read and execute the commands in the batch file To halt the debugger s execution of a batch file press Esc Entering and Using Commands 3 414 Creating a Log File to Reexecute a Series of Commands 3 4 Creating a Log File to Reexecute a Series of Commands 3 12 The information shown in the display area of the Command window can be written to a log file The log file is a system file that contains commands you have entered from the command line from the toolbar from the menus or with function keys The log file also contains the results from commands and error or progress messages The debugger automatically precedes all error or prog ress messages and command results with a semicolon to turn them into com ments This way you can reexecute the commands in your
305. session You can run two types of profiling sessions _ A full profile collects a full set of statistics for the defined profile areas _4J A quick profile collects a subset of the available statistics it does not collect exclusive or exclusive max data which are described in section 8 7 on page 8 20 This reduces overhead because the debugger does not have to track entering exiting subroutines within an area Running a full or a quick profiling session To run a profiling session follow these steps 1 Open the Profile Run dialog box by using one of these methods J Click the Run icon on the toolbar J From the Profile menu select Run _j Press 5 This displays the Profile Run dialog box Profile Run Fi Aun Method Full all fields Quick no exclusive fields Select the type of profiling session that you want to pane Resume Clear data Often Herer Display Rate both o aad Slide the frequency bar ne specify how often the Start Point display is updated Click this arrow to choose from a list of starting points Cancel Help 2 Inthe Run Method box select the type of profiling session that you want to perform Full or Quick Profiling Code Execution 8 17 Running a Profiling Session 8 18 3 5 Slide the Display Rate frequency bar to specify how often the display is updated You can choose a Display Rate from Often to Never A Display Rate of Never causes the profile
306. set them by selecting the Reset Counter button in the Analysis Statistics window This means that the counters accumulate occurrences of defined events even if you reexecute your program If you do not want the event counters to accu mulate select the Reset Counter button on the Analysis Statistics window When you select the Reset Counter button the event counters reset to 0 im mediately Using Simulator Memory System Analysis 9 9 Summary of Memory System Analysis Commands 9 7 Summary of Memory System Analysis Commands In addition to the memory system analysis interface the debugger supports analysis commands that can be entered from the command line or a batch file For information on setting up a batch file see section 9 8 on page 9 13 The debugger supports several analysis commands that allow you to control analysis events Each of these commands are summarized in Table 9 2 and discussed in detail in the sections following the table Table 9 2 Memory System Analysis Command Summary Command event_enable event_disable event_break event_counter_ start event_counter_reset event_list event_reset Alias Description ee Enables memory system analysis ed If no parameter is used disables memory system analysis If parameter is used disables the specified event eb Configures the specified event as a break event ecs Configures the specified as a count event ecr If no parameter is used resets all event counter
307. set result ar1 0 100 In this case result is the variable name and ar1 0 100 is the expression that will be evaluated whenever you use the variable result Once you have defined result you can use it with other PDM commands such as the SEND command send CPU D result The dollar sign tells the PDM to replace result with ar1 0 100 the string defined in result as the expression parameter for the command You must precede the name of a system variable with a when you want to use the string value you defined with the variable as a parameter You can also use the SET command to concatenate and substitute strings O Concatenating strings The dollar sign followed by a system variable name enclosed in braces and tells the PDM to append the contents of the variable name to a String that precedes or follows the braces For example set k Hel Set k to the string Hel S k lo S k en Concatenate the contents of k before lo and en and set the result to i echo i Show the contents of i Hello Helen set 1 Using System Variables _j Substituting strings You can substitute defined system variables for parts of variable names or strings This series of commands illustrates the substitution feature set err0 25 Set err0 to 25 set j 0 Set j to 0 echo err j Show the value of err j gt err0 gt 25 25 Substitution stops when the PDM detects recursion for example k k Assigning a vari
308. simulator this file is named siminit cmd A 1 What the Debugger Does During Invocation Where the Debugger Looks for Files If the debugger finds the file corresponding to your tool it reads and executes the file If the debugger does not find the t option or the initializa tion batch file it looks for a file called init cmd This allows you to have one initialization batch file for more than one debugger tool To set up this file you can use the IF ELSE ENDIF commands see page 3 8 for more in formation to indicate which memory map applies to each tool 7 Loads any object files specified with D OPTIONS or specified on the com mand line during invocation 8 Determines the initial mode auto assembly or mixed and displays the appropriate windows on the screen At this point the debugger is ready to process any commands that you enter Where the debugger looks for files A 2 You can perform all load type commands by using menu options However if you choose to use the command line equivalents to these menu options you need to know where the debugger looks for source files The FILE LOAD RELOAD SLOAD SCONFIG and TAKE commands expect a filename as a parameter If the filename includes path information the debugger uses the file from the specified directory and does not search for the file in any other directory If you do not supply path information the debugger must search for the file The debugger first looks fo
309. sis run Run the program dlog analysis log Store output to log file event_list List the analysis statistics in Command window dlog close Using Simulator Memory System Analysis 9 13 Chapter 10 Monitoring Hardware Functions With the Emulator Analysis Module The C6x has an on chip analysis module that allows the emulator to monitor hardware functions Using the analysis module you can count occurrences of certain hardware functions or set hardware breakpoints on these occurrences You access the analysis features through dialog boxes described in this chap ter These dialog boxes provide a transparent means of loading the special set of pseudoregisters that the debugger uses to access the on chip analysis module Topic Page Major Functions of the Analysis Module Overview of the Analysis Process Enabling the Analysis Module Defining the Conditions for Analysis Running Your Program Viewing the Analysis Data Creating Customized Analysis Commands Summary of Analysis Pseudoregisters 10 1 Mayor Functions of the Analysis Module 10 1 Major Functions of the Analysis Module 10 2 The C6x analysis module provides a detailed look into events occurring in hardware expanding your debugging capabilities beyond software break points The analysis module examines C6x bus cycle information in real time and reacts to this information through actions such as hardware breakpoints and event counting The a
310. sis Events Set Up Analysis Events When analysis is disabled all events you previously enabled remain un changed You can simply reenable analysis and use the events already de fined During a single debugging session you may want to change the parameters of the analysis module several times For example you may want to define new parameters such as counting branches tracking CPU clock cycles etc To do this you must open the individual dialog boxes deselect any previous events and select the new events you want to track You also can enable and disable analysis from the Analysis Events dialog boxes by selecting and deselecting the Enable analysis events checkbox For more information about the Analysis Events dialog boxes see Section 10 4 on page 10 5 oo Note You must enable the analysis module only once during a debugging session Itis not necessary to enable the analysis module each time you run your pro gram Lee Defining the Conditions for Analysis 10 4 Defining the Conditions for Analysis The analysis module detects hardware events and monitors the internal sig nals of the processor according to the parameters you define that count events or halt the processor You must define the conditions the analysis module must meet to track a par ticular event To do this select the events you want to track by enabling the appropriate conditions in the Analysis Events dialog boxes To bring up the Analysis Ev
311. sis of values of the Inclusive field select Inclusive in the Sort Field box The area with the highest Inclusive field displays first and the area with the lowest Inclusive field displays last This ap plies even when you are viewing individual fields Profiling Code Execution 8 23 Viewing Profile Data Viewing different profile areas By default all marked areas are listed in the Profile window You can modify the window to display selected areas To do this follow these steps 1 Open the Profile View dialog box by using one of these methods _j From the Profile menu select Change View _j From the context menu for the Profile window select Change View This displays the Profile View dialog box Select to show C data Select to show line areas range assembly data or both areas function areas or all areas Profile View Display Filter Level Oc Assembly Display Field All fields O Functions Sort Field j Both Data i All areas Module H7 q Function H A Defaults Cancel Help To reset the Profile window to its You can select a specific filename default settings click Defaults or function name to filter on 2 Inthe Level box select C Assembly or Both 3 In the Area box select Lines Ranges Functions or All areas See Table 8 3 on page 8 13 on for a list of valid combinations 4 Ifyou want to view areas within a specific file or function do one of the fol l
312. splay format parameter identifies the new display format for any data of type data type Table 7 3 lists the available formats and the corresponding characters that can be used as the display format parameter Table 7 3 Display Formats for Debugger Data Display Format Parameter Display Format Parameter Default for the data type Octal o ASCII character bytes C Valid address p Decimal d ASCII string S Exponential floating point e Unsigned decimal u Decimal floating point f Hexadecimal x Displaying Data in Alternative Formats Table 7 4 lists the C data types that can be used for the data type parameter Only a subset of the display formats applies to each data type so Table 7 4 also shows valid combinations of data types and display formats Table 7 4 Data Types for Displaying Debugger Data Valid Display Formats Data Type c do x e f p s u Default Display Format char V vV Vv Vv V ASCII c uchar V V NNI V Decimal d short V V W VI yV Decimal d int V V NVW VI yV Decimal d uint V V VVL V Decimal d long EE E yV Decimal d ulong V V VVI V Decimal d float V vy y Exponential floating point e double V Vy y Exponential floating point e ptr A V y Address p Here are some examples _j To display all data of type short as an unsigned decimal enter setf short u _j To return all data of type short to its default display format enter setf short J To list the current display formats fo
313. splay the specified line number in the FILE window line ine number none basic debugger E PDM E profiling Use the LINE command to view specific lines of code The LINE command displays the specified line numberin the middle of the FILE window When the line numberis already displayed in the FILE window the LINE command does not affect the display Load Executable Object File load object filename File gt Load Program none basic debugger _ PDM profiling The LOAD command loads both an object file and its associated symbol table into memory In effect the LOAD command performs both a RELOAD and an SLOAD If you do not supply an extension the debugger looks for filename out The LOAD command clears the old symbol table and closes any Watch windows Loop Through PDM Commands Batch File Only loop Boolean expression PDM commands break continue endloop none basic debugger PDM _ profiling The LOOP BREAK CONTINUE ENDLOOP commands allow you to set up a looping situation in a batch file or from the command line Unlike the debugger loop endloop Syntax Menu selection Toolbar selection Environments Description loop endloop version of the LOOP ENDLOOP commands the PDM version of the LOOP command evaluates only Boolean expressions _j If the Boolean expression evaluates to true 1 the PDM executes all commands between the LOOP and BREAK CONTINUE or ENDLOOP _j If the Boolean expression ev
314. ss s01s05e0taaenes be cee senda ds ndes o nan 55 Determining the type of a variable 0 ccc eects Evaluating an expression 0 0c cent teen teen ne eneaas 7 4 Basic Methods for Changing Data Values 0c ccc cece eee ees Editing data displayed in a WINdOW n anaana nananana ete nents Editing data using expressions that have side effects 0 000 cee eee eee 7 5 Managing Data in Memory lt i ii ceed toe maak ork home es Saeed Shee ey Changing the memory range displayed in a Memory window 045 Opening an additional Memory window 000 cee eet ne eens Displaying memory contents while you are debugging eee Saving memory values to a file 0 nannaa aaae Filling a block of memory oe 2 4 5 cesa aim Seec pin greet sarn Geet nin deter aoe amp Bade wisi om Gres cea wie 4 xii 7 6 1 1 1 8 Contents Managing Register Data siccmita dashed cs wie nd Wed did ahd Roe ook ed ee eek 8 Displaying register contents 0 e eee e ee nees Accessing single precision floating point registers 0 0 Accessing double precision floating point registers 0 0 0 0 cee eee Managing Data in a Watch Window 0 0 cece teens Displaying data in a Watch window 0 00 cc een ene ees Displaying additional data nanasan ananena teen een teen ene Deleting watched values 0 0 ccc tent n teen eee nee Displaying Da
315. st _ Relational and logical operators gt greater than gt greater than or equal to lt less than lt less than or equal to is equal to l is not equal to amp amp logical AND logical OR logical NOT unary E C Expressions for Assembly Language Programmers Increment and decrement operators increment decrement These unary operators can precede or follow a symbol When the operator precedes a symbol the symbol value is incremented decremented before it is used in the expression when the operator follows a symbol the sym bol value is incremented decremented after it is used in the expression Because these operators affect the symbol s final value the parameters they are used with have side effects Bitwise operators amp bitwise AND A bitwise exclusive OR lt lt gt gt right shift Assignment operators assignment assignment with subtrac tion assignment with modulo amp assignment with bitwise XOR lt lt assignment with left shift gt gt assignment with multiplica tion bitwise OR left shift 1s complement unary assignment with addition assignment with division assignment with bitwise AND assignment with bitwise OR assignment with right shift These operators support a shorthand version of the familiar binary expres sions for example X X Y can be written in C as X Y Because these operators affect a symbol
316. step expression Running Code 6 9 Single Stepping Through Code Continuously stepping through code You can use the debugger to watch your code as it executes You can step through code continuously until the debugger reaches a breakpoint This is re ferred to as a continuous step When a breakpoint is encountered during a con tinuous step execution halts To execute a continuous step select Continuous Step from the Target menu If no breakpoints are set you can halt a continuous step by using one of the methods described in section 6 6 on page 6 13 Single stepping through code and stepping over C functions 6 10 Besides single stepping through all code with the basic single step com mands you can single step through assembly language or C code and step over function calls This type of single stepping always steps to the next con secutive statement and never shows the execution of called functions You can use the next single step command in one of two ways _ To use the next single step command and single step in terms of assem bly language or C statements similar to the basic single step command choose one of these methods Mm Click the Next Statement icon on the toolbar F m From the Target menu select Next Mm Press O E From the command line enter the NEXT command The format for this command is next expression _j To use the next single step command and single step in terms of C state ment
317. t bpt a testsetz bp Select from a list of files Files of type Breakpoint Files pt Cancel 3 Select the file that you want to open To do so you might need to change the working directory 4 Click Open 5 In the Breakpoint Control dialog box click Close E Note When you load a breakpoint file breakpoints that you have defined pre viously in your debugging session are not cleared but remain in effect C Running Code 6 19 Chapter 7 Managing Data The debugger allows you to examine and modify many types of data related to the C6x and to your program You can display and modify these values _j The contents of individual memory locations or a range of memory _J The contents of C6x registers _j Variables including scalar types ints chars etc and aggregate types arrays structures etc Topic Page Where Data Is Displayed How the Emulator Displays Data for Load and Store Instructions Basic Commands for Managing Data Basic Methods for Changing Data Values Managing Data in Memory Managing Register Data Managing Data in a Watch Window Displaying Data in Alternative Formats 7 1 Where Data Is Displayed How the Emulator Displays Data for Load and Store Instructions 7 1 Where Data Is Displayed Various types of data are displayed in one of three dedicated windows Type of Data Window Name Purpose Memory locations Memory window Displays the contents of a ran
318. t a CPU event Add defined event ene o nE A or Chip Program Memory Access to list of events t0 monitor Event Type Define an event as Break or Count Coun i Enable and disable analysis W Enable analysis events Close Help Close the dialog Bring up online box help for the dialog box Using Simulator Memory System Analysis 9 5 Defining the Conditions for Analysis Description of available system events Table 9 1 lists and describes the events in the Analysis Events dialog box that are available for the TMS320C6x simulator core Table 9 1 Description of Analysis Counter Events Event Program memory access Program cache hit Program cache miss Off chip program access Off chip data access Data memory bank conflict Memory stall Description Any program fetch Any program memory access resulting in a cache hit Occurs only when cache is enabled Any program memory access resulting in a cache miss Occurs only when cache is enabled A program memory access resulting in an external memory access A single pro gram fetch from external memory results in eight off chip memory accesses A data memory access resulting in an external memory access Two data accesses occur in the same memory bank resulting in a CPU stall The number of cycles lost due to memory stalls A memory stall occurs when the CPU is stalled because the system is unable to provide the data as soon as it is requested
319. t code and or the symbol table associated with an object file Loading an object file and its symbol table To load both an object file and its associated symbol table follow these steps 1 From the File menu select Load Program This displays the Load Pro gram File dialog box You can change the directory that you want to search Load Program File Look ir Select from a list of files Files of type Program Files out Cancel 2 Select the file that you want to open To do so you might need to change the working directory 3 Click Open 5 2 Loading and Displaying Assembly Language Code Loading an object file without its symbol table You can load an object file without loading its associated symbol table This is useful for reloading a program when memory has been corrupted To load an object file without its symbol table select Reload Program from the File menu The debugger reloads the file that you loaded last but does not load the symbol table If you want to load a new file without loading its associated symbol table use the RELOAD command The format for this command is reload object filename Loading a symbol table only You can load a symbol table without loading an object file This is most useful in an emulation environment in which the debugger cannot or need not load the object code for example if the code is in ROM In such an environment loading the symbol table all
320. t counters to 0 If used with a parameter the event_counter_reset com mand resets the counter of the specified event to 0 The syntax for the event_counter_reset command is event_counter_reset event_number Or use the predefined alias ecr event_number You cannot reset the counter for a specific event through the debugger inter face however you can reset all the event counters for all the events by select ing the Reset Counters button on the Analysis Statistics window For more in formation on the Reset Counters button see page 9 9 event_reset disable and clear configuration for all events The event_reset command disables analysis and resets all event counters to 0 The syntax for the event_counter_reset command is event_reset Or use the predefined alias er To disable all events and reset all event counters through the debugger inter face 1 From the Analysis menu select Enable Analysis Events 2 From the Analysis Statistics window select the Reset Counters button For more information on the Reset Counters button see page 9 9 event_list list configuration of all events 9 12 If used without a parameter the event_list command lists in the Command win dow the configuration of all the events If used with a parameter the event_list command lists the configuration for the specified event The configuration in cludes the event name event number whether the event is defined as a count or break event and
321. ta in Alternative Formats 0 c ccc eee eens Changing the default format for specific data types 0 0 cee eee Changing the default format with data management commands Profiling Code Execution se 2c cers eens daeareneewe seane se enmeesracsauneneeaeeuexens Describes the profiling environment and tells you how to collect statistics about code execution 8 1 8 2 8 3 8 4 8 5 8 6 8 7 8 8 Overview of the Profiling Environment 0 000 cece teen eee eens 8 Overview of the Profiling Process 2 202 2sccaveteedates takes nabevie Sas naes wee Ss 8 A profiling strategy nananana nanan Entering the Profiling Environment 00 c cece eee eee eee eens Defining Areas tor PIO iING ancaac tg cetacean aeccueed nade teweresen ee eaeesavee don 8 5 Marking an area with a mouse 2 dad iid m oe eek ew de Geek dae eek eee ws Hayao ae ai Sk Marking an area with a dialog DOX cece tenet ne enes DiSaDING A ANOS srera erte epua rE EAEE EEA ee dent ene awe eee nek eas Reenabling a disabled area 0 ccc eect een ene nnes Unmarking an area ccc tne ene e tenet n eee nee Restrictions on profiling areas asa tems sn te pwc Hk wh ew nh aed we Denning 4 Stopping POIN gt s2 22524065005500545 0052408 debon dean chegge ene E A Setting a software breakpoint 0 cece eee e eens Clearing a software breakpoint 0 cc eee eee ens Running a Profiling Session s ccscn
322. tem Variables Checking the execution status of the processors In addition to displaying the execution status of a processor or group of proces sors the STAT command described on page 11 8 sets a system variable called status _ If allot the processors in the specified group are running the status vari able is set to 1 _j If one or more of the processors in the group is halted the status variable is set to 0 You can use this variable when you want an instruction loop to execute until a processor halts loop stat 1 send pc Listing system variables To list all system variables use the SET command without parameters set You can also list the contents of a single variable For example set j J TOO Deleting system variables 11 20 To delete a system variable use the UNSET command The format for this command is unset variable name If you want to delete all of the variables you have created and any groups you have defined as described on page 11 4 use the UNSET command with an asterisk instead of a variable name unset a Note When you use UNSET to delete all of your system variables and processor groups variables such as prompt status and dgroup are also deleted Evaluating Expressions 11 9 Evaluating Expressions The debugger includes an EVAL command that evaluates an expression see section 7 3 Basic Commands for Managing Data for more information about the debug
323. tering Operating System Commands From Within the Debugger The debugger provides a simple method for entering operating system commands without explicitly exiting the debugger environment To do this use the SYSTEM command The format for this command is system _ operating system command flag The SYSTEM command behaves in one of two ways depending on whether or not you supply an operating system command as a parameter _j If you enter the SYSTEM command with an operating system command as a parameter then you stay within the debugger environment _ If you enter the SYSTEM command without parameters the debugger opens a system shell This means that the debugger blanks the debugger display and temporarily exits to the operating system prompt Use the first method when you have only one command to enter use the second method when you have several commands to enter Entering a single command from the debugger command line If you need to enter only a single operating system command supply it as a parameter to the SYSTEM command For example if you want to copy a file from another directory into the current directory enter system copy a backup sample c sample c If the operating system command produces a display such as a message the debugger blanks the upper portion of the debugger display to show the in formation In this situation you can use the flag parameter to tell the debugger whether or not it should hesitate
324. that you enter frequently as well as information about using a batch file or a log file for entering commands Topic Page Defining Your Own Command Strings Entering Operating System Commands From Within the Debugger Creating and Executing a Batch File Creating a Log File to Reexecute a Series of Commands 3 1 Defining Your Own Command Strings 3 1 3 2 Defining Your Own Command Strings List of defined aliases i To define an alias enter an alias The debugger provides a shorthand method of entering often used com mands or command sequences This process is called aliasing Aliasing al lows you to define an alias name for the command s and then enter the alias name as if it were a debugger command Note Creating aliased commands in PDM is different from creating aliased com mands in the debugger For information about the PDM versions of the ALIAS and UNALIAS commands see page 11 15 To use the aliasing feature select Alias Commands from the Setup menu This displays the Alias Control dialog box Alias Control 10 x INIT load test outfile source c go main RESTRUN restart run Edit alias Name Command string Clear Fields Delete UE Cancel J Help V To delete an alias select an alias name and command string and name and click Delete click Apply Defining Your Own Command Strings Defining an alias To define an alias follow these steps 1 From the Setup men
325. the Function combo box select a specific function name See Table 8 3 for a list of valid combinations Click Disable Click Close to close the dialog box Reenabling a disabled area When an area has been disabled and you would like to profile it once again you must enable the area To reenable an area click the white arrow s next to marked line range or function the area will once again be highlighted with a green arrow You can also reenable an area by using the Profile Marking dialog box 1 Open the Profile Marking dialog box by using one of these methods _ From the Profile menu select Select Areas J From the context menu for the Profile window select Select Areas This displays the Profile Marking dialog box In the Level box select C Assembly or Both In the Area box select Lines Ranges Functions or All areas See Table 8 3 for a list of valid combinations Depending on what you select in step 3 do one or more of the following _j Next to Lines enter an absolute address C expression assembly label or line number _J Next to Ranges enter a Start and an End value as an absolute address C expression assembly label or line number 4 From the Module combo box select a specific filename _ From the Function combo box select a specific function name See Table 8 3 for a list of valid combinations Click Enable Click Close to close the dialog box Profiling Code Execution 8 11 Def
326. tics of the memory ranges For more information about the MA command see section 4 5 on page 4 10 By default mapping is enabled when you invoke the debugger Figure 4 1 b illustrates the memory map defined by the MA commands in Figure 4 1 a Figure 4 1 Sample Memory Map for Use With a TMS320C6x Simulator a Memory map commands b Memory map for TMS320C6x local memory 0x00000000 0x01000000 0x0000_0000 CEO BEETA Metra 0x01000000 0x00400000 to OxOOff_ffff COA OI OS OOO TOGO CxO FEOC000 0x00400000 to ee a CE1 External Memory OZ 0 00000 COIL 000000 E Oxo OOOO O00000 to 0x0140_ffff Internal Program Memory to a uo Internal Peripheral Space 0x0200 0000 to OxO2ff fff CE2 External Memory 0x0300 0000 to OxO3ff Tf CE3 External Memory 0x8000 0000 to 0x8000_fiff Internal Data Memory Defining a Memory Map 4 9 Defining and Executing a Memory Map in a Batch File 4 5 Defining and Executing a Memory Map in a Batch File You can create a batch file that contains memory map commands This pro vides you with a convenient way to define a memory for each debugging ses sion You can define the memory map in the initialization batch file which executes when you invoke the debugger or you can define the memory map in a separate batch file of your own that you can execute using the File gt Execute Take File menu option or the t debugger option Defining a memory map in a batch file To define a memory map in a batch
327. ting group or creating a group based on another group Once you have created a group you can add processors to it by using the SET command and preceding the existing group name with a dollar sign in the list of processors You can also use a group as part of another group by preceding the existing group s name with a dollar sign The dollar sign tells the PDM to use the processors listed previously in the group as part of the new list of processors Suppose GROUPA contained CPU_C and CPU_D If you wanted to add CPU_E to the group you would enter set GROUPA SGROUPA CPU E Identifying Processors and Groups After entering this command GROUPA would contain CPU_C CPU_D and CPU _E If you decided to send numerous commands to GROUPA you could make it the default group set dgroup SGROUPA _j Listing all groups of processors To list all groups of processors in the system use the SET command with out any parameters set The PDM lists all of the groups and the processors associated with them GROUP 1 CPU_A CPU_C GROUPA COPU_C CPU_D CPU_E dgroup CPUC CPU_D CPU_E You can also list all of the processors associated with a particular group by supplying a group name set dgroup dgroup CPU_C CPU_D CPU_E _ Deleting a group To delete a group use the UNSET command The format for this com mand is unset group name You can use this command in conjunction with the SET command to re move a particular
328. tings and examples are shown ina special font Some examples use abold version to identify code commands or portions of an example that you enter Here is an example Command Result Displayed in the Command Window whatis aai int aai 1l10 5 whatis XXX struct xxx int aj int b int cC ine fl 2 int f2 4 struct xxx f3 int 4 10 In this example the left column identifies debugger commands that you type in The right column identifies the result that the debugger displays in the display area of the Command window In syntax descriptions the instruction or command is in a bold face and parameters are in italics Portions of a syntax that are in bold should be entered as shown portions of a syntax that are in italics describe the kind of information to be entered Here is an example of a command syntax load object filename load is the command This command has one required parameter indi cated by object filename Square brackets and identify an optional parameter If you use an op tional parameter you supply the information specified within the brackets you do not enter the brackets themselves Here is an example of a com mand that has an optional parameter run expression The RUN command has one parameter expression which is optional Related Documentation From Texas Instruments _ Braces and indicate a list The symbol read as or separates items within the list Here is a
329. tion is most useful in an emulation environment in which the debugger cannot or need not load the object code for example if the code is in ROM Insuch an environment loading the symbol table allows you to per form symbolic debugging and examine the values of C variables The format for this option is S filename out Using this option is similar to loading a file by using the debugger s File gt Load Symbols menu option or the SLOAD command within the debugger environ meni Identifying a new initialization file t option The t option allows you to specify your own customized initialization com mand file to use instead of siminit cmd emuinit cmd or init cmd The format for the t option is t filename cmd Using this option is similar to loading a batch file by using the debugger s File Execute Take File menu option or the TAKE command within the debugger environment Loading without the symbol table v option The v option prevents the debugger from loading the entire symbol table when you load an object file The debugger loads only the global symbols and later loads local symbols as it needs them This speeds up the loading time and consumes less memory The v option affects all loads including those performed when you invoke the debugger and those performed with the File Load Program menu option or the LOAD command within the debugger environment Ignoring D_OPTIONS x option The x
330. tional Commands 000 eae 7 1 Pseudoregister Names for Single Precision Floating Point Registers 7 2 Pseudoregister Names for Double Precision Floating Point Registers 7 3 Display Formats for Debugger Data 0 ccc eee een ens 7 4 Data Types for Displaying Debugger Data 0 ccc eens 8 1 Debugger Commands That Can Cannot Be Used in the Profiling Environment 8 2 Using the Profile Marking Dialog Box to Mark Areas 0 00 c cece 8 3 Disabling Enabling Unmarking or Viewing AreaS 0 000 cee eee 8 4 Types of Data Shown in the Profile Window 0 c cece nee eens 9 1 Description of Analysis Counter Events 0 000 anana aana 9 2 Memory System Analysis Command Summary 0000 c cece eee eee ees 10 1 Description of Analysis Counter Events 0 00 ccc eee ees 11 1 PDM Operators ao eee oie ga bee ddan tect soon eo oe peenad bene bee el duead soa 12 1 Mak areas texneteawebennstenecbusesteteevanetecheewanneu caetweneee anaes 12 2 Disabling marked areas 12 3 Enabling disabled areas 12 4 Unmarking areas wet inw a tins Vitis deh cherie eee Rake Ceo wes end 12 5 Changing the profile window display xviii Chapter 1 Overview of the Code Development and Debugging System The C source debugger is an advanced programmer s interface that helps you to develop test and refine C6x C programs compiled with the C6x optimizi
331. to break out of asynchronous command and regain control of the PDM commandline press in the PDM window This returns control to the PDM command line However no debugger executing the command is interrupted m With r control is returned to the commandline immediately even if a debugger is still executing a command When you use r you do not see the results of the commands that the debuggers are executing EG Seta Variable to a String Syntax set group name list of processor names set variable string value Menu selection none Toolbar selection none Environments L basic debugger PDM E profiling Description The SET command allows you to create groups of processors to which you can send commands With the SET command you can _j Define a group of processors It is useful to define a group when you plan to send commands to the same set of processors The commands are sent to the processors in the same order in which you added the processors to the group To define a group specify a group name and then list the processors you want in the group _ Set the default group Defining a default group provides you with a short hand method of maintaining members in a group or of sending commands to the same group To set up the default group use the SET command with a special group name called dgroup Summary of Commands 12 47 set 12 48 _ Modify an existing group or creating a group based on another group Once you h
332. try from a Watch window follow these steps 1 Select the item in the Watch window that you want to delete 2 Press DELETE If you want to close a Watch window and delete all of the items in that window in a single step use the WR watch reset command The syntax is 7 20 ES Watch Values pe OO0041e0 H class OO000c0d8 A plececountUU00ssas ES Watch Managing Data in a Watch Window wr window name The optional window name parameter deletes a particular Watch window deletes all Watch windows ooe Note The debugger automatically closes any Watch windows when you execute File gt Load Program File gt Load Symbols the LOAD command or the SLOAD command Le Managing Data 7 21 Displaying Data in Alternative Formats 7 8 Displaying Data in Alternative Formats By default all data is displayed in its natural format This means that _j Integer values are displayed as decimal numbers _j Floating point values are displayed in floating point format _ Pointers are displayed as hexadecimal addresses with a Ox prefix _j Enumerated types are displayed symbolically However any data displayed in the Command Memory or Watch window can be displayed in a variety of formats Changing the default format for specific data types To display specific types of data in a different format use the SETF command The syntax for this command is setf data type display format The di
333. u select Alias Commands This displays the Alias Control dialog box 2 Inthe Name field enter a name for the alias 3 Inthe Command string field enter the command string that you want to associate with the alias name If you want to associate multiple commands with the alias separate the commands with a semicolon Enter the command string that you want Enter a name for the alias to associate with the alias name Edit alias Name Command string Wha To WA pcs wai Wa Clear Fields Apply Delete 4 Click Apply 5 Click OK to close the Alias Control dialog box You can include a defined alias name in the command string of another alias definition Defining an alias with parameters The command string that you use to define an alias can include parameter vari ables for which you supply the values when you use the alias Use a percent sign and a number 1 to represent each parameter Use consecutive num bers 1 2 3 unless you plan to reuse the same parameter value for multiple commands For example suppose that every time you filled an area of memory you also wanted to display that block in the Memory window You could set up the follow ing alias Edit alias Name Command string MFIL Hil 1 ee 23 mem 1 Clear Fields Delete Entering and Using Commands 3 3 Defining Your Own Command Strings Once you define this alias you could enter the following from the command line mfil 0x808020
334. ugger cannot find the init cmd file Be sure that init cmd Is in the appropriate directory If it is not copy it from the debugger product diskette If the file is already in the correct directory verify that the D_DIR environment variable is set up to identify the directory See the information about setting up the debugger environment information in cluded with your installation instructions Cannot halt the processor Description Action This is a fatal error for some reason pressing did not halt program execution Exit the debugger Invoke the autoexec bat file then invoke the debugger again Cannot initialize target system Description Action This error occurs while you are invoking the debugger with the emulator A variety of events may cause this error to occur _ Check the cable connecting the emulator to the target system to be sure it is not loose _ Ensure that your port address is set correctly m Check to be sure the p option used with the D OPTIONS environment variable matches the I O address defined by your switch settings m Check to see if you have a conflict in address space with another bus setting If you have a conflict change the switches on your board to one of the alter nate settings listed in the installation guide Modify the p option of the D_OPTIONS environment vari able to reflect the change in your switch settings _ Check the end of your autoexec bat or initdb bat f
335. uide Modify your source code Move path conflicts at cycle cycle Description Action Your program issued two instructions that used the same functional unit in the same execute packet For more informa tion about functional units and resource constraints see the TMS320C62x C67x CPU and Instruction Set Reference Guide Modify your source code Alphabetical Summary of Debugger Messages Multiple writes to register register at cycle cnum Description Your program issued multiple writes to the same register in the same cycle This problem occurs due to the latency associated with previous instructions in the pipeline For more information see the TMS320C62x C67x CPU and Instruction Set Reference Guide Action Modify your source code Name name not found Description The command cannot find the object named name Action If nameis a symbol be sure that it was typed correctly If itwas not reenter the command with the correct name If it was then be sure that the associated object file is loaded Nesting of repeats cannot exceed 100 Description The debugger cannot simulate more than 100 levels of repeat nesting in an input data file If this happens the debugger dis connects the input file from the pin Action Correct the input file so that the data does not include nesting repetition exceeding 100 Use the PINC command to recon nect the input file to the desired pin No file connected to this pin Des
336. ummary mode commands PDM commands profiling commands to 12 65 profiling commands summary 12 9 restrictions on validity sereen customization commands summa ry system E 11 16 system commands summary 12 6 using a system shell 8 6 window commands common object file format definition compiler 1 8 composer utility condition for analysis 10 5 10 9 conditional commands 3 8 11 10 to 11 12 fi2 26 to 12 61 conditional execution 6 11 conditional run 6 11 conditional single stepping configure analysis counter events pseudoregister ACE 10 14 configure hardware breakpoints pseudoregister ABE 10 13 constraints benchmarking 6 12 CLK context sensitive help accessing 1 14 CONTINUE command 11 11 to 11 22 12 28 to 12 29 continuous run halting starting 6 6 continuous step halting starting continuous step execution stepping until a break point Count CPU Events dialog box 10 6 count data 8 21 counter internal disabling 10 6 counters resetting internal event simulator CPU window definition description 1 4 7 13 to 7 17 editing registers reordering registers cr linker option 2 10 CSTEP command 12 18 current directory changing 12 17 current field editing 7 5 current PC finding 6 2 selecting cursors definition customizing memory types customizing the display changing the prompt loading a custom display saving a custom displa
337. uses the default group dgroup to contain CPU_A CPU_B and CPU_D and it changes the PDM prompt to GROUP3 x gt gt 11 6 Entering Operating System Commands The SYSTEM command provides you with a method of entering operating system commands The format for the PDM version of this command is system operating system command The SYSTEM command is similar to the debugger s SYSTEM command de scribed on page 3 5 but there are some differences _j Similarities You can enter operating system commands without having to leave the primary environment in this case the PDM and without hav ing to open another operating system window _j Differences Unlike the debugger version of the SYSTEM command m The PDM version of the SYSTEM command cannot be entered with out an operating system command parameter Therefore you cannot use the command to open a shell m There is no flag parameter command output is always displayed in the PDM window 11 16 Understanding the PDM s Expression Analysis 11 7 Understanding the PDM s Expression Analysis Table 17 1 The PDM analyzes expressions differently than individual debuggers do ex pression analysis for the debugger is described in Chapter 13 Basic Informa tion About C Expressions The PDM uses a simple integral expression ana lyzer You can use expressions to cause the PDM to make decisions as part of the command and the flow control commands described on pages 11 19 and 11
338. vailable on the TMS320C6201 C6701 digital signal processors This book includes in formation on the internal data and program memories the external memory interface EMIF the host port serial ports direct memory access DMA clocking and phase locked loop PLL and the power down modes TMS320C62x C67x Programmer s Guide literature number SPRU198 describes ways to optimize C and assembly code for the TMS320C62x C67x DSPs and includes application program examples TMS320C62x C67x Technical Brief literature number SPRU197 gives an introduction to the C62x C67x digital signal processors development tools and third party support Read This First V Related Documentation Trademarks XDS51x Emulator Installation Guide literature number SPNUO70 describes the installation of the XDS510 XDS510PP and XDS510WS emulator controllers The installation of the XDS511 emulator is also described Related Documentation FCC Warning Trademarks yi If you are an assembly language programmer and would like more information about C or C expressions you may find these books useful American National Standard for Information Systems Programming Language C X3 159 1989 American National Standards Institute ANSI standard for C Programming in C Kochan Steve G Hayden Book Company The C Programming Language second edition 1988 by Brian W Kernig han and Dennis M Ritchie published by Prentice Hall Engl
339. valid use of a pointer in an expression 123 A5 A2 123 dau By default the values are treated as integers that is these expressions point to integer values Any expression can be type cast to a pointer to a specific type overriding the default of pointing to an integer as described above Hint You can use casting with the WA and DISP commands to display data in a desired format For example the expression x float 10 treats 10 as a pointer to a floating point value at location 10 in memory In this case the debugger fetches the contents of memory location 10 and treats the contents as a floating point value If you use this expression as a parameter for the DISP command the debugger displays memory con tents as an array of floating point values within the DISP window begin ning with memory location 10 as array member 0 Basic Information About C Expressions 13 5 Using Expression Analysis in the Debugger 13 6 Note how the first expression differs from the expression float 10 In this case the debugger fetches an integer from address 10 and con verts the integer to a floating point value You can also type cast to user defined types such as structures For exam ple in the expression struct STR 10 gt field the debugger treats memory location 10 as a pointer to a structure of type STR assuming that a structure is at address 10 and accesses a field from that structure Appendix
340. w name parameter specifies a particular Watch window If no window names is given the expres sion is deleted from the default Watch window Summary of Commands 12 59 whatis Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description 12 60 Find Data Type whatis symbol none none basic debugger E PDM E profiling The WHATIS command shows the data type of symbol in the display area of the Command window The symbol can be any variable local global or static a function name structure tag typedef name or enumeration constant Make a Window Active win window name View menu options none basic debugger L PDM profiling The WIN command allows you to make a window active by name You can spell out the entire window name but you really need to specify only enough letters to identify the window If you supply an ambiguous name such as C which could stand for CPU or Calls the debugger selects the first window it finds whose name matches the name you supplied If the debugger does not find the window you asked for because you closed the window or misspelled the name then the WIN command has no effect Syntax Menu selection Toolbar selection Environments Description Syntax Menu selection Toolbar selection Environments Description zoom Close Watch Window wr window name Setup Watch Variab
341. want an interrupt to occur You can have two types of CPU clock cycles m Absolute To use an absolute clock cycle your cycle value must represent the actual CPU clock cycle where you want to simulate an interrupt For example 12 34 56 Interrupts are simulated at the 12th 34th and 56th CPU clock cycles No operation is performed on the clock cycle value the interrupt oc curs exactly as the clock cycle value is written m Relative You can also select a clock cycle that is relative to the time at which the last event occurred A plus sign before a clock cycle adds that value to the total clock cycles preceding it For example l2 F34 D9 In this example a total of three interrupts are simulated at the 12th 46th 12 34 and 55th CPU clock cycles You can mix both relative and absolute values in your input file Simulating External Interrupts Simulator Only J Therpt n EOS parameter is optional and represents a repetition value You can have two forms of repetition to simulate interrupts m Repetition on a fixed number of times You can format your input file to repeat a particular pattern for a fixed number of times For exam ple S F710 20 rou 2 The values inside the parentheses represent the portion that is re peated Therefore an interrupt is simulated at the 5th CPU cycle then the15th 5 10 35th 15 20 45th 35 10 and 65th 45 20 CPU clock cycles The nis a positive integer value
342. wowex oo aene nee 6 3 Single Stepping Through Code ccc ee tenet ene ees Single stepping through assembly language or C code 0 cece ee eee Single stepping through C code 1 ee eet e tenes Continuously stepping through code 1 eee Single stepping through code and stepping over C functions 64 Running Code Conditionally 10 0s 0 06srcedsiasentuse di nageetadbensan tas 60 BonciMakKM st vi cerives Coun rieder eae eee r eid eE ues 6 6 Halting Program EXCCUUOIN tins ctvaaedmaeeetenee wed timi eee ad Behe eae Seed a What happens when you halt the emulator 0 0 0 0 cee eee 6 7 Using Software Breakpoints 0 ccc ee teen eee eens Setting a software breakpoint 0 cc eet ee eee e eens Clearing a software breakpoint 0 ccc ene nn ens Clearing all software breakpoints 0 0c ccc ene eee ne nes Saving breakpoint settings 24 s06n2seedtoes de wiendesee ceed eeessmensueend coe cus Loading Saved breakpoint SCUINGS 25 2c406 eteecy and eens ed aes beet eedeeonen ss Managing Wala sess ose sete tc cceesasstecseenhetaseden nessun esauseynoeeehenyewan ex Describes the data display windows and tells you how to edit data memory contents register contents and individual variables 7 1 Where Data Is Displayed 0 0 ccc teen e nee eens 7 2 How the Emulator Displays Data for Load and Store Instructions 7 3 Basic Commands for Managing Dala s
343. x 5 2 load file commands 12 4 loading assembly language code 5 2 to 5 5 batch files COFF files restrictions 4 2 object code after invoking the debugger 6 4 description b 2 to 5 5 symbol table only b 4 while invoking the debugger 7 2 9 with global symbols only 13 with symbol table without symbol table RELOAD saved breakpoint settings Log File dialog box opening a file log files 8 12 to 3 13 11 10 logical operators conditional execution 6 11 description 13 2 long data type LOOP BREAK CONTINUE ENDLOOP com mands 11 11 to 11 22 12 28lto 12 29 LOOP ENDLOOP commands 3 9 8 1 0 12 30 to 8 10 12 29 looping commands 8 9 to 3 10 12 28 to 12 29 to 11 22 Index 11 Index MA command to 12 30 emulator syntax managing data modifying a map basic commands _ 7 3 to multiple maps changing data values_ 7 5 to 7 6 potential problems in memory 7 7 to resetting 12 34 in registers 7 13 to restrictions to returning to default 4 12 sample map listing current map in Watch windows MAP command 12 31 marking areas for profiling 8 5 to 8 9 Memory menu MC command 4 14 to 4 15 12 31 Fill Byte option MD command 12 32 Fill Word option a B Mapping option 4 3 me debugger option 2 11 n A MEM command E description 12 32 memory system Analysis Statistics window display formats 12 33 memory system analysis effect on debugging modes counting events 9
344. x Optimizing C Compiler User s Guide for more in formation The assembler translates assembly language source files into machine language COFF object files See the TMS320C6x Assembly Language Tools User s Guide for more in formation The linker combines object files into a single executable COFF object module As it creates the executable module it performs relocation and resolves external references The linker allows you to define your sys tem s memory map and to associate blocks of code with defined memory areas See the TMS320C6x Assembly Language Tools User s Guide for more in formation The main product of this development process is a module that can be executed in a TMS320C6x target system Developing Code for the TMS320C6x _j You can use debugging tools to refine and correct your code Available products include An_instruction accurate and clock accurate fixed point software simulator An instruction accurate limited floating point software simulator A faster limited version of the fixed point simulator An XDS emulator Overview of the Code Development and Debugging System 1 9 Limited Versions of the Simulator 1 4 Limited Versions of the Simulator This release provides you with three simulator versions _j Fixed point simulator for use with the TMS320C6201 _j Limited faster version of the fixed point simulator for use with the TMS320C6201 _j Limited floating point simulator for use with
345. x Software Development Flow C source files Linear as sembly Assembler Assembly aans optimizer Assembly optimized file Executable COFF file Overview of the Code Development and Debugging System 1 7 Developing Code for the TMS320C6x Common object file format COFF allows you to divide your code into logical blocks define your system s memory map and then link code into specific memory areas COFF also provides rich support for source level debugging The following list describes the tools shown in Figure 1 2 E The assembly optimizer allows you to write linear assembly code without being concerned with the TMS320C6x pipeline structure or with assigning registers It assigns registers and uses loop optimization to turn linear as sembly into highly parallel assembly that takes advantage of software pi pelining See the TMS320C6x Optimizing C Compiler User s Guide for more in formation The C compiler accepts C source code and produces TMS320C6x as sembly language source code A shell program an optimizer and an in terlist utility are included in the compiler package m Theshell program enables you to compile assemble and link source modules in one step m The optimizer modifies code to improve the efficiency of C programs m The interlist utility interlists C source statements with assembly lan guage output to correlate code produced by the compiler with your source code See the TMS320C6
346. y Index d decimal display format d debugger option 2 10 D_DIR environment variable effects on debugger invocation D_OPTIONS environment variable 2 10 to 2 13 definition effects on debugger invocation for HPUX systems to for SPARC systems 2 5 to for Windows 95 systems ignoring x option setting up D_ SRC environment variable definition effects on ENTE a A 1 for HPUX systems to for SPARC systems AE for Windows 95 M naming additional deoe A 2 setting up D_DIR environment variable definition D 2 for HPUX DA e ea for SPARC Dene for Windows 95 ns E 2 3 setting up DASM command description 12 19 effect on debugging modes 2 17 finding current PC data display windows definition data formats 7 22 data management determining variable types data management commands controlling data format 7 9 EVAL command PDM version 12 22 side effects _ 7 5 to 7 6 summary data memory adding to memory map to data type changing the default 7 22 for displaying debugger data 7 23 parameter for SETF command data management commands EVAL command PDM version 11 21 Index 5 Index data display windows CPU window i 7 2 7 13 to 7 17 description Memory itor 7 7 to overview Watch window 7 18 to 7 21 data management changing data value 7 5 to 7 8 changing memory range displayed in Memory window 7 70 7 251 changing the default display format comma
347. you want to change the data format for the watched item select the for mat you want to use from the Format drop list The format field is optional 4 Ifyou wantto assign a label for the watched item use the Label field If you leave the Label field blank the debugger displays the expression vari able or register as the label 5 If you want to open a new Watch window enter a name for the new Watch window in the Window name field This field is optional When you enter Managing Data 7 19 Managing Data in a Watch Window a window name the debugger appends the window name to the Watch window label If you do not supply a name the debugger adds the item to the default Watch window 6 Click Apply When you have entered the last expression variable or regis ter that you want to watch click OK After you open a Watch window executing Setup Watch Variable and using the same window name adds additional values to the Watch window You can open as many Watch windows as you need by using unique window names Displaying additional data When you use the Watch window to view structures pointers or arrays you can display the additional data the data pointed to or the members of the array or structure by clicking the box icon next to the watched item Click this icon to display the contents of the array You can also display additional data by selecting an item and pressing l Deleting watched values To delete an en
348. your system can handle Action If you have numerous debuggers invoked and you re not using all of them close some of them If you are under a UNIX environment use the ipcs command to check your message queues use ipcrm to clean up the message queues Alphabetical Summary of PDM Messages Cannot open log file Description The PDM cannotfind the filename that you supplied when you entered the DLOG command Action Be sure that the file resides in the current directory or in one of the directories specified by the D_DIR environment variable Check to see if you mistyped the filename Cannot open take file Description The PDM cannot find the batch filename supplied for the TAKE command You will also see this message if you try to execute a batch file that does not have a odm extension Action Be sure that the file resides in the current directory or in one of the directories specified by the D_DIR environment variable Check to see whether you mistyped the filename Be sure that the batch filename has a pdm extension _ Be sure that the file has executable rights Cannot open temporary file Description The PDM is unable create a temporary file in the current direc tory Action Change the permissions of the current directory Cannot seek in file Description While the PDM was reading a file the file was deleted or modified Action Be sure that the files the PDM reads are not deleted or modi fied during the
349. ys the Save Profile View File dialog box Save IF E S QUINCE fed Ee Profile Data Files prt Cancel Save as type Enter a name for the file Use a prf extension 2 Inthe Filename field enter a name for the file You can use a prf extension to identify the file as a profile data file 3 Click Save This saves only the current view if for example you are viewing only the Count field then only that information is saved If the file already exists debug ger overwrites the file with the new data Profiling Code Execution 8 27 Saving Profile Data to a File Saving all data for currently displayed areas To save all data for the currently displayed areas follow these steps 1 From the Profile menu select Save All This displays the Save Profile File dialog box 2 Inthe Filename field enter a name for the file You can use a prf extension to identify the file as a profile data file 3 Click Save This saves all views of the data including the individual count inclusive etc with the percentage indications and histograms If the file already exists debugger overwrites the file with the new data 8 28 Chapter 9 Using Simulator Memory System Analysis The TMS320C6x simulator debugger memory system analysis functionality allows you to measure your system performance accurately You do this by monitoring system events using the Analysis Events dialog box and the Analy sis Statisti
Download Pdf Manuals
Related Search
Related Contents
BrakeMate Jr. - Flo Aquacom® STX-101 User Guide STAN User Guide (Version 1.0) Reglamento vehicular Nº 94 de las Naciones Unidas Nashua Tape 1207782 Installation Guide ACTUALIZAÇÃO TAXAS DE IVA 8.取り扱いと保守 Hi Rick, I can confirm that drilling locations have not yet been User Manual - Sports Dryer Copyright © All rights reserved.
Failed to retrieve file