From: Dmitry Selyutin Date: Sat, 29 Jan 2022 16:36:02 +0000 (+0000) Subject: Revert "sv_binutils: introduce per-record validity flag" X-Git-Tag: sv_maxu_works-initial~528 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5daf93104a4fdc383fc4a3eabce416c624fa8e6b;p=openpower-isa.git Revert "sv_binutils: introduce per-record validity flag" 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. --- diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index a961918d..68460763 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -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 " yield "#include " yield ""