From bb4f3642deb1f607b82bff132e0aba5b1cef555b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 30 Apr 2019 08:04:22 +0200 Subject: [PATCH] Some pmgen reorg, rename peepopt.pmg to peepopt_shiftmul.pmg Signed-off-by: Clifford Wolf --- passes/pmgen/Makefile.inc | 4 +++- passes/pmgen/{peepopt.pmg => peepopt_shiftmul.pmg} | 0 passes/pmgen/pmgen.py | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) rename passes/pmgen/{peepopt.pmg => peepopt_shiftmul.pmg} (100%) diff --git a/passes/pmgen/Makefile.inc b/passes/pmgen/Makefile.inc index b8a14df90..a8cac7ea4 100644 --- a/passes/pmgen/Makefile.inc +++ b/passes/pmgen/Makefile.inc @@ -16,5 +16,7 @@ passes/pmgen/peepopt.o: passes/pmgen/peepopt_pm.h EXTRA_OBJS += passes/pmgen/peepopt_pm.h .SECONDARY: passes/pmgen/peepopt_pm.h -passes/pmgen/peepopt_pm.h: passes/pmgen/pmgen.py passes/pmgen/peepopt.pmg +PEEPOPT_PATTERN = passes/pmgen/peepopt_shiftmul.pmg + +passes/pmgen/peepopt_pm.h: passes/pmgen/pmgen.py $(PEEPOPT_PATTERN) $(P) mkdir -p passes/pmgen && python3 $< -o $@ -p peepopt $(filter-out $<,$^) diff --git a/passes/pmgen/peepopt.pmg b/passes/pmgen/peepopt_shiftmul.pmg similarity index 100% rename from passes/pmgen/peepopt.pmg rename to passes/pmgen/peepopt_shiftmul.pmg diff --git a/passes/pmgen/pmgen.py b/passes/pmgen/pmgen.py index 24ad07359..5860c634a 100644 --- a/passes/pmgen/pmgen.py +++ b/passes/pmgen/pmgen.py @@ -23,8 +23,7 @@ for o, a in opts: debug = True if outfile is None: - outfile = args[-1] - args = args[0:-1] + outfile = "/dev/stdout" for a in args: assert a.endswith(".pmg") @@ -246,7 +245,8 @@ if debug: pp.pprint(blocks) with open(outfile, "w") as f: - print("// Generated by pmgen.py from {}.pgm".format(prefix), file=f) + for fn in pmgfiles: + print("// Generated by pmgen.py from {}".format(fn), file=f) print("", file=f) print("#include \"kernel/yosys.h\"", file=f) -- 2.30.2