A semiconductor device able to improve data retaining characteristics and
decrease power consumption, further able to realize more unrestricted
system without increasing excessive circuits, and having the following:
an ALPG receiving a start signal and a mode selection signal to generate
commands and addresses with respect to a DRAM circuit with the
predetermined patterns in accordance with modes, and outputting an ending
signal when ending a pattern generating processing in each of modes; an
ECC circuit receiving a start signal and a mode selection signal
indicating a parity generation mode to generate a parity based on data
read from the DRAM circuit, receiving the start signal and a mode
selection signal indicating an error correction mode to perform an error
correction with respect to data read from the DRAM circuit based on the
parity generated in the parity generation mode and outputting data after
correcting; and an interface circuit.