return _selectconcat(*(self[bit] for bit in tuple(key)))
- def traverse(self, path):
- span = self.__class__.__members__
- yield (path, self.storage[span], span)
+ @classmethod
+ def traverse(cls, path):
+ yield (path, cls.__members__)
class MappingMeta(type):
return self.__members[key]
- def traverse(self, path=""):
- for (name, member) in self.__members.items():
+ @classmethod
+ def traverse(cls, path):
+ for (name, member) in cls.__members__.items():
if name == "_":
yield from member.traverse(path=path)
elif path == "":
def disassemble(self, verbosity=Verbosity.NORMAL):
if verbosity >= Verbosity.VERBOSE:
indent = (" " * 4)
- for (name, value, members) in self.traverse(path="RM"):
+ for (name, span) in self.traverse(path="RM"):
+ value = self.storage[span]
yield f"{name}"
yield f"{indent}{int(value):0{value.bits}b}"
- yield f"{indent}{', '.join(map(str, members))}"
+ yield f"{indent}{', '.join(map(str, span))}"
class FFPRRc1BaseRM(BaseRM):
yield from super().c_decl()
yield ""
- for (path, field) in _SVP64Instruction.traverse():
+ for (path, field) in _SVP64Instruction.traverse(path="svp64_insn"):
yield from getter(path, field)
yield from setter(path, field)
if not v30b_op.endswith('.'):
v30b_op += rc
yield "%s %s" % (v30b_op, ", ".join(v30b_newfields))
- for (field, value, span) in svp64_insn.traverse("SVP64"):
- log(field, f"{value.value:0{value.bits}b}", span)
+ for (name, span) in svp64_insn.traverse("SVP64"):
+ value = svp64_insn.storage[span]
+ log(name, f"{value.value:0{value.bits}b}", span)
log("new v3.0B fields", v30b_op, v30b_newfields)
def translate(self, lst):