[HDL] Add new Scan-chain DFF cell
This commit is contained in:
parent
ad703ad85b
commit
ff53d2c375
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue