Added possibility to start from ngc in ISE build

This commit is contained in:
2025-10-18 21:56:05 +02:00
parent dc437c99ca
commit ce90d68554
2 changed files with 20 additions and 8 deletions

View File

@ -13,6 +13,8 @@ def do(config, target, log, subprocesses, prefix='.'):
stopafter = config.get(f'target.{target}', 'stopafter', fallback='') stopafter = config.get(f'target.{target}', 'stopafter', fallback='')
if config.get(f'target.{target}', 'ngc_in', fallback=None) is None:
# Synthesize if no ngc is already given
log("Syntesize:") log("Syntesize:")
res = xst(config, target, log, subprocesses, prefix) res = xst(config, target, log, subprocesses, prefix)

View File

@ -22,8 +22,18 @@ def ngdbuild(config, target, log, subprocesses, prefix='.') -> int:
os.makedirs(build_dir, exist_ok=True) os.makedirs(build_dir, exist_ok=True)
os.makedirs(out_dir, exist_ok=True) os.makedirs(out_dir, exist_ok=True)
if config.get(f'target.{target}', 'ngc_in', fallback=None) is None:
ngcfile = f'{out_dir}/{target}.ngc'
else:
log(" - Synthesized design already given, start from there")
ngcfile = config.get(f'target.{target}', 'ngc_in', fallback='')
d = os.path.dirname(ngcfile)
if d:
os.makedirs(f"{build_dir}/{d}", exist_ok=True)
shutil.copy(ngcfile, f'{build_dir}/{ngcfile}')
log(" - run ngdbuild") log(" - run ngdbuild")
p = subprocess.Popen(f"ngdbuild -intstyle xflow -p {devstring} -uc {prefix}/{files_con[0]} {ngdbuild_opts} {out_dir}/{target}.ngc impl.ngd", p = subprocess.Popen(f"ngdbuild -intstyle xflow -p {devstring} -uc {prefix}/{files_con[0]} {ngdbuild_opts} {ngcfile} impl.ngd",
shell=True, cwd=build_dir, shell=True, cwd=build_dir,
stdin=subprocess.DEVNULL, stdin=subprocess.DEVNULL,
# stdout=subprocess.DEVNULL, # stdout=subprocess.DEVNULL,