Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 396ddaa37dff
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6392af08ed4d
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 6, 2019

  1. interface.jtag_probe: simplify XR scanning.

    It's nice to not do so many roundtrips, and it also is less code and
    pollutes logs less.
    whitequark committed Aug 6, 2019
    Copy the full SHA
    6392af0 View commit details
Showing with 8 additions and 13 deletions.
  1. +8 −13 software/glasgow/applet/interface/jtag_probe/__init__.py
21 changes: 8 additions & 13 deletions software/glasgow/applet/interface/jtag_probe/__init__.py
Original file line number Diff line number Diff line change
@@ -594,29 +594,24 @@ async def _scan_xr(self, xr, max_length, zero_ok=False):
await self.enter_shift_dr()

try:
# Fill the entire register chain with ones.
data = await self.shift_tdio((1,) * max_length, last=False)

length = 0
while length < max_length:
out = await self.shift_tdio((0,), last=False)
if out[0] == 0:
break
length += 1
data_1 = await self.shift_tdio((1,) * max_length, last=False)
data_0 = await self.shift_tdio((0,) * max_length, last=False)
for length in range(max_length):
if data_0[length] == 0:
self._log_h("scan %s length=%d data=<%s>",
xr, length, dump_bin(data_1[:length]))
return data_1[:length]
else:
self._log_h("overlong %s", xr)
return

self._log_h("scan %s length=%d data=<%s>", xr, length, dump_bin(data[:length]))
return data[:length]

finally:
if xr == "ir":
# Fill the register with BYPASS instructions.
await self.shift_tdi((1,) * length, last=True)
if xr == "dr":
# Restore the old contents, just in case this matters.
await self.shift_tdi(data[:length], last=True)
await self.shift_tdi(data_1[:length], last=True)

await self.enter_run_test_idle()