build/colognechip/colognechip: check if p_r is in PATH before trying to copy dly file

This commit is contained in:
Gwenhael Goavec-Merou 2024-03-02 12:23:10 +01:00
parent 62f275debd
commit 044760e06c
1 changed files with 4 additions and 3 deletions

View File

@ -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 ---------------------------------------------------------------------------------------