6

I'm a bit confused about what is considered an input when you use the wildcard @* in an always block sensitivity list. For instance, in the following example which signals are interpreted as inputs that cause the always block to be reevaluated? From what I understand clk and reset aren't included because they dont appear on the right hand side of any procedural statement in the always block. a and b are included because they both appear on the right hand side of procedural statements in the always block. But where I'm really confused about is en and mux. Because they are used as test conditions in the if and case statements are they considered inputs? Is the always block reevaluated each time en and mux change value? I'm pretty much a noob, and in the 3 Verilog books I have I haven't found a satisfactory explanation. I've always found the explanations here to be really helpful. Thanks

module example
( 
    input wire clk, reset, en, a, b,
    input wire [1:0] mux,
    output reg x,y, z
);

always @*    
begin  
 x = a & b;    
  if (en)
    y= a | b;
  case(mux)
    2'b00: z = 0;
    2'b01: z = 1;
    2'b10: z = 1;
    2'b11: z = 0;
  endcase
end
endmodule
4

3 に答える 3

11

ブロック内で読み取られ、ブロックの値が変更された場合にブロックの結果が変更される可能性がある信号は、 に含まれ@*ます。使用される読み取り信号が変更されると、ブロックの出力が変更される可能性があるため、ブロックを再評価する必要があります。ご存知のとおり、使用していなかった場合は、@*これらの信号を手動でリストすることになります。

あなたが提供したコードの場合、それは次のようなシグナルです:

  • 代入の右辺で評価 ( aand b)
  • 条件 ( enand mux)の一部として評価される

...しかし、何らかの理由で評価されるのは任意のシグナルです。(今のところ他の理由は思いつきませんが、他の誰かが考えられるかもしれません)

clkこれらは使用されてresetいないため、機密リストには含まれていません。そのような単純な。それらについて特別なことは何もありません。それらは他の信号と同じです。

于 2012-03-12T00:50:40.767 に答える
4

あなたの例では、次のシグナルが暗黙的な機密リストに含まれています。

a
b
en
mux

clk機密リストの一部ではありresetません。

これは、Verilog の IEEE Std (たとえば、1800-2009) で完全に説明されています。IEEE 仕様は、Verilog に関する詳細情報の最良の情報源です。シミュレーターのドキュメントにも、どのように機能するかが記載されている場合があります@*

于 2012-03-11T23:40:53.460 に答える