feature article
Subscribe Now

Free Linux Microprocessor*

(Some Restrictions Apply)

In keeping with our theme of free stuff (see Embedded Technology Journal, January 27, 2009) we proudly chronicle the newest free alternative for embedded developers: a free Linux-compatible microprocessor. Never has so much been offered to so many for so little. Or something like that.

Here’s the deal. Altera, the world’s second-best-known FPGA company, has struck a deal with Wind River Systems, the world’s second-best-known embedded-software company, to port Linux to Altera’s NIOS II processor. And since NIOS is free, you’ve got yourself a free 32-bit microprocessor capable of running a genuine full-on multitasking Linux operating system.

Naturally, there’s a catch. In fact, there are two. First off, NIOS is free only if you’re already using Altera’s FPGA chips (more on this later). Second, the Linux itself isn’t free; Wind River charges a significant amount of money for access to the software, and even more money for annual support.

That’s right – the microprocessor is free but the open-source software costs money. One wonders how such a paradox came to be.

Let’s focus first on the hardware. If you’re a NIOS neophyte, you’re in for a treat. NIOS is a “soft core” processor design that Altera happily gives away for free to any customer using its FPGA chips. As an Altera customer, you’re able to put as many NIOS processors into an FPGA as you like, with the only limitation being the capacity of the chip itself.

Why NIOS and not, say, ARM or PowerPC or x86? For years, programmers and engineers have been trying to implement microprocessors in FPGA chips, but the results were always dismal. FPGAs, by their nature, don’t lend themselves to processor implementations. They don’t have the right mix of logic and interconnect that microprocessor architectures require, so it’s a bad fit. Although technically you can make an ARM or a PowerPC to work in an FPGA, it’ll be slow and awkward and expensive and power-hungry. It’s like making a pig dance: it’s not pretty and it annoys the pig.

Enter NIOS. Altera, like its arch-rival Xilinx, wanted to give developers the ability to implement CPUs in FPGAs. So rather than shoe-horn a standard processor into a fundamentally incompatible logic fabric, the company went the other direction and created its own CPU specifically tailored for its FPGAs. Xilinx came up with MicroBlaze and Altera did NIOS (the name doesn’t stand for anything).

Because NIOS (like MicroBlaze) is designed to suit FPGA logic structures, there are some compromises, but nothing that the average programmer would worry about. It’s a fully functional 32-bit processor complete with memory management, caches, branch prediction, and a rich instruction set. It’s even customizable. Like any self-respecting processor, NIOS comes with a C compiler and other basic software-development tools. The only downside is that NIOS works only in Altera-brand FPGA chips. If you’re not using Altera’s silicon you can’t use NIOS.

Which is, of course, precisely the point. That’s the reason Altera developed NIOS and gives it away for free (Xilinx does the same with MicroBlaze). It’s the sweet treat that keeps you coming back for more. But if you’re already committed to using Altera FPGAs in your design, then NIOS is a complete freebie. It doesn’t even take up a significant amount of space. About 4000 logic elements is all that’s required; wee enough to fit in even the smallest Cyclone III device. Giant Stratix IV chips can hold hundreds of NIOS II processors and still have room left over. It’s really a zero-cost processor – if you’re already using Altera FPGAs.

Software… and Support

A processor is only as good as its software. One problem with a specialty processor like NIOS is that there isn’t much software available for it. Oh, you can get Micrium’s MicroC/OS-II RTOS and a TCP/IP network stack, but most of NIOS’s sparse software library is self-supported open-source code. With the free hardware you mostly get free software. Some assembly required.

This is what makes Wind River’s Linux such a big deal. First, it’s remarkable that such a large and complex operating system would run on a small and simple FPGA-based processor. Second, it’s equally remarkable that a large company like Wind River would throw its weight behind NIOS II. The business case must have been compelling for the company to expend the effort required to port Linux and provide the support it will require for years into the future.

Wind River is no charity, however, and the company expects to be paid for its work. Unlike Altera’s NIOS, Wind River’s Linux isn’t free. The company doesn’t disclose the terms of its license agreements and has no published price list, but developers can expect to pay thousands of dollars for access to the Linux port, along with recurring payments for annual support. In short, this is anything but a cheap open-source alternative.

So the hardware might be free (or at least, buried in the cost of the FPGA) but the software cost is likely to be substantial. Is it worth it? Quite possibly, but the answer depends on your goals – and your philosophy.

To many programmers, the whole point of Linux – its raison d’être, if you like – is that it’s an open-source alternative to commercial operating systems. In short, that it’s free. Paying money for access to the software defeats the whole purpose of using Linux.

Some developers choose Linux for reasons of control. They like to tweak the code to suit their own purposes and don’t like the idea of being beholden to an outside commercial entity.

For either of these camps, Wind River’s Linux is anathema. (Presumably, the same would be true of Red Hat Linux, or any of the many other commercial distributions.) But to many department heads, program managers, and business executives, paying money for Linux makes perfect sense. It’s money well spent on a quality port with round-the-clock technical support. And it minimizes the distractions to the engineering team. Unless your company’s core competence is porting operating systems, there’s little to be gained by doing it yourself. Focus instead on your key value-add and leave the software plumbing to someone else. It’s modular programming at its best.

So then it boils down to the choice of Linux and its suitability to the task. Do you need such a big operating system? Many embedded systems do, and Linux has been growing in popularity for many years. It’s easy to find programmers with Linux experience (though not many will have NIOS experience), so staffing is easy. It even looks good on the resume.

Linux has a big memory footprint, however. So even though the processor uses very little of the FPGA, you’ll need to include a memory controller, plus several megabytes of DRAM outside the chip. Keeping NIOS fed will be a design task in itself; there’s no point in starving the processor once you’ve gone to all the trouble to include it. Fortunately, Altera provides plenty of design assistance and support here. Tens of thousands of its customers have used NIOS II in their designs, so there’s a ready source of support.

If Linux is right for you, and if you don’t have strong feelings about processor architecture, and if you can wrap your head around the idea of free hardware but expensive open-source software, this may be just the ticket. It’s certainly a milestone. Giveaway FPGA processors started out as pretty modest affairs, more science project than serious processor. That’s clearly changed, with real operating systems doing real work in real projects. Let’s hear it for progress.

Leave a Reply

featured blogs
Aug 19, 2018
Consumer demand for advanced driver assistance and infotainment features are on the rise, opening up a new market for advanced Automotive systems. Automotive Ethernet allows to support more complex computing needs with the use of an Ethernet-based network for connections betw...
Aug 18, 2018
Once upon a time, the Santa Clara Valley was called the Valley of Heart'€™s Delight; the main industry was growing prunes; and there were orchards filled with apricot and cherry trees all over the place. Then in 1955, a future Nobel Prize winner named William Shockley moved...
Aug 17, 2018
Samtec’s growing portfolio of high-performance Silicon-to-Silicon'„¢ Applications Solutions answer the design challenges of routing 56 Gbps signals through a system. However, finding the ideal solution in a single-click probably is an obstacle. Samtec last updated the...
Aug 16, 2018
All of the little details were squared up when the check-plots came out for "final" review. Those same preliminary files were shared with the fab and assembly units and, of course, the vendors have c...
Jul 30, 2018
As discussed in part 1 of this blog post, each instance of an Achronix Speedcore eFPGA in your ASIC or SoC design must be configured after the system powers up because Speedcore eFPGAs employ nonvolatile SRAM technology to store its configuration bits. The time required to pr...