Home › Practice › RTL Design › Memory BIST stuck-at detector
Memory BIST stuck-at detector
MediumDFTRTLFSM
Build a built-in self-test (BIST) controller for a 4-word by 4-bit memory. It writes all-0s, reads them back to catch bits stuck at 1, writes all-1s, and reads them back to catch bits stuck at 0.
Concept first. Memories on a chip are too dense to wire every address and data line out to package pins. Instead, a small state machine right beside the memory generates test patterns, checks the readback, and reports pass or fail on two wires: done and fault. Writing and checking both 0 and 1 at every bit detects any bit line or cell stuck at either value.
What to build.
- Inputs
clk,rst,start,mem_rdata[3:0]. Outputsmem_we,mem_addr[1:0],mem_wdata[3:0],done,fault. rstis synchronous, active-high: it puts the controller in idle withdone=0,fault=0,mem_we=0,mem_addr=0, andmem_wdata=0.- In idle, when
start=1on a risingclkedge, the 16-cycle test begins on the next cycle.startis ignored once running or done. - Four phases of 4 cycles each step
mem_addrthrough0, 1, 2, 3:- Cycles 0–3 (write 0s):
mem_we=1,mem_wdata=4'b0000. - Cycles 4–7 (read 0s):
mem_we=0,mem_wdata=4'b0000. Assume combinational memory read:mem_rdatareflectsmem_addrin the same cycle. Ifmem_rdata != 4'b0000on the rising edge, latchfault=1. - Cycles 8–11 (write 1s):
mem_we=1,mem_wdata=4'b1111. - Cycles 12–15 (read 1s):
mem_we=0,mem_wdata=4'b0000. Ifmem_rdata != 4'b1111on the rising edge, latchfault=1.
- Cycles 0–3 (write 0s):
- On the rising edge finishing cycle 15, enter done:
donebecomes1,mem_we=0,mem_addr=0,mem_wdata=0, and bothdoneandfaultstay latched untilrst=1.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.