How Yosys Powers RTL Bench
Yosys is the open-source synthesis framework that acts as the engine for RTL Bench. It takes your behavioral Verilog and translates it into a structural gate-level netlist.
What is Synthesis?
When you write code like assign y = (a & b) | c;, you are describing a behavior.
Silicon doesn't understand behavior; it only understands physical logic gates. Synthesis is the process of
translating that behavior into actual AND, OR, and NOT gates, and deciding how they physically connect.
The Yosys Pipeline
When you hit "Generate" in RTL Bench, Yosys executes a specific sequence of passes:
- Parsing: Yosys reads your
.svor.vfile and builds an Abstract Syntax Tree (AST). - Elaboration (
proc): It converts high-level constructs likealwaysblocks andif/elsestatements into multiplexers and flip-flops. - Optimization (
opt): It removes redundant logic, eliminates unused wires, and folds constants. (e.g., if you write1'b1 & b, it just replaces it withb). - Technology Mapping (
techmap): This is the final step. Yosys maps the logic to the specific standard cells provided by the PDK (like SkyWater 130nm).
Why Open-Source Synthesis Matters
Commercial tools like Synopsys Design Compiler cost hundreds of thousands of dollars. Yosys proves that high-quality synthesis can be done openly. RTL Bench uses Yosys because it is fast, highly scriptable, and can run directly on a web server without licensing issues.
Frequently asked questions
Yosys parses the Verilog AST, performs elaboration to create a hierarchy of internal RTLIL cells, optimizes logic using Boolean simplification passes, and maps high-level operators to target technology gates or FPGA LUTs.
The generic synth command performs technology-independent logic optimization. Target-specific commands like synth_ice40 or synth_gowin execute vendor-specific mapping scripts that target device Look-Up Tables, carry chains, and flip-flops.
Yes. Using the dfflibmap and abc passes with Liberty format (.lib) timing and cell definitions, Yosys maps digital logic into foundry-specific cells (like SkyWater sky130 or GF180MCU).