C6EZRun Pi Estimation Example

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

^ Up to main C6EZRun Main Page ^

This article is part of a collection of articles describing the C6EZRun Software Development Project. Select the link above to return to the main project page.

Contents

Introduction

This example uses an iterative method to estimate the value of pi. The usage here shows off the C6Run project, which is an ease-of-use tool for ARM developers to leverage the DSP on TI's DSP+ARM embedded processors. The performance is compared between the ARM and DSP cores on the TI OMAP-L138 embedded processor using both the C6RunLib and C6RunApp tools.

Pi Estimation

This Wikipedia article gives a good overview of the many methods used to approximate the value of pi. The method used for this demo is the Leibniz formula for π, a slowly converging series that provides a lot of room for optimization.

Procedures

To build the C6Run-enhanced pi estimation demo, you can follow the steps given below:

[host] $ make c6run
from the top level of the SDK4 install directory
[host] $ source <C6RUN_INSTALL_DIR>/environment.sh
[host] $ mkdir ${HOME}/targetfs/home/root/omapl138/pi 
[host] $tar -zxvf Pi_source.tar.gz
[host] $ cd <pi_source_download_directory>/C6RunApp/ 
and build the project with
[host] $ make all 
[host] $ cp pi_arm ${HOME}/targetfs/home/root/omapl138/pi
[host] $ cp pi_dsp_c6run_app ${HOME}/targetfs/home/root/omapl138/pi 
[host] $ cd ../C6RunLib/ 
[host] $ make all
[host] $ cp pi_arm ${HOME}/targetfs/home/root/omapl138/pi
[host] $ cp pi_dsp_c6run_lib ${HOME}/targetfs/home/root/omapl138/pi 
Note: the pi_arm application generated by the C6RunApp tool is identical to that from the C6RunLib tool
[target] $ cd /home/root/omapl138/pi/ 
[target] $ cd /usr/share/ti/c6run-apps/
[target] $ ./unloadmodules.sh
[target] $ ./loadmodules.sh
[target] $ ./pi_arm 
[target] $ ./pi_dsp_c6run_app
[target] $ ./pi_dsp_c6run_lib


Results

The following are screen shots of the execution. The execution time in the DSP decreased by about a factor of 4, and there is a slight performance improvement in using C6RunLib over C6RunApp in this case:

Using the ARM:
Pi arm.png

Using the DSP with C6RunApp:
Pi dsp c6run app.png

Using the DSP with C6RunLib:
Pi dsp c6run lib.png

^ Up to main C6EZRun Main Page ^

This article is part of a collection of articles describing the C6EZRun Software Development Project. Select the link above to return to the main project page.

E2e.jpg For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article C6EZRun Pi Estimation Example here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox