mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
tested user project stuff, docs, metrics, working on caravel
This commit is contained in:
@@ -52,6 +52,7 @@ class CaravelConfig():
|
|||||||
if row == 0 and col <= 1:
|
if row == 0 and col <= 1:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
logging.debug(self.num_projects)
|
||||||
if num_macros_placed < self.num_projects:
|
if num_macros_placed < self.num_projects:
|
||||||
if orientation == 'N':
|
if orientation == 'N':
|
||||||
# scanchain first
|
# scanchain first
|
||||||
|
|||||||
+11
-3
@@ -56,17 +56,21 @@ class Projects():
|
|||||||
continue
|
continue
|
||||||
if args.end_at != 0 and index > args.end_at:
|
if args.end_at != 0 and index > args.end_at:
|
||||||
continue
|
continue
|
||||||
if self.project_config[index]['status'] == 'disable':
|
|
||||||
continue
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
email = self.git_url_to_email_map[git_url]
|
email = self.git_url_to_email_map[git_url]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
email = 'none'
|
email = 'none'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
git_url = self.project_config[index]['url']
|
git_url = self.project_config[index]['url']
|
||||||
filler = self.project_config[index]['fill']
|
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
|
# fill projects don't have their own directory, reuse the first project which is always fill
|
||||||
if filler:
|
if filler:
|
||||||
project_dir = os.path.join(os.path.join(self.project_dir, f'{0 :03}'))
|
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()]
|
all_gds_files = [project.get_macro_gds_filename() for project in self.projects if not project.is_fill()]
|
||||||
self.assert_unique(all_gds_files)
|
self.assert_unique(all_gds_files)
|
||||||
|
|
||||||
|
logging.info(f"loaded {len(self.projects)} projects")
|
||||||
|
|
||||||
def assert_unique(self, check):
|
def assert_unique(self, check):
|
||||||
duplicates = [item for item, count in collections.Counter(check).items() if count > 1]
|
duplicates = [item for item, count in collections.Counter(check).items() if count > 1]
|
||||||
if duplicates:
|
if duplicates:
|
||||||
@@ -136,8 +142,10 @@ class Projects():
|
|||||||
total_physical_cells = 0
|
total_physical_cells = 0
|
||||||
max_cells = 0
|
max_cells = 0
|
||||||
min_cells = 1000
|
min_cells = 1000
|
||||||
|
max_cell_project = None
|
||||||
max_util = 0
|
max_util = 0
|
||||||
min_util = 100
|
min_util = 100
|
||||||
|
max_util_project = None
|
||||||
languages = {}
|
languages = {}
|
||||||
|
|
||||||
for project in self.projects:
|
for project in self.projects:
|
||||||
@@ -149,7 +157,7 @@ class Projects():
|
|||||||
total_wire_length += int(project.metrics['wire_length'])
|
total_wire_length += int(project.metrics['wire_length'])
|
||||||
total_wires_count += int(project.metrics['wires_count'])
|
total_wires_count += int(project.metrics['wires_count'])
|
||||||
util = float(project.metrics['OpenDP_Util'])
|
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
|
total_physical_cells += num_cells
|
||||||
|
|
||||||
yaml_data = project.get_project_doc_yaml()
|
yaml_data = project.get_project_doc_yaml()
|
||||||
|
|||||||
+18
-2
@@ -63,7 +63,7 @@ class Project():
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
def check_num_cells(self):
|
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 self.is_hdl():
|
||||||
if num_cells < 20:
|
if num_cells < 20:
|
||||||
logging.warning(f"{self} only has {num_cells} cells")
|
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']]
|
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"]}|')
|
||||||
|
|
||||||
|
# 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
|
# 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 = {}
|
cell_count = {}
|
||||||
total = 0
|
total = 0
|
||||||
gl_files = glob.glob(os.path.join(self.local_dir, 'runs/wokwi/results/final/verilog/gl/*.nl.v'))
|
gl_files = glob.glob(os.path.join(self.local_dir, 'runs/wokwi/results/final/verilog/gl/*.nl.v'))
|
||||||
|
|||||||
Reference in New Issue
Block a user