Introduction to ARM The world’s most popular 32-bit Embedded Processor Dr. Bore Gowda S B Associate Professor - Senior Reference Books 1. Hohl W., ARM Assembly Language Fundamentals and Techniques, CRC press, 2009 2. Sloss A.N., ARM System Developer’s Guide, Designing and Optimizing System Software, Elsevier, 2004 3. Steve Furber., “ARM System-on-Chip Architecture”, Second Edition, PEARSON EDUCATION, 2000 4. Gibson J. R., ARM Assembly Language-an Introduction, Dept. of Electrical Engineering and Electronics, The University of Liverpool, 2007. 5. Reay D., Digital Signal Processing and Applications with the OMAP-L138 Experimenter, Wiley. 6. ARM CORTEX MICROCONTROLLER DATA SHEET History of ARM In 1985, Acorn Computers Ltd. was in search of a new processor to put up in the desktop. While the technocrats were contemplating various design options, they came across a few papers published by a set of students in the University of Berkely(USA) outlining a very simple processor design based on RISC principles. The computer architects of Acorn Computers found the design very attractive and decided to build a new processor using some of these principles. This led to the development of ARM1, which had less than 25,000 transistors, and operated at 6MHz. This was followed by ARM2(in 1987) with 30,000 transistors. Comparing this to an Intel/Motorola’s processor of that time having 70,000 transistors, this was a beauty in terms of a smaller die size and lower power dissipation. History of ARM (contd…) ARM2 was the first ARM processor which was produced in bulk – It had a 32-bit bus, a 26-bit address space and sixteen 32-bit registers – was clocked at 8 to 12 MHz. – It dissipated much less power, and performed much better than Intel’s 80286 which came up around the same time (but focused on the desktop market). ARM3, ARM4, ARM5 were also designed, but never produced, because around this time, in 1990, Acorn Computers teamed up with Apple Computers and VLSI Technology group to form a company named Advanced RISC Machines Ltd. This company continued with ARM6, ARM7, etc. The latter was the processor which became very popular and led to ARM being used in exotic products such as mobile phones, PDAs, Ipods, computer harddisks, etc. History of ARM (contd…) As of 2011, ARM processors account for approximately 90 percent of all embedded 32-bit RISC processors. ARM Applications : PDAs, mobile phones, digital media and music players, handheld game consoles, calculators and computer peripherals such as hard drives and routers etc. The subsequent and more advanced processors of the ARM family ARM9, ARM10, ARM11, Cortex These have been built on the success of the ARM7 processor, which is still the most popular and widely used member of the ARM family. Over the years, many advanced features have been added to the ARM processor, but the core has remained more or less the same. The ARM Core Core : It is the ‘processing unit’ or the ‘computing engine’ which has all the computing power, and this aspect is decided by the architecture, which represents the basic design of the processor. Special and unique feature - ARM as a company it designs the core and licenses this IP (Intellectual Property) to others. This simply means that the company does not ‘fabricate’ the chip, but sells only the design. This design is taken by the licensee, who may or may not add more features (usually peripherals) to the design. Sometimes the buyer can also modify the basic design to a minor extent The buyer company fabricates the design and sells it/uses it for its products. The ARM Core (contd..) Various ways ARM sells its IP in the form of : 1. Soft IP: In this case, the design is sold as RTL (VHDL/Verilog code), and this allows the buyer to modify the design to a certain extent. 2. Hard IP: It means the buyer gets only the layout or the netlist (connection of nets or electronic wires). Thus the buyer can add only peripherals to the ‘black box’ design he has purchased. We can thus understand that ARM the company does not ‘fabricate’ ARM chips. (In contrast, Intel fabricates its processors and sells them as chips.) It is because of this, that we have ARM chips and boards of various companies – Samsung, Philips, Atmel, Texas Instruments, ST Microelectronics and so on – the list is very long. The RISC Design philosophy ARM core uses a RISC architecture RISC is a design philosophy aimed at delivering simple but powerful instructions that execute within a single cycle at a high clock speed. RISC philosophy concentrates on reducing the complexity of instructions performed by the hardware because it is easier to provide greater flexibility and intelligence in software than hardware. In contrast, the traditional complex instruction set computer (CISC) relies more on the hardware for instruction functionality, and consequently the CISC instructions are more complicated. The RISC Design philosophy (contd..) The RISC Philosophy is implemented with four major design rules: 1. Instructions – RISC processors have a reduced number of instruction classes. These classes provide simple operations that can each execute in a single cycle. – The compiler or programmer synthesizes complicated operations by combining several simple instructions. – Each instruction is a fixed length to allow the pipeline to fetch future instructions before decoding the current instruction. – In contrast, in CISC processors the instructions are often of variable size and take many cycles to execute. 2. Pipelines – The processing of instructions is broken down into smaller units that can be executed parallel by pipelines. The RISC Design philosophy (contd..) 3. Registers – RISC machines have a large general-purpose register set. Any register can contain either data or an address. 4. Load – store architecture – The processor operates on data held in registers. – Separate load and store instructions transfer data between register bank and external memory. – Memory accesses are costly, so separating memory access from data processing provides an advantage because you can use data items held in the register bank multiple times without needing multiple memory access. – In contrast, with a CISC design the data processing operations can act on memory directly. The ARM Design philosophy There are number of physical features that have driven the ARM processor design: 1. Reduced power consumption o Portable embedded systems require some form of battery power o ARM processor has been specifically designed to be small to reduce power consumption and extend battery operation o Essential for applications such as mobile phones and personal digital assistants (PDAs) 2. High code density o Major requirement since embedded systems have limited memory due to cost and/or physical size restrictions o High code density is useful for applications that have limited onboard memory, such as mobile phones and mass storage devices The ARM Design philosophy (contd..) 3. Price sensitive o Embedded systems use slow and low-cost memory devices o Ability to use low-cost memory devices produces substantial savings 4. Size o Another important requirement is to reduce the area of the die taken up by the embedded processor o For a single-chip solution, the smaller the area used by the embedded processor, the more available space for specialized peripherals o This in turn reduces the cost of the design and manufacturing since fewer discrete chips are required for the end product ARM has incorporated hardware debug technology within the processor so that software engineers can view what is happening while the processor is executing code. With greater visibility, software engineers can resolve issues faster, which has a direct effect on the time to market and reduces overall development costs. ARM Instruction set Vs RISC instruction set The ARM core is not a pure RISC architecture because of the constraints of its primary application – the embedded system. In today’s systems the key is not raw processor speed but total effective system performance and power consumption. The ARM instruction set differs from the pure RISC definition in several ways that make the ARM instruction set suitable for embedded applications: – Variable cycle execution for certain instructions: • Not every ARM instruction executes in a single cycle. • For example: load-store-multiple instructions vary in the number of execution cycles depending upon the number of registers being transferred. – Instruction barrel shifter leading to more complex instructions: • The inline barrel shifter is a hardware component that preprocesses one of the input registers before it is used by an instruction. This expands the capability of many instructions to improve core performance and code density. The ARM Design philosophy (contd..) – Thumb 16-bit instruction set: • ARM enhanced the processor core by adding a second 16-bit instruction set called Thumb that permits the ARM core to execute either 16- or 32-bit instructions. The 16-bit instructions improve code density by about 30% over 32-bit fixed length instructions – Conditional execution: • An instruction is only executed when a specific condition has been satisfied. This feature improves performance and code density by reducing branch instructions – Enhanced instructions: • The enhanced digital signal processor (DSP) instructions were added to the standard ARM instruction set to support fast 16x16-bit multiplier operations and saturation. These instructions allow a faster-performing ARM processor in some cases to replace the traditional combinations of a processor plus a DSP