Semiconductor device, physical quantity sensor, electronic apparatus, and moving object
A semiconductor device includes a digital circuit having a scan test mode. The digital circuit includes a first flip-flop forming a part of a scan chain when in the scan test mode, and a first selector provided on an input side of the first flip-flop. The first selector is capable of selecting a first signal when not in the scan test mode, and selecting a second signal that is different from the first signal when in the scan test mode.
1. A semiconductor device comprising:
a digital circuit including a first selector, a first flip-flop, a first logic element, a second flip-flop, and a second logic element, wherein the digital circuit is operable in a normal operation mode and a scan test mode different from the normal mode; and
an analog circuit providing an input signal to the digital circuit, wherein:
in the normal operation mode, the first selector of the digital circuit selects the input signal from the analog circuit, and the input signal propagates in an order of the first selector, the first flip-flop, the first logic element, the second flip-flop, and the second logic element, and
in the scan test mode, the first selector selects a signal based on an output signal from the second logic element.
2. The semiconductor device according to claim 1 wherein, in the scan test mode:
the first flip-flop and the second flip-flop form a part of a scan chain, and
a scan in signal is held in the first flip-flop and is inputted to the first logic element from the first flip-flop.
3. The semiconductor device according to claim 1 wherein:
the digital circuit receives a scan enable signal,
in the scan test mode, the first flip-flop and the second flip-flop form a part of a scan chain,
in the scan test mode and with the scan enable signal in a first state, a scan in signal is held in the first flip-flop and provided to the second flip-flop while bypassing the first logic element, and
in the scan test mode and with the scan enable signal in a second state, the scan in signal is held in the first flip-flop and is inputted to the first logic element.
4. The semiconductor device according to claim 1 wherein the first selector is provided on an input side of the first flip-flop.
5. The semiconductor device according to claim 1 wherein, in the scan test mode, the signal selected by the first selector is an output signal from the digital circuit to the analog circuit.
6. The semiconductor device according to claim 1 wherein, in the scan test mode, the signal selected by the first selector is a signal inputted to a third logic element in which a logic level of an output signal is fixed.
7. The semiconductor device according to claim 1 wherein, in the scan test mode, a logic level of the input signal is fixed.
8. The semiconductor device according to claim 1 , wherein;
the digital circuit includes a third flip-flop that forms a part of the scan chain when in the scan test mode, and
the first selector selects the input signal or the signal based on the output signal from the second flip-flop in response to an output signal from the third flip-flop when in the scan test mode.