From: Florent Kermarrec Date: Tue, 23 Dec 2014 19:53:05 +0000 (+0100) Subject: host/drivers: add possibility to pass cond dict to ease trigger pattern generation X-Git-Tag: 24jan2021_ls180~2575^2~50 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=834e9b99bea6456792eaf2a4ea2e83eb38760c46;p=litex.git host/drivers: add possibility to pass cond dict to ease trigger pattern generation --- diff --git a/miscope/host/drivers.py b/miscope/host/drivers.py index eab1d9e7..a3d65633 100644 --- a/miscope/host/drivers.py +++ b/miscope/host/drivers.py @@ -67,7 +67,11 @@ class MiLaDriver(): print(s, end="|") sys.stdout.flush() - def prog_term(self, port, trigger, mask): + def prog_term(self, port, trigger=0, mask=0, cond=None): + if cond is not None: + for k, v in cond.items(): + trigger |= getattr(self, k+"_o")*v + mask |= getattr(self, k+"_m")*v t = getattr(self, "mila_trigger_port{d}_trig".format(d=int(port))) m = getattr(self, "mila_trigger_port{d}_mask".format(d=int(port))) t.write(trigger)