Of CPU Emulation, Crusoe, The ARM, And x86
A Historical Take On Transmeta, You CAN Try This At Home
By Trevor Marshall
February 14, 2000
These past weeks we have seen Transmeta place a new term into our vocabulary, "Code Morphing." Wow! Morphing is the technique movie makers use to get the Taco Bell dog to talk, and to make those aliens in Star Wars look so real. Morphing takes one image and stretches and compresses the visual features until it looks different, or until it becomes surreal, like the talking dog.
Morphing can even make our hero re-materialize out of a pool of liquid. But what can it do for Crusoe? And why did the PR types choose "code morphing" to describe the way Crusoe runs x86 machine code? Is "code morphing" the silver bullet that will break Intel's hold on the PC marketplace?
(For more information about Crusoe itself, check out other Byte.com articles like Alex Wolfe's column and Mark Hachman's January 31, 2000 feature.)
Crusoe's VLIW Concepts Are Effective, But Not New
During the early 1990's, Michael Slater organized an annual event called the Microprocessor Forum, and every November, I made the pilgrimage to Silicon Valley, as did chip and system designers from all over the world. Dave Ditzel (now CEO of Transmeta) was there, often as a guest of honor. The Forums were once-in-a-lifetime opportunities to mix with Andy Grove, Keith Diefendorff (Motorola's leading designer), and a host of other luminaries. They were gatherings where the chip designers and marketing folk could chat informally about their products, share ideas and try to figure out where our industry was going. Very little of the material we discussed was ever placed into the public domain, but Joel Birnbaum's perspective "Architecture at HP: Two Decades of Innovation" is a pretty good example of the formal presentations. Joel describes how VLIW first came to prominence in the 1980's. I recall Philips produced a multimedia VLIW chip in 1995, which never really caught on, and the Intel/HP alliance is working hard on their VLIW IA64 processor. So, Crusoe is not revolutionary just because of its VLIW architecture. We must look a little deeper.
Crusoe Is Not Low Power
I have a lucite pyramid on my trophy shelf titled "Microprocessor Forum 1992." Embedded into the lucite are a number of silicon chips, one supplied by each major manufacturer. Intel's i486DX2 is there, so is their i960, Cyrix's Cx486, IBM's 486SL, Texas Instrument's "Super Sparc" and TMS390, Digital's NVAX and Alpha AXP, Motorola's 88110, HP's PA7100 PA-RISC, National's NS32, AMD's 29000, and IDT's 3081. But the smallest chip in the pyramid is the ARM6 core, only 33,494 transistors and 3.25 x 2.2-mm big (7.15 square mm).
We all know very few of these CPU families ever made it to the big league, but few of us may know just how successful that little ARM (Acorn RISC Machine) has been. You will find variants in TV set-top boxes, in Nokia and Ericsson cellular phones, and they are at the heart of the PSION mobile computers and many other "information appliances."
In the trade, the ARM processor is known as an "embedded" chip, it is usually shipped with software to do a specific function, and the amount of third-party software available is quite limited, orders of magnitude smaller than the software base for the Intel x86 product range. You can see just how successful the ARM has been by looking at the OEM partners listed on their website. The latest version, the ARM9, is less than 15 square mm and uses approximately 0.9 watts of power at 200 MHz. PSION's latest organizer, the REVO, chosen by the Byte.com editors as the best hardware of Comdex 1999, runs for two weeks on just one charge of its internal NiMH batteries. Crusoe uses more power than that, and its die size is six times larger.
The Intel x86 compatible CPUs currently rule the PC world for two reasons. First, there is an operating system for them (Microsoft's Windows) that seems to fill the requirements most of us demand from our PC. Second, if we want some function that Microsoft did not integrate into Windows itself, there is guaranteed to be a third-party program available that will meet our needs.
By comparison with, for example, Intel's failed i960, Acorn had developed an OS that was readily adapted for the ARM, and unlike Windows, it was compact and could be programmed into ROM or Flash RAM. There were also a plethora of development tools that could be used by information appliance designers when creating the system software for their ARM products.
Will Crusoe Survive?
Linus Torvalds is working on, and nobody has any doubt he will deliver, a variant of the Linux OS for Crusoe. It will run "native", without morphing, and will be lightning fast. Trust me. Transmeta is hedging its bets on the application software base, however. Transmeta has allowed for two types of applications, native and morphed.
Those developers who produce code using the native Linux tools will see their software run very fast indeed, while those who use the morphing to emulate x86 code will of course be somewhat slower. The big question is will code morphing run code fast enough to compete with x86 native processors?
How Fast Can Morphed Code Run?
This is not the correct question to ask, in my opinion. The speed of a PC, or of an information appliance, depends not only on the raw MIPS rating of the CPU, but also on the speed of the hard disk, the display processor, and especially on the speed of the DRAM and cache subsystem. I believe Transmeta's code morphing will be a winner, and for reasons that none of us journalists have yet predicted.
Of course, the Linux community will embrace Crusoe with open arms. But the real power will lie in OS Emulation, in addition to the CPU's code morphing. You see, it is possible to get one OS to run software designed for another OS.
Wine Will Give Longevity To Crusoe
Some time ago, the Linux community started work on a program called Wine, which is a software emulator that lets programs written for Microsoft Windows execute on an x86 running Linux. Up until now, if you wanted to run wine you had to be already running on an x86 core, with all the power guzzling and hidden overheads that come with that x86 CPU. This is because Wine does not emulate the x86 instruction set, only the underlying system calls to the Windows OS. Wine translates the Windows system calls into a form the Linux OS can handle.
Wine, therefore, potentially lets the entire Windows application base run on Crusoe-based systems.
In Byte Magazine, August 1985, pp 120-136, I described how to run a 32-bit National Semiconductor CISC processor on an 8086 machine with the DOS OS. The development software was licensed straight from Unix, and my software team put together the OS emulator to make those Unix tools run under DOS.
In Byte, July 1986, pp 120-144, I extended this concept to the (then revolutionary) Motorola 68020 CPU.
But Byte also published an OS emulator and CPU emulator you can try out for yourself.
Z80MU, The 1986 Precursor To Wine And Code Morphing
Robert Baumann described his emulator for the venerable Z80 processor, Z80MU, which included an OS emulator for CP/M 2.2, in Byte, October 1986, pp 203-216. He wrote:
"The emulator's Z80 engine emulates the Z80 almost perfectly, down to an emulation of all six flag bits in the flags register. The program interface (via the BIOS and BDOS) is exactly the same as CP/Ms."
After all these years, I downloaded the software, opened up a DOS window, and it ran perfectly. You can download a working copy of Z80MU (shareware) from http://TrevorMarshall.com/z80mu52b.zip
Unzip it into a Z80MU folder in the root directory of your hard disk (remember to keep those filenames trimmed down to 8 characters). Select "MS-DOS Prompt" from your START:Programs: menu to open up the DOS window.