comment cleanup
[nmigen-soc.git] / nmigen_soc / memory.py
index 2597fd845da99ff399587b029c9548c2e374a7ae..8f1e6a18ce43e6e363fdd8723e48e6f81583fc00 100644 (file)
@@ -157,8 +157,8 @@ class MemoryMap:
                 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]
@@ -329,11 +329,13 @@ class MemoryMap:
         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(
@@ -386,8 +388,9 @@ class MemoryMap:
     @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