【发布时间】:2017-05-09 17:05:52
【问题描述】:
我正在尝试使用 verilog 连接 Altera FPGA 上的两个引脚。
具体来说,我将inout 引脚连接到input 引脚。我得到了错误。
引脚“
”有多个驱动程序
此链接上解释了该错误。
这是解决方案:
module multi_driver(inout o, input a, b, en);
// Input a directly drives the bidir pin w/o a tri-state condition
assign o = a;
// If en = 1 below, there will be an electrical conflict in the design.
// To avoid this possibility, the Quartus II software issues an error
assign o = (en) ? b : 1'bz;
endmodule
有人能解释一下assign o = (en) ? b : 1'bz; 的确切作用吗?
【问题讨论】:
-
您提到的代码不是解决方案,而是错误代码的示例:“例如,以下设计合成错误”。
标签: verilog fpga intel-fpga