HDL & Verification

Why should the random seed be recorded in tests that use random inputs?

  1. AThe same seed reproduces the same input sequence, so a bug that was found can be re-examined any number of times
  2. BRecording the seed generates random numbers faster
  3. CSimulation will not start unless the seed is recorded
Show answer and explanation

Answer: A. The same seed reproduces the same input sequence, so a bug that was found can be re-examined any number of times

Simulation random numbers are pseudo-random, generated by a fixed procedure from a seed, so the same seed gives the same sequence. If a random test finds a bug but the seed is unknown, the situation cannot be recreated to investigate the cause or to confirm a fix. The standard practice is to run many tests with different seeds and record the seed of any failure.

  • A. Correct. Bugs that cannot be reproduced are hard to fix.
  • B. It has nothing to do with speed.
  • C. Simulation starts without it.
Practice this topic Back to topic

More HDL & Verification questions

  1. Which describes constrained random verification in SystemVerilog?
  2. Which describes regression testing in circuit design?
  3. What is an advantage of SystemVerilog's logic type?
  4. What is the advantage of using SystemVerilog's always_ff and always_comb instead of Verilog's always?
  5. What is the advantage of writing a module with a parameter as above?