Complementing ARM with easy DSP development for TI's community platforms Daniel Allred Senior Applications Engineer 3/23/2016 TI Information - Selective Disclosure 1 Find the right ARM® Solution for you 32-bit ARM MCU for Safety-Critical Applications 32-bit ARM Cortex™-M3 MCUs ARM Cortex-A8 & ARM9™ MPUs TMS570 Stellaris® Sitara™ ARM Cortex-R4™ ARM Cortex-M3 Up to 250 DMIPS/ 160 MHz Up to 80 MHz 375MHz to >1GHz 2 MB Flash, 160 KB RAM Flash 8 KB to 256 KB USB, ENET MAC+PHY CAN, ADC, PWM, SPI Connectivity,Security, Motion Control, HMI, Industrial Automation Cache, RAM, ROM 300MHz to >1Ghz +Accelerator Cache RAM, ROM USB, CAN, SATA, SPI, PCIe, EMAC USB, ENET, PCIe, SATA, SPI Industrial automation, POS & portable data terminals $1.00 to $8.00 $5.00 to $25.00 Floating/Fixed Point Video, Audio, Voice, Security, Conferencing $5.00 to $200.00 ARM Cortex-A8 & ARM9 DSP ARM+DSP C6000™ Integra™ DaVinci™ Digital Media processors FPU, ECC, Timer/PWM Co-Proc, 12bit ADCs, CAN, EMIF, LIN, SPI, Flexray Transportation, Motor Control, Certified for use in safety critical (SIL3) systems $7.00 to $18.00 Development tools Software support Comprehensive developer ecosystem Responsive design support 3/23/2016 TI Information - Selective Disclosure 2 Fast, low power, flexible expansion Rev C OMAP3530 Processor 720MHz Cortex-A8 NEON+VFPv3 16KB/16KB L1$ 256KB L2$ 430MHz C64x+ DSP 32K/32K L1$ 48K L1D 32K L2 PowerVR SGX GPU 64K on-chip RAM POP Memory 256MB LPDDR RAM 256MB NAND flash $149 3.1” Peripheral I/O DVI-D video out SD/MMC S-Video out USB 2.0 HS OTG I2C, I2S, SPI, MMC/SD JTAG Stereo in/out Alternate power RS-232 serial USB Powered 2W maximum consumption OMAP is small % of that Many adapter options Car, wall, battery, solar, … BeagleBoard-xM details Laptop-like performance 3.35”** DM3730 processor (AM37x-compatibile) 1GHz superscaler ARM® Cortex ™-A8 More than 2,000 Dhrystone MIPS Up to 20 Million polygons per sec graphics 512KB L2$ 512MB LPDDR RAM HD video capable C64x+™ DSP core DM3730 Desktop-style USB peripherals and embedded style expansion LCD Expansion I2C, I2S, SPI, MMC/SD Expansion DVI-D Camera Header S-Video JTAG 4-port USB 2.0 Hub Stereo Out Stereo In 10/100 Ethernet USB 2.0 HS OTG Alternate Power RS-232 Serial microSD Slot Agenda • Motivation for ARM+DSP heterogeneous processors • Importance of Software Development • C6000 DSP Ease of Use Initiatives – C6Accel – C6Run • Conclusion • Demo • Q&A 3/23/2016 TI Information - Selective Disclosure 5 Why ARM+DSP? • Lets start with an example system 3/23/2016 TI Information - Selective Disclosure 6 Networked Audio System (before) Connectivity System Audio System HDMI SPDIF ADC LCD Controller Internet Radio Ethernet MAC USB Host Controller ARM9 I2S/ I2C DAC DAC DAC Audio DSP SD/MMC Controller Problem - Adding connectivity to an audio system adds: • Cost • Components/Size • Development complexity 3/23/2016 C674x TI Information - Selective Disclosure SDRAM FLASH SDRAM FLASH 7 Networked Audio System (after) Buttons/ Knobs EQEP/ ECAP Internet Radio HDMI LCD Controller SPDIF ADC OMAP-L137 Audio System on a Chip Ethernet MAC USB Host Controller ARM9 450MHz Software Link C674x DSP 450MHz Serial Ports DAC DAC DAC SD/MMC Controller I2C/SPI/ UART PWM 3 Mbit RAM 8 Mbit ROM SDRAM FLASH 3/23/2016 TI Information - Selective Disclosure 8 What can an ARM developer do with the DSP? • Run math intensive algorithms • Leverage some DSP features, like floating-point computations • Free up ARM MIPS for additional system features • Save money by not moving to a more powerful & expensive ARM! • Get true real-time response via DSP without sacrificing features of a high-level OS like Linux 3/23/2016 TI Information - Selective Disclosure 10 Agenda • Motivation for ARM+DSP heterogeneous processors • Importance of Software Development • C6000 DSP Ease of Use Initiatives – C6Accel – C6Run • Conclusion • Demo • Q&A 3/23/2016 TI Information - Selective Disclosure 11 Importance of software in embedded development 14 HW Engrs SW Engrs 12 14 10 Companies are dedicating more resources to software Average embedded team size 8 9 6 4 2 4 5 0 2009 Purchase decisions are driven by software Most important embedded processor selection criteria Source: US EE Times/ESD annual embedded developer survey (Jan/Feb ‘10) 2010 Changing face of TI DSP developers • ARM+DSP devices provide an opportunity for TI and our customers • Example: Beagleboard – Greater than 10000 sold, each one containing a C64x+ DSP – How do we connect with those developers? Agenda • Motivation for ARM+DSP heterogeneous processors • Importance of Software Development • C6000 DSP Ease of Use Initiatives – C6Accel – C6Run • Conclusion • Demo • Q&A 3/23/2016 TI Information - Selective Disclosure 14 Universe of embedded developers – leveraging the DSP Embedded Developers Tool Customer Needs More ready-to-use DSP functionality with audio, video and voice codecs C6Accel ARM® developer Leverage the DSP without specialized knowledge C6Run Advanced User/Developer Optimized libraries, real-time Libraries, DSP RTOS, OS and development tools IPC System developer \ Codec Engine C6Accel API VISA API ARM® processor Codec Engine ARM Application Experience with C6Accel! C6Accel DSPLIB IMGLIB MATHLIB Audio, Video Codecs DSP hC6accel = C6accel_create( engName, NULL, algName, NULL); ……………….. Status = C6accel_DSPfunction(hC6accel, parameters); …………………… C6accel_delete(hC6accel); • Above converts C code creates a C6Accel handle with the codec server • Passes function ID for DSP kernel, manages cache and contiguous memory required to pass input parameters, makes iUniversal process call to the codec engine and returns error status. • Closes the C6Accel instance C6Run overview • Open Source Project, hosted on gforge.ti.com • Intends to provide an abstracted mechanism for getting code running on the DSP • Project Goals – Introduce DSP Development to ARM/Linux developer – Simplify simple application/function offloading to the DSP – Start getting Linux and open-source community using the DSP • C6RunLib: Partition an application between the ARM and DSP • C6RunApp: Run an entire application on the DSP 3/23/2016 TI Information - Selective Disclosure 17 C6RunLib • Goal is to automate building an ARM-side library from user’s C code of critical functions • User can call into that library in their app, and calls will be executed on the DSP ARM DSP ARM Application Extract Critical Fxns as a library using C6RunLib C6RunLib Framework Critical Stub Library Fxns • Consists of automating creation of RPC framework, hiding DSPLink and other TI specific bits as possible 3/23/2016 TI Information - Selective Disclosure 18 module1.c module2.c main.c critical.c GCC Toolchain ARM Executable ARM-only Development module1.c module2.c main.c GCC Toolchain critical.c c6runlib tools critcal.lib ARM+DSP Development with c6runlib ARM Executable Embedded DSP Executable Example C6RunLib usage $ c6runlib-cc -c -O2 –o dummy.o dummy.c • Above converts C code containing critical functions to C6000 object file • Also analyzes global C functions and generates ARM-side remote procedure call stubs $ c6runlib-ar rcs dummy_dsp.lib dummy.o • Add object file to library dummy_dsp.lib • Underneath, the dummy.o object file is linked to a DSP executable and compiled into the framework • Framework object file and stubs object file is archived into the lib • ARM-side stubs resolve symbols for ARM application when built against the library 3/23/2016 TI Information - Selective Disclosure 20 C6RunApp • Consists of two parts – Backend library builds – Front end user interface • Backend libraries collate DSPLink, CMEM, DSP/BIOS, and custom code • Front end interface is a command-line cross compiler script (acts like GCC) • Entire application retargets to DSP, but with C I/O access to ARM/Linux ARM DSP C6RunApp Framework Recompile using DSP C6RunApp C Loader and Application CIO Server • Ready now (support for OMAPL1, OMAP3, including hawkboard, beagleboard) 3/23/2016 TI Information - Selective Disclosure 21 module1.c module2.c main.c GCC Toolchain ARM Executable ARM-only Development module1.c module2.c main.c c6runapp tool ARM Executable Embedded DSP Executable DSP Development using c6runapp 3/23/2016 TI Information - Selective Disclosure 22 Example C6RunApp usage $ c6runapp-cc -o hello_world hello_world.c • Compiles hello_world.c to C6000 object file, which is then linked into a DSP executable • Executable is compiled into the ARM side framework, which is used to build an ARM-side executable called hello_world • Notes on the c6runapp-cc cross-compiler tool: • Front end script wraps the TI C6000 Codegen tools (specifically cl6x) • Supports many GCC options and translates them to appropriate cl6x options • Many GCC optimization/warning options are silently ignored • Unknown options passed directly to cl6x command-line 3/23/2016 TI Information - Selective Disclosure 23 Complex FFT performance Total Execution Time (s) For 100 FFT Iterations FFT Size FFT runs ~10x faster on DSP than on ARM. Small FFT size, overhead dominates, running on DSP does not provide advantage. Larger FFT size, overhead absorbed, running on DSP provides advantage. SoC: ARM9 + Floating-Point DSP CPU Frequency: 300MHz Code & Data Location: External DDR2 Memory Instruction and Data Cache: Enabled Single-precision floating-point data buffers. 3/23/2016 TI Information - Selective Disclosure 24 Agenda • Motivation for ARM+DSP heterogeneous processors • Importance of Software Development • C6000 DSP Ease of Use Initiatives – C6Accel – C6Run • Conclusion • Demo • Q&A 3/23/2016 TI Information - Selective Disclosure 25 Status and availability • Documentation available on TI’s Embedded Processor Wiki – http://processors.wiki.ti.com/index.php/C6Run – http://processors.wiki.ti.com/index.php/C6Accel • Latest package is available at TI’s website – http://focus.ti.com/docs/toolsw/folders/print/c6run-dsparmtool.html – http://focus.ti.com/docs/toolsw/folders/print/c6accel-dsplibs.html 3/23/2016 TI Information - Selective Disclosure 26 Conclusion • TI believes ARM+DSP devices can offer our customers an advantage in system integration and design • TI is committed to helping our customers leverage the power of the DSP by offering easy to use software development solutions • C6Accel and C6Run are quick ways for the ARM developer to gain access the capabilities of the DSP using the ARM/Linux operating system 3/23/2016 TI Information - Selective Disclosure 27 Demo • Building Code with C6Run • Running C6Run/C6Accel Applications • Questions 3/23/2016 TI Information - Selective Disclosure 28