From dc26ba8c44e3571b90c275ca00a1d7ac348dc443 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Fri, 28 Jun 2024 17:17:15 +0300 Subject: [PATCH] cxxrtl: only write "opt" out when actually opt; write "noopt" otherwise. --- niar/cxxrtl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/niar/cxxrtl.py b/niar/cxxrtl.py index baed800..246ddfa 100644 --- a/niar/cxxrtl.py +++ b/niar/cxxrtl.py @@ -138,7 +138,11 @@ def main(np: Project, args): f.write(f"read_rtlil {_make_absolute(il_path)}\n") if args.optimize.opt_rtl: f.write("opt\n") - f.write(f"write_rtlil {_make_absolute(il_path)}.opt\n") + f.write(f"write_rtlil {_make_absolute(il_path)}.opt\n") + else: + # Allow apples-to-apples comparison of generated RTLIL by + # rewriting it with Yosys. + f.write(f"write_rtlil {_make_absolute(il_path)}.noopt\n") f.write(f"write_cxxrtl -header {_make_absolute(cxxrtl_cc_path)}\n") def rtlil_to_cc():