From b1a02d39181b8147062dae4192bfbc1aa40d0407 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 27 Nov 2021 19:36:25 +0000 Subject: [PATCH] sv_analysis: introduce stub binutils format --- src/openpower/sv/sv_analysis.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/openpower/sv/sv_analysis.py b/src/openpower/sv/sv_analysis.py index b3fce3e1..c4ba19d5 100644 --- a/src/openpower/sv/sv_analysis.py +++ b/src/openpower/sv/sv_analysis.py @@ -166,11 +166,13 @@ def keyname(row): class Format(enum.Enum): + BINUTILS = enum.auto() VHDL = enum.auto() @classmethod def _missing_(cls, value): return { + "binutils": Format.BINUTILS, "vhdl": Format.VHDL, }[value.lower()] @@ -668,13 +670,17 @@ def process_csvs(format): if format == Format.VHDL: # and a nice microwatt VHDL file file_path = find_wiki_file("sv_decode.vhdl") + elif format == Format.BINUTILS: + file_path = find_wiki_file("binutils.c") with open(file_path, 'w') as stream: output(format, svt, csvcols, insns, csvs_svp64, stream) def output(format, svt, csvcols, insns, csvs_svp64, stream): - _ = format + if format == Format.BINUTILS: + stream.write("/* TODO: implement proper support */\n") + return # autogeneration warning stream.write("-- this file is auto-generated, do not edit\n") @@ -758,6 +764,6 @@ if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("-f", "--format", type=Format, choices=Format, default=Format.VHDL, - help="format to be used (VHDL)") + help="format to be used (binutils or VHDL)") args = parser.parse_args() process_csvs(args.format) -- 2.30.2