[libre-riscv-dev] [Bug 60] N-stage 64-bit multiplier pipeline needed (signed/unsigned)

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Fri May 24 17:19:52 BST 2019


http://bugs.libre-riscv.org/show_bug.cgi?id=60

--- Comment #18 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
the convention for docstrings is:
+        """ Assign ``PartitionPoints`` using ``Signal.eq``.
+        """


+        """ Create a bit-mask from `self`.
+
+            Each bit in the returned mask is clear only if the partition point
+            at the same bit-index is enabled.
+
+            :param width: the bit width of the resulting mask
+        """

* one space after the introductory """
* alignment of ALL text starting lined up with the first word NOT with the """
* ending """ on its own blank line

reasons are as follow:

* space after the introductory """ makes it clear
* alignment of the text vertically makes for increased readability
* the alignmnent """ SPACE happens coincidentally to be a multiple of 4.
  this matches python's 4-space per indentation pep8 rule.
* the use of """ at the end on its own line provides for a single break
  between the __init__ part and the start of the code


indent one space between """ and A

+        """Assign ``PartitionPoints`` using ``Signal.eq``."""

start ending """ on new line

         if set(self.keys()) != set(rhs.keys()):
             raise ValueError("incompatible point set")
         for point, enabled in self.items():
             yield enabled.eq(rhs[point])

     def as_mask(self, width: int) -> Value:

indent one space between """ and A

+        """Create a bit-mask from `self`.
+
+        Each bit in the returned mask is clear only if the partition point at
+        the same bit-index is enabled.

indent these by four spaces

+        :param width: the bit width of the resulting mask

indent this by four spaces.

+        """

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list