Patent attributes
A scan flip-flop includes a selection circuit, a primary latch, a secondary latch, and a data retention latch. The selection circuit selects and outputs one of functional data, first reference data, scan data, and first control data as second reference data. The primary latch receives the second reference data and outputs third reference data, whereas the secondary latch receives the third reference data and outputs second control data. The second control data is then provided to a subsequent scan flip-flop of a scan chain. The data retention latch receives one of the third reference data and the second control data, and outputs and provides the first reference data to the selection circuit. The first reference data corresponds to functional data retained in the scan flip-flop during a structural testing mode associated with the scan chain.