Product Details
Practical FPGA Programming in C (Prentice Hall Modern Semiconductor Design Series' Sub Series: PH Signal Integrity Library)

Practical FPGA Programming in C (Prentice Hall Modern Semiconductor Design Series' Sub Series: PH Signal Integrity Library)
By David Pellerin, Scott Thibault

List Price: $84.99
Price: $67.99 & eligible for FREE Super Saver Shipping on orders over $25. Details

Availability: Usually ships in 24 hours
Ships from and sold by Amazon.com

19 new or used available from $50.00

Average customer review:

Product Details

  • Amazon Sales Rank: #663095 in Books
  • Published on: 2005-05-02
  • Number of items: 1
  • Binding: Paperback
  • 464 pages

Editorial Reviews

From the Back Cover

C-based techniques for building high-performance, FPGA-accelerated software applications

Circuits, Devices, and Systems

C-based Techniques for Optimizing FPGA Performance, Design Flexibility, and Time to Market

Forward written by Clive "Max" Maxfield.


High-performance FPGA-accelerated software applications are a growing demand in fields ranging from communications and image processing to biomedical and scientific computing. This book introduces powerful, C-based parallel-programming techniques for creating these applications, verifying them, and moving them into FPGA hardware.

The authors bridge the chasm between "conventional" software development and the methods and philosophies of FPGA-based digital design. Software engineers will learn to look at FPGAs as "just another programmable computing resource," while achieving phenomenal performance because much of their code is running directly in hardware. Hardware engineers will master techniques that perfectly complement their existing HDL expertise, while allowing them to explore design alternatives and create prototypes far more rapidly. Both groups will learn how to leverage C to support efficient hardware/software co-design and improve compilation, debugging, and testing.

  • Understand when C makes sense in FPGA development and where it fits into your existing processes

  • Leverage C to implement software applications directly onto mixed hardware/software platforms

  • Execute and test the same C algorithms in desktop PC environments and in-system using embedded processors

  • Master new, C-based programming models and techniques optimized for highly parallel FPGA platforms

  • Supercharge performance by optimizing through automated compilation

  • Use multiple-process streaming programming models to deliver truly astonishing performance

  • Preview the future of FPGA computing

  • Study an extensive set of realistic C code examples

About the Web Site

Visit http://www.ImpulseC.com/practical to download fully operational, time-limited versions of a C-based FPGA design compiler, as well as additional examples and programming tips.


© Copyright Pearson Education. All rights reserved.

About the Author

Author Bio

David Pellerin is president and founder of Impulse Accelerated Technologies, a firm that serves systems designers who want to use FPGAs for hardware-based software acceleration and fast prototyping of mixed hardware/software systems. His Prentice Hall PTR books include VHDL Made Easy, Practical Design Using Programmable Logic, Digital Design Using ABEL, and Electronic Design Automation for Windows. Scott Thibault is president and founder of Green Mountain Computing Systems, developers of custom and OEM software that leverages advanced HDL and C-to-RTL expertise to improve time-to-market. Dr. Thibault holds a Ph.D. in computer science from the University of Rennes.


© Copyright Pearson Education. All rights reserved.

Excerpt. © Reprinted by permission. All rights reserved.
Preface

Preface

This is a book about software programming for FPGAs. To be more specific, this book is about using parallel programming techniques in combination with the C language to create FPGA-accelerated software applications.

We have written this book to help bridge the gap—the great chasm, in fact—that exists between software development methods and philosophies, and the methods and philosophies of FPGA-based digital design. We understand that as a result we may be writing for two quite different audiences: software application developers and digital hardware designers.

For software engineers, our goal is to present FPGAs as software-programmable computing resources. We hope to show that these devices, when programmed using appropriate methods, are not so different from other non-traditional computing platforms, such as DSPs. We will show, through example, that software development methods and software languages can be used in a practical way to create FPGA-based, high-performance computing applications, without a deep knowledge of hardware design.

For hardware designers our intent is similar, but with a caveat: we are not trying to replace your existing methods of design or suggest that the methods and tools described in this book represent a "next wave" of hardware engineering. After all, if you are an FPGA designer using VHDL or Verilog to create complex electronic systems, the title of this book, Practical FPGA Programming in C, may sound like an oxymoron. How can C, a software programming language, be a practical way to describe digital electronic hardware? The truth is, sometimes the explicit and precise descriptions offered by hardware description languages (HDLs) are essential to achieve designs goals. But, as you'll see, this explicit control over hardware is not always necessary. In the same way that you might first write software in C and then recode key portions in assembler, hardware designers can benefit from tools that allow them to mix high-level and low-level descriptions as needed to meet design goals as quickly as possible. Even when the entire hardware design will be eventually be recoded with a lower-level HDL, high-level design languages allow hardware engineers to rapidly explore the design space and create working prototypes.

So for you, the experienced hardware engineer, we'll state right up front that we agree with you. We do not believe that C and C++ (as used by legions of programmers worldwide) are practical replacements for VHDL, Verilog, or any other HDL. And we agree with you that C and C++ may not play a leading, or perhaps even significant, role as a design entry language for general-purpose ASIC and FPGA design, at least not as we know such design today. Nevertheless, we believe there is a place for C-based design in a hardware design flow. Still not convinced? Stay with us for a moment, and we'll explain.

C Language for FPGA-Based Hardware Design?

Let's think a bit more about the role of C—or lack of a role, as the case may be—in hardware design. Why is standard C not appropriate as a replacement for existing hardware design languages? Because any good programming language provides one important thing: a useful abstraction of its target. VHDL and Verilog (or, more precisely, the synthesizable subsets of these languages) succeed very well because they provide a rational, efficient abstraction of a certain class of hardware: level- and edge-sensitive registers with reset and clock logic, arbitrary logic gates, and somewhat larger clocked logic elements arranged in a highly parallel manner. All of today's FPGAs fit this pattern, and it is the pattern also found in the vast majority of today's ASIC designs, no matter how complex.

The standard C language does not provide that level of abstraction (which we call register transfer level, or RTL), so "C-based" languages for hardware could add RTL-like constructs in the form of syntax decorations, extra functions or keywords, compiler hints, and more to create some meaningful way of expressing parallelism and describing low-level hardware structures such as clocks and resets. But in this case we would just have another HDL with new syntax. On the other hand, without the benefit of RTL constructs such as these, the developers of C compilers for FPGAs and other nontraditional targets would face a nearly impossible problem: how to efficiently map algorithms and applications written for one class of processing target (the traditional microprocessor) to something entirely different (arbitrary logic gates and registers combined with somewhat higher-level logic structures). Nobody has yet figured out how to do that mapping from a pure software application with a reasonable level of efficiency, although we are getting better at it.

So why use C at all for FPGA design? There are significant advantages, including the potential for hardware-software codesign, for the creation of test benches written in C, and (if the modified C language supports it) the ability to compile and debug an FPGA application using a standard C development environment. And if a mid-level approach to hardware abstraction is taken—one that does not require that the programmer understand all the details of the hardware target, and yet is guided by the programming model toward more appropriate methods of coding—you can strike a balance between software design productivity and hardware design results, as measured in system performance and size.

Compelling Platforms for Software Acceleration

Here's where software developers come in. On the applications side there is an increasing trend toward using FPGAs as hardware accelerators for high-performance computing. Applications that demand such performance exist in many domains, including communications, image processing, streaming media, and other general-purpose signal processing. Many of these applications are in the embedded software space, while others represent scientific, biomedical, financial, and other larger-scale computing solutions.

When acceleration is required, these applications typically begin their lives as software models, often in C language, and are then manually rewritten and implemented in hardware using VHDL or Verilog. This manual conversion of software algorithms to hardware is a process that can be long and tedious in the extreme; hence, there is a strong demand for more rapid paths to working hardware. There is also a strong desire to avoid later redesigns of that hardware to reflect software algorithm updates. Automating the process of software-to-hardware conversion—at the very least for the purpose of creating hardware prototypes—is therefore highly compelling. This automation also brings hardware acceleration within reach of design teams and developers who do not have vast hardware design expertise, or where hardware design might be cost-prohibitive using traditional approaches. C-to-hardware compilation is an enabling technology that has the potential to open up hardware acceleration for a whole new class of applications and developers.

On the hardware side, there have been recent advances in FPGA-based programmable platforms that make FPGAs even more practical for use as application accelerators. In fact, FPGAs with embedded processor cores have now become cost-effective as replacements for entire embedded systems. The concept of building a complete "system on an FPGA" is finally a reality, thanks to the continued efforts of the major FPGA providers and third-party intellectual property (IP) suppliers. What is common about these new FPGA-based platforms is that they combine one or more general-purpose processor cores with a large amount of programmable logic. Just as significantly, they come equipped with substantial amounts of royalty-free, pretested components and an ever-growing collection of licensable third-party and open-source components that can be assembled on-chip in a matter of hours to create an amazingly diverse set of potential hardware/software processing platforms.

From a tools perspective, what is interesting about these new devices—and the new computing platforms they represent—is that they are flexible enough to support the use of methods and tools from the software development world, including traditional software debuggers. Using languages such as C and C++ in conjunction with software-to-hardware compilers makes it practical to implement software applications directly onto a mixed hardware/software platform.

It is here that FPGA designers who are questioning the use of software design languages and methods for FPGAs may be missing the point. C is not likely to replace HDLs such as VHDL and Verilog for traditional, general-purpose hardware design. C will, however, play a strong role in the kind of mixed hardware/software applications that are emerging today—applications in which the line between what is software and what is hardware is becoming increasingly blurred, and where the ability to rapidly prototype and experiment with implementation alternatives is critical.

In addition, because of the prevalence of embedded FPGA processors, the C language is already being used for FPGAs by thousands of software engineers. The problem is that the vast majority of these software engineers are only able to program for the embedded microprocessor within the FPGA. Our goal in this book is to make C-language programming applicable to the entire FPGA, not just the embedded microprocessor within it.

The Power to Experiment

Using C language programming as an aid to FPGA-based hardware design gives you the power to experiment—with alternate algorithmic approaches, with alternate hardware/software partitioning, and with alternate target platforms. Using the same design entry language, you now have the ability to evaluate your applications and their constituent algorithms using different hardware and software targets.

In this book ...


Customer Reviews

Clarification of previous review4
As a reader of this book and a user of Impulse C I feel that I should clarify some of the previous reviewer's comments. While "weirdweird" is clearly knowledgeable about FPGAs, he (or she) is confused about the programming and execution model used by Impulse C.

Impulse C is an extension to the traditional ANSI C programming language that permits development of FPGA hardware by writing C. Like any C-to-gates development tool, the resulting hardware design is inferior to what an experienced hardware designer could produce. However, many feel that the greatly reduced development time and effort of a C development environment is worth the performance trade-off. In many cases the resulting hardware runs significantly faster than software programs on a PC.

The CoDeveloper tools that come with Impulse C (they are not included with the book) compile C to FPGA hardware and, in the process, extract multiple types of parallelism. Contrary to what "weirdweird" says, the resulting designs do not suffer from traditional processor bottlenecks as the resulting designs are nothing like a processor. Hardware synthesized from Impulse C programs consists of a datapath controlled by a Finite State Machine, the same structure used in most hardware designs and one that is not found in processors.

In addition to any parallelism the user specifies through stream declarations, the Impulse C compiler can also perform loop unrolling and other optimizations to perform multiple operations in parallel. The tools also permit the simultaneous use of multiple memories internal to the FPGA, eliminating the "memory wall" to which the previous reviewer refers.

"weirdweird" is correct that this book focuses solely on Impulse C, so readers without potential access to the Impulse C tools might want to consider other choices.

Very mixed3
Let's start on the positive side. This book is very current - it mentions the recent Cray and SGI FPGA accelerators as part of the reason for programmers to learn about FPGAs. It goes through some interesting and practical examples, showing how a C program can be used to specify the synthesizable logic for triple DES, including time/space tradeoffs. It gives some hardware awareness, without trying to turn a programmer into an EE. Best of all, it shows practical use of Impulse C, an ANSI C extension that supports pragma-driven pipelining and parallelism. Impulse C, by the way, seems to have an exceptional pedigree. It seems to descend from Maya Gokhale's work at Los Alamos, and there isn't much better parentage for such a product to claim.

There are some problems with this book, however. It relies overwhelmingly on the Impulse C product, to the exclusion of Handel C and a flock of other products - it's really an Impulse C how-to. That's not necessarily a bad thing, but it's not what I assumed from the title. It emphasizes streaming data, like radar input, video, audio, or all the other traditional DSP applications of FPGAs. Streaming is good, but a poor match to the Cray and SGI coprocessors.

The biggest problems in this book come from the basic approach of trying to turn an FPGA into a CPU. Back when iron was first introduced for bridge-building, iron beams were built to imitate wooden ones. The result was a wooden bridge made of iron. It worked, but used far more material than was needed for the job, and got relatively poor performance from the material. Ditto what happens when FPGA logic goes into a soft CPU. The result is a little like the classic "Fortran program written in C," only worse. Andre deHon, in his FCCM `04 talk on hardware design patterns, identified the FPGA CPU as one of the biggest anti-patterns in his lexicon (though he didn't use the word anti-pattern). Creating a CPU makes the FPGA look familiar to a C programmer, but is a great way to turn the FPGA's inherent parallelism into serial execution, and far slower than the host CPU's at that.

The FPGA CPU re-introduces the "memory wall." A big Xilinx FPGA has 300-400 on-chip memories that can be accessed independently and concurrently. You can (I did) build a dual-ported RAM with 1000-bit words. You can (I did) create a 64-way interleave, so all data for a 3D tricubic interpolation can be accessed in one cycle. You can (I did) create scratch buffers for hundreds of concurrent computations. You can create all kinds of wild structures with massive performance - or you can reinvent the 16-bit von Neumann bottleneck. (Soft CPUs aren't inherently evil, there are good uses for them. Mostly, I'd rather use the same logic for 100 parallel, dedicated processing elements instead of one serial PE.)

If you need to use Impulse C, there's probably no other book around. If you're a programmer trying to learn about hardware, I suggest Wirth's aging "Digital Circuit Design for Computer Science Students." I recommend this book only to people with product-specific needs.

//wiredweird