From 1659b887a6c7910e0be79f289651a734e1543163 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 1 Jun 2022 18:16:14 +0000 Subject: [PATCH] sv_binutils: exclude useless records --- src/openpower/sv/sv_binutils.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index 46f7f687..f2255b21 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -186,8 +186,8 @@ OutSel = Enum("OutSel", _OutSel, tag="svp64_out_sel") CRInSel = Enum("CRInSel", _CRInSel, tag="svp64_cr_in_sel") CROutSel = Enum("CROutSel", _CROutSel, tag="svp64_cr_out_sel") SVPType = Enum("SVPType", _SVPtype, tag="svp64_sv_ptype") -SVEType = Enum("SVEType", _SVEtype, tag="svp64_sv_etype") -SVExtra = Enum("SVExtra", _SVEXTRA, tag="svp64_sv_extra") +SVEType = Enum("SVEType", _SVEtype, tag="svp64_sv_etype", exclude="NONE") +SVExtra = Enum("SVExtra", _SVEXTRA, tag="svp64_sv_extra", exclude="Idx_1_2") class Constant(CType, _enum.Enum, metaclass=EnumMeta): @@ -708,14 +708,23 @@ def parse(path): cls = FIELDS.get(key) if cls is None: continue + + if ((cls is SVEType and value == "NONE") or + (cls is SVExtra and value == "Idx_1_2")): + record = {} + break + if not isinstance(value, cls): if issubclass(cls, _enum.Enum): value = {item.name:item for item in cls}[value] else: value = cls(value) record[key] = value - record = Record(**record) + if not record: + continue + + record = Record(**record) for name in map(Name, names): yield Entry(name=name, record=record) -- 2.30.2