2014-08-07 09:14:38 -05:00
|
|
|
(* techmap_celltype = "$adff" *)
|
|
|
|
module adff2dff (CLK, ARST, D, Q);
|
|
|
|
parameter WIDTH = 1;
|
|
|
|
parameter CLK_POLARITY = 1;
|
|
|
|
parameter ARST_POLARITY = 1;
|
|
|
|
parameter ARST_VALUE = 0;
|
|
|
|
|
|
|
|
input CLK, ARST;
|
2020-05-18 11:15:03 -05:00
|
|
|
(* force_downto *)
|
2014-08-07 09:14:38 -05:00
|
|
|
input [WIDTH-1:0] D;
|
2020-05-18 11:15:03 -05:00
|
|
|
(* force_downto *)
|
2014-08-07 09:14:38 -05:00
|
|
|
output reg [WIDTH-1:0] Q;
|
2020-05-18 11:15:03 -05:00
|
|
|
(* force_downto *)
|
2021-02-23 05:12:37 -06:00
|
|
|
reg [WIDTH-1:0] NEXT_Q;
|
2014-08-07 09:14:38 -05:00
|
|
|
|
|
|
|
wire [1023:0] _TECHMAP_DO_ = "proc;;";
|
|
|
|
|
|
|
|
always @*
|
|
|
|
if (ARST == ARST_POLARITY)
|
|
|
|
NEXT_Q <= ARST_VALUE;
|
|
|
|
else
|
|
|
|
NEXT_Q <= D;
|
|
|
|
|
|
|
|
if (CLK_POLARITY)
|
|
|
|
always @(posedge CLK)
|
|
|
|
Q <= NEXT_Q;
|
|
|
|
else
|
|
|
|
always @(negedge CLK)
|
|
|
|
Q <= NEXT_Q;
|
|
|
|
endmodule
|