• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » Hercules™ Safety Microcontrollers » Hercules™ Safety Microcontrollers Forum » clock() function on TMS570 MCU Development Kit
Share
Hercules™ Safety Microcontrollers
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS

clock() function on TMS570 MCU Development Kit

clock() function on TMS570 MCU Development Kit

This question is not answered
Christopher Noll
Posted by Christopher Noll
on Oct 28 2010 13:28 PM
Prodigy10 points

I have a TMS570 MCU deve kit (usb stick).  I am trying to get some benchmarking information using the emulator.  I used the demo program as my baseline and added an additional element to the "switch" statement to call my benchmark code.  All runs correctly but I was intending to get timing information by bracketing the benchmart functions with reads of CPU cycles from the emulator via the "clock()" function.  It seems like this function always returns a value of 0.  Is there any timing or performance monitoring supported?  I don't want to invest a huge amount of time in measuring this benchmark.

Thanks in advance

Christopher Noll

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Anthony Vaughan
    Posted by Anthony Vaughan
    on Nov 01 2010 10:56 AM
    Intellectual1275 points

    Christopher,

    We have forwarded your question to our benchmarking experts and will have an answer for you shortly.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Shrikant S
    Posted by Shrikant S
    on Jun 26 2012 08:10 AM
    Prodigy160 points

    I am also facing same issue,clock function is always returning 0.I am using TI CCS5.0 and Compiler TIv4.9.5

    I am using below code

    start=clock();

    function();

    stop=clock();

    Both the variables(start and stop) are having values of 0.Can you please let me know why the value is 0?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jean-Marc Mifsud
    Posted by Jean-Marc Mifsud
    on Jun 26 2012 08:58 AM
    Expert8985 points

    Christopher,

    The Cortex R4F core has a build in unit to perform cycle count on different events. (Performance Monitor Unit).

    Here is an assembly code that provides the basic routine to initialize the PMU, Start count, Stop Count and Read results. 1667.perf_monitor_r4.asm

    The way to use it is easy. See the following example:

    int startTime, endTime, execTime = 0;

    Enable_Performance_Monitor(0);
    Performance_Monitor_Start(0);

    startTime = Performance_Monitor_Read_CycleCount(0);

    Code to be benchmarked;

    endTime = Performance_Monitor_Read_CycleCount(0);
    execTime = endTime - startTime ;

    Performance_Monitor_Stop(0);

    The result in execTime is the number of CPU cycles.

    Please have a try and let me know if this is helpful.

    For more information on PMU, please refer to ARM TRM and search for PMU.

    Regards,

    Jean-Marc

    Best regards,

    Jean-Marc

    Application Engineer


    If my reply answers your question please click on the green button "Verify Answer".

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use