Revert "sv_binutils: introduce per-record validity flag"
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sat, 29 Jan 2022 16:36:02 +0000 (16:36 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sat, 29 Jan 2022 16:36:02 +0000 (16:36 +0000)
This reverts commit 3b5e6816766ea7f52e99938edb47bf0e7cb8dd77.

Since we decided to use a separate hash, and it can check for duplicate
records, there's no need to keep track of duplicates.

src/openpower/sv/sv_binutils.py

index a961918d0903ce8e8372bdee8e5a13b824617f95..6846076346d3bafac8202cfd378a4ec75d3f30e8 100644 (file)
@@ -78,15 +78,6 @@ SVEType = Enum("SVEType", {item.name:item.value for item in _SVEtype})
 SVEXTRA = Enum("SVEXTRA", {item.name:item.value for item in _SVEXTRA})
 
 
-class Bool(CType, int):
-    def c_value(self, prefix="", suffix=""):
-        yield f"{prefix}{'true' if self else 'false'}{suffix}"
-
-    @classmethod
-    def c_var(cls, name):
-        yield f"bool {name}"
-
-
 class Opcode(CType):
     def __init__(self, value, mask, bits):
         self.__value = value
@@ -195,17 +186,13 @@ class Record(CType):
     sv_out2: SVEXTRA
     sv_cr_in: SVEXTRA
     sv_cr_out: SVEXTRA
-    active: Bool=_dataclasses.field(default_factory=lambda: Bool(False))
 
     @classmethod
     def c_decl(cls):
         bits_all = 0
         yield f"struct svp64_record {{"
         for field in _dataclasses.fields(cls):
-            if issubclass(field.type, Bool):
-                bits = 1
-            else:
-                bits = len(field.type).bit_length()
+            bits = len(field.type).bit_length()
             yield from indent([f"uint64_t {field.name} : {bits};"])
             bits_all += bits
         bits_rsvd = (64 - (bits_all % 64))
@@ -283,7 +270,6 @@ class Codegen(_enum.Enum):
             yield f"#define {self.name}"
             yield ""
 
-            yield "#include <stdbool.h>"
             yield "#include <stdint.h>"
             yield ""