Home › Practice › Design Verification › Waveform: the counter that stops early
Waveform: the counter that stops early
EasyWaveformdebugcounter
A teammate says their 4-bit counter works. The spec says: while rst is 1 the count goes to 0. Otherwise, on every clock edge where en is 1, the count goes up by one, and it wraps to 0 only after 15. When en is 0 it holds its value. The waveform from their test is below, one column per clock cycle.
Concept first. Debugging a design starts with reading a waveform against the spec. Do not hunt for the strange-looking spot. Instead take the spec as a rule, walk the cycles from the left, and at each cycle ask what the output should be. The bug is the first cycle where the rule and the waveform disagree. Everything after it can be wrong too, but that is only a side effect, so the first one is the one to find.
What to do.
- Walk the output
qfrom the left and compare each value with what the spec says. - Click the cell of
qwhere it first disagrees with the spec, then press Check.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.