[Libre-soc-bugs] [Bug 1025] create IEEE754 FP Pipelines and decoder for TestIssuer

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Aug 19 04:17:31 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1025

--- Comment #2 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #1)

> https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;
> h=bb7069cee706f7fbc75dc7cafec3afe19cd87e02;
> hp=c8b2c5d2c984cc444880187679c2a9589bae0526

+
+    @property
+    def DRN(self):
+        return self.fsi['DRN'].asint(msb0=True)
+
+    @DRN.setter
+    def DRN(self, value):
+        self.fsi['DRN'].eq(value)
+

please remove all of those and replace them with
dynamic functions added within the for-loop.
there are far too many and you should have
immediately red-flagged the fact that they are
a regular pattern (60+ identical duplications of the
above lines with different 'DRN')

python is not rust or java.

use a simple override on __getattr__ and __setattr__ do not
waste time creating metaclasses (or override __dir__)
https://amir.rachum.com/python-dynamic-attributes/ we do
not want complex concepts nor unintelligable code nor
vast quantities of unmaintainable code.

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


More information about the libre-soc-bugs mailing list