From c361361d638bdae4908e0a869d624d1878c33a6e Mon Sep 17 00:00:00 2001 From: Wanda Date: Wed, 3 Jul 2024 16:44:16 +0200 Subject: [PATCH] applet.interface.jtag_svf: automatically insert DUT reset in more cases. See #303. --- software/glasgow/applet/interface/jtag_svf/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/software/glasgow/applet/interface/jtag_svf/__init__.py b/software/glasgow/applet/interface/jtag_svf/__init__.py index 913aef397..01e2c798e 100644 --- a/software/glasgow/applet/interface/jtag_svf/__init__.py +++ b/software/glasgow/applet/interface/jtag_svf/__init__.py @@ -110,6 +110,13 @@ async def svf_state(self, state, path): if not path and state == "RESET": await self._enter_state(state) return + if self.lower.get_state() == JTAGState.UNKNOWN: + # The SVF specification doesn't mention whether, at entry, the DUT is assumed to be + # in a known state or not, and it looks like some SVF generators assume it is, indeed, + # reset; accept that, but warn. + self._log("test vector did not reset DUT explicitly, resetting", + level=logging.WARN) + await self.lower.enter_test_logic_reset() state = getattr(JTAGState, state) if path: path = [getattr(JTAGState, s) for s in path] + [state]