我正在做一個數字模塊的綜合,我需要一個D觸發器與2異步復位。 (原因是,我將推動一個復位與可用的時鐘,我將使用第二個重置我的數碼塊的所有寄存器) 我準備了下面的代碼:D觸發器與2重置:綜合錯誤
module dff_2rst(q,qn,clk,d, rst,clear);
input clk,d, rst, clear ;
output q,qn;
reg q,qn;
always @(posedge clk or posedge rst or posedge clear) //asynchronous reset
begin
(* full_case, parallel_case *)
case({rst, clear})
2'b00: begin
q <= d;
qn<=~d;
end
default: begin
q <= 1'b0;
qn <=1'b1;
end
endcase
end
endmodule
,但我得到以下錯誤:
The statements in this 'always' block are outside the scope of the synthesis policy. Only an 'if' statement is allowed at the top level in this always block. (ELAB-302)
*** Presto compilation terminated with 1 errors. ***
我也試圖與
if(~rst & ~clear)
,但我有錯誤了。
你有想法糾正我的代碼嗎?非常感謝!
不要定義爲REG,作爲電線離開。 – Morgan
'reg q,qn;'應該是'reg q;' – Morgan
我試過了,但是我得到錯誤'Assigment to'qn'要求它是一個寄存器。 (VER-952)' –