[HDL] Add new Scan-chain DFF cell

This commit is contained in:
tangxifan 2020-11-30 17:54:10 -07:00
parent ad703ad85b
commit ff53d2c375
1 changed files with 31 additions and 0 deletions

View File

@ -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