A Programmable BIST for DRAM Testing and Diagnosis