mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
golden harden
This commit is contained in:
+2
-1
@@ -106,7 +106,8 @@ class Projects():
|
|||||||
|
|
||||||
if args.harden:
|
if args.harden:
|
||||||
if filler is False:
|
if filler is False:
|
||||||
project.harden()
|
project.create_user_config()
|
||||||
|
project.golden_harden()
|
||||||
|
|
||||||
if args.update_caravel:
|
if args.update_caravel:
|
||||||
logging.debug("copying files to caravel")
|
logging.debug("copying files to caravel")
|
||||||
|
|||||||
+2
-27
@@ -310,36 +310,11 @@ class Project():
|
|||||||
fh.write(' \\\n')
|
fh.write(' \\\n')
|
||||||
fh.write('"\n')
|
fh.write('"\n')
|
||||||
|
|
||||||
"""
|
def golden_harden(self):
|
||||||
def harden(self):
|
|
||||||
logging.info(f"hardening {self}")
|
logging.info(f"hardening {self}")
|
||||||
|
|
||||||
# copy golden config
|
# copy golden config
|
||||||
shutil.copyfile('golden_config.tcl', os.path.join(self.local_dir, 'src', 'config.tcl'))
|
shutil.copyfile('golden_config.tcl', os.path.join(self.local_dir, 'src', 'config.tcl'))
|
||||||
|
self.harden()
|
||||||
cwd = os.getcwd()
|
|
||||||
os.chdir(self.local_dir)
|
|
||||||
|
|
||||||
# setup user config, not including python fails on github action
|
|
||||||
if 'LOCAL' in os.environ:
|
|
||||||
configure_cmd = './configure.py --create-user-config'
|
|
||||||
else:
|
|
||||||
configure_cmd = 'python ./configure.py --create-user-config'
|
|
||||||
p = subprocess.run(configure_cmd, shell=True)
|
|
||||||
if p.returncode != 0:
|
|
||||||
logging.error(f"configure failed for {self}")
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
# requires PDK_ROOT, OPENLANE_ROOT & OPENLANE_IMAGE_NAME to be set in local environment
|
|
||||||
harden_cmd = 'docker run --rm -v $OPENLANE_ROOT:/openlane -v $PDK_ROOT:$PDK_ROOT -v $(pwd):/work -e PDK=$PDK -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $OPENLANE_IMAGE_NAME /bin/bash -c "./flow.tcl -overwrite -design /work/src -run_path /work/runs -tag wokwi"'
|
|
||||||
env = os.environ.copy()
|
|
||||||
p = subprocess.run(harden_cmd, shell=True, env=env)
|
|
||||||
if p.returncode != 0:
|
|
||||||
logging.error(f"harden failed for {self}")
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
os.chdir(cwd)
|
|
||||||
"""
|
|
||||||
|
|
||||||
def harden(self):
|
def harden(self):
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
|
|||||||
Reference in New Issue
Block a user