• No results found

Programming Embedded Processors

In document The Votes Are In! (Page 103-106)

So, you are ready to bootstrap your embedded Linux system on a brand-new OpenRISC implementation. How do you do this? With a cross compiler, of course. The GNU C compiler project can generate binary executables for 32-bit i386 processors or x86-64 64-bit processors on your basic GNU/

Linux installation. However, if you want to develop for OpenRISC, you have to recompile the GNU C compiler so it can target OpenRISC. This is a rather involved process, which may require a special implementation of the standard C library—

this means you need to write code so

that printf()and scanf() know how to read and write characters! The instructions at http://www.openrisc.net are concise and quick. If you follow them, you can get a full working copy of the GNU toolchain for OpenRISC very quickly.

If you want to understand how to build the OpenRISC toolchain from scratch, or make modifications for your custom implementation, I recommend reading http://www.openrisc.net/

toolchain-build.html by Gene Sally.

He does an excellent job of introducing the details of cross compilers.

INDEPTH

to a net list consisting of only simple logic gates is possible, though very rudimentary without proprietary tools.

Also, open-source tools for placement and routing of logic gates in integrated circuits are virtually nonexistent. The best place to look for source code that compiles a net list, does place and route, or extracts parasitics is to search the Web pages of university research projects.

If you have the budget for proprietary chip-design software (think millions of US dollars), it is possible to design for the latest manufacturing process available. Apple, Inc., has licensed the ARM processor and developed the A6 processor in a 28nm technology node for the iPhone, and at the time of this writing, it is currently in testing. OpenMoko and Android are

both Linux-based distributions for smartphones. A company developing a smartphone processor that is targeted for use with these distributions might consider using the OpenRISC target.

General chip design is beyond the scope of this article, but if you are really interested, http://opencircuitdesign.com or my personal Web site http://www.jamestandon.com will get you started.

One group of people who have benefited tremendously from the OpenRISC are university researchers who explore new technologies in digital and mixed-signal development of integrated circuits. If a graduate student needs to research how custom hardware interacts with software

quickly, it is possible to simulate and fabricate a processor without spending

years developing a processor core with a corresponding C compiler.

A researcher can test the system in FPGA, then submit a custom chip for fabrication within six months.

The Future

OpenRISC has a large following in the integrated circuit research community and the hardware hacker community. The OpenRISC/

Linux development team recently submitted their patch for inclusion in the Figure 1. Layout of an OpenRISC 1200 processor in 0.18um

technology implemented at the University of Tokyo. It has a serial port, Ethernet, I2C, 128kB of on-chip memory and a custom serial communication interface.

INDEPTH

WWW.LINUXJOURNAL.COM / DECEMBER 2011 / 105

main Linux distribution. If all goes well, you will soon see the OpenRISC build target when you download version 3.1 of the Linux kernel. Work on the latest 3.1 OpenRISC kernel patch continues. If you feel inclined to help, a lot of testing is needed for the latest development version.

Will it be possible to purchase an OpenRISC ASIC in the future? Quite possibly. The team at http://opencores.org is soliciting donations for a custom ASIC implementation. Hardware hackers who decide to commercialize their FPGA projects may want a faster, lower-power version of OpenRISC when selling their applications. Another possibility is that open-source integrated circuit design will become available as well, making it possible for small groups of people, or even individuals, without millions of dollars, to submit custom chip designs to a manufacturer. The fabless semiconductor company has become a much more viable business model in the past 15 years.

The place where OpenRISC truly shines right now is in FPGA design. Anybody can purchase a single FPGA for as little as a few dollars or a prebuilt FPGA board for as little as $200 USD. This means that anybody with a little extra cash can build a custom embedded system with the OpenRISC.

While processor cores that manufacturers provide confine you to their architecture, the OpenRISC allows you to choose the best FPGA for your project. Because Linux can run effectively on OpenRISC, you

can include any number of open-source projects on your custom hardware. If this article has whet your interest for more, check the list of Resources for this article.

Also, if you implement a project with Linux and OpenRISC, send me an e-mail to let me know!

James Tandon is a post-doctoral researcher at the VLSI Design

& Education Center of Tokyo University, Japan. He has fabricated numerous digital and mixed-signal integrated circuits in technology nodes from 0.35um down to 65nm. His personal Web address is http://www.jamestandon.com.

Resources

Home Page for the Linux and GCC Development Projects:

http://www.openrisc.net

Large Repository of Open-Source Hardware Cores: http://www.opencores.org

Home Page of the OpenRISC 1000 Project:

http://opencores.org/or1k/Main_Page

Open-Source Verilog Simulator (good for simulating before implementation and very stable): http://iverilog.icarus.com

Verilog Programming Tutorial:

http://www.asic-world.com/verilog/

veritut.html

Demonstration of OpenRISC Controlling a Robot: http://www.youtube.com/

watch?v=Lv1Gow7WZxM

INDEPTH

Fixing Broken

In document The Votes Are In! (Page 103-106)