mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
style: fix lint errors + reformat source with black
This commit is contained in:
+93
-21
@@ -1,39 +1,111 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import logging
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from project import Project
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="TT setup")
|
||||
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('--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)
|
||||
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(
|
||||
"--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
|
||||
parser.add_argument('--print-cell-summary', help="print summary", action="store_const", const=True, default=False)
|
||||
parser.add_argument('--print-cell-category', help="print category", action="store_const", const=True, default=False)
|
||||
parser.add_argument('--print-stats', help="print some stats from the run", action="store_const", const=True)
|
||||
parser.add_argument('--print-warnings', help="print any warnings", action="store_const", const=True)
|
||||
parser.add_argument('--print-wokwi-id', help="prints the Wokwi project id", action="store_const", const=True)
|
||||
parser.add_argument(
|
||||
"--print-cell-summary",
|
||||
help="print summary",
|
||||
action="store_const",
|
||||
const=True,
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--print-cell-category",
|
||||
help="print category",
|
||||
action="store_const",
|
||||
const=True,
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--print-stats",
|
||||
help="print some stats from the run",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--print-warnings", help="print any warnings", action="store_const", const=True
|
||||
)
|
||||
parser.add_argument(
|
||||
"--print-wokwi-id",
|
||||
help="prints the Wokwi project id",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
|
||||
# documentation
|
||||
parser.add_argument('--check-docs', help="check the documentation part of the yaml", action="store_const", const=True)
|
||||
parser.add_argument('--create-pdf', help="create a single page PDF", action="store_const", const=True)
|
||||
parser.add_argument('--create-svg', help="create a svg of the GDS layout", action="store_const", const=True)
|
||||
parser.add_argument('--create-png', help="create a png of the GDS layout", action="store_const", const=True)
|
||||
parser.add_argument(
|
||||
"--check-docs",
|
||||
help="check the documentation part of the yaml",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--create-pdf",
|
||||
help="create a single page PDF",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--create-svg",
|
||||
help="create a svg of the GDS layout",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--create-png",
|
||||
help="create a png of the GDS layout",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
|
||||
# configure
|
||||
parser.add_argument('--create-user-config', help="create the user_config.tcl file with top module and source files", action="store_const", const=True)
|
||||
parser.add_argument('--harden', help="use a local OpenLane install to harden the project", action="store_const", const=True)
|
||||
parser.add_argument(
|
||||
"--create-user-config",
|
||||
help="create the user_config.tcl file with top module and source files",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--harden",
|
||||
help="use a local OpenLane install to harden the project",
|
||||
action="store_const",
|
||||
const=True,
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# setup log
|
||||
log_format = logging.Formatter('%(asctime)s - %(module)-10s - %(levelname)-8s - %(message)s')
|
||||
log_format = logging.Formatter(
|
||||
"%(asctime)s - %(module)-10s - %(levelname)-8s - %(message)s"
|
||||
)
|
||||
# configure the client logging
|
||||
log = logging.getLogger('')
|
||||
log = logging.getLogger("")
|
||||
# has to be set to debug as is the root logger
|
||||
log.setLevel(args.loglevel)
|
||||
|
||||
@@ -43,7 +115,7 @@ if __name__ == '__main__':
|
||||
ch.setFormatter(log_format)
|
||||
log.addHandler(ch)
|
||||
|
||||
project = Project(0, 'unknown', args.project_dir, args, is_user_project=True)
|
||||
project = Project(0, "unknown", args.project_dir, args, is_user_project=True)
|
||||
project.post_clone_setup()
|
||||
|
||||
# handle the options
|
||||
|
||||
Reference in New Issue
Block a user