
v
Preface
As a former RTL designer who made the switch to High-Level Synthesis (HLS) years ago, I can
still remember both the excitement of discovering a totally new design methodology, as well as
the frustration of not knowing what to expect from the HLS tool as I attempted to code increas-
ingly complex designs.
My first exposure to the world of HLS began with a demo of a FIR filter written in C++, and syn-
thesized directly to RTL. This was a design I was very familiar with coming from the world of
RTL. After having written numerous hand-coded VHDL and Verilog implementations, I was
completely blown away when I saw how a single algorithmic C++ description could be used to
generate a large number of RTL implementations, each with different area/performance character-
istics. The HLS tool was able to do in a matter of minutes, what normally would take me days or
weeks to accomplish. The fact that it was then able to take the resulting RTL and simulate it using
my C++ testbench to prove functionality was simply unbelievable. The potential of the technol-
ogy was too attractive for me not to make the switch, and I soon found myself working in the field
of HLS.
As I began to tackle more complex designs, I started to encounter occasional problems with
achieving the best possible results. What I saw was that the style in which my C++ was written
could have a big impact on the resulting quality of the RTL. I would liken this to what I had expe-
rienced when people were first making the switch from schematic based design to RTL, where
proper coding style was critical to good quality of results. Fortunately for me, I was working with
a number of experts in HLS who I could rely on to provide the explanation as to why a particular
coding style gave less than desirable results, and who could suggest a better way to write the C++.
I was lucky since at that time there was no formal style guide for writing C++ for synthesis.
As HLS has matured the quality of results has improved dramatically for a much wider range of
C++ coding styles. However, this does not mean that all styles are equal, and there is still the
potential for ending up with poor quality RTL when the C++ is not well written. Good style not
only requires an understanding of the underlying hardware architecture of an algorithm, so that it
is reflected in the C++ design, but also an understanding of how HLS works.
This book presents the recommended coding style for C++ synthesis that results in good quality
RTL. Most of the C++ examples are accompanied with hardware and timing diagrams, where
appropriate. The basic concepts of HLS are introduced and an effort is made to relate them
directly to concepts that are well understood by RTL engineers. Although this book focuses pri-
marily on C and C++ to illustrate the fundamentals of C++ synthesis, all concepts presented here
are equally applicable to SystemC when describing the core algorithmic part of a design.
Although the examples are simplistic in many cases, they illustrate the fundamental principles
behind C++ hardware design. These concepts will translate to much larger designs.
As a final thought for the RTL Designers, System Architects, and Algorithm Designers who are
looking to adopt High-Level Synthesis; correct-by-construction RTL synthesized from C++ may
not look exactly like what you would code by hand. HLS optimizations often can result in the odd