split out non-derived params into separate class without all the accuracy checking...
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 27 Apr 2022 04:57:40 +0000 (21:57 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Wed, 27 Apr 2022 04:57:40 +0000 (21:57 -0700)
src/soc/fu/div/experiment/goldschmidt_div_sqrt.py

index f57e044889fac9d4650d888b6b1f928dbf7b5e27..bdce6fd950e65157c1b2657deb127a58409f18b7 100644 (file)
@@ -284,9 +284,9 @@ def _assert_accuracy(condition, msg="not accurate enough"):
 
 
 @dataclass(frozen=True, unsafe_hash=True)
-class GoldschmidtDivParams:
-    """parameters for a Goldschmidt division algorithm.
-    Use `GoldschmidtDivParams.get` to find a efficient set of parameters.
+class GoldschmidtDivParamsBase:
+    """parameters for a Goldschmidt division algorithm, excluding derived
+    parameters.
     """
 
     io_width: int
@@ -306,6 +306,13 @@ class GoldschmidtDivParams:
     iter_count: int
     """the total number of iterations of the division algorithm's loop"""
 
+
+@dataclass(frozen=True, unsafe_hash=True)
+class GoldschmidtDivParams(GoldschmidtDivParamsBase):
+    """parameters for a Goldschmidt division algorithm.
+    Use `GoldschmidtDivParams.get` to find a efficient set of parameters.
+    """
+
     # tuple to be immutable, default so repr() works for debugging even when
     # __post_init__ hasn't finished running yet
     table: "tuple[FixedPoint, ...]" = field(init=False, default=NotImplemented)