[英]How to use multi-input logic gates in Chisel3?
I am implementing a Carry Lookahead Adder using Chisel3.我正在使用 Chisel3 实现一个进位超前加法器。 In order to shorten latency, I need to use multi-input logic gate.
为了缩短延迟,我需要使用多输入逻辑门。
However, even if I write code like但是,即使我编写类似的代码
io.out:= a | b | c | d | e
, the generated verilog code will be like ,生成的verilog代码会像
assign _T = a | b
assign _T_1 = _T | c
assign _T_2 = _T_1 | d
assign io_out = _T_2 | e
which uses 4 OR gates, and leads to 4x gate delay.它使用 4 个 OR 门,并导致 4x 门延迟。
I am wondering that is there a way to generate multi-input logic gates?我想知道有没有办法生成多输入逻辑门? Such as
如
assign io_out = a | b | c | d | e
or或者
or (io_out, a, b, c, d,e)
One work around would be to construct a multi input OR gate class where you can define how you want the connections to be made so that the translations happen the way you want.一种解决方法是构建一个多输入或门 class ,您可以在其中定义您希望如何进行连接,以便以您想要的方式进行翻译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.