tested user project stuff, docs, metrics, working on caravel

This commit is contained in:
matt venn
2023-03-14 13:26:19 +01:00
parent c903467adb
commit ada59f5679
3 changed files with 30 additions and 5 deletions
+1
View File
@@ -52,6 +52,7 @@ class CaravelConfig():
if row == 0 and col <= 1:
continue
logging.debug(self.num_projects)
if num_macros_placed < self.num_projects:
if orientation == 'N':
# scanchain first
+11 -3
View File
@@ -56,17 +56,21 @@ class Projects():
continue
if args.end_at != 0 and index > args.end_at:
continue
if self.project_config[index]['status'] == 'disable':
continue
"""
try:
email = self.git_url_to_email_map[git_url]
except KeyError:
email = 'none'
"""
git_url = self.project_config[index]['url']
filler = self.project_config[index]['fill']
# not sure if this is a good idea
if self.project_config[index]['status'] == 'disable':
filler = True
# fill projects don't have their own directory, reuse the first project which is always fill
if filler:
project_dir = os.path.join(os.path.join(self.project_dir, f'{0 :03}'))
@@ -123,6 +127,8 @@ class Projects():
all_gds_files = [project.get_macro_gds_filename() for project in self.projects if not project.is_fill()]
self.assert_unique(all_gds_files)
logging.info(f"loaded {len(self.projects)} projects")
def assert_unique(self, check):
duplicates = [item for item, count in collections.Counter(check).items() if count > 1]
if duplicates:
@@ -136,8 +142,10 @@ class Projects():
total_physical_cells = 0
max_cells = 0
min_cells = 1000
max_cell_project = None
max_util = 0
min_util = 100
max_util_project = None
languages = {}
for project in self.projects:
@@ -149,7 +157,7 @@ class Projects():
total_wire_length += int(project.metrics['wire_length'])
total_wires_count += int(project.metrics['wires_count'])
util = float(project.metrics['OpenDP_Util'])
num_cells = project.check_num_cells()
num_cells = project.get_cell_count_from_synth()
total_physical_cells += num_cells
yaml_data = project.get_project_doc_yaml()
+18 -2
View File
@@ -63,7 +63,7 @@ class Project():
exit(1)
def check_num_cells(self):
num_cells = self.get_cell_count_from_gl()
num_cells = self.get_cell_count_from_synth()
if self.is_hdl():
if num_cells < 20:
logging.warning(f"{self} only has {num_cells} cells")
@@ -486,8 +486,24 @@ class Project():
cell_links = [f'[{name}]({CELL_URL}{name})' for name in cat_dict['examples']]
print(f'|{cat_name} | {" ".join(cell_links)} | {cat_dict["count"]}|')
# get cell count from synth report
def get_cell_count_from_synth(self):
num_cells = 0
try:
yosys_report = glob.glob(f'{self.local_dir}/runs/wokwi/reports/synthesis/1-synthesis.*0.stat.rpt')[0] # can't open a file with \ in the path
with open(yosys_report) as fh:
for line in fh.readlines():
m = re.search(r'Number of cells:\s+(\d+)', line)
if m is not None:
num_cells = int(m.group(1))
except IndexError:
logging.warning(f"couldn't open yosys cell report for cell checking {self}")
return num_cells
# Parse the lib, cell and drive strength an OpenLane gate-level Verilog file
def get_cell_count_from_gl(self):
def get_cell_counts_from_gl(self):
cell_count = {}
total = 0
gl_files = glob.glob(os.path.join(self.local_dir, 'runs/wokwi/results/final/verilog/gl/*.nl.v'))