0
我正尝试使用verilog连接Altera FPGA上的两个引脚。fpga在verilog中将inout引脚分配给输入引脚
具体而言,我将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问号(?)运算符]的可能的副本(http://stackoverflow.com/questions/12336139/verilog-question-mark-operator) –
您提到的代码不是解决方案,而是不正确的代码示例:“例如,以下设计不正确地合成”。 – Qiu