From: Jacob Lifshay Date: Tue, 16 Aug 2022 05:43:31 +0000 (-0700) Subject: change to use plain_data.fields X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=nmigen-gf.git change to use plain_data.fields --- diff --git a/src/nmigen_gf/hdl/cldivrem.py b/src/nmigen_gf/hdl/cldivrem.py index 6037c6a..7b77acc 100644 --- a/src/nmigen_gf/hdl/cldivrem.py +++ b/src/nmigen_gf/hdl/cldivrem.py @@ -13,7 +13,7 @@ from nmigen.hdl.ast import Signal, Value, Assert from nmigen.hdl.dsl import Module from nmutil.singlepipe import ControlBase from nmutil.clz import CLZ, clz -from nmutil.plain_data import plain_data +from nmutil.plain_data import plain_data, fields def cldivrem_shifting(n, d, shape): @@ -165,7 +165,7 @@ class CLDivRemState: def eq(self, rhs): assert isinstance(rhs, CLDivRemState) - for f in CLDivRemState._fields: + for f in fields(CLDivRemState): if f in ("shape", "name"): continue l = getattr(self, f) @@ -206,7 +206,7 @@ class CLDivRemState: def eq_but_zero_substep(self, rhs, do_assert): assert isinstance(rhs, CLDivRemState) - for f in CLDivRemState._fields: + for f in fields(CLDivRemState): if f in ("shape", "name"): continue l = getattr(self, f)