The embodiment of the invention provides a detection method and device for a storage unit of a
chip, and the method comprises the steps: generating a scanning mode entering instruction, and calling a joint test behavior organization interface to control the
chip to enter a scanning mode based on the scanning mode entering instruction; in a scan mode, generating a
scan chain for the storage unit through the register; the
scan chain comprises a first storage built-in self-test
scan chain which is generated for the register and aims at the native storage unit, and a second storage built-in self-test scan chain which aims at the customized storage unit; when it is judged that the storage unit has a fault, scanning data aiming at the storage unit is obtained through the first storage built-in self-test scanning chain and the second storage built-in self-test scanning chain, and a first count value is obtained by resetting a counter; the storage unit is detected based on the scanning data and the first count value, multiple diagnosis
modes can be provided for detecting the storage unit, and therefore the detection efficiency of the on-
chip storage unit is improved.