NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
SPRA822 XDS510/XDS560 XDS510TM XDS560TM XDS510 XDS560 TMS320C6000TM - Datasheet Archive
SPRA822 May 2002 Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 Emulator Huimin Xu Software
Application Report SPRA822 SPRA822 May 2002 Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator Huimin Xu Software Development Systems/Emulation Team ABSTRACT For a multiprocessor system with multiple CPUs on a single board or one or more multicore devices in the system, the CPUs and the cores sometimes may interact or depend on the actions of the other CPUs or cores. The multiple cores on a single device often even share a common block of memory, which contains executable code or shared data. Hence it is often desirable to debug the multiple CPUs or the multiple cores simultaneously when trying to debug code that provides communications between processors. The Code Composer StudioTM integrated development environment (IDE) provides debug support for systems with multiple processors connected on the same JTAG scan path. This process, sometimes referred to as co-emulation, allows the user to coordinate debugging between all of the processors. One of the commonly used debug methods for multiprocessor system debug is to use the parallel debug manager control within the Code Composer Studio IDE to broadcast debug commands to multiple processors simultaneously. This feature allows the user to perform synchronous execution on multiple processors such as stepping, running, and halting in parallel. This gives the user more control over the code execution and communications between multiple processors. This application report describes how to set up the Code Composer Studio for a multiprocessor system using a XDS510TM XDS510TM and a XDS560TM XDS560TM emulator, and how to use the broadcast commands in parallel debug manager (PDM) to debug a multiprocessor system. Contents 1 2 Introduction . 2 Setting Up Code Composer Studio . 3 2.1 2.2 2.3 3 Installing Code Composer Studio IDE v2.0. 3 Configuring a Multiprocessor System Using XDS510 XDS510 Emulator. 3 Configuring a Multiprocessor System Using XDS560 XDS560 Emulator. 6 Debugging With Parallel Debug Manager . 7 3.1 Open Debug Sessions . 7 3.2 Grouping Processors. 7 3.2.1 To View the List of Groups. 7 3.2.2 To Create a New Group. 8 3.2.3 To Delete a Group . 9 Code Composer Studio, XDS510 XDS510, and XDS560 XDS560 are trademarks of Texas Instruments. SPRA822 SPRA822 3.2.4 To Edit a Group . 9 3.3 Using Broadcast Commands to Debug Multiprocessor System. 9 3.3.1 Loading Program . 10 3.3.2 Running Processors . 10 3.3.3 Halting Processors. 11 1 Introduction For a multiprocessor system with multiple CPUs on a single board or one or more multicore devices in the system, the CPUs and the cores sometimes may interact or depend on the actions of the other CPUs or cores. The multiple cores on a single device often even share a common block of memory, which contains executable code or shared data. Hence, it is often desirable to debug the multiple CPUs or the multiple cores simultaneously when trying to debug code that provides communications between processors. The Code Composer Studio Integrated Development Environment (IDE) provides debug support for systems with multiple processors connected on the same JTAG scan path. This process, sometimes referred to as co-emulation, allows the user to coordinate debugging between all of the processors. There are two ways to debug the multiple processors simultaneously. 1) Use the parallel debug manager to broadcast debug commands to multiple processors simultaneously. This allows users to perform synchronous execution on multiple processors such as stepping, running, and halting in parallel. One example is to debug a multicore device using shared memory for code execution. It is common for the user to synchronously run all the cores from the same location and synchronously halt all the cores and examine if the code executes as expected for each processor. 2) Use the parallel debug manager to start a separate Code Composer Studio debug session for each processor. Then switch back and forth between the separate sessions running on different cores. In this case, the user executes debug commands one debug session at a time. This method may be especially inconvenient for a multiprocessor system with a large number of processors within the system when broadcast commands could be used instead. The CPUs and cores in the multiprocessor system can all be the same kind (referred to as a homogeneous multiprocessor system) or they can be different types (DSPs and microcontrollers, for example, referred to as a heterogeneous multiprocessor system). By default, the Code Composer Studio can provide co-emulation only when the target device driver supports all of the processors in the scan path. Since the target device drivers are generally dedicated to a single instruction set architecture (ISA), the normal target device drivers are sufficient to configure a homogeneous multiprocessor system, but not sufficient to configure a heterogeneous multiprocessor system. A heterogeneous device driver is required in that case. Refer to the Code Composer Studio online help for more details about how to setup Code Composer Studio using the heterogeneous device driver. Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 2 SPRA822 SPRA822 2 Setting Up Code Composer Studio 2.1 Installing Code Composer Studio IDE v2.0 Install a copy of Code Composer Studio IDE v2.0 or above for each processor type you intend to debug (e.g., TMS320C6000TM TMS320C6000TM DSP platform and TMS320C5000TM TMS320C5000TM DSP platform). The order of installation is not important. See the release notes of the product for the processor combinations supported under Code Composer Studio IDE v2.0 or above. After the first product is installed, subsequent installations detect that another Code Composer Studio product is already present. The installation program prompts the user to select the merged installation option. In order to enable heterogeneous debugging, the merged installation option must be selected. To debug with XDS560 XDS560 emulator, install the XDS560 XDS560 hardware and software after installing Code Composer Studio IDE. Refer to the XDS560 XDS560 documentation for the installation details. In this application report, a system with 6 TMS320C5500TM TMS320C5500TM DSP cores within a single device is used as an example to describe how to configure and debug a multiprocessor system using a XDS510 XDS510 or a XDS560 XDS560 emulator. 2.2 Configuring a Multiprocessor System Using XDS510 XDS510 Emulator 1) Connect the XDS510 XDS510 JTAG cable to the system. 2) Start Code Composer Studio setup by double clicking the Setup CCS desktop icon. 3) From the File menu, select Clear to erase the existing system configuration and click OK. 4) Drag the C55x XDS driver from the Available Board/Simulator Types panel to the System Configuration Panel. 5) The Board Properties dialog box, which contains 4 tabs, should appear with the first tab Board Name & Data File active. Modify Board Name in the first tab to a name you wish to use for your board, and press Next> to proceed to the Board Properties tab. Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 3 SPRA822 SPRA822 6) Modify I/O Port to the address of the I/O port being used by the XDS510 XDS510 (in most cases this value is 0x240). For this example, the default I/O port address is used. The Board Properties tab should now look like: 7) Press Next> and the Processor Configuration tab should now be active. From the Available Processors list, select TMS320C5500 TMS320C5500 and click Add Multiple. A Processor Setup dialog box should appear. Modify the Processor Base Name for the processors and modify the Quantity to 6, the Processor Setup dialog box should now look like: Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 4 SPRA822 SPRA822 8) Click on OK to return to the Processor Configuration tab. The Processor Configuration tab should now look like: 9) Click on Next> to proceed to the Start GEL File(s) tab. Click on the desired processor to specify a GEL file, and then click on the "." box under Startup GEL File to display a list of GEL files. Pick a GEL file that contains the appropriate startup commands for that processor selected. For this example, a custom GEL file named multi_c55xx.gel is selected for all six processors and the Board Properties should now look like: 10) Click on Finish to close the Board Properties dialog and complete target device driver setup. 11) Select File->Exit, then click Yes to save changes to the system configuration, and exit the setup program. By default, Code Composer Studio is automatically started. Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 5 SPRA822 SPRA822 2.3 Configuring a Multiprocessor System Using XDS560 XDS560 Emulator 1) Connect the XDS560 XDS560 JTAG cable to the system. 2) Start Code Composer Studio setup by double clicking the Setup CCS desktop icon. 3) From the File menu, select Clear to erase the existing system configuration and click OK. 4) Drag the C5500 C5500 XDS560 XDS560 driver from the Available Board/Simulator Types panel to the System Configuration Panel. 5) The Board Properties dialog box, which contains 4 tabs, should appear with the first tab Board Name & Data File active. Modify Board Name in the first tab to a name the user chooses for the board, and press Next> to proceed to the Board Properties tab. 6) There are two properties shown in the Board Properties tab: TCLK and emulator name. The TCLK property enables the user to specify a value for the JTAG clock rate. To select a value for the TCLK property, click the arrow button on the right column to activate the drop down list. The drop down list in the Value field provides three options: Automatic, Legacy (10.368MHz), and User Defined. If the Automatic option is selected, Code Composer Studio automatically determines the best clock rate for the system. If the Legacy (10.368MHz) option is selected, then the clock rate is set to the value used for the XDS510 XDS510 emulator that is 10.368 MHz. If User Defined is selected, a new property named JTAG Clock Rate is displayed. It allows the user to enter a specific positive integer value. The clock rate is then set to half of the value entered for JTAG Clock Rate property in the unit of MHz. For example, if 10 is entered for the value of the JTAG Clock Rate property, then the clock rate is set to 5 MHz. The Emulator Name property enables the user to specify the name and port address (board index) of a XDS560 XDS560 class emulator. The default value for this property is XDS560 XDS560 0. Modifications may be necessary if you have multiple XDS560 XDS560 emulators installed and the one used is not at board index 0. For example, the default values for both the TCLK property and the Emulator Name property are used. The Board Properties tab now looks like: Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 6 SPRA822 SPRA822 Follow steps 7) through 11) described in the previous section for Configuring a Multiprocessor System Using XDS510 XDS510 Emulator to complete the setup for target device drivers. 3 Debugging With Parallel Debug Manager Code Composer Studio should already be started at this point. If not, start Code Composer Studio by double clicking the CCS desktop icon. The parallel debug manager (PDM) control is displayed as follows: From the PDM menu bar, the user can open individual parent windows to control each processor or broadcast commands to a group of processors. The PDM is a floating toolbar. To keep it on top of other windows, select Options->Always On Top. Change the shape of the menu bar by resizing it. The command buttons and menus will wrap around to fit the size of the window. 3.1 Open Debug Sessions To select a debugging session on a processor: 1) Select Open from the PDM menu bar. 2) Select the processor by its name. This opens a parent window for the selected processor. The Open menu contains the list of physical target boards/processors and simulated targets that are defined in your current system configuration. If the correct processor list does not appear under the Open menu, make sure that you have correctly configured Code Composer Studio with the Code Composer Studio setup program. For demonstration purpose, debug sessions for all the six processor in the system are opened. 3.2 Grouping Processors All debug commands from the parallel debug manager (PDM) are broadcast to all target processors in the current group. Code Composer Studio allows the user to define up to 32 different groups of processors. Each processor may be included in one or more groups. 3.2.1 To View the List of Groups Select Group on the PDM menu bar. The Group menu lists all groups by name. By default, a group named FirstBoard is created. This group can be modified, but it cannot be deleted. This ensures that there is always at least one group available. There is also a checkmark shown besides the FirstBoard name to indicate this group is currently selected. Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 7 SPRA822 SPRA822 3.2.2 To Create a New Group Select Group->Edit. The Groups dialog box should appear as: In the Groups dialog box, click New. A new group is generated with a unique name. Group names can be edited directly by double clicking on the group name, and they must be unique. Initially, no processors are included in the new group. The Groups dialog box should now look like: Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 8 SPRA822 SPRA822 3.2.3 To Delete a Group In the Groups dialog box, use the mouse or the arrow keys to highlight the desired group name and click Remove. 3.2.4 To Edit a Group As seen from the Groups dialog box, group names are displayed in the first column and processor names are displayed across the top line. If using the scroll bar, the user can actually see all the processor names displayed on the top line. Each entry in the table is either Y (yes) or N (no). When these entries are Y, the processor for that column is included in the group in the same row. Only processors that are included in the current group receive broadcast messages. To include a processor in a group, first find the column corresponding to the desired processor. Then find the row corresponding to the group that is to include the processor. Now click the cell where the column and row intersect. When a Y appears, the processor is included in the group. When an N appears, the processor is excluded from the group. For this example, the first three processors are grouped into the FirstBoard group and the latter three processors into the Group1 group. The Groups dialog box now looks like: Click on OK to finish editing the groups. The user is now ready to start debugging with the PDM. 3.3 Using Broadcast Commands to Debug Multiprocessor System All debug commands in the parallel debug manager (PDM) are broadcast to all target processors in the currently selected group. If the device driver supports synchronous operation, each of the following commands is synchronized to start at the same time on each processor. Locked Step Locked step is used to single step all processors that are not already running. Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 9 SPRA822 SPRA822 StepOver StepOver executes step over on all processors that are not already running. StepOut If all the processors are inside a subroutine, StepOut executes the step out command on all the processors that are not already running. Sync Run This command sends a global run command to all processors that are not already running. Sync Halt This command halts all processors simultaneously. Animate This command starts animating all the processors that are not already running. GEL Command Functions written in the general extension language (GEL) can also be broadcast from the parallel debug manager (PDM) to all processors in the current group. Broadcast GEL commands are restricted to processors whose parent window is open. To broadcast GEL commands: 1) Select Group->Broadcast command. 2) In the Broadcast Command dialog box, enter a built-in GEL function or user-defined GEL function in the command box. 3) Click OK or press Enter to broadcast the command to each processor in the current group. To start debugging a multiprocessor system, first select a group. Select Group on the PDM menu bar, and select the group to be used. The active group has a check mark beside the name. For this example, Group1 is selected for the debug. 3.3.1 Loading Program From the PDM menu bar, select File->Load Programs, and browse to the files you wish to load and click on Open. The program is loaded into the three processors specified in the Group1 group. The disassembly window displays the three processors all stopping at the same location. While in the debug sessions for the other three processors, nothing happens. 3.3.2 Running Processors From the PDM control, press the Run button to initiate the synchronous run command. The three processors specified in Group1 group start to run, while the other three processors remain halted. Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 10 SPRA822 SPRA822 3.3.3 Halting Processors From the PDM control, press the Halt button to initiate the synchronous halt command. The three processors specified in the Group1 are halted. The disassembly window display that the three processors all stop at the same location. While the debug sessions for the other three processors remain unchanged. Note: In order to synchronously run and halt the processors and achieve the above result, all the processors have to run from a common functional clock. Otherwise the above results are not assured. Using Broadcast Commands for Multiprocessor System Debug With XDS510/XDS560 XDS510/XDS560 Emulator 11