mirror of https://github.com/YosysHQ/yosys.git
Added test_verific mode to tests/fsm/generate.py
This commit is contained in:
parent
e5ac8fdf2b
commit
1dd8252169
|
@ -7,6 +7,9 @@ import sys
|
|||
import random
|
||||
from contextlib import contextmanager
|
||||
|
||||
# set to 'True' to compare verific with yosys
|
||||
test_verific = False
|
||||
|
||||
@contextmanager
|
||||
def redirect_stdout(new_target):
|
||||
old_target, sys.stdout = sys.stdout, new_target
|
||||
|
@ -86,6 +89,13 @@ for idx in range(50):
|
|||
print(' end')
|
||||
print('endmodule')
|
||||
with file('temp/uut_%05d.ys' % idx, 'w') as f, redirect_stdout(f):
|
||||
if test_verific:
|
||||
print('read_verilog temp/uut_%05d.v' % idx)
|
||||
print('proc;; rename uut_%05d gold' % idx)
|
||||
print('verific -vlog2k temp/uut_%05d.v' % idx)
|
||||
print('verific -import uut_%05d' % idx)
|
||||
print('rename uut_%05d gate' % idx)
|
||||
else:
|
||||
print('read_verilog temp/uut_%05d.v' % idx)
|
||||
print('proc;;')
|
||||
print('copy uut_%05d gold' % idx)
|
||||
|
|
Loading…
Reference in New Issue