From 044760e06cdf68caef822d5dd3ece0c9b6aa06d0 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sat, 2 Mar 2024 12:23:10 +0100 Subject: [PATCH] build/colognechip/colognechip: check if p_r is in PATH before trying to copy dly file --- litex/build/colognechip/colognechip.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/litex/build/colognechip/colognechip.py b/litex/build/colognechip/colognechip.py index 06e431b7b..5ae48da0a 100644 --- a/litex/build/colognechip/colognechip.py +++ b/litex/build/colognechip/colognechip.py @@ -93,9 +93,10 @@ class CologneChipToolchain(GenericToolchain): self._yosys.build_script() # p_r complains about missing cc_worst_spd_dly.dly -> copy it in gateware directory - p_r_path = which("p_r") - cc_worst_spd_dly_path = os.path.join(os.path.dirname(p_r_path), "cc_worst_spd_dly.dly") - copyfile(cc_worst_spd_dly_path, os.path.join(self._build_dir, "cc_worst_spd_dly.dly")) + if which("p_r"): + p_r_path = which("p_r") + cc_worst_spd_dly_path = os.path.join(os.path.dirname(p_r_path), "cc_worst_spd_dly.dly") + copyfile(cc_worst_spd_dly_path, os.path.join(self._build_dir, "cc_worst_spd_dly.dly")) # Script ---------------------------------------------------------------------------------------