2007年8月10日 星期五

Java Chips: The Hardware Solution

‧Java Chips: The Hardware Solution
1998/05

The Java virtual machine (JVM) isn't virtual anymore -- it's real. New Java chips can execute Java bytecode as their native machine language, making it unnecessary to interpret or compile the bytecode into some other CPU's machine language.

In theory, this could allow Java to run as fast as native code on other CPUs -- if Java chips were as powerful as other CPUs. In practice, most Java chi ps will be sub-$50 processors, because they're designed for network computers (NCs), TV set-top boxes, smartcards, and other embedded devices. Only one company, Sun Microelectronics, is known to be developing a high-end Java processor (ultraJava).

Nine companies are working on Java chips: Sun, NEC, IBM, Fujitsu, LG Semicon, Rockwell, Siemens, Patriot Scientific, and International Meta Systems (IMS). Seven of them (Sun, NEC, IBM, Fujitsu, LG Semicon, Rockwell, and Siemens) are designing their chips around Sun's picoJava core, which is available for licensing. Patriot modified an existing processor to run Java, and IMS is working on an independent design.

Sun plans to ship its first Java chip, the microJava 701, in the second half of this year. Later, Sun plans to introduce additional 700-series microJava chips, plus some lower-end 500-series and 300-series chips. For the high end, Sun is designing the ultraJava for 1999 or later. It's for graphics workstations and will compete against high-end CPUs of other architectures, says Harlan McGhan, technical marketing manager.

So far, nobody has shipped actual products with Java chips. Sun has announced the JavaBlaster, a $99 ISA card that turns old PCs into Java-based computers, but it won't appear until after the microJava 701 ships. Siemens is designing a picoJava-based smartcard. Rockwell might use its JEM1 chip in navigation and communications systems. Patriot has shipped more than two dozen development kits for its PSC1000.

Java chips aren't limited to running software written in Java, any more than other CPUs are. Programmers can use any high-level language that has a bytecode compiler. In fact, Sun is introducing C/C++ compilers that generate bytecode. The picoJava architecture defines about half a dozen extended bytecode instructions to support C/C++ and low-level hardware functions, such as memory writes, on-board cache control, access to control registers, and power-up/power-down diagnostics.

Is this heresy ? No, says Sun. Java chips must support those functions so developers can write OSes, device drivers, and other low-level programs. Regular Java can't do it because Java source compilers don't generate the extended bytecodes. Even if they did, the bytecode verifiers built into JVMs would reject the extended bytecodes as illegal. This preserves the safety of Java applications while permitting developers to write low-level system software for Java chips.

Patriot was the first company to demonstrate a working Java chip (November 1997). Instead of licensing Sun's picoJava core, Patriot took an existing Forth chip and reprogrammed the microcode to recognize bytecodes. The PSC1000 already had a stack architecture, because Forth, like Java, is a stack-oriented language. Patriot's PSC1000 costs less than $10 in volume.

Marc Tremblay, a chip architect at Sun, predicts that low-end Java chips based on the picoJava core will run Java about 20 times faster than interpreters running on a Pentium at the same clock frequency. Tremblay thinks the chips will deliver about five times as much performance as a just-in-time (JIT) compiler running on a Pentium.

Is that fast enough? By the time the chips come out, the best JIT compilers might deliver more performance on fast CPUs than low-end Java chips. However, that won't threaten the two most important markets for the chips: inexpensive devices that can't afford a Pentium-class CPU but still need to run Java at acceptable speeds and low-memory devices that lack the resources for a full-size JVM and a JIT compiler.