if overlap in self._resources:
resource_range = self._resources[overlap]
overlap_descrs.append("resource {!r} at {:#x}..{:#x}"
- .format(overlap,
- resource_range.start,
+ .format(overlap,
+ resource_range.start,
resource_range.stop))
if overlap in self._windows:
window_range = self._windows[overlap]
else:
ratio = 1
size = (1 << window.addr_width) // ratio
- # For resources, the alignment argument of add_resource() affects both address and size
- # of the resource; aligning only the address should be done using align_to(). For windows,
- # changing the size (beyond the edge case of the window size being smaller than alignment
- # of the bus) is unlikely to be useful, so there is no alignment argument. The address of
- # a window can still be aligned using align_to().
+ # For resources, the alignment argument of add_resource()
+ # affects both address and size of the resource; aligning only
+ # the address should be done using align_to(). For windows,
+ # changing the size (beyond the edge case of the window size being
+ # smaller than alignment of the bus) is unlikely to be useful,
+ # so there is no alignment argument. The address of a window
+ # can still be aligned using align_to().
alignment = max(self.alignment, window.addr_width // ratio)
addr_range = self._compute_addr_range(
@staticmethod
def _translate(start, end, width, window, window_range):
assert (end - start) % window_range.step == 0
- # Accessing a resource through a dense and then a sparse window results in very strange
- # layouts that cannot be easily represented, so reject those.
+ # Accessing a resource through a dense and then a sparse
+ # window results in very strange layouts that cannot be easily
+ # represented, so reject those.
assert window_range.step == 1 or width == window.data_width
size = (end - start) // window_range.step
start += window_range.start