TechOnline India Header
Most Popular
Top 5 Courses
  • Fundamentals of PCB Design
  • Paralleling DC-DC Converters
  • Fundamentals of x86 Architecture
  • Analog Devices' SHARC 32-Bit DSP
  • Analog eLab - Improved INA Input Filter
    Most Popular
    Top 5 Technical Papers
  • ARM Platform Technical Overview
  • Using C++ Efficiently in Embedded Applications
  • Top 10 Drivers for Embedded Android
    Most Popular
    Top 5 Webinars
  • Designing embedded HMIs and connecting them to hardware
  • 2009 Embedded Market Study
    All Articles Products Courses Papers VirtuaLabs Webinars
    Top Search Items
    C


    Techpaper Spotlight

    Wind River
    Accelerating the Development of Embedded Linux Devices with JTAG On-Chip Debugging
    /
        Login | Register | Welcome, Guest

    Topics
    POLL
    How much code have you produced in your career?
    A few KLOC
        38%
    100s of KLOC
        44%
    Millions of LOC
        11%
    A trillion
        7%
     



    Compilation strategies for the PIC32
    Unlike conventional compilation that optimizes and generates object code independently for each individual program module, omniscient compilation optimizes based on a view of all modules, across the entire program.
    Embedded.com

    The PIC32 is a major departure from Microchip's bread-and-butter offering of 8- and 16-bit microcontrollers, so developing code for the PIC32 poses a new set of challenges. The highest nonvolatile-memory (NVM) density on 8-/16-bit PIC MCUs is 128 kbytes, SRAM is limited to 4 kbytes or less, and 16 registers is the maximum. Midrange PICs have as few as one or two registers and even smaller memory densities.

    All 8-/16-bit PIC MCUs have banked memories that require assembly language or nonstandard C extensions to address efficiently, resulting in nonportable code. Thus, in spite of the common peripheral set and development environment shared by the PIC32 and its 8-/16-bit precursors, migrating nonstandard legacy code could pose serious complications.

    In contrast to previous PICs, PIC32 devices have as much as 512 kbytes of flash, up to 32 kbytes of SRAM memory, and 32 general purpose registers. Also unlike 8-bit PICs, the PIC32 memory space is linear, so no complicated addressing schemes are required.

    With fast DSP instructions for multiply and divide, a 256-byte instruction cache, 5-stage pipeline, direct memory access, and fast context switching, the PIC32 offers instruction throughput of 1.56 DMIPS (Dhrystone million instructions per second)/MHz--the highest of any microcontroller in its class. Its 80 MHz maximum clock provides PIC32 users with unparalleled throughput and flexibility. So, the question is how does an engineer develop code to take full advantage of the PIC32's horsepower?

    One way to squeeze the maximum performance from a PIC32 is to choose a compilation method that exploits the benefits of the architecture while offering a seamless up/down migration path for legacy code. Basically, there are two approaches to compilation for the PIC32 architecture: conventional compilation that optimizes and generates object code independently for each individual program module and "omniscient" compilation that optimizes code based on a view of all program modules, across the entire program.

    Pitfalls of conventional compilation
    Conventional compilation technology (shown in Figure 1) shadows the modular embedded software design process, in which programs are broken up into modules--partly to accommodate their increasing complexity and partly to distribute programming tasks among teams of engineers to speed up the development process.

    View the full-size image

    Compilers generate code in the same way, individually compiling each module into an independent sequence of low-level machine instructions, without any knowledge about what is in the other modules. Once all the modules are compiled, a linker links the modules together, along with any code being used from precompiled libraries.

    1 | 2 | 3 | 4 | 5 NEXT >
     
     
    Latest Webinars
    · The Next Generation of Ethernet: How the New IEEE Standards Enable Energy Efficiency and Quality-of-Service
    · Simplified Physical Layer Receiver Test of Re-timed Architectures Such as USB 3.0, SATA, SAS, PCIe 2
    · How to solve the most common high-speed bus issues in embedded design on a budget
    · Early access to ARM Core Technology with Fast Models from ARM
    · Latest MIPI Standards: PHY and Protocol Testing Guidance
     
    Member Company Spotlight
    Xilinx
     

    Start Your Spartan-3A FPGA DSP Design Now! Evaluate Free Downloadable Tools Built Just for You.


    Member Companies