NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

What is my DSP clock speed

From Texas Instruments Wiki
Jump to: navigation, search

It is very common to wonder if the DSP is really running at the clock speed you set it for. This application note offers one simple method for measuring the approximate clock speed of a DSP that is based on the C64x+ core, including the C674x and C66x DSPs and including the DSPs that are embedded in DaVinci and C6-Integra devices.

Download the DSPClockSpeed test program[edit]

Click the link to download the Project zip file to a temporary location on your computer.

Randyp_DSPClockSpeed.zip (Date: Nov 21, 2011)

Import the DSPClockSpeed project[edit]

The DSPClockSpeed project can be imported from the Randyp_DSP_ClockSpeed.zip file into CCSv4 or CCSv5. The zip file contains an archived CCSv4 project that will easily work in CCSv5, also. For CCS 3.x, you may use the main.c and lnkdsp.cmd files, but you will have to create your own project file.

Import to CCSv4[edit]

Use the CCSv4 File->Import command to import the DSPClockSpeed project into your workspace using these steps:

  1. From the CCSv4 main menu, select the File->Import command
  2. Select as source type CCS:Existing CCS/CCE Eclipse Projects
  3. Select an archive file
  4. Browse to the Randyp_DSPClockSpeed.zip file or enter the path to it
  5. Select the DSPClockSpeed project
  6. Click Finish

Since this program was built and archived from a workspace using CCSv4.2.4.00033 and Code Generation Tools 7.2.3, there may be some "housekeeping" needed to make your build and debug experience run smoothly. Please follow these steps to make sure the right tools are selected:

  1. In the C/C++ Projects window, right-click on the project folder name and select Build Properties..., select CCS Build in the left pane then the General tab
  2. Click the drop-down arrow for Device Variant: and select the device type that you are using; this project was built for the C674x, so you may need to change it to Generic C64x+
  3. Click the drop-down arrow for Code Generation tools and select the latest version of CGT that you have. Earlier versions like 6.0.x may work but have not been tested (please comment here if you test them). If your latest version is not yet in the list, click More then Select tool from file-system and browse to the folder, such as C:\TI\Tools\C6000 Code Generation Tools 7.3.1, then click OK and OK.
  4. Click OK to save these changes and select Apply changes to existing build configuration in the Save Build Configuration Settings window if it comes up.

Import to CCSv5[edit]

Use the CCSv5 File->Import command to import the DSPClockSpeed project into your workspace using these steps:

  1. From the CCSv5 main menu, select the File->Import command
  2. Select as source type Code Composer Studio:Existing CCS/CCE Eclipse Projects
  3. Select an archive file
  4. Browse to the Randyp_DSPClockSpeed.zip file or enter the path to it
  5. Select the DSPClockSpeed project
  6. Click Finish

Since this program was built and archived from a workspace using CCSv4.2.4.00033 and Code Generation Tools 7.2.3, there may be some "housekeeping" needed to make your build and debug experience run smoothly. Please follow these steps to make sure the right tools are selected:

  1. In the Project Explorer window, right-click on the project folder name and select Properties, select General in the left pane
  2. Click the drop-down arrow for Variant: and select the device type that you are using; this project was built for the C674x, so you may need to change it to Generic C64x+ or Generic C66x
  3. Click the drop-down arrow for Compiler version: and select the latest version of CGT that you have. Earlier versions like 6.0.x may work but have not been tested (please comment here if you test them). If your latest version is not yet in the list, click More then Select tool from file-system and browse to the folder, such as C:\TI\Tools\C6000 Code Generation Tools 7.3.1, then click OK and OK.
  4. Click OK to save these changes

Build the Application[edit]

Each board or DSP may have different methods for configuring the device and the DSP's PLL or clock speed. Whatever steps must be taken will usually be done in a GEL script, or in boot code, or in an initialization/setup function at the beginning of the main function. It is your responsibility to make sure this initialization is done either outside this test program or inside this test program, under the comments starting with "System setup".

Build in CCSv4[edit]

Follow the steps below to get a successful build of the project.

  1. Select the DSPClockSpeed project, right-click and Set as Active Project.
  2. On the main icon row click the Build Active Project icon.

Build in CCSv5[edit]

Follow the steps below to get a successful build of the project.

  1. In the Project Explorer window, select the DSPClockSpeed project to make it the Active Project.
  2. On the main icon row click the "hammer" icon that says Build Debug for your project, or right-click on DSPClockSpeed and choose Build Project.

Load and Run the Application[edit]

After a successful build has been completed, follow these steps in the Debug Perspective to load and run the application:

Load and Run in CCSv4[edit]

  1. In a Target Configurations window, find the appropriate Target Configuration, then right-click on it and select Launch Selected Configuration
  2. On some heterogeneous devices like the OMAP-L138 or DaVinci DM8168, there may be some required steps to enable the DSP for debug. If so, please do those steps here, including any GEL Script functions that need to be executed.
  3. In the Debug Perspective, on the main icon row, click Connect Target to connect to the DSP. Please do any additional steps required to configured the DSP for the desired operation, including any GEL Script functions that need to be executed.
  4. On the main icon row, click Load Program and find DSPClockSpeed.out to load
  5. On the Debug window icon row, click Run to reach the in-code SWBP breakpoint
  6. Open or show the Local Window
  7. Find a clock or timer with visible seconds
  8. Click Run again
  9. Wait 10 seconds based on the clock or timer with visible seconds
  10. Click Halt
  11. Observe the CPU clock rate in the Local Window as shown below for the C674x DSP on an OMAP-L138 running at 300MHz; read the Value for the variable CPUClockMHz

CCSv4 Local Window for OMAP-L138 DSP @ 300MHz

Load and Run in CCSv5[edit]

  1. In a Target Configurations window, find the appropriate Target Configuration, then right-click on it and select Launch Selected Configuration
  2. On some heterogeneous devices like the OMAP-L138 or DaVinci DM8168, there may be some required steps to enable the DSP for debug. If so, please do those steps here, including any GEL Script functions that need to be executed.
  3. In the CCS Debug Perspective, on the main icon row, click Connect Target to connect to the DSP. Please do any additional steps required to configured the DSP for the desired operation, including any GEL Script functions that need to be executed.
  4. On the main icon row, click Load Program and find DSPClockSpeed.out to load
  5. On the Debug window icon row, click Run to reach the in-code SWBP breakpoint
  6. Open or show the Variables Window
  7. Find a clock or timer with visible seconds
  8. Click Run again
  9. Wait 10 seconds based on the clock or timer with visible seconds
  10. Click Halt
  11. Observe the CPU clock rate in the Variables Window as shown below for the C674x DSP on a DM8168 running at 800MHz; read the Value for the variable CPUClockMHz

CCSv5 Variables Window for DM8168 DSP @ 800MHz

Summary[edit]

The clock rate displayed will be close, usually within 5%. The accuracy depends mostly on your reaction times when measuring the 10 second delay. You can use longer delays and adjust your interpretation of the displayed counts accordingly.

This project provides a simple way to confirm that the clock speed settings you have implemented for your DSP are running at the correct frequency.

Another good application idea would be to toggle a pin or send a message through a communication channel, then count off 10G counts of the TSC counter, then toggle the pin again or send another message. The pin pulses or messages could be timed and compared to the expected value as a method to confirm that your DSP is running at the desired speed, but without using CCS or an emulator.

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article What is my DSP clock speed here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article What is my DSP clock speed here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article What is my DSP clock speed here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article What is my DSP clock speed here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article What is my DSP clock speed here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article What is my DSP clock speed here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article What is my DSP clock speed here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article What is my DSP clock speed here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article What is my DSP clock speed here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity