The primary objective of this project is to design and implement a custom logic synthesis, optimization, and technology mapping engine in C++. The tool takes intermediate representations generated by Yosys (such as Yosys JSON or bit-blasted AIGER netlists) for complex SystemVerilog Out-of-Order (OoO) RISC-V processor modules—such as the Reorder Buffer (ROB), Reservation Station (RS), or Register Alias Table (RAT)—and transforms them into structural Verilog netlists targeting FPGA architectures.
This project explicitly excludes front-end HDL parsing and parameter elaboration, leveraging Yosys as a front-end parser to emit intermediate netlist representations. The engine focuses exclusively on graph data structures, Boolean logic optimization passes, cut-based technology mapping, and backend verification.
+-----------------------------------------------------------------------------------+
| SystemVerilog RTL (e.g., ROB / RS / RAT Modules) |
+-----------------------------------------------------------------------------------+
|
| Yosys Parsing & Elaboration
v
+-----------------------------------------------------------------------------------+
| Intermediate Netlist Representation (Yosys JSON / AIGER) |
+-----------------------------------------------------------------------------------+
|
| CUSTOM C++ SYNTHESIS ENGINE
v
+-----------------------------------------------------------------------------------+
| 1. IR Ingestion & Core Graph Manager (AIG / Strashing) |
| 2. Pre-Mapping Optimizations (Constant Folding, DCE, Resubstitution) |
| 3. K-Feasible Cut Enumeration & Technology Mapping (K=6) |
| 4. Sub-Graph Truth Table Computation & Netlist Emission |
+-----------------------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------------------+
| Target Netlist: Structural Verilog (`LUT6` + `FDRE` Primitives) |
+-----------------------------------------------------------------------------------+
/ \
v v
+-----------------------------------+ +-----------------------------------+
| Yosys SAT Equivalence Proof | | Vivado / Quartus Physical Flow |
| (`equiv_make` -> `sat` miter) | | Place & Route (P&R), Slack & Fmax |
+-----------------------------------+ +-----------------------------------+
- Netlist Ingestion: Ingest intermediate representations emitted by Yosys (e.g., Yosys JSON or AIGER) representing combinational logic cones and sequential flip-flops.
- Scope Boundary: Focus purely on netlist graph ingestion; no custom SystemVerilog parsing or elaboration.
- Graph Representation: Implement an internal Directed Acyclic Graph (DAG) / And-Inverter Graph (AIG) manager to represent logic network topology and complemented edges.
- Constant Handling: Support constant node representation and propagation across the logic graph.
- Structural Hashing (Strashing): Implement structural hashing to automatically deduplicate redundant logic gates during graph construction.
Perform graph cleaning and logic minimization passes prior to technology mapping:
- Constant Folding: Propagate known constant values through logic cones.
- Dead Code Elimination (DCE): Purge unreferenced nodes that do not drive primary outputs or sequential registers.
- Node Merging & Rewriting: Collapse redundant sub-graphs to minimize total graph node count.
-
Target Primitives:
$K$ -input Look-Up Tables ($K$ -LUTs, targeting$K=6$ ) for modern FPGA architectures. -
Cut Enumeration: Enumerate
$K$ -feasible cuts across graph nodes using dynamic programming techniques. - Cover Selection: Traverse the cut graph to select a global LUT cover optimizing for depth (delay) and area (LUT count).
- Truth Table Evaluation: Compute Boolean truth tables (
INITmasks) for each mapped LUT cut. - Structural Output: Emit structural Verilog composed of target FPGA primitives (
LUT6and flip-flop instantiations) ready for downstream verification and vendor Place & Route.
Every synthesized netlist must pass automated formal verification to guarantee mathematical correctness against the original RTL:
- Verification Driver: Yosys script utilizing
equiv_maketo construct a miter circuit between the original SystemVerilog module and the engine's output structural Verilog netlist. - Proof Engine: Run
sat -prove-definedinside Yosys. A run is marked successful only if the solver returns an explicitUNSAT(proving zero equivalence-violating input patterns exist).
- Target Toolchains: Xilinx Vivado or Intel Quartus.
-
Flow: Ingest the generated structural Verilog directly into the vendor tool, bypass vendor logic synthesis (
synth_design), and run implementation (opt_design,place_design,route_design). - Metrics: Collect physical Quality-of-Results (QoR) metrics:
- Area: Total physical LUT count.
-
Timing: Maximum Operating Frequency (
$F_{max}$ ) and Worst Negative Slack (WNS).
- Synthesize at least one complex module (e.g., ROB, RS, or RAT) from the custom Out-of-Order processor into a verified LUT netlist.
- Complete full end-to-end verification via Yosys SAT equivalence checking.
- Successfully run physical Place & Route on an FPGA target.
- Extend technology mapping to target standard cell Liberty (
.lib) libraries instead of FPGA LUTs. - Expand synthesis scale to process the entire Out-of-Order processor core end-to-end.
- Eliminate the Yosys front-end dependency by writing an isolated bit-blasting IR parser directly.
This project is explicitly designed to explore critical questions in electronic design automation and system architecture:
-
Understanding Synthesis Tradeoffs: Quantify the exact area/delay trade-offs introduced by custom
$K$ -cut mapping heuristics versus commercial baseline synthesizers. - Synthesis Runtime Bottlenecks: Evaluate whether logic synthesis optimization runtime is a primary constraint in current semiconductor workflows, analyzing its impact from a software programmer's perspective.
- Workload-Specific Optimization: Explore how custom logic transformations can be specialized for specific microarchitectural structures, such as priority encoders inside Reservation Stations or content-addressable memory inside the ROB.