Locale Icon
English
  • Forums

    Popular Forums

    • LTspice
    • Video
    • Power Management
    • RF & Microwave
    • Precision ADCs
    • FPGA Reference Designs

    Product Forums

    • Amplifiers
    • Clocks & Timers
    • Data Converters
    • Direct Digital Synthesis (DDS)
    • Energy
    • Interface and Isolation
    • MEMS Inertial Sensors
    • Power Management
    • Processors & DSP
    • Processors & Microcontrollers
    • Switches & Multiplexers
    • Sensors
    • Voltage References
    View All

    Application Forums

    • A2B Audio Bus
    • Audio
    • Automated Test Equipment (ATE)
    • Condition-Based Monitoring
    • Depth, Perception & Ranging Technologies
    • LiDAR Solutions
    • Motor Control Hardware Platforms
    • Speech Processing Solutions
    • Video

    Design Center Forums

    • ACE Evaluation Software
    • ADEF System Platforms
    • Design Tools & Calculators
    • FPGA Reference Designs
    • Linux Software Drivers
    • Microcontroller no-OS Drivers
    • Precision Studio
    • Power Studio Designer
    • Power Studio Planner
    • Reference Designs
    • Robot Operating System (ROS) SDK
    • Signal Chain Designer
    • Software Interface Tools
  • Learn

    Highlighted Webinar

    Power Integrity for High Performance Measurement Systems

    Increasing data rates driven by AI workloads and the evolution from 5G to emerging 6G standards are placing new demands on electronic test and measurement...

    Places

    • ADI Academy
    • ADI Webinars
    • EZ Blogs
    • Video Annex
    • Virtual Classroom

    Libraries

    • 3D ToF Depth Sensing Library
    • Continuous-Wave CMOS Time of Flight (TOF) Library
    • Embedded Vision Sensing Library
    • Gigabit Multimedia Serial Link (GMSL) Library
    • Optical Sensing Library
    • Other Products Library
    • Precision Technology Signal Chains Library
    • Software Modules and SDKs Library
    • Supervisory Circuits Library
    • Wireless Sensor Networks Library
  • Community Hub

    Challenge Yourself!

      KCC Quizzes AQQ302 about Bang Gap Reference Generation

      1.Quote of the month: "People Who Say They Sleep Like a Baby usually don't have one" - unknown 2. New quiz AQQ302 about Band Gap Reference Voltage...

    View All

    What's Brewing

      Read the Blog:  Simplified I/O: One Chip, Flexible Voltage Output, Take this Quiz for Another Chance to Win a Gift Card!

      Important: Read the blog first . The quiz questions are all based on the content of the blog: Simplified I/O: One Chip, Flexible Voltage Outpu...

    View All

    Places

    • Community Help
    • Analog Dialogue Quiz
    • Logic Lounge
    • Super User Program

    Resources

    • EZ Code of Conduct
    • EZ How To Help Articles
    • Getting Started Guide
    • ADI: Words Matter
    • Community Help Videos
    View All
  • ContentZone

    Visit ContentZone

    Search content by industry or technology.
    • Blogs
    • Technical Articles
    • Tutorials
    • Videos
    • Webinars
    Your ADI content all in one place.
    View ContentZone

    The Latest Read

    SYSREF and Multi-Chip Synchronization Pitfalls

    Phased-array radars, multi-channel spectrum analyzers, and massive MIMO front-ends require that all ADCs and DACs remain phase-coherent to operate as a...

    New Release

    Using the Industrial I/O Framework for Easy Prototyping of Software Defined Radio (SDR) Transceivers
    Using the Industrial I/O Framework for Easy Prototyping of Software Defined Radio (SDR) Transceivers

    Introduction to Industrial I/O, libIIO, and Python software tools

    Recent Technical Insights

    Latest Technical Article from Analog.com
    Evaluating Power Supplies with Different Compensation Settings

    Evaluating Power Supplies with Different Compensation Settings

EngineerZone
EngineerZone
ADSP-CM40x
  • Log In
  • User
  • Site
  • Search
OR
Ask a Question
ADSP-CM40x
  • Processors & DSP
  • ADSP-CM4xxx Processors
  • ADSP-CM40x
  • Cancel
ADSP-CM40x
Documents How do I benchmark or count system cycles of a segemnt of code on the ADSP-CM40x ?
  • Forums
  • Docs/FAQs
  • Members
  • Tags
  • Cancel
  • Documents
  • +AD CM408F: FAQ
  • -ADSP-CM40x: FAQ
    • ADSP-CM40x Enablement Package (Rev 2.1.0) Supports Rev H Silicon ONLY
    • ADSP-CM40X PROCESSORS SUPPORT COMMUNITY
    • Analog inputs of internal ADC
    • Can I access ADCM40x cache directly?
    • Can I use MATLAB/Simulink with the ADSP-CM40x?
    • Can the VRef for the ADC on the ADSP-CM40x be used as a voltage supply for other devices?
    • Does AD CM40x feature a Data Cache?
    • Getting Started with ADSP-CM40x Mixed-Signal Control Processors
    • How do I access my ADSP-CM40x 2.0 part when the debugger cannot connect?
    • How do I benchmark or count system cycles of a segemnt of code on the ADSP-CM40x ?
    • What general features of Blackfin Cache are not available in CM40x Cache?
  • +Cache with Async memory connected SRAM: FAQ
  • +Clock to the USB controller: FAQ
  • +MEMX and MEMY physical memories: FAQ
  • +Processors & Microcontrollers
  • +SPI Memory Mapped Mode: FAQ
  • +SPI/Cache: FAQ
  • +What is XiP: FAQ

How do I benchmark or count system cycles of a segemnt of code on the ADSP-CM40x ?

// This example uses the ADSP-CM40X Enablement Software, available as a free download

/*=============  D A T A  =============*/

volatile Uint32_t data_a, data_b, data_c, data_d, data_e, data_f;   // Data variables

/*=============  C O D E  =============*/

CYCLES_INIT                                  // Initialize and enable system tick counter
CYCLES_CLR                                  // Clear system tick counter
 
data_a  = CYCLES_GET;                   // Get counter value
data_b  =    CYCLES_GET;                 // Get counter value
// Code of interest
. . .
. . .
// End of code of interest
data_c =    CYCLES_GET;                // Get counter value
data_d = data_b - data_a;                 // Calculate over head of read routines
data_e = data_c - data_b - data_d;   // Calculate system ticks or cycles to execute code of interest
// data_e is the number of cycles to execute code of interest

Tags: benchmark cycle cyclecount counting
  • Share
  • History
  • More
  • Cancel
analog-devices logo

About Analog Devices

  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
  • Instagram page
  • Twitter page
  • Linkedin page
  • Youtube page
  • Facebook
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2026 Analog Devices, Inc. All Rights Reserved

analog-devices

About Analog Devices

Down Up
  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

Down Up
  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
Instagram page Facebook Twitter page Linkedin page Youtube page
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2026 Analog Devices, Inc. All Rights Reserved