hls4ml (High-Level Synthesis for Machine Learning) is an open-source compiler that translates pre-trained neural networks from frameworks like TensorFlow or PyTorch into register-transfer level (RTL) code. This generated code is synthesized for field-programmable gate arrays (FPGAs) using high-level synthesis tools, enabling ultra-low-latency inference directly in hardware fabric without a traditional CPU or GPU operating system stack.
Glossary
HLS4ML

What is HLS4ML?
An open-source compiler workflow that translates pre-trained machine learning models into register-transfer level (RTL) code for synthesis on field-programmable gate arrays (FPGAs) using high-level synthesis tools.
The workflow applies hardware-aware optimizations, including quantization-aware training and configurable parallelism, to balance resource usage against throughput. By generating VHDL or Verilog from ONNX or Keras models, hls4ml allows signal processing engineers to deploy complex neural receivers and RF machine learning models on resource-constrained edge devices with deterministic, microsecond-level execution times.
Key Features of HLS4ML
An open-source compiler workflow that translates pre-trained machine learning models into register-transfer level (RTL) code for synthesis on field-programmable gate arrays (FPGAs) using high-level synthesis (HLS) tools.
Model Translation Pipeline
Converts models from frameworks like TensorFlow, PyTorch, and Keras into HLS-ready C++ code. The workflow parses the model graph, applies optimizations, and generates synthesizable firmware.
- Supports fully connected, convolutional, and recurrent layers
- Handles custom activation functions and merge layers
- Outputs Vivado HLS or Quartus compatible projects
Configurable Precision
Enables arbitrary fixed-point precision assignment per layer using ap_fixed and ap_ufixed data types. This allows designers to trade numerical accuracy for resource efficiency without rewriting the model.
- Integer bits and fractional bits specified independently
- Supports mixed-precision strategies across layers
- Critical for meeting DSP slice and BRAM budgets
Reuse Factor Optimization
Controls the degree of resource sharing through a reuse factor parameter that determines how many times a single hardware multiplier is reused per clock cycle.
- Reuse factor = 1: Fully parallel, maximum throughput
- High reuse factor: Serialized execution, minimal resource consumption
- Directly impacts initiation interval (II) and latency
HLS Strategy Configuration
Exposes granular control over the underlying HLS synthesis directives, including pipelining, unrolling, and array partitioning.
- Pipeline style: STALL, FLUSH, or DATAFLOW
- Unroll factor: Partial or full loop unrolling
- Array partitioning: Cyclic, block, or complete partitioning for memory bandwidth
Vivado & Quartus Backend Support
Generates complete project files for both Xilinx Vivado HLS and Intel Quartus, including test benches and C simulation files for functional verification.
- C simulation validates numerical accuracy pre-synthesis
- Co-simulation with RTL verifies post-synthesis behavior
- Exports IP blocks for integration into larger FPGA designs
Profiling and Analysis Tools
Provides built-in profiling to estimate resource utilization, latency, and throughput before running full synthesis, enabling rapid design space exploration.
- Layer-by-layer DSP, BRAM, FF, and LUT estimates
- Latency breakdown per layer in clock cycles
- Integration with hls4ml-profiler for bottleneck identification
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Addressing the most common technical inquiries regarding the translation of pre-trained machine learning models into register-transfer level code for field-programmable gate array synthesis.
HLS4ML is an open-source compiler workflow that translates pre-trained machine learning models into register-transfer level (RTL) code for synthesis on field-programmable gate arrays (FPGAs) using high-level synthesis tools. The workflow begins by parsing a model from standard frameworks like TensorFlow, PyTorch, or Keras, converting it into an intermediate representation. It then applies hardware-aware optimizations—such as fixed-point quantization and parallelization strategies—before generating C++ code compatible with Vivado HLS or Quartus. This generated code is synthesized into a custom hardware accelerator that executes the neural network with deterministic, ultra-low latency, bypassing the overhead of traditional processor-based inference. The core mechanism involves mapping matrix multiplications and activation functions to pipelined hardware datapaths, enabling direct deployment on Xilinx, Intel, or Alveo platforms for real-time signal processing applications.
Related Terms
Key concepts and complementary technologies in the HLS4ML workflow for deploying machine learning on FPGAs.
Register-Transfer Level (RTL)
The hardware description output generated by the HLS4ML compiler. RTL code, typically in VHDL or Verilog, models the flow of data between registers and the logical operations performed at the register level on each clock cycle. This is the standard input for FPGA synthesis tools. HLS4ML automates the complex translation from a Keras or PyTorch model graph into an optimized, pipelined RTL microarchitecture.
Reuse Factor
A fundamental HLS4ML configuration parameter that controls the resource-throughput trade-off. A reuse factor of N means a single hardware unit for a specific operation (e.g., a multiplier) is reused N times to compute a layer's outputs. A low reuse factor creates a highly parallel, high-throughput implementation at the cost of high FPGA resource consumption. A high reuse factor saves resources but increases latency and reduces initiation interval (II).

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us