From: Jacob Lifshay Date: Wed, 27 Apr 2022 04:57:40 +0000 (-0700) Subject: split out non-derived params into separate class without all the accuracy checking... X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=381fd1efc7de1c456d172b96e5c85517a9cc4ad1 split out non-derived params into separate class without all the accuracy checking stuff. --- diff --git a/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py b/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py index f57e0448..bdce6fd9 100644 --- a/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py +++ b/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py @@ -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)