projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5f38f8
)
tests: fsm to use a randomly-generated seed
author
Eddie Hung
<eddie@fpgeh.com>
Fri, 24 Apr 2020 21:31:33 +0000
(14:31 -0700)
committer
Eddie Hung
<eddie@fpgeh.com>
Fri, 24 Apr 2020 21:31:33 +0000
(14:31 -0700)
tests/fsm/generate.py
patch
|
blob
|
history
diff --git
a/tests/fsm/generate.py
b/tests/fsm/generate.py
index c8eda0cd166ddadbbb2ac39acef84ea19ebc99b8..784e5a054688e125f9a5c00514f1353613aee50b 100644
(file)
--- 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: