Home / Learn / Chip Design / What Is High-Level Synthesis (HLS)?
On this page
The problem it addressesHow high-level synthesis worksWhat it is good forWhere it strugglesThe benefitsThe limitationsHLS and hand-written RTL comparedWhere it fits in the flowWhy it matters for AI hardwareGood practiceCommon questionsRelated guidesWhat Is High-Level Synthesis (HLS)?
High-level synthesis, or HLS, is the automatic conversion of an algorithm written in a language such as C++ or SystemC into RTL hardware. Instead of describing registers and clock cycles by hand, the designer describes what should be computed, and a tool works out how to build it. HLS speeds up design and makes it easier to explore alternatives, though it does not suit every kind of block.
The problem it addresses
Hand-written RTL fixes many decisions at once: what is computed, in which clock cycle, using which hardware resources. Changing any one of them, for example adding a pipeline stage to run faster, can mean rewriting large parts of the code.
That makes RTL slow to write and slow to change. It also makes it hard to try several designs and compare them, because each one is a substantial piece of work.
HLS separates the algorithm from the hardware decisions. The designer writes the algorithm once and then directs the tool toward different implementations.
How high-level synthesis works
The tool takes two inputs: the source code describing the algorithm, and constraints such as the target clock speed and the technology library. It then carries out several steps.
- Scheduling. Decides which operations happen in which clock cycle.
- Allocation. Decides how many hardware units, such as multipliers and adders, are needed.
- Binding. Assigns each operation to a specific unit.
- Control generation. Builds the state machine that sequences everything.
- RTL generation. Writes out the result as RTL code for the normal design flow.
Designers steer the outcome with directives. They can ask for a loop to be unrolled so its iterations run in parallel, for a function to be pipelined, or for an array to be built as a particular kind of memory. The same source code can yield a small, slow design or a large, fast one.
What it is good for
HLS works best on blocks dominated by computation on streams of data.
- Image and video processing
- Signal processing and wireless communication
- Machine learning accelerators
- Compression and cryptography
These have regular structure, heavy arithmetic and many possible trade-offs between speed and size, which is where automated exploration pays off.
Where it struggles
- Control-heavy logic. Bus protocols, interrupt handling and complex state machines depend on exact cycle-by-cycle behavior that is easier to state directly in RTL.
- Highest-performance blocks. A skilled designer can sometimes beat the tool on area or speed for a critical block.
- Precise interface timing. Matching an exact external protocol can be awkward.
- Ordinary software. Code written for a processor does not become good hardware. It has to be written with hardware in mind.
The benefits
- Productivity. The source is shorter and written at a higher level, so there is less to write and to maintain.
- Faster simulation. High-level models run far faster than RTL, so more testing can be done sooner.
- Design-space exploration. Many implementations can be generated and compared in the time it would take to hand-write one.
- Easier retargeting. The same source can be re-synthesized for a different clock speed or process.
- A shared model. The algorithm description can serve as a reference for both hardware and software teams.
The limitations
- A learning curve. Writing good HLS code requires understanding what hardware the tool will infer.
- Less direct control. The generated RTL is not written for human readers, which complicates debugging and late fixes.
- Verification still required. The output must be checked, either by simulation or by formally proving it matches the source.
- Quality varies. Results depend on the tool, the coding style and the directives.
HLS and hand-written RTL compared
| Hand-written RTL | High-level synthesis | |
|---|---|---|
| Input | Cycle-accurate hardware description | Algorithm in C++ or SystemC |
| Timing decisions | Made by the designer | Made by the tool, guided by directives |
| Design effort | High | Lower |
| Exploring alternatives | Slow | Fast |
| Best for | Control logic, critical blocks | Data-processing blocks |
| Control over the result | Exact | Indirect |
| Readability of final RTL | Good | Poor |
Where it fits in the flow
HLS sits in front of the usual design flow. Its output is RTL, which then goes through the same synthesis, physical design and sign-off steps as any other RTL.
Most chips that use HLS use it selectively. Data-processing blocks are generated from high-level code, and control logic and integration are written directly in RTL.
Why it matters for AI hardware
AI accelerators are a natural application. Their core is arithmetic on large arrays of numbers, with many options for how much to parallelize and how to arrange memory. Models also change often, so the ability to regenerate hardware from an updated algorithm is valuable.
HLS is also popular for FPGA designs, where engineers from software and algorithm backgrounds use it to build accelerators without writing RTL.
Good practice
- Write source code that reflects hardware structure, with fixed loop bounds and explicit bit widths.
- Keep a test environment that runs on both the high-level model and the generated RTL.
- Use the tool’s reports to understand where area and time are going.
- Reserve hand-written RTL for interfaces and control.
Common questions
Does high-level synthesis replace RTL designers?
No. It changes part of what they do. Understanding hardware is still essential to write code that synthesizes well, and control logic and integration are still done in RTL.
Which languages does HLS use?
Most tools accept C, C++ or SystemC. Some accept other high-level descriptions, including models exported from algorithm-design environments.
Is hardware from HLS as good as hand-written hardware?
For data-processing blocks it is often comparable and occasionally better, because more alternatives can be tried. For control-dominated or highly tuned blocks, hand-written RTL usually wins.