А вот рекомендации от Synplify:
Код
@W: Latch generated from always block for signal <out1>,
probably caused by a missing assignment in an if or case stmt
Verilog Compiler Warning CL118
Description:
This warning appears if all conditions are not declared in a case statement or if an if statement exists describing purely combinatorial logic. The compiler infers a latch. In the following test case, a latch is generated for signal out1 because the if condition sel = 2'b00 is missing.
module newmux (out1, a, b, c, sel);
input a, b, c;
output out1;
input[1:0] sel;
reg out1;
always@(a or b or c or sel)
begin
if (sel ==2'b10)
out1 = a;
else if (sel == 2'b01)
out1 = b;
else if (sel == 2'b11)
out1 = c;
end
endmodule
User Action:
Three ways to avoid this warning are:
Complete the if clause by using the else clause in an if-then-else statement.
Always use a default clause in a case statement.
Use the Verilog full_case directive, /* synthesis full_case */, if the case statement includes all possible case choices.
To eliminate the warning in the above test case, edit the code as shown in the corrected test case below.
module newmux (out1, a, b, c, sel);
input a, b, c;
output out1;
input[1:0] sel;
reg out1;
always@(a or b or c or sel)
begin
if (sel ==2'b10)
out1 = a;
else if (sel == 2'b01)
out1 = b;
else if (sel == 2'b11)
out1 = c;
else out1 = a;
end
endmodule
Действительно правильнее делать блокирующее прерывание.
Вообще в help на Ваш синтезатор много можно почерпнуть при решении тех или иных проблем.
Сообщение отредактировал lehho - Apr 28 2007, 15:02