Skip to content

Hierarchy in SystemC: Why it’s so important for HLS!

Last time, I looked at the verification advantages of using SystemC for HLS. This time, I want to explore another important capability of SystemC that makes it far superior to ANSI C for hardware design.

I’m talking about structural hierarchy. SystemC supports hierarchy while ANSI C does not. Structural hierarchy means submodules, connected together and executing concurrently. Use of hierarchy is the traditional mainstay of hardware designers for breaking down complex designs into a group of smaller, more manageable designs that are easier to design and verify.

Here are some of the advantages that come from SystemC’s support for hierarchy:

Unit-Level Verification
It’s easier to build a testbench that can stimulate all the critical corner cases in a design when it’s a smaller block. Also, signoff requirements like code coverage are easier to meet when you have controllability at the smaller block boundary. Making sure that every line of source code is covered requires a designer to find the correct sequence of input values to exercise every code branch. With a small block you don’t have to try to trick the upstream blocks into producing the right stimulus, you can just have the testbench present whatever stimulus you need. In large blocks this may be impossible altogether.

Connections and Interfaces
Working at the submodule level allows designers to isolate the complex interfaces and channel connections between them. ANSI C HLS tools, as mentioned in the previous post, do not accurately represent concurrent hardware. This can really cause problems designing and verifying interfaces because the handshaking and transactions all occur simultaneously. The simulation semantics of SystemC let you examine interfaces and channels at the pin-level and make it straightforward to code your own interfaces with whatever protocol you need. SystemC-based HLS also allows you to encapsulate the details of a particular protocol in a set of classes and easily switch from one interface to another without changing your module’s source code–but that’s the topic of a future posting!

Architecture Design
In HLS design there is a step between algorithmic design and RTL generation: architectural design. This step takes the untimed algorithmic code and decides how major portions will be implemented in hardware to best meet QoR requirements, i.e. whether a particular array be an external memory or a flattened register. Some of this is done through synthesis directives or constraints, but a handy tactic is being able to partition a section of code into a nice hierarchical submodule. This, and its verification advantage, is talked about more in John Sanguinetti’s recent EETimes EDA DesignLine article.

Faster Runtimes
Everything will run faster with smaller modules. The blocks will get through behavioral synthesis scheduling more quickly and the generated RTL will run through logic synthesis tools faster. The block-level testing will go faster because smaller blocks compile and run in simulators faster as well.

Teams of Multiple Designers
Teams usually work in parallel, with multiple teams designing and verifying multiple blocks in parallel. Hierarchy makes design maintenance easier, makes it possible to keep a consistent set of code for HLS and verification, and keeps designers from stepping on each others’ toes.

Reuse
When the next-generation design is derived from your current design,having the design broken into manageable blocks makes it much easier to reuse some of those blocks without an entirely new verification effort. It also improves your ability to figure out which blocks will have to be changed, or how to fit together a combination of old, new and modified blocks to meet the new requirements.

SystemC supports our familiar friend–structural hierarchy–and allows you to use many of the same techniques you are accustomed to for managing the complexity of design and verification tasks. Gee, using SystemC for HLS is just like having a real hardware language, only with higher levels of abstraction available. No wait, it’s not like that–it’s exactly that! And that’s what you really need for practical high-level hardware design.

Need another reason to use SystemC for HLS? The verification advantage is the best of all.

The “language war” in high-level system (HLS) design has been waging for a while now. You’ve probably read a lot of online publications touting the advantages of using SystemC over ANSI C to design at an abstract level. If you were to take what everyone is saying and boil it down to a few key points, they might sound something like this:

  • ANSI C is a sequential language.
  • ANSI C cannot execute two subroutines or functions concurrently.
  • ANSI C executes your code in a single flow, one line after another.
  • ANSI C-based HLS tools either limit themselves to single-block designs or provide a proprietary mechanism to mimic concurrency.
  • ANSI C HLS tools don’t give you a way to accurately simulate what a real piece of hardware does.
  • SystemC, on the other hand, is a standardized superset of C++ that supports multiple concurrent processes.
  • SystemC supports hierarchy and modules.
  • SystemC allows communication between those modules at the transaction or pin level.
  • SystemC gives hardware designers the ability to tackle the very complex design and interface tasks they face every day.

Notice first I said “superset of C++” instead of “language.” That’s because SystemC is indeed not a language: it’s a family of C++ classes specifically geared toward hardware design constructs like modules, ports, concurrency, clocks, resets and channels.

The list above is short, but to see what far-reaching consequences these points have for hardware designers, consider the following:

Let’s say you use an ANSI C tool that can only work with single blocks. If you have a multiple block system, you can produce each block one at a time. But there’s a catch: how do you verify that system? According to the tool, that’s your problem. It’s up to you to somehow stitch these blocks together in RTL and do all the verification in RTL.

If you use an ANSI C tool that mimics concurrent simulation using proprietary libraries or other non-standard techniques, you are locked into that proprietary flow. Want to drive yourself crazy? Just try using this flow to create some IP cells and distribute them to your customers. Those customers will have to use (and own) the same tool just to run a simulation.

The proprietary library approach also takes liberties to get your ANSI C code to act like real hardware. To emulate the dataflow of your design they will typically have you partition the design so each block is a subroutine, and require you to call proprietary APIs inside the subroutines to manage that dataflow. One common approach is to have you conditionally execute the algorithms inside the subroutines depending on the availability of data reported by these API calls.

Sound messy? It is. And when you consider that it takes an API call (also proprietary) to determine if there is data in the channel, then you start to understand how these libraries are rudimentary static simulators at best.

If you have a fairly simple design that has a sequential algorithm, can be controlled by a single finite state machine, processes the same number of inputs and outputs every cycle, and uses a limited set of interfaces to communicate, then ANSI C may work fine for you. But the truth is that real projects aren’t that simple. Complex designs have multiple processes operating concurrently, they communicate with things like external memories and they send data through interfaces that must be customizable.

If you use the SystemC classes for HLS design, you have a real built-in, event-driven simulator to support your verification efforts. SystemC supports multiple modules that can execute concurrently, can share data in memories, and can synchronize their execution using real signal-level protocols. In other words, it allows you to attack the biggest design problems by breaking them down into multiple blocks and connecting them with channels that follow a protocol.

And with SystemC, you can easily simulate these blocks together to make sure everything is working correctly.

Can you do all this with ANSI C? You could, but how much time are you willing to spend writing the specialized hardware classes that already exist with SystemC?

There’s a lot more I could say about this, but I’ll let someone else do it for me.  John Sanguinetti, Forte’s CTO, just published this article in EETimes’ EDA DesignLine that takes another look at the verification angle.

Next time, I’ll take a little deeper look into another important advantage of SystemC in HLS design: its support of structural hierarchy.

Welcome to CynCity!

Hello and welcome to CynCity, the all new Forte Design Systems blog located here at http://cyncity.forteds.com. We are doing this so we can share our ideas with you more publicly – ideas we think you should consider in the fast-evolving world of high-level design. Forte now has a decade of experience helping people achieve great results. We hope that you will find CynCity to be both entertaining and informative, and above all, give you a clearer understanding of innovative approaches to design techniques and methodologies.

For our inaugural blog posting, I thought there was no better place to start than at the beginning.

Forte was founded on a vision with 4 core beliefs:

  • Abstraction – critical to improve the productivity and maintainability of new designs.
  • Verification – an essential component of any design solution.
  • Quality Silicon – tight coupling to downstream tools to produce high-quality results.
  • Standards – support for standard languages is best for our customers and our industry as a whole.

In 2001 we introduced Cynthesizer to the market, the first SystemC-based high-level synthesis tool. Cynthesizer raised the level of abstraction for designers, but it also delivered a series of verification integrations that made it easier for customers to adopt this new, high-level design flow. We chose SystemC at the time because it was the clear momentum winner in C++ modeling for EDA, and have since evolved that standard through technical and executive participation in the OSCI standards body. We also provided very close ties to existing silicon implementation flows (starting with logic synthesis tools) and tight integration of specialized datapath engines for generation of high-performance, quality silicon.

Our approach seems to be working. Cynthesizer has rapidly been adopted by the world’s leading electronics companies and our online Cynthesizer Knowledge Base now has over 600 users.

Things got even better last September when we acquired the CellMath Designer (CMD) technologies from Arithmatica. This brought to Forte a very high-performance datapath optimization technology, a number of world-class IP blocks and a team of world-renowned datapath experts. This step exemplifies our commitment to a core belief in quality silicon.

One of the challenges Forte faces, as a small company, is the fear on the part of designers to be “the guinea pig” – a fear of being the first user of new technology that might not work. Rest easy. Cynthesizer and CMD have both been through the ringer, having been used by many customers to tape out numerous designs. If you go to your local electronics store and buy a digital camera, TV, printer, MP3 player or one of the most popular smart phones on the market, chances are you will walk out holding a piece of hardware that was designed with a Forte product.

Each month we plan to bring you all kinds of helpful information no matter what your current tools or usage may be. If you are an existing Forte customer, we’ll help you get the most out of Cynthesizer and CMD to do things like create complex line buffer interfaces, get that external memory interface synthesized or design with floating-point data types. If you are a user of a competing high-level design tool, we hope to challenge some of the restrictions we know you are facing and point out ways you could achieve better results. And if you’re new to high-level synthesis but don’t know where to start, we’ll give you the information you need to examine your current design approaches and ask yourself a few tough questions that we’ve already solved.

If you’ve read other blogs or message boards, you’ve heard a lot of banter and conflicting opinions about high-level synthesis. Should I use SystemC or ANSI C? How exactly do I verify the results? What do I do with the RTL you generate? How do I analyze what you’ve done with my code? What about control-oriented designs? What about low power and ECOs?

It’s okay. We hear this all the time and you’ll see the answers right here on CynCity.

So welcome again. Please take a moment to bookmark this page and sign up for an email subscription. This way you’ll get the most out of your experience with Cynthesizer and CellMath Designer.

And, as always, we’re here to listen. If you have topics you would like to see covered or any suggestions to make our blog as usable as possible for you, don’t hesitate to send your ideas to us at cyncity@forteds.com.