【发布时间】:2015-10-27 05:17:35
【问题描述】:
我对 Verilog 完全不熟悉,并且对控制台打印的错误有些担心。我知道总是块不允许电线 - 我不确定 assign 会做什么,但我知道 initialize 肯定不会产生我想要的。我不确定如何阅读或解释错误,并且我在网上查看过,但似乎没有找到与我的具体错误相关的太多内容。
module project(input [2:0] p1, input [2:0] p2, input m1, input m2, output reg [6:0] winner);
// reg mo; //not allowed
// reg mop; //not allowed
always @(*)
begin
if(m1 > 0 )
case(0)
0: winner = 16;
//1: mo = 32;
//2: mo = 64;
//4: mo = 16;
endcase
if(m2 > 0 )
case(0)
0: winner = 1;
//16: mop = 2;
//32: mop = 1;
//64: mop = 4;
endcase
winner = 0;
case(p1 + p2 + m1 + m2)
//rock1 & rock2 => tie no one wins
17: winner = 0;
//rock1 & paper2 => player2 won with paper
33: winner = p2;
//rock1 & scissors2 => player1 won with rock
65: winner = p1;
//paper1 & rock2 => player1 won with paper
18: winner = p1;
//paper1 & paper2 => tie no one wins
34: winner = 0;
//paper1 & scissors2 => player2 won with scissors
66: winner = p2;
//scissors1 & rock2 => player2 won with rock
20: winner = p2;
//scissors1 & paper2 => player1 won with scissors
36: winner = p1;
//scissors1 & scissors2 => tie no one wins
68: winner = 0;
endcase
end
endmodule
至于我的错误:
WARNING:Par:283 - There are 8 loadless signals in this design. This design will cause Bitgen to issue DRC warnings.
WARNING:Par:288 - The signal p1<0>_IBUF has no load. PAR will not attempt to route this signal.
WARNING:Par:288 - The signal p1<1>_IBUF has no load. PAR will not attempt to route this signal.
WARNING:Par:288 - The signal p1<2>_IBUF has no load. PAR will not attempt to route this signal.
WARNING:Par:288 - The signal p2<0>_IBUF has no load. PAR will not attempt to route this signal.
WARNING:Par:288 - The signal m1_IBUF has no load. PAR will not attempt to route this signal.
WARNING:Par:288 - The signal m2_IBUF has no load. PAR will not attempt to route this signal.
WARNING:Par:288 - The signal p2<1>_IBUF has no load. PAR will not attempt to route this signal.
WARNING:Par:288 - The signal p2<2>_IBUF has no load. PAR will not attempt to route this signal.
WARNING:PhysDesignRules:367 - The signal <p1<0>_IBUF> is incomplete. The signal
does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <p1<1>_IBUF> is incomplete. The signal
does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <p1<2>_IBUF> is incomplete. The signal
does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <p2<0>_IBUF> is incomplete. The signal
does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <m1_IBUF> is incomplete. The signal
does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <m2_IBUF> is incomplete. The signal
does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <p2<1>_IBUF> is incomplete. The signal
does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <p2<2>_IBUF> is incomplete. The signal
does not drive any load pins in the design.
我为多行表示歉意,但我认为发生的情况是一样的,所以如果我能找出一个,我就可以做下一个。如果我的问题令人困惑,我深表歉意,感谢您所有的时间和帮助查看这些乱七八糟的代码。我为凌乱的代码道歉——如果有人甚至可以认为它是代码的话。谢谢!
【问题讨论】: