misc: 'sim{out/err}' -> 'sim{out/err}.txt'

By default, the --stderr-file and --stdout-file arguments were
directing the simulator output to files named "simerr" and
"simout" respectively if an output redirect was requested.

A small annoyance is these files lack an extension meaning programs
refuse to open them, or to do so without some additional effort. On
many systems they are assumed to scripts.

This patch adds the .txt extension to both, thus clearly indicating
to other programs these are text files and can be opened to be read
as such.

Change-Id: Iff5af4a9e6966b4467d005a029dbf401099fbd35
This commit is contained in:
Bobby R. Bruce
2023-08-31 10:26:45 -07:00
parent 6eb7c10eb9
commit 391f62b213
14 changed files with 25 additions and 17 deletions

View File

@@ -318,8 +318,8 @@ def define_constants(constants):
constants.supported_hosts = constants.supported_tags["host"] constants.supported_hosts = constants.supported_tags["host"]
constants.tempdir_fixture_name = "tempdir" constants.tempdir_fixture_name = "tempdir"
constants.gem5_simulation_stderr = "simerr" constants.gem5_simulation_stderr = "simerr.txt"
constants.gem5_simulation_stdout = "simout" constants.gem5_simulation_stdout = "simout.txt"
constants.gem5_simulation_stats = "stats.txt" constants.gem5_simulation_stats = "stats.txt"
constants.gem5_simulation_config_ini = "config.ini" constants.gem5_simulation_config_ini = "config.ini"
constants.gem5_simulation_config_json = "config.json" constants.gem5_simulation_config_json = "config.json"

View File

@@ -126,13 +126,13 @@ def parse_options():
option( option(
"--stdout-file", "--stdout-file",
metavar="FILE", metavar="FILE",
default="simout", default="simout.txt",
help="Filename for -r redirection [Default: %default]", help="Filename for -r redirection [Default: %default]",
) )
option( option(
"--stderr-file", "--stderr-file",
metavar="FILE", metavar="FILE",
default="simerr", default="simerr.txt",
help="Filename for -e redirection [Default: %default]", help="Filename for -e redirection [Default: %default]",
) )
option( option(

View File

@@ -508,7 +508,7 @@ class VerifyPhase(TestPhaseBase):
missing = [] missing = []
log_file = ".".join([test.name, "log"]) log_file = ".".join([test.name, "log"])
log_path = gd.entry(log_file) log_path = gd.entry(log_file)
simout_path = os.path.join(out_dir, "simout") simout_path = os.path.join(out_dir, "simout.txt")
if not os.path.exists(simout_path): if not os.path.exists(simout_path):
missing.append("log output") missing.append("log output")
elif log_path: elif log_path:

View File

@@ -26,7 +26,9 @@
from testlib import * from testlib import *
verifiers = (verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref", "simout")),) verifiers = (
verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref", "simout.txt")),
)
gem5_verify_config( gem5_verify_config(
name="test-low_power-close_adaptive", name="test-low_power-close_adaptive",

View File

@@ -41,7 +41,9 @@ else:
for isa in test_progs: for isa in test_progs:
for binary in test_progs[isa]: for binary in test_progs[isa]:
ref_path = joinpath(getcwd(), "ref") ref_path = joinpath(getcwd(), "ref")
verifiers = (verifier.MatchStdoutNoPerf(joinpath(ref_path, "simout")),) verifiers = (
verifier.MatchStdoutNoPerf(joinpath(ref_path, "simout.txt")),
)
for cpu in cpu_types[isa]: for cpu in cpu_types[isa]:
gem5_verify_config( gem5_verify_config(

View File

@@ -45,7 +45,7 @@ url = config.resource_url + "/test-progs/pthreads/sparc64/" + binary
test_atomic = DownloadedProgram(url, base_path, binary) test_atomic = DownloadedProgram(url, base_path, binary)
verifiers = ( verifiers = (
verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref/sparc64/simout")), verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref/sparc64/simout.txt")),
) )
for cpu in cpu_types: for cpu in cpu_types:

View File

@@ -32,7 +32,9 @@ tests/gem5/configs/simple_binary_run.py to run a simple SE-mode simualation
with different configurations of the BaseCPUProcessor. with different configurations of the BaseCPUProcessor.
""" """
verifiers = (verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref", "simout")),) verifiers = (
verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref", "simout.txt")),
)
gem5_verify_config( gem5_verify_config(

View File

@@ -84,7 +84,7 @@ class MatchGoldStandard(Verifier):
""" """
def __init__( def __init__(
self, standard_filename, ignore_regex=None, test_filename="simout" self, standard_filename, ignore_regex=None, test_filename="simout.txt"
): ):
""" """
:param standard_filename: The path of the standard file to compare :param standard_filename: The path of the standard file to compare

View File

@@ -47,7 +47,7 @@ import sys
import re import re
# This script is intended to post process and plot the output from # This script is intended to post process and plot the output from
# running configs/dram/lat_mem_rd.py, as such it parses the simout and # running configs/dram/lat_mem_rd.py, as such it parses the simout.txt and
# stats.txt to get the relevant data points. # stats.txt to get the relevant data points.
def main(): def main():
@@ -62,9 +62,9 @@ def main():
exit(-1) exit(-1)
try: try:
simout = open(sys.argv[1] + "/simout", "r") simout = open(sys.argv[1] + "/simout.txt", "r")
except IOError: except IOError:
print("Failed to open ", sys.argv[1] + "/simout", " for reading") print("Failed to open ", sys.argv[1] + "/simout.txt", " for reading")
exit(-1) exit(-1)
# Get the address ranges # Get the address ranges
@@ -85,7 +85,7 @@ def main():
simout.close() simout.close()
if not got_ranges: if not got_ranges:
print("Failed to get address ranges, ensure simout is up-to-date") print("Failed to get address ranges, ensure simout.txt is up-to-date")
exit(-1) exit(-1)
# Now parse the stats # Now parse the stats

View File

@@ -79,9 +79,9 @@ def main():
exit(-1) exit(-1)
try: try:
simout = open(sys.argv[2] + "/simout", "r") simout = open(sys.argv[2] + "/simout.txt", "r")
except IOError: except IOError:
print("Failed to open ", sys.argv[2] + "/simout", " for reading") print("Failed to open ", sys.argv[2] + "/simout.txt", " for reading")
exit(-1) exit(-1)
# Get the burst size, number of banks and the maximum stride from # Get the burst size, number of banks and the maximum stride from
@@ -102,7 +102,9 @@ def main():
simout.close() simout.close()
if not got_sweep: if not got_sweep:
print("Failed to establish sweep details, ensure simout is up-to-date") print(
"Failed to establish sweep details, ensure simout.txt is up-to-date"
)
exit(-1) exit(-1)
# Now parse the stats # Now parse the stats