我正在合成一个数字块,我需要一个带有 2 个异步复位的 D 触发器。(原因是我将使用可用时钟驱动一个复位,我将使用第二个复位我的数字块的所有寄存器)我准备了以下代码:
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)
但我也有错误。
你有想法纠正我的代码吗?非常感谢!