Introducing the ARM

From ARMwiki
Revision as of 04:44, 5 December 2011 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The ARM processor is a simple processor based upon the RISC concept of having fewer instructions that perform less complicated tasks. Taking the concept of Keep It Simple to extremes in the early days of the ARM has led to a processor that is suitably fast enough to get a job done, but light enough on resources to provide hours and hours of use from a miniscule battery.


Features of the ARM

  • Like the 6502 which greatly inspired the design (see below), the ARM is hardwired and makes no use of microcode.
  • The aim is for most instructions to execute in a single cycle.
  • Arithmetic and data load instructions may make use of a barrel shifter to generate fairly powerful instructions. The use of the barrel shifter does not introduce any penalty, the instruction operates at the same speed.
  • Most instructions may be executed conditionally, so constructs such as "if x is less than 32, make x equal 46" can be implemented in two instructions, with no jumps or branches.
  • To aid the above, arithmetic instructions can be specified to alter the status flags, or not.
  • There is a link/return feature where you can call a function and return from it. This is similar to the 6502's JSR/RTS except that the return address is saved to register R14 instead of being pushed to the stack.
  • The ARM is a load/store architecture. What this means is that there are specific instructions to load data from memory (or memory-mapped hardware) and to save data. The operations between registers take place purely within the registers.

To give an idea, the 6502 provides an INC instruction which can increment a given memory location. As the ARM is load/store, it would have to load the value, add one to it, then write it back. There is no specific way to increment a value in memory using only one instruction.
This is not as big a problem as it might seem, for the large number of registers and interaction between them can allow fairly complex code to be implemented utilising the registers - so instead of INCing a memory location to keep track of a loop counter, one of the registers can be used for this purpose.

  • All instructions are 32 bits (16 bit for Thumb) with everything being word aligned.
  • Large number of registers, plus shadow registers for stacks private to each processor mode, plus additional registers for FIQ.
  • There is a complex software interrupt (SWI) system which allows many services to be provided. Linux uses SWI in a manner similar to the DOS INT call (with later EABI kernels passing the system call in R7 for increased performance reasons), while RISC OS makes extensive use of SWIs for operating system and extension 'module' facilities.
  • Finally, there is a simple but capable two priority interrupt system. Possibly inspired by the 6502s IRQ/NMI behaviour, the ARM offers IRQ (regular interrupts) and FIQ (fast interrupt). FIQs can interrupt IRQs, and are used in cases where the interrupt absolutely has to be serviced or data loss will occur. The original Archimedes computers used FIQ to accept data from the floppy disc drive, while slower and ACK-based protocols (such as serial and parallel ports) used IRQs.

ARM do not create processors

ARM do not create processors. They are not like companies such as Intel. Instead, they licence designs for others to create processors. This has led to an astonishing array of ARM-based devices...

 Please note that these are not recommendations to the products linked,
 they are simply a look at different types of ARM device with links to further information.

At the lower end, a simple ARM-based microcontroller which offers a mere 128KiB Flash memory, and a miniscule 20KiB of SRAM. It does offer, however, more I/O than you can shake a stick at, and priced at only £29.99 ($51 / €35), it makes a respectable alternative to PIC or ATmega dev boards, where the ARM's 32 bit processing will blow away lesser microcontrollers.
More information from the Cool Components website

At the lower end of the price, but midrange performance, is the HD-capable RaspberryPi which will offer 512MiB RAM, USB, Ethernet, etc bolted to an ARM11 core clocking around 700MHz. It isn't cutting edge, but carrying a price tag of $25 (cut down Model A) or $35 (Model B), this could well be The Killer App of ARM processors. Booting from an image on SD card, it also has the benefit of being able to change identity quicker than you can imagine (swap SD, boot...) plus being virtually unbrickable. It wouldn't be hard to imagine they'll sell like hotcakes, perhaps more to geeks than schoolchildren.
More information from the 'official' website

A hundred and fifty US dollars will buy you a BeagleBoard, an ARM based microcomputer offering an ARM clocking a Gigahertz coupled to an 800MHz DSP, along with graphics acceleration, etc. This is one of TI's OMAP chips and can be compared to a decent Android handset. Normally running Linux, the Beagle has a RISC OS port plus there is work on bringing Android to it.
More information from the BeagleBoard website

If you prefer raw chips, a Cortex A8 (1GHz) will set you back $44 apiece, dropping to $30 for bulk purchases of a thousand. This compares well for a 1GHz Intel Atom based chip which has a "Recommended Channel Price" of $72 (for a bulk order of a thousand). Remember - the Cortex is a System-on-a-Chip (SoC) so you can't compare it against a plain processor. We are, of course, comparing apples and oranges here, suffice to say that ARM processors are fairly inexpensive compared to what you get.
Cortex-A8 on DigiKey's website and for comparison Intel Atom E645C at Intel's website.

The ARM is capable

The ARM itself is only moderately powerful, multiple cores are rare, and the majority of ARMs do not even offer floating point maths on board. The power of the ARM is when it is coupled with custom DSPs and image/video processors. A device such as the (now obsolete) TMS320DM320 (pictured as the ARMwiki logo) offers a relatively sedate 200MHz ARM coupled to hardware image resizers, DCT processors, a powerful DSP, etc. With the necessary codecs, it is capable of recording 640×480 video in H.263 format (similar to DivX) with AAC stereo sound, in realtime. Indeed, the picture was taken from a little MPEG4 video recorder. There's no way a 200MHz ARM could manage this on its own, but couple it with hardware assistance, it is possible. Everything has its own strengths and weaknesses, and no one solution fits all.

The ARM's history

Following the success of the BBC Microcomputer, Acorn were about to release the expanded Master computer (which was arguably all the things the Beeb should have been), however behind the scenes they were already thinking of their next generation of computer. The 6502 was well liked, but it was simply too limited to run a graphical user interface, and the Master design using memory paging showed the limitations of a 64KiB addressing space.

After some trials with other popular processors of the day (68000, x86, 32016, etc), all were found to be unsuitable. At this point Acorn didn't know exactly what they wanted, but they had a pretty good idea of what they didn't want.

The ARM processor project started in late 1983, using minimal design tools and barely any budget. The aim was to produce a working 32 bit RISC processor which offered interrupt latency on par with the 6502, and direct memory access for memory mapped hardware (also like the 6502). The first ARM was produced by VLSI in April 1985. It worked first time. The ARM1 (as it was known) was fitted to a co-processor board for the BBC range, to allow the support hardware (VIDC, MEMC, IOC) to be designed.

Acorn planned for an operating system called ARX which was to be written in Modula-2 and offer pre-emptive multitasking, multi-threading, and all the sort of cool stuff that is common nowadays. Unfortunately the project (based in Palo Alto) ran over budget and was nowhere near completion as the first set of Archimedes computers were ready to be built.

Thus, the ARM1 co-processor was dusted off and plugged into a Beeb and "Arthur" was written. Arthur, so-called from the title "A Risc operating system by THURsday". The product team were given mere months to develop the system from the ground up when it became clear that ARX was not to be. For this reason, Arthur is something of a rush job, being more or less an expanded port of the BBC MOS bundled with an extremely horrible GUI (from the days when having every available colour on-screen at once was 'normal'). The GUI was incomplete, however, and could not properly multitask, instead running built-in GUI software alongside the application that needed the windowing environment. In this respect, it was a lot like GEM or Windows 2.

The first Archimedes computers rolled out in late 1985 with the ARM2 (having a few tweaks to the ARM1, plus the addition of the MUL instruction), a functional 32 bit RISC processor that contained a mere thirty thousand transistors. This was minicule: compare nearly seventy thousand in the 68000 and a hundred and thirty five thousand in the 80286.

By 1987, RISC OS 2 was released (there was no RISC OS 1). This was Arthur given a complete facelift, the ability to fully multitask, a grey-theme desktop (much easier on the eyes), and many enhancements. The name RISC OS was chosen as at the time "Arthur II" was a film starring Dudley Moore.
RISC OS continued receiving enhancements, RISC OS 3.10 being the de facto base version as it brought numerous features that RISC OS 2 lacked. Along the way, the ARM2 evolved into the ARM3 which contained a small on-chip cache and faster clock speeds. There was a time, briefly, when an ARM based workstation was the fastest desktop computer in the world. Anywhere.
Unfortunately the PC x86 world which was highly fragmented with a million expansions to a million different machines (remember the Hercules graphics card?) started to come to some sense of organisation with the release of Microsoft Windows. Suddenly the world saw what Acorn and Apple users had known for a long time - that text-console based applications where each program had a dozen different drivers and worked in completely different ways... was extremely lame. Windows threw all that away and offered a GUI and common driver system. Accordingly, the PC market exploded and companies such as Intel and AMD were churning out bigger, better, faster processors more quickly than manufacturers could make motherboards to fit them on.

Apple and VLSI along with the Acorn development team were looking for how to take the ARM to the next level. The organisation spun itself off into a separate company and the fruits of this labour was the ARM6 (there was never an ARM4 or ARM5). The ARM6, with newer support chips (VIDC2 and IOMD) gave birth to the RiscPC. Unfortunately Acorn simply updated RISC OS to cater for the new hardware, instead of making the transition to a 32 bit version of RISC OS.

Behind the scenes at this time, ARM created the Thumb instruction set, which was a reduced version of the ARM instruction set operating in a 16 bit world. This might sound bizarre, however for cost savings and reduced complexity, some hardware may only have a small amount of RAM available through a full 32 bit bus. The majority would be accessed via cheaper and simpler 16 bit datapaths, for example firmware on a single 16 bit (Flash)ROM. For this reason, it would be logical to generally use the more restricted Thumb instruction set, switching to full ARM with access to the 32 bit memory when the extra processing power is required.

ARM designed their first system-on-a-chip (SoC), the ARM7500 which was basically an ARM7, VIDC, and IOMD in one piece of silicon. This saw use in the Psion Series 5 organiser. A later version with Thumb instruction set was put to use in the GameBoy Advance, Nintendo DS, early Garmin GPS units, and the original Apple iPod.

Here is a photo of the processor (ARM plus Z80 plus sound, graphics, etc) inside a Gameboy Advance. The chip on the right is a 256KiB Windowed SRAM with a 16 bit data bus and a 16 bit address bus.

Gameboy Advance CPU.jpeg

In the RISC OS world, the final Acorn upgrade was a StrongARM processor card, taking advantage of the extended pipeline, split data/instruction caches, and the jump from 40MHz (ARM710) to 233MHz. Sadly the RiscPC's memory bus is extremely slow, being clocked at 12MHz with an 8MHz I/O and podule pathway, so the StrongARM struggled to perform well in the machine. It also saw use in hardware such as the Psion netBook, the Apple Newton, and a range of personal organisers. There are rumours that one of the first generation Sky Digibox was powered by a StrongARM, but this has not been substantiated (it seems most digital satellite hardware is based upon the ST20).

ARM continued with the early ARM9 range which saw use in Garmin and TomTom GPS units, "featurephones", organisers, and such. But it was the association of the ARM926 with Texas Instruments know-how that set the world alight with their DaVinci and OMAP processors, with hardware such as the aforementioned TMS320DM320 showing that the ARM hooked to a DSP could be a good and power efficient media unit, finding application in various personal MPEG4 video recorders, Squeezebox network music players, NASs, higher end featurephones, Canon EOS cameras...

From here, the ARM really took off, finding application where decent processing power and extremely low battery life were important. iPods, iPhones, Kindles, and the vast majority of Android smartphones to name but a few. Once the preserve of people who loved a specific type of British computer system (with features not found in GUIs even today, such as fully context-sensitive menus (no across-the-top menu bar) and the ability to set input focus and enter text into a window that is not the top window), it is perhaps safe to say that most people in the developed world will have an ARM or two assisting their life, whether they know it or not.

With some companies planning low cost long duration netbook style computers, the ARM looks to steal some of the Atom's thunder. The Motorola Xoom is a tablet style computer powered by the Nvidia Tegra processor, which is a dual-core ARM Cortex.

Operating systems with ARM support

[non-exhaustive list, feel free to add]

Personal tools