misc: 'sim{out/err}' -> 'sim{out/err}.txt' (#250)

By default, the `--stderr-file` and `--stdout-file` arguments were
directing the simulator to output 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 don't do so withou 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 and read as such.
This commit is contained in:
Bobby R. Bruce
2023-09-27 17:36:03 -07:00
committed by GitHub
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.tempdir_fixture_name = "tempdir"
constants.gem5_simulation_stderr = "simerr"
constants.gem5_simulation_stdout = "simout"
constants.gem5_simulation_stderr = "simerr.txt"
constants.gem5_simulation_stdout = "simout.txt"
constants.gem5_simulation_stats = "stats.txt"
constants.gem5_simulation_config_ini = "config.ini"
constants.gem5_simulation_config_json = "config.json"

View File

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

View File

@@ -508,7 +508,7 @@ class VerifyPhase(TestPhaseBase):
missing = []
log_file = ".".join([test.name, "log"])
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):
missing.append("log output")
elif log_path:

View File

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

View File

@@ -41,7 +41,9 @@ else:
for isa in test_progs:
for binary in test_progs[isa]:
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]:
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)
verifiers = (
verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref/sparc64/simout")),
verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref/sparc64/simout.txt")),
)
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.
"""
verifiers = (verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref", "simout")),)
verifiers = (
verifier.MatchStdoutNoPerf(joinpath(getcwd(), "ref", "simout.txt")),
)
gem5_verify_config(

View File

@@ -84,7 +84,7 @@ class MatchGoldStandard(Verifier):
"""
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

View File

@@ -47,7 +47,7 @@ import sys
import re
# 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.
def main():
@@ -62,9 +62,9 @@ def main():
exit(-1)
try:
simout = open(sys.argv[1] + "/simout", "r")
simout = open(sys.argv[1] + "/simout.txt", "r")
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)
# Get the address ranges
@@ -85,7 +85,7 @@ def main():
simout.close()
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)
# Now parse the stats

View File

@@ -79,9 +79,9 @@ def main():
exit(-1)
try:
simout = open(sys.argv[2] + "/simout", "r")
simout = open(sys.argv[2] + "/simout.txt", "r")
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)
# Get the burst size, number of banks and the maximum stride from
@@ -102,7 +102,9 @@ def main():
simout.close()
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)
# Now parse the stats