Skip to content

Commit 23f2254

Browse files
committed
QuartusPGM: add driver config fallback for backward compatibility
1 parent 6781086 commit 23f2254

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

labgrid/driver/quartuspgmdriver.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
from ..step import step
1212
from .common import Driver
1313

14+
15+
# backward compatibility with version < v24.0.0+mle.3
1416
JTAG_CONF_INTEL = """
1517
Remote1 {
1618
Host = "HOST";
1719
Password = "PASSWORD";
1820
}
1921
"""
2022

23+
2124
@target_factory.reg_driver
2225
@attr.s(eq=False)
2326
class QuartusPGMDriver(Driver):
@@ -69,8 +72,12 @@ def operate(self, filename=None, operation="P", devnum=1) -> tuple[str, str]:
6972
cmd = f"{self.tool} -c {cable} -m JTAG -o {operation}"
7073

7174
with tempfile.NamedTemporaryFile() as conf_temp:
72-
73-
cfg = self.interface.extra['jtag_conf']
75+
if 'jtag_conf' in self.interface.extra:
76+
cfg = self.interface.extra['jtag_conf']
77+
# backward compatibility with version < v24.0.0+mle.3
78+
else:
79+
cfg = JTAG_CONF_INTEL.replace("HOST", self.interface.host + ":" + str(self.interface.jtagd_port))\
80+
.replace("PASSWORD", self.interface.jtagd_password)
7481
conf_temp.write(cfg.encode("utf-8"))
7582
conf_temp.flush()
7683
log.info("Flashing with command: %s", cmd)

0 commit comments

Comments
 (0)