From ff53d2c37539187a6699fff62b2c1ae42ba07512 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Mon, 30 Nov 2020 17:54:10 -0700 Subject: [PATCH] [HDL] Add new Scan-chain DFF cell --- .../openfpga_cell_library/verilog/dff.v | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/openfpga_flow/openfpga_cell_library/verilog/dff.v b/openfpga_flow/openfpga_cell_library/verilog/dff.v index 99bb50c85..e54950827 100644 --- a/openfpga_flow/openfpga_cell_library/verilog/dff.v +++ b/openfpga_flow/openfpga_cell_library/verilog/dff.v @@ -332,6 +332,37 @@ end endmodule //End Of Module +//----------------------------------------------------- +// Function : D-type flip-flop with +// - asynchronous active high reset +// - scan-chain input +// - a scan-chain enable +//----------------------------------------------------- +module SDFFRQ ( + input RST, // Reset input + input CK, // Clock Input + input SE, // Scan-chain Enable + input D, // Data Input + input SI, // Scan-chain input + output Q // Q output +); +//------------Internal Variables-------- +reg q_reg; + +//-------------Code Starts Here--------- +always @ ( posedge CK or posedge RST) +if (RST) begin + q_reg <= 1'b0; +end else if (SE) begin + q_reg <= SI; +end else begin + q_reg <= D; +end + +assign Q = q_reg; + +endmodule //End Of Module + //----------------------------------------------------- // Function : D-type flip-flop with // - asynchronous active high reset