From 5ff3d3d61cc5d916a398e15d6a66e9b32078654e Mon Sep 17 00:00:00 2001 From: Yunsup Lee Date: Sun, 2 Oct 2016 15:49:58 -0700 Subject: [PATCH] correctly initialize with seed --- vsrc/TestDriver.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vsrc/TestDriver.v b/vsrc/TestDriver.v index 11102bf0..d59ab83f 100644 --- a/vsrc/TestDriver.v +++ b/vsrc/TestDriver.v @@ -21,6 +21,12 @@ module TestDriver; reg [1023:0] vcdfile = 0; initial begin + // do not delete the line below + // $random function needs to be called with the seed once + // to affect all the downstream $random functions within the + // Chisel-generated Verilog code + $fdisplay(stderr, "seed %0d, testing $random %0x", unsigned'($get_initial_random_seed), $random($get_initial_random_seed)); + $value$plusargs("max-cycles=%d", max_cycles); verbose = $test$plusargs("verbose"); `ifdef DEBUG