From cd90e81c76095135f7d298d7b0d4f2f7c23a64fc Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sat, 30 Nov 2024 23:43:51 -0800 Subject: [PATCH] wsim cleanup --- bin/wsim | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/bin/wsim b/bin/wsim index 4e03b0d95..907ff9105 100755 --- a/bin/wsim +++ b/bin/wsim @@ -72,10 +72,12 @@ if(args.lockstep and not args.testsuite.endswith('.elf') and not args.testsuite exit(1) # Validate arguments -if (args.gui or args.ccov or args.fcov or args.lockstep or args.lockstepverbose): - if args.sim not in ["questa", "vcs"]: - print("Option only supported for Questa and VCS") - exit(1) +if (args.gui or args.ccov or args.fcov or args.lockstep or args.lockstepverbose) and args.sim not in ["questa", "vcs"]: + print("Option only supported for Questa and VCS") + exit(1) +elif (args.tb == "testbench_fp" and args.sim != "questa"): + print("Error: testbench_fp presently only supported by Questa, not VCS or Verilator, because of a touchy testbench") + exit(1) if (args.vcd): args.args += " -DMAKEVCD=1" @@ -91,14 +93,10 @@ if(int(args.locksteplog) >= 1): EnableLog = 1 else: EnableLog = 0 prefix = "" if (args.lockstep or args.lockstepverbose or args.fcov): - if (args.sim == "questa" or args.sim == "vcs"): - imperasicPath = os.path.join(WALLY, "config", args.config, "imperas.ic") - if not os.path.isfile(imperasicPath): # If config is a derivative, look for imperas.ic in derivative configs - imperasicPath = os.path.join(WALLY, "config", "deriv", args.config, "imperas.ic") - prefix = "IMPERAS_TOOLS=" + imperasicPath -# Force Questa to use 64-bit mode, sometimes it defaults to 32-bit even on 64-bit machines -if (args.sim == "questa"): - prefix = "MTI_VCO_MODE=64 " + prefix + imperasicPath = os.path.join(WALLY, "config", args.config, "imperas.ic") + if not os.path.isfile(imperasicPath): # If config is a derivative, look for imperas.ic in derivative configs + imperasicPath = os.path.join(WALLY, "config", "deriv", args.config, "imperas.ic") + prefix = "IMPERAS_TOOLS=" + imperasicPath if (args.lockstep or args.lockstepverbose): if(args.locksteplog != 0): ImperasPlusArgs = " +IDV_TRACE2LOG=" + str(EnableLog) + " +IDV_TRACE2LOG_AFTER=" + str(args.locksteplog) @@ -137,13 +135,10 @@ for d in ["logs", "wkdir", "cov", "ucdb", "fcov", "fcov_ucdb"]: cd = "cd $WALLY/sim/" +args.sim -# check for unsupported sims -if (args.tb == "testbench_fp" and args.sim != "questa"): - print("Error: testbench_fp presently only supported by Questa, not VCS or Verilator, because of a touchy testbench") - exit(1) - # per-simulator launch if (args.sim == "questa"): + # Force Questa to use 64-bit mode, sometimes it defaults to 32-bit even on 64-bit machines + prefix = "MTI_VCO_MODE=64 " + prefix if (args.gui) and (args.tb == "testbench"): args.params += "DEBUG=1" if (args.args != ""): @@ -159,7 +154,6 @@ if (args.sim == "questa"): print("Running Questa with command: " + cmd) os.system(cmd) elif (args.sim == "verilator"): - # PWD=${WALLY}/sim CONFIG=rv64gc TESTSUITE=arch64i print(f"Running Verilator on {args.config} {args.testsuite}") os.system(f"/usr/bin/make -C {regressionDir}/verilator WALLYCONF={args.config} TEST={args.testsuite} TESTBENCH={args.tb} PLUS_ARGS=\"{args.args}\" PARAM_ARGS=\"{args.params}\"") elif (args.sim == "vcs"):