mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat: initial support for openlane2 user projects
This commit is contained in:
+11
-1
@@ -261,6 +261,9 @@ class Project():
|
|||||||
# metrics
|
# metrics
|
||||||
def get_metrics_path(self):
|
def get_metrics_path(self):
|
||||||
if self.is_user_project:
|
if self.is_user_project:
|
||||||
|
if self.args.openlane2:
|
||||||
|
return os.path.join(self.local_dir, 'runs/wokwi/final/metrics.csv')
|
||||||
|
else:
|
||||||
return os.path.join(self.local_dir, 'runs/wokwi/reports/metrics.csv')
|
return os.path.join(self.local_dir, 'runs/wokwi/reports/metrics.csv')
|
||||||
else:
|
else:
|
||||||
return os.path.join(self.local_dir, 'metrics.csv')
|
return os.path.join(self.local_dir, 'metrics.csv')
|
||||||
@@ -474,6 +477,8 @@ class Project():
|
|||||||
# SVG and PNG renders of the GDS
|
# SVG and PNG renders of the GDS
|
||||||
def create_svg(self):
|
def create_svg(self):
|
||||||
gds = glob.glob(os.path.join(self.local_dir, 'runs/wokwi/results/final/gds/*gds'))
|
gds = glob.glob(os.path.join(self.local_dir, 'runs/wokwi/results/final/gds/*gds'))
|
||||||
|
if self.args.openlane2:
|
||||||
|
gds = glob.glob(os.path.join(self.local_dir, 'runs/wokwi/final/gds/*gds'))
|
||||||
library = gdstk.read_gds(gds[0])
|
library = gdstk.read_gds(gds[0])
|
||||||
top_cells = library.top_level()
|
top_cells = library.top_level()
|
||||||
top_cells[0].write_svg('gds_render.svg')
|
top_cells[0].write_svg('gds_render.svg')
|
||||||
@@ -483,7 +488,10 @@ class Project():
|
|||||||
|
|
||||||
def print_warnings(self):
|
def print_warnings(self):
|
||||||
warnings = []
|
warnings = []
|
||||||
with open(os.path.join(self.local_dir, 'runs/wokwi/logs/synthesis/1-synthesis.log')) as f:
|
synth_log = 'runs/wokwi/logs/synthesis/1-synthesis.log'
|
||||||
|
if self.args.openlane2:
|
||||||
|
synth_log = 'runs/wokwi/02-yosys-synthesis/yosys-synthesis.log'
|
||||||
|
with open(os.path.join(self.local_dir, synth_log)) as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
if line.startswith('Warning:'):
|
if line.startswith('Warning:'):
|
||||||
# bogus warning https://github.com/YosysHQ/yosys/commit/bfacaddca8a2e113e4bc3d6177612ccdba1555c8
|
# bogus warning https://github.com/YosysHQ/yosys/commit/bfacaddca8a2e113e4bc3d6177612ccdba1555c8
|
||||||
@@ -573,6 +581,8 @@ class Project():
|
|||||||
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'))
|
||||||
|
if self.args.openlane2:
|
||||||
|
gl_files = glob.glob(os.path.join(self.local_dir, 'runs/wokwi/final/nl/*.nl.v'))
|
||||||
with open(gl_files[0]) as fh:
|
with open(gl_files[0]) as fh:
|
||||||
for line in fh.readlines():
|
for line in fh.readlines():
|
||||||
m = re.search(r'sky130_(\S+)__(\S+)_(\d+)', line)
|
m = re.search(r'sky130_(\S+)__(\S+)_(\d+)', line)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ if __name__ == '__main__':
|
|||||||
parser.add_argument('--project-dir', help="location of the project", default='.')
|
parser.add_argument('--project-dir', help="location of the project", default='.')
|
||||||
parser.add_argument('--yaml', help="the project's yaml configuration file", default='info.yaml')
|
parser.add_argument('--yaml', help="the project's yaml configuration file", default='info.yaml')
|
||||||
parser.add_argument('--debug', help="debug logging", action="store_const", dest="loglevel", const=logging.DEBUG, default=logging.INFO)
|
parser.add_argument('--debug', help="debug logging", action="store_const", dest="loglevel", const=logging.DEBUG, default=logging.INFO)
|
||||||
|
parser.add_argument('--openlane2', help="use openlane 2", action="store_const", const=True, default=False)
|
||||||
|
|
||||||
# reports & summaries
|
# reports & summaries
|
||||||
parser.add_argument('--print-cell-summary', help="print summary", action="store_const", const=True, default=False)
|
parser.add_argument('--print-cell-summary', help="print summary", action="store_const", const=True, default=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user