Issue
142 May2002
Design
Your Own Microprocessor
by
Jim Turley
CLONE
RANGERS
Any
mention of the ’x86 architecture often brings up the
issue of cloning. How can these knock-off processors
exist? Are they legal? And, what liability am I exposing
myself to if I use one? The answers are sometimes murky,
but the short version is: don’t worry about it. Cloning
processors is a long and honored tradition, and the
ones who got there illegally generally aren’t around
any more. Darwinian selection has culled the dubious
ones.
Legal
protection on processors is a funny thing. You can’t
patent an instruction set but you can copyright a processor’s
mnemonics as a work of literature. Even more bizarre
is the fact that it’s illegal to print a programmer’s
reference manual that’s the same as, say, Pentium’s,
but it’s perfectly okay to make a chip that runs Pentium
code. That is, as long as you don’t violate any hardware
patents, which is where Lexra, picoTurbo, Shengyu Shen,
and others may have run afoul of the technology lawyers.
Although
you can’t patent a processor’s instructions per se,
you can patent the circuits that make those instructions
work. AMD, Transmeta, and other (now defunct) ’x86 clone
makers have laboriously worked out different ways to
get their processors to work exactly the same as Intel’s,
but without using Intel’s exact circuitry. For a CPU
as complex and baroque as Pentium, that’s no small feat.
Cloning
RISC processors is far easier, although not nearly as
lucrative. RISC chips have, by definition, a reduced
set of features so they’re naturally less complicated.
That simplicity was supposed to make streamlined RISC
chips faster than tangled CISC chips like Pentium, but
Intel’s determination prevented that fairy tale from
ever coming true. However, if you’re going to clone
a processor, RISC is definitely the way to go.
You
can get a facsimile of a MIPS processor from OpenCores.
Its "MIPS-lite" core supports most MIPS instructions
from a few generations back (see Figure 3). For the
premier MIPS knock-off, though, you needed to go to
Lexra Computing Engines. Lexra’s MIPS cores were close
enough to the real thing to warrant two lawsuits from
MIPS. Oddly enough though, neither suit alleged patent
infringement, only copyright infringement. Until recently,
Lexra dodged both suits and sold its line of mostly
MIPS-compatible cores. Now, Lexra is officially MIPS
licensed and concentrates on network processors.
|

(Click
here to enlarge)
|
Figure
3—OpenCores’ contributors have developed an open-source
microprocessor that’s similar to a MIPS core. |
Along
those same lines, there were at least two unauthorized
versions of the popular ARM architecture. A free one
was available through OpenCores until last summer, when
legal pressure apparently made it disappear. picoTurbo
was also happy to sell you its version until it disappeared
a few months ago.
YOU-BUILD-IT
INSTRUCTION SETS
The
next giant step just beyond building your own processor
is designing your own processor. You can start from
scratch and have all the glory (and all the headaches)
for yourself, or you can use one of the many do-it-yourself
(DIY) kits that are available. Like Lego blocks, these
DIY microprocessors can be used to build an amazing
array of completely different products.
The
two big leaders in the area of user-configurable microprocessors
are ARC International and Tensilica. ARC (not to be
confused with ARM) is the older of the two and has more
customers. Tensilica is based in Silicon Valley and
seems to be catching on well. There are minor differences
between ARC’s ARCtangent and Tensilica’s Xtensa processors,
but they’re more alike than different.
Both
are 32-bit processors that you can tweak, twist, and
modify to create your own private custom 32-bit CPU.
You don’t have to start from scratch either, because
both processors work right out of the box. In this case,
the box is a VHDL or Verilog description of the CPU.
Neither company sells chips, only the recipe for the
processor. Your freedom lies in your ability to adjust
the recipe to suit your taste before you send your chip
off to the silicon oven. You can make your chips in
FPGA if you’re looking at modest volumes, or go to a
big Asian foundry if you’re ready for millions of chips
with your logo on them.
Both
ARC and Tensilica start you off with a working 32-bit
RISC core that’s in the same league as ARM7, MIPS R3000,
or most other mid-range 32-bit processors. These cores
start out small enough to fit into all but the smallest
parts from Xilinx or Altera. Both processors have the
usual arithmetic (add, subtract, multiply), logical
(shift, rotate, exclusive-OR), and flow-control (branch,
jump, return) features that you’d expect to see. In
short, they’re completely functional RISC designs that
crank out about 1.1 Dhrystone MIPS per megahertz, just
like any self-respecting processor should these days.
But,
that’s just the basics. On top of the baseline features,
you get to select from a menu of predefined, pre-tested
options to extend your processor. Do you want a faster
multiplier? Choose that option, and your chip will get
smarter (and bigger). Do you need DSP features? Yeah,
that’s in there. Do you want bigger caches or more registers?
Go for it. Both companies’ cores have a dozen or so
canned options you can choose from. Selecting them all
might double the size of your basic processor core,
but that’s your choice.
Both
firms use a familiar point-and-click user interface
to configure the processor. ARC has a program called
ARChitect and Tensilica’s interface is available through
its web site (see Photo 1). In either case, you click
on the options you want, and after a few minutes, your
custom processor design is generated for you, complete
with software tools to program it.
|

(Click
here to enlarge)
|
Photo
1—ARChitect is a program that allows engineers
or programmers to design their own CPU with only
a few mouse clicks.
|