From 8a107fe6479a6f54f260e9e066a12f02ef5fcfed Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Fri, 31 Dec 2021 11:41:38 +0000 Subject: [PATCH] sv_binutils: support basic header generation --- src/openpower/sv/sv_binutils.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index 501a0aff..2c22323b 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -20,6 +20,15 @@ from openpower.decoder.power_enums import ( ) +DISCLAIMER = ( + "/*", + " * this file is auto-generated, do not edit", + " * http://libre-soc.org/openpower/sv_binutiks.py", + " * part of Libre-SOC, sponsored by NLnet", + " */", +) + + def indent(strings): return map(lambda string: (" " + string), strings) @@ -157,7 +166,28 @@ class Codegen(_enum.Enum): def generate(self, entries): def ppc_opc_svp64_h(entries): - yield from () + yield from DISCLAIMER + yield "" + + yield f"#ifndef {self.name}" + yield f"#define {self.name}" + yield "" + + enums = ( + PType, EType, + In1Sel, In2Sel, In3Sel, OutSel, + CRInSel, CROutSel, + SVEXTRA, + ) + for enum in enums: + yield from enum.c_decl() + yield "" + + yield from Entry.c_decl() + yield "" + + yield f"#endif /* {self.name} */" + yield "" def ppc_opc_svp64_c(entries): yield from () -- 2.30.2