Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼

Al Williams

Dr. Dobb's Bloggers


February 05, 2010

When you need a CPU with custom I/O or features, there seems to be three very distinct ways that people employ FPGAs. One solution is to simply incorporate an FPGA along side a standard CPU. You keep using your usual development tools and just build some interface between the CPU and the logic on the FPGA.

Another way to handle a design like this is to build the CPU right on the FPGA along with whatever custom things you need. There are an endless number of possibilities here, but, as always, some trade offs too. The FPGA vendors have their own CPUs that you can incorporate and often support tools to make this relatively simple.  You can also acquire "cores" from a variety of sources either for a fee or on the open source market (see Open Cores , for example). And, of course, you could design your own CPU (a hobby of mine , although perhaps not that practical for most projects).

 The third way, is to use FPGAs with a CPU core (or cores) on the die. This is really more like the first method, just integrated into one IC package.

If you want to use a CPU on an FPGA, availability of tools is a major issue. Some cores emulate "real" chips so they can piggy back on other tools. This is a particularly popular approach with open source CPUs. If the CPU is truly "custom" you'd like to find things like assemblers, debuggers, compilers, simulators, and the like. Naturally, if you are building your own truly custom CPU you'll have to roll your own assembler and compiler .

But suppose you really want to build your own CPU. Maybe you really have a unique requirement. Or maybe you just want to roll your own. One barrier is learning exactly how to design a CPU. Modern CPUs are extremely complex, so studying modern CPUs can be a bit daunting. Most of the CPU architecture classes I've seen at the college level are fascinated with out of order execution, register scheduling, and other things that are great expert topics, but not very conducive to learning.

CPUs need not be complex. The mCPU design will fit on a tiny CPLD! It is not the most practical design but since it is about a page of logic description language, it isn't a bad place to start learning. Sometimes getting over that first hump is the real challenge and a simple project can help get past that awkward stage. There are several enhanced versions of mCPU as well .

Open Cores, in particular, is a great place to read CPU source code ranging from mCPU to "old fashioned" designs like my own Blue to clones of 8051, 8080, and other standard processors.

Of course, for real projects, you'd need a pretty good reason to design your own CPU and an associated tool chain. Of course, you probably don't design your own car engines, either, but the best drivers and mechanics understand what's happening under the hood.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.