diff --git a/host/ga100vfi/cli.py b/host/ga100vfi/cli.py index 03c3ecb..24349a8 100644 --- a/host/ga100vfi/cli.py +++ b/host/ga100vfi/cli.py @@ -89,10 +89,16 @@ def cmd_campaign(args) -> int: a = Attempt( v_dip_mv=v_dip, t_dip_us=args.t_dip, v_restore_mv=args.v_restore, t_restore_us=args.t_restore, - t_revert_us=args.t_revert, fast=1, hold_ms=0, + t_revert_us=args.t_revert, fast=args.fast, hold_ms=0, pulses=args.pulses, pw=args.pw, gap=args.gap, delay=args.delay, revert=0, ) + if not args.no_unlock: + try: + card.cmd("@w 25 03") + _ensure_unlocked(card) + except IOError: + pass try: rep = card.attempt(a) except IOError as e: @@ -136,6 +142,13 @@ def cmd_campaign(args) -> int: counts[outcome] += 1 if outcome == "goldilocks": verdict = v + import os as _os, subprocess as _sp + _bp=_os.environ.get("BURN_PLAN"); _bd=_os.environ.get("BURN_DUMP") + if _bp and _bd: + print("GOLDILOCKS -> burning immediately", flush=True) + _sp.run(["python3","-m","ffcalc.burntool","burn","--dump",_bd, + "--bdf",args.bdf,"--yes",_bp], + cwd=_os.environ.get("FFCALC_DIR",".")) break if planner: # A lost link is a too-deep outcome: the planner reads it as over. @@ -214,6 +227,8 @@ def main(argv=None) -> int: help="3 for the Goldilocks triple pulse") a.add_argument("--pw", type=int, default=0, help="pulse width us (0=auto)") a.add_argument("--gap", type=int, default=0, help="gap between pulses us (0=auto)") + a.add_argument("--fast", type=int, default=1, choices=(0, 1), help="1=fast slew, 0=slow slew") + a.add_argument("--hold-ms", type=int, default=0, help="hold rail low at release (ms)") a.add_argument("--revert", type=int, default=1, choices=(0, 1), help="1=hand back to PWM-VID after dip; 0=stay PMBus (fast campaigns)") a.add_argument("--no-unlock", action="store_true") @@ -238,6 +253,7 @@ def main(argv=None) -> int: camp.add_argument("--pw", type=int, default=198) camp.add_argument("--gap", type=int, default=150) camp.add_argument("--delay", type=int, default=117) + camp.add_argument("--fast", type=int, default=1, choices=(0,1), help="1=fast slew, 0=slow slew") camp.add_argument("--restore-wait", type=float, default=0.25, help="seconds to wait for PCIe link after PEX_RST") camp.add_argument("--no-unlock", action="store_true") diff --git a/host/ga100vfi/glitch.py b/host/ga100vfi/glitch.py index ffccf4a..7e59dd4 100644 --- a/host/ga100vfi/glitch.py +++ b/host/ga100vfi/glitch.py @@ -101,6 +101,8 @@ class Card: def attempt(self, a: Attempt) -> Report: r = self.cmd(a.command(), wait=0.8, total=20.0, until="glitch done") + import os as _o, sys as _s + if _o.environ.get("VFI_RAW"): print("RAW:", repr(r), file=_s.stderr) m = re.search( r"glitch done pwd=(\d) e1=0x([0-9a-f]{4})" r"(?: nvvdd=(-?[\d.]+))? writes_failed=(\d+)", r)