print total non tap or fill cells

This commit is contained in:
matt venn
2023-03-14 15:13:34 +01:00
parent ada59f5679
commit efb4dc5959
+7 -1
View File
@@ -444,7 +444,7 @@ class Project():
# Print the summaries # Print the summaries
def summarize(self): def summarize(self):
cell_count = self.get_cell_count_from_gl() cell_count = self.get_cell_counts_from_gl()
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(script_dir, 'categories.json')) as fh: with open(os.path.join(script_dir, 'categories.json')) as fh:
@@ -469,6 +469,7 @@ class Project():
if self.args.print_cell_category: if self.args.print_cell_category:
by_category = {} by_category = {}
total = 0
for cell_name in cell_count: for cell_name in cell_count:
cat_index = categories['map'][cell_name] cat_index = categories['map'][cell_name]
cat_name = categories['categories'][cat_index] cat_name = categories['categories'][cat_index]
@@ -478,6 +479,9 @@ class Project():
else: else:
by_category[cat_name] = {'count' : cell_count[cell_name], 'examples' : [cell_name]} by_category[cat_name] = {'count' : cell_count[cell_name], 'examples' : [cell_name]}
if cat_name not in ['Fill', 'Tap']:
total += cell_count[cell_name]
print('# Cell usage by Category') print('# Cell usage by Category')
print() print()
print('| Category | Cells | Count |') print('| Category | Cells | Count |')
@@ -486,6 +490,8 @@ class Project():
cell_links = [f'[{name}]({CELL_URL}{name})' for name in cat_dict['examples']] cell_links = [f'[{name}]({CELL_URL}{name})' for name in cat_dict['examples']]
print(f'|{cat_name} | {" ".join(cell_links)} | {cat_dict["count"]}|') print(f'|{cat_name} | {" ".join(cell_links)} | {cat_dict["count"]}|')
print(f'## {total} total cells (excluding fill and tap cells)')
# get cell count from synth report # get cell count from synth report
def get_cell_count_from_synth(self): def get_cell_count_from_synth(self):
num_cells = 0 num_cells = 0