# 逻辑综合

逻辑综合是将寄存器传输级（RTL）或行为级硬件描述自动转换为功能等价的门级或晶体管级网表（电路元件及其连接关系的列表）的过程。<sup>[1](https://cseweb.ucsd.edu/classes/fa23/cse248-a/papers/logic/ls-handout.pdf)</sup> 它位于高层次综合（产生RTL）与物理设计（对网表进行布局布线）之间。<sup>[1](https://cseweb.ucsd.edu/classes/fa23/cse248-a/papers/logic/ls-handout.pdf)</sup> 标准做法将这一工作分为三个阶段：将RTL转换为布尔表示、[逻辑优化](https://www.edgepedia.org/zh/logic-optimization)、以及映射为可用于制造的标准单元网表的[技术映射](https://www.edgepedia.org/zh/technology-mapping)。<sup>[2](https://ieda.oscc.cc/res/papers/25-TODAES-ML4LS.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 输入与输出 | 输入RTL或行为级硬件描述；输出逻辑门级或物理门级网表，映射到单元库或FPGA查找表。<sup>[3](https://yosyshq.readthedocs.io/projects/yosys/en/latest/appendix/primer.html)</sup> |
| 核心表示 | 与-非图（AIG），即由二输入与门和反相器构成的同质图；面积即与节点数，延迟即图深度。<sup>[4](https://people.eecs.berkeley.edu/~alanmi/publications/2006/iwls06_sls.pdf)</sup> |
| 通用流程 | 工艺无关表示、反复的窥孔优化、技术映射。<sup>[5](https://people.eecs.berkeley.edu/~alanmi/publications/2019/dac19_syn.pdf)</sup> |
| 辅助输入 | .lib库（有哪些单元及其速度）和SDC约束（设计必须达到多快）。<sup>[6](https://siliconpath.in/learn/synthesis/detailed-synthesis-flow)</sup> |
| 完成判据 | 形式化逻辑等价性检查（Synopsys Formality、Cadence Conformal）证明网表与RTL一致。<sup>[6](https://siliconpath.in/learn/synthesis/detailed-synthesis-flow)</sup> |
| 生产实绩 | IBM的LSS为一个波基普西项目生产了其一百多个芯片部件中的90%。<sup>[7](https://dl.acm.org/doi/10.1147/rd.285.0537)</sup> |

## 工作原理

其数学基础是[布尔代数](https://www.edgepedia.org/zh/boolean-algebra)，即“逻辑的代数”；克劳德·E·香农（Claude E. Shannon）1938年的论文《继电器与开关电路的符号分析》将这一代数与开关电路联系起来。<sup>[1](https://cseweb.ucsd.edu/classes/fa23/cse248-a/papers/logic/ls-handout.pdf)</sup><sup> • </sup><sup>[8](https://doi.org/10.1109/t-aiee.1938.5057767)</sup> 最简单的综合目标是两级逻辑：积之和（SOP）形式，一层与门馈入一个或门。这种方法最坏情况下计算量呈指数增长，其延迟取决于扇入和容性负载而非级数；在CMOS中可以用静态互补的N网络和P网络构建，而动态和伪NMOS风格是替代的电路族，并非必需。<sup>[29](https://www.cerc.utexas.edu/~jaa/vlsi/lectures/3-2.pdf)</sup><sup> • </sup><sup>[3](https://yosyshq.readthedocs.io/projects/yosys/en/latest/appendix/primer.html)</sup><sup> • </sup><sup>[9](https://si2.epfl.ch/~demichel/publications/archive/2019/08478240.pdf)</sup> 因此现代工具使用多级算法，作用于二元决策图（BDD，具有唯一的规范形式）或与-非图（AIG，对于大型函数具有好得多的最坏情况性能）。<sup>[3](https://yosyshq.readthedocs.io/projects/yosys/en/latest/appendix/primer.html)</sup>

在AIG中，面积以与节点总数衡量，延迟以图的深度衡量，两者都易于计算。<sup>[4](https://people.eecs.berkeley.edu/~alanmi/publications/2006/iwls06_sls.pdf)</sup> AIG是使用最广泛的工艺无关表示；多数-反相图（MIG）已被提出作为可直接替换的方案，而FPGA设计则使用k输入查找表（k-LUT）网络。<sup>[5](https://people.eecs.berkeley.edu/~alanmi/publications/2019/dac19_syn.pdf)</sup><sup> • </sup><sup>[9](https://si2.epfl.ch/~demichel/publications/archive/2019/08478240.pdf)</sup> 检查两个AIG的等价性可归约为对其输出异或非的永真式检查，这是一个coNP完全问题，这就是为什么基于SAT的推理贯穿整个流程。<sup>[1](https://cseweb.ucsd.edu/classes/fa23/cse248-a/papers/logic/ls-handout.pdf)</sup>

## 如何实现

最先进的综合分三步进行：将设计表达为工艺无关的逻辑表示，反复应用快速窥孔优化，然后映射到工艺相关的表示。<sup>[5](https://people.eecs.berkeley.edu/~alanmi/publications/2019/dac19_syn.pdf)</sup> AIG上的优化工具箱包括重写（基于模板的小子图替换）、在最大无扇出锥（MFFC，即某节点的扇入中仅被该节点使用的子集）上的重构、以最小化逻辑深度为目标的平衡、以及重替换——即用称为除数的现有节点重新表达某节点的函数；当替换所释放的节点数超过其所增加的k个算子时，替换才是划算的。<sup>[4](https://people.eecs.berkeley.edu/~alanmi/publications/2006/iwls06_sls.pdf)</sup><sup> • </sup><sup>[2](https://ieda.oscc.cc/res/papers/25-TODAES-ML4LS.pdf)</sup><sup> • </sup><sup>[5](https://people.eecs.berkeley.edu/~alanmi/publications/2019/dac19_syn.pdf)</sup>

重写作用于4输入割，即通过至多四个输入可达的子网络；割枚举可以列出最多12个输入的所有割。当子网络不超过16至20个输入时，穷举真值表模拟胜过重量级的布尔推理；基于SAT的精确综合可计算出最多约8个输入的可证明最优子网络。<sup>[5](https://people.eecs.berkeley.edu/~alanmi/publications/2019/dac19_syn.pdf)</sup>

技术映射通常分两个阶段进行：RTL单元首先映射到单比特单元的内部库，然后将该网表转换为目标库中的门，目标库以Liberty（.lib）行业标准格式描述。<sup>[10](https://yosyshq.readthedocs.io/projects/yosys/en/0.41/using%5Fyosys/synthesis/techmap_synth.html)</sup> 在Yosys中，寄存器单元由dfflibmap映射，组合逻辑由外部ABC程序的abc pass配合-liberty选项映射。<sup>[10](https://yosyshq.readthedocs.io/projects/yosys/en/0.41/using%5Fyosys/synthesis/techmap_synth.html)</sup> ABC的标准单元映射器有map（面向延迟、布尔匹配、单元最多5个输入）和amap（面向面积、结构化、单元最多15个输入）；通过st；dch引入的结构选择在映射前同时改善面积和延迟。<sup>[11](https://ethz.ch/content/dam/ethz/special-interest/itet/efcl-dam/documents/Introduction%20to%20ABC.pdf)</sup> OpenROAD流程的综合阶段运行一个Yosys脚本，包含粗综合和细综合、可选的重定时、触发器映射、ABC技术映射、缓冲，以及在写出网表前进行带断言检查的映射验证。<sup>[12](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/scripts/synth.tcl)</sup>

## 起源

两级SOP公式的最小化理论由W. V. 奎因（W. V. Quine）于1952年在《美国数学月刊》上建立，<sup>[13](https://doi.org/10.1080/00029890.1952.11988183)</sup> E. J. 麦克拉斯基（E. J. McCluskey）1956年在《贝尔系统技术期刊》上的论文将其转化为现在称为奎因-麦克拉斯基的表格算法，可精确最小化逻辑覆盖。<sup>[14](https://doi.org/10.1002/j.1538-7305.1956.tb03835.x)</sup><sup> • </sup><sup>[9](https://si2.epfl.ch/~demichel/publications/archive/2019/08478240.pdf)</sup> [启发式](https://www.edgepedia.org/zh/heuristic)两级最小化在Espresso中达到顶峰：ESPRESSO-II用APL实现并在工业实例上测试；1984年Kluwer的著作记录了其算法。<sup>[15](https://doi.org/10.1007/978-1-4613-2821-6)</sup><sup> • </sup><sup>[16](https://link.springer.com/book/10.1007/978-1-4613-2821-6)</sup>

当代逻辑综合随CMOS技术和半定制设计于1980年代兴起，分为工艺无关阶段和随后的技术映射。<sup>[9](https://si2.epfl.ch/~demichel/publications/archive/2019/08478240.pdf)</sup> IBM的多级方法来自约翰·A·达林格（John A. Darringer）及其同事的《通过局部变换的逻辑综合》，《IBM研究与开发期刊》，1981年；<sup>[17](https://doi.org/10.1147/rd.254.0272)</sup> 生产系统LSS建立在其基础上，被IBM一个波基普西项目用于生产其一百多个芯片部件中的90%，其成功归因于多个抽象层次上的局部变换加上设计者的配合。<sup>[7](https://dl.acm.org/doi/10.1147/rd.285.0537)</sup> SOCRATES是一个自动综合和优化组合逻辑的系统，由大卫·格雷戈里（David Gregory）及其同事于1986年报道。<sup>[18](https://doi.org/10.5555/318013.318026)</sup> 库尔特·科伊策（Kurt Keutzer）的DAGON通过DAG匹配进行技术绑定，在安通·多米奇（Antun Domic）的回顾中定为1987年，开创了基于树的技术映射。<sup>[19](https://si2.epfl.ch/~demichel/si.epfl.ch/files/content/sites/si/files/shared/Logic%20Synthesis/slides/EPFL%20LSV%20Workshop%202015_Antun%20Domic.pdf)</sup> Synopsys成立于1986年，通过一个在标准单元库之间迁移网表的重映射器产品将逻辑优化商业化。<sup>[1](https://cseweb.ucsd.edu/classes/fa23/cse248-a/papers/logic/ls-handout.pdf)</sup> 路易丝·特雷维良（Louise Trevillyan）1987年的教程将该领域概括为从简单的映射方案到具有复杂逻辑优化的工具。<sup>[20](https://doi.org/10.1145/37888.37913)</sup>

## 变体

**树覆盖与基于割的映射。** DAGON通过DAG匹配进行技术绑定。<sup>[19](https://si2.epfl.ch/~demichel/si.epfl.ch/files/content/sites/si/files/shared/Logic%20Synthesis/slides/EPFL%20LSV%20Workshop%202015_Antun%20Domic.pdf)</sup> 对于FPGA查找表映射，FlowMap由J. Cong和丁玉正（Yuzheng Ding）于1994年在《IEEE集成电路与系统计算机辅助设计汇刊》上发表，证明了K有界网络的最小深度问题可以用网络流计算的最小高度K可行割在多项式时间内最优求解，对于n个节点和m条边，时间复杂度为\( O(K \cdot m \cdot n) \)。<sup>[21](https://doi.org/10.1109/43.273754)</sup> mockturtle中的通用映射器（其map命令）既映射到单元库，也通过割枚举、NPN规范布尔匹配、面积流和基于MFFC的精确面积覆盖在图形表示（AIG、XAG、MIG、XMG）之间映射。<sup>[22](https://aspdac2022.github.io/taoka/pdf/5D-3.pdf)</sup>

**近似综合。** 结合立方体插入和移除的两级近似综合报告称，与最先进方法相比，在1%、3%和5%的错误率下，文字数分别减少高达38%、56%和93%。<sup>[23](https://dl.acm.org/doi/10.1109/TCAD.2022.3143489)</sup>

**工具格局。** 商业流程主要区别在于接口：[Synopsys Design Compiler](https://www.edgepedia.org/zh/synopsys-design-compiler)通常运行一条命令compile_ultra，而Cadence Genus暴露显式阶段syn_generic、syn_map和syn_opt。<sup>[6](https://siliconpath.in/learn/synthesis/detailed-synthesis-flow)</sup> 在开源方面，Yosys包含基本综合，但建议与ABC配合使用。<sup>[3](https://yosyshq.readthedocs.io/projects/yosys/en/latest/appendix/primer.html)</sup>

## 应用

EPFL组合基准套件包含23个电路，分为算术、随机/控制和MtM类别，提供比较基线，并有年度最佳结果竞赛。<sup>[24](https://github.com/lsils/benchmarks)</sup> 图映射将综合与新兴技术联系起来：MIG用于绝热量子通量参量子和量子点元胞自动机，XMG用于可重构FET纳米技术，XAG用于密码学和量子编译。<sup>[22](https://aspdac2022.github.io/taoka/pdf/5D-3.pdf)</sup>

## 局限与替代方案

**综合-仿真不匹配。** 给仿真器提供综合工具无法接收的信息的编码风格会导致RTL到门级的失配，往往在流片后才被发现，迫使二次流片。<sup>[25](https://csg.csail.mit.edu/6.375/6_375_2006_www/papers/cummings-synth-mismatch-snug99.pdf)</sup> 不完整的敏感列表会导致失配，因为综合从块的方程推导逻辑，而仿真遵循列表；修复方法是通配符列表或always_comb。<sup>[25](https://csg.csail.mit.edu/6.375/6_375_2006_www/papers/cummings-synth-mismatch-snug99.pdf)</sup><sup> • </sup><sup>[26](https://schaumont.dyn.wpi.edu/ece574f24/04synthesis.html)</sup> full_case指令可能将某个输入优化掉并使其悬空；parallel_case将优先级逻辑变为并行逻辑，可能使设计更大更慢；casex将X值视为无关项，因此未知输入在RTL仿真中匹配，而网表传播X；在RTL中赋X意味着仿真中未知但综合中无关。<sup>[25](https://csg.csail.mit.edu/6.375/6_375_2006_www/papers/cummings-synth-mismatch-snug99.pdf)</sup> 不完整的if或case语句是典型的精化陷阱：组合信号未在每条路径上赋值会推断出锁存器，破坏时序和可测试性，许多工具在生成锁存逻辑时都会警告。<sup>[6](https://siliconpath.in/learn/synthesis/detailed-synthesis-flow)</sup><sup> • </sup><sup>[3](https://yosyshq.readthedocs.io/projects/yosys/en/latest/appendix/primer.html)</sup> 硬件推断是有选择性的，并非每个Verilog构造都会导致仿真所暗示的硬件。<sup>[26](https://schaumont.dyn.wpi.edu/ece574f24/04synthesis.html)</sup>

**估计与规模。** 综合后设计的时序使用布线延迟的估计；只有布局布线后的分析才包含实际布线延迟。<sup>[27](https://www.ecs.csun.edu/~smirzaei/docs/ece524/ug901-vivado-synthesis-en-us-2025.1.pdf)</sup> 随着设计达到数百万门，对所有逻辑组合进行完整测试变得不切实际，因此必须尽早避免易出错的风格。<sup>[25](https://csg.csail.mit.edu/6.375/6_375_2006_www/papers/cummings-synth-mismatch-snug99.pdf)</sup> 作为替代的抽象层次，自1980年代末以来已提出从类C语言进行高层次综合（HardwareC、SystemC、Handel-C、SpecC等），但没有一个像Verilog或VHDL在RTL设计中那样成功，因为C没有语言级支持的并发性，也没有执行时间的概念，而且每种方法都需要一种将时间划分为时钟周期的机制。<sup>[28](https://www.cs.columbia.edu/~sedwards/papers/edwards2005challenges.pdf)</sup>

## References

1. [Logic Synthesis in a Nutshell (UCSD course handout)](https://cseweb.ucsd.edu/classes/fa23/cse248-a/papers/logic/ls-handout.pdf)
2. [A Survey of Machine Learning Approaches in Logic Synthesis](https://ieda.oscc.cc/res/papers/25-TODAES-ML4LS.pdf)
3. [A primer on digital circuit synthesis, Yosys documentation](https://yosyshq.readthedocs.io/projects/yosys/en/latest/appendix/primer.html)
4. [Scalable Logic Synthesis using a Simple Circuit Structure (Mishchenko, Chatterjee, Brayton, IWLS 2006)](https://people.eecs.berkeley.edu/~alanmi/publications/2006/iwls06_sls.pdf)
5. [Scalable Generic Logic Synthesis: One Approach to Rule Them All (DAC 2019)](https://people.eecs.berkeley.edu/~alanmi/publications/2019/dac19_syn.pdf)
6. [Detailed Synthesis Flow (SiliconPath)](https://siliconpath.in/learn/synthesis/detailed-synthesis-flow)
7. [LSS: a system for production logic synthesis (IBM Journal of Research and Development, 1984)](https://dl.acm.org/doi/10.1147/rd.285.0537)
8. [Claude E. Shannon (1938). A symbolic analysis of relay and switching circuits. Transactions of the American Institute of Electrical Engineers.](https://doi.org/10.1109/t-aiee.1938.5057767)
9. [Logic Synthesis for Established and Emerging Computing (Testa et al., Proceedings of the IEEE, 2019)](https://si2.epfl.ch/~demichel/publications/archive/2019/08478240.pdf)
10. [Technology mapping, Yosys documentation](https://yosyshq.readthedocs.io/projects/yosys/en/0.41/using%5Fyosys/synthesis/techmap_synth.html)
11. [Introduction to ABC: An Open-Source Synthesis and Verification CAD Tool (lecture slides)](https://ethz.ch/content/dam/ethz/special-interest/itet/efcl-dam/documents/Introduction%20to%20ABC.pdf)
12. [OpenROAD-flow-scripts synth.tcl (Yosys synthesis script)](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/scripts/synth.tcl)
13. [W. V. Quine (1952). The Problem of Simplifying Truth Functions. American Mathematical Monthly.](https://doi.org/10.1080/00029890.1952.11988183)
14. [E. J. McCluskey (1956). Minimization of Boolean Functions*. Bell System Technical Journal.](https://doi.org/10.1002/j.1538-7305.1956.tb03835.x)
15. [Robert K. Brayton and colleagues (1984). Logic Minimization Algorithms for VLSI Synthesis. Kluwer international series in engineering and computer science.](https://doi.org/10.1007/978-1-4613-2821-6)
16. [Logic Minimization Algorithms for VLSI Synthesis (Brayton, Hachtel, McMullen, Sangiovanni-Vincentelli, 1984)](https://link.springer.com/book/10.1007/978-1-4613-2821-6)
17. [John A. Darringer and colleagues (1981). Logic Synthesis Through Local Transformations. IBM Journal of Research and Development.](https://doi.org/10.1147/rd.254.0272)
18. [David Gregory and colleagues (1986). SOCRATES: A System for Automatically Synthesizing and Optimizing Combinational Logic. .](https://doi.org/10.5555/318013.318026)
19. [The Evolution of Logic Synthesis (Antun Domic, Synopsys, EPFL LSV Workshop 2015)](https://si2.epfl.ch/~demichel/si.epfl.ch/files/content/sites/si/files/shared/Logic%20Synthesis/slides/EPFL%20LSV%20Workshop%202015_Antun%20Domic.pdf)
20. [An overview of logic synthesis systems (Louise H. Trevillyan, 1987)](https://doi.org/10.1145/37888.37913)
21. [J. Cong, Yuzheng Ding (1994). FlowMap: an optimal technology mapping algorithm for delay optimization in lookup-table based FPGA designs. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.](https://doi.org/10.1109/43.273754)
22. [A Versatile Mapping Approach for Technology Mapping and Graph Optimization](https://aspdac2022.github.io/taoka/pdf/5D-3.pdf)
23. [A Two-Level Approximate Logic Synthesis Combining Cube Insertion and Removal](https://dl.acm.org/doi/10.1109/TCAD.2022.3143489)
24. [The EPFL Combinational Benchmark Suite (repository)](https://github.com/lsils/benchmarks)
25. [RTL Coding Styles That Yield Simulation and Synthesis Mismatches (Clifford Cummings, SNUG 1999)](https://csg.csail.mit.edu/6.375/6_375_2006_www/papers/cummings-synth-mismatch-snug99.pdf)
26. [RTL Synthesis, Advanced Digital Systems Design Fall 2024 (schaumont.dyn.wpi.edu)](https://schaumont.dyn.wpi.edu/ece574f24/04synthesis.html)
27. [Vivado Design Suite User Guide: Synthesis (UG901, 2025.1)](https://www.ecs.csun.edu/~smirzaei/docs/ece524/ug901-vivado-synthesis-en-us-2025.1.pdf)
28. [The Challenges of Hardware Synthesis from C-like Languages (Stephen Edwards, 2005)](https://www.cs.columbia.edu/~sedwards/papers/edwards2005challenges.pdf)
29. [cerc.utexas.edu](https://www.cerc.utexas.edu/~jaa/vlsi/lectures/3-2.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 21, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Semiconductor devices & fabrication › Integrated circuits and chip families

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/logic-synthesis

English original: https://www.edgepedia.org/logic-synthesis
