yosys - 是否可以选择将一些代码合成为 verilog 内置原语?
问题描述
我以为techmap
没有任何争论就可以做到,但事实并非如此。可能我误解了“逻辑综合”的含义。
基本示例:
AND_GATE.v:
module AND_GATE( input A, input B, output X);
assign X = A & B;
endmodule
yosys> read_verilog AND_GATE.v
yosys> synth
....................
Number of wires: 3
Number of wire bits: 3
Number of public wires: 3
Number of public wire bits: 3
Number of memories: 0
Number of memory bits: 0
Number of processes: 0
Number of cells: 1
$_AND_ 1
yosys> abc -g AND,NAND,OR,NOR,XOR,XNOR
........................
3.1.2. Re-integrating ABC results.
ABC RESULTS: AND cells: 1
ABC RESULTS: internal signals: 0
ABC RESULTS: input signals: 2
ABC RESULTS: output signals: 1
Removing temp directory.
yosys> clean
Removed 0 unused cells and 3 unused wires.
yosys> write_verilog net.v
网络.v
module AND_GATE(A, B, X);
(* src = "AND_GATE.v:1" *)
input A;
(* src = "AND_GATE.v:1" *)
input B;
(* src = "AND_GATE.v:1" *)
output X;
assign X = B & A;
endmodule
解决方案
使用类似的东西synth; abc -g AND,NAND,OR,NOR,XOR,XNOR
将映射到一组与 Verilog 原语等效的基本门 -techmap
它本身也不会让你远离 - 但是 Yosys verilog 后端没有使用内置原语的选项,它总是写大门作为他们的表达方式。
推荐阅读
- laravel-5.6 - Laravel-'auth' 中间件不起作用
- laravel - 针对用户不同角色的基于角色的身份验证
- c# - 如何读取大txt文件并在PostgreSQL中添加数据?
- api - 我在子文件夹上部署时出现 Swashbuckle 根错误
- angular - 简单的 Angular 2 Plunker 不工作
- javascript - R shinydashboard - 根据用户输入显示/隐藏多个菜单项
- c# - NI LabVIEW中的AES加密
- php - 无法通过使用标头功能重定向访问其他页面上的会话?
- post - _this.testFormEl.nativeElement.submit 不是 Form Post 的函数
- serialization - 协议缓冲区的长度前缀帧示例