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: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7e47987d65e0
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f7e0ee0919e1
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 8, 2019

  1. Copy the full SHA
    f7e0ee0 View commit details
Showing with 15 additions and 5 deletions.
  1. +15 −5 software/glasgow/applet/interface/jtag_probe/__init__.py
20 changes: 15 additions & 5 deletions software/glasgow/applet/interface/jtag_probe/__init__.py
Original file line number Diff line number Diff line change
@@ -533,12 +533,22 @@ def segment_irs(self, ir_value, count=None):

irs = []
ir_offset = 0
ir_starts = ir_value.search(bitarray("10"))
for ir_start0, ir_start1 in zip(ir_starts, ir_starts[1:] + [len(ir_value)]):
ir_length = ir_start1 - ir_start0
self._log_h("found ir[%d]", ir_length)
if count == 1:
# 1 TAP case; the entire IR belongs to the only TAP we have.
ir_length = len(ir_value)
self._log_h("found ir[%d] (1-tap)", ir_length)
irs.append((ir_offset, ir_length))
ir_offset += ir_length
else:
# >1 TAP case; there is no way to segment IR without knowledge of specific devices
# involved, but an IR always starts with 10, and we can use this to try and guess
# the IR segmentation. Our segmentation is pessimistic, i.e. it always detects either
# as many IRs as TAPs, or more IRs than TAPs.
ir_starts = ir_value.search(bitarray("10"))
for ir_start0, ir_start1 in zip(ir_starts, ir_starts[1:] + [len(ir_value)]):
ir_length = ir_start1 - ir_start0
self._log_h("found ir[%d] (n-tap)", ir_length)
irs.append((ir_offset, ir_length))
ir_offset += ir_length

if count is not None and len(irs) != count:
self._log_h("ir count does not match idcode count")