cvw/synthDC/extractSummary.py

29 lines
1.0 KiB
Python
Raw Normal View History

2022-03-03 00:22:14 +00:00
#!/usr/bin/python3
# Shreya Sanghai (ssanghai@hmc.edu) 2/28/2022
import glob
import re
import csv
2022-03-07 00:08:47 +00:00
field_names = [ 'Name', 'Critical Path Length', 'Cell Area', 'Synth Time']
data = []
for name in glob.glob("/home/ssanghai/riscv-wally/synthDC/runs/*/reports/wallypipelinedcore_qor.rep"):
f = open(name, 'r')
2022-02-28 17:33:15 +00:00
# trimName = re.search("runs\/(.*?)\/reports", name).group(1)
trimName = re.search("wallypipelinedcore_(.*?)_sky9",name).group(1)
for line in f:
if "Critical Path Length" in line:
pathLen = re.search("Length: *(.*?)\\n", line).group(1)
if "Cell Area" in line:
area = re.search("Area: *(.*?)\\n", line).group(1)
2022-03-07 00:08:47 +00:00
if "Overall Compile Time" in line:
time = re.search("Time: *(.*?)\\n", line).group(1)
data += [{'Name' : trimName, 'Critical Path Length': pathLen, 'Cell Area' : area, 'Synth Time' :time}]
with open('Summary.csv', 'w') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=field_names)
writer.writeheader()
writer.writerows(data)