From: Dmitry Selyutin Date: Sun, 16 Jan 2022 18:01:03 +0000 (+0000) Subject: sv_binutils: introduce SVP64 entries X-Git-Tag: sv_maxu_works-initial~561 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1613025caed731cde5f2288f8908e6feaba401f9;p=openpower-isa.git sv_binutils: introduce SVP64 entries --- diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index b0bfc6a7..a6c97d94 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -258,11 +258,23 @@ class Codegen(_enum.Enum): yield from Entry.c_decl() yield "" + yield "extern const struct svp64_entry svp64_entries[];" + yield "extern const unsigned int svp64_num_entries;" + yield "" + yield f"#endif /* {self.name} */" yield "" def ppc_opc_svp64_c(entries): - yield from () + yield from DISCLAIMER + yield "" + + yield "const struct svp64_entry svp64_entries[] = {{" + for (index, entry) in enumerate(entries): + yield from indent(entry.c_value(prefix=f"[{index}] = ", suffix=",")) + yield f"}};" + yield f"const unsigned int svp64_num_entries = {len(entries)};" + yield "" return { Codegen.PPC_OPC_SVP64_H: ppc_opc_svp64_h, @@ -367,7 +379,7 @@ def main(codegen): } for (path, opcode_cls) in table.items(): entries.extend(parse(path, opcode_cls)) - entries = sorted(entries) + entries = sorted(frozenset(entries)) for line in codegen.generate(entries): print(line)