Skip to content

Commit e893b42

Browse files
committed
Piping result into object instead of stdout
1 parent 29a4c4c commit e893b42

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/test_yosys.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ def run_yosys(dlist):
1414
# Generic synthesis
1515
proc; opt; flatten; opt
1616
17+
# Get stats
18+
stat
19+
1720
# Write synthesized netlist in Verilog
1821
write_verilog {{ netlist }}
1922
"""
@@ -46,8 +49,13 @@ def run_yosys(dlist):
4649
script = f"{name}.ys"
4750
with open(script, 'w') as f:
4851
f.write(output)
49-
# run
50-
subprocess.run(["yosys", "-s", script], check=True)
52+
# get results
53+
result = subprocess.run(["yosys", "-s", script],
54+
check=True,
55+
capture_output=True,
56+
text=True)
57+
#grab stats here if you like
58+
#print(result)
5159

5260
def test_yosys_basic():
5361
run_yosys(common.basic_list)

0 commit comments

Comments
 (0)