diff --git a/remotesyn/toolchains/ISE.py b/remotesyn/toolchains/ISE.py index da1d6b5..2701851 100644 --- a/remotesyn/toolchains/ISE.py +++ b/remotesyn/toolchains/ISE.py @@ -13,14 +13,16 @@ def do(config, target, log, subprocesses, prefix='.'): stopafter = config.get(f'target.{target}', 'stopafter', fallback='') - log("Syntesize:") + if config.get(f'target.{target}', 'ngc_in', fallback=None) is None: + # Synthesize if no ngc is already given + log("Syntesize:") - res = xst(config, target, log, subprocesses, prefix) - if res != 0: - log("ERROR: xst returned with", res) - return res - if stopafter=='synth': - return res + res = xst(config, target, log, subprocesses, prefix) + if res != 0: + log("ERROR: xst returned with", res) + return res + if stopafter=='synth': + return res log("Implement") diff --git a/remotesyn/toolchains/util_ISE/ngdbuild.py b/remotesyn/toolchains/util_ISE/ngdbuild.py index 7e0c5c9..6c57f59 100644 --- a/remotesyn/toolchains/util_ISE/ngdbuild.py +++ b/remotesyn/toolchains/util_ISE/ngdbuild.py @@ -22,8 +22,18 @@ def ngdbuild(config, target, log, subprocesses, prefix='.') -> int: os.makedirs(build_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") - 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, stdin=subprocess.DEVNULL, # stdout=subprocess.DEVNULL,