diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-04-24 14:31:33 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-04-24 14:31:33 -0700 |
commit | 7f203cb019c56e0eaf3387a5f7b49f266d6dd9c6 (patch) | |
tree | 757a38aef20a12f3f73a1cf4204dd05283ffcf64 | |
parent | b5f38f834207fab3a563c55568c4543a3b5dcc1f (diff) | |
download | yosys-7f203cb019c56e0eaf3387a5f7b49f266d6dd9c6.tar.gz yosys-7f203cb019c56e0eaf3387a5f7b49f266d6dd9c6.tar.bz2 yosys-7f203cb019c56e0eaf3387a5f7b49f266d6dd9c6.zip |
tests: fsm to use a randomly-generated seed
-rw-r--r-- | tests/fsm/generate.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/fsm/generate.py b/tests/fsm/generate.py index c8eda0cd1..784e5a054 100644 --- a/tests/fsm/generate.py +++ b/tests/fsm/generate.py @@ -36,9 +36,11 @@ parser.add_argument('-S', '--seed', type = int, help = 'seed for PRNG') parser.add_argument('-c', '--count', type = int, default = 50, help = 'number of test cases to generate') args = parser.parse_args() -if args.seed is not None: - print("PRNG seed: %d" % args.seed) - random.seed(args.seed) +seed = args.seed +if seed is None: + seed = random.randrange(sys.maxsize) +print("PRNG seed: %d" % seed) +random.seed(seed) for idx in range(args.count): with open('temp/uut_%05d.v' % idx, 'w') as f: |