tests: Update the insttest to use simple_binary_run.py
In addition, test.py has been formatted with Python black. Change-Id: If813c80e15a019502c60ab09fb62484fc2cdf0c6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49555 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
Global frequency set at 1000000000000 ticks per second
|
||||
**** REAL SIMULATION ****
|
||||
Begining test of difficult SPARC instructions...
|
||||
LDSTUB: Passed
|
||||
SWAP: Passed
|
||||
@@ -24,55 +24,46 @@
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
'''
|
||||
"""
|
||||
Test file for the insttest binary running on the SPARC ISA
|
||||
'''
|
||||
"""
|
||||
from testlib import *
|
||||
|
||||
test_progs = {
|
||||
constants.sparc_tag : ('insttest',)
|
||||
}
|
||||
test_progs = {constants.sparc_tag: ("sparc-insttest",)}
|
||||
|
||||
cpu_types = {
|
||||
constants.sparc_tag : ('AtomicSimpleCPU', 'TimingSimpleCPU')
|
||||
}
|
||||
cpu_types = {constants.sparc_tag: ("atomic", "timing")}
|
||||
|
||||
supported_os = {
|
||||
constants.sparc_tag : ('linux',)
|
||||
}
|
||||
if config.bin_path:
|
||||
resource_path = config.bin_path
|
||||
else:
|
||||
resource_path = joinpath(absdirpath(__file__), "..", "resources")
|
||||
|
||||
base_path = joinpath(config.bin_path, 'insttest')
|
||||
|
||||
urlbase = config.resource_url + '/test-progs/insttest/bin/'
|
||||
for isa in test_progs:
|
||||
for binary in test_progs[isa]:
|
||||
for operating_s in supported_os[isa]:
|
||||
import os
|
||||
url = urlbase + isa.lower() + '/' + operating_s + '/' + binary
|
||||
path = joinpath(base_path, isa.lower(), operating_s, binary)
|
||||
ref_path = joinpath(getcwd(), "ref", binary)
|
||||
verifiers = (
|
||||
verifier.MatchStdoutNoPerf(joinpath(ref_path, "simout")),
|
||||
)
|
||||
|
||||
try:
|
||||
program = DownloadedProgram(url, path, binary)
|
||||
except:
|
||||
continue
|
||||
|
||||
ref_path = joinpath(
|
||||
getcwd(), 'ref', isa.lower(), operating_s, binary
|
||||
for cpu in cpu_types[isa]:
|
||||
gem5_verify_config(
|
||||
name="test-" + binary + "-" + cpu,
|
||||
fixtures=(),
|
||||
verifiers=verifiers,
|
||||
config=joinpath(
|
||||
config.base_dir,
|
||||
"configs",
|
||||
"example",
|
||||
"components-library",
|
||||
"simple_binary_run.py",
|
||||
),
|
||||
config_args=[
|
||||
binary,
|
||||
cpu,
|
||||
"--override-download",
|
||||
"--resource-directory",
|
||||
resource_path,
|
||||
],
|
||||
valid_isas=(isa,),
|
||||
length=constants.long_tag,
|
||||
)
|
||||
verifiers = (
|
||||
verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')),
|
||||
)
|
||||
|
||||
for cpu in cpu_types[isa]:
|
||||
|
||||
gem5_verify_config(
|
||||
name='test-'+binary + '-' + operating_s + '-' + cpu,
|
||||
fixtures=(program,),
|
||||
verifiers=verifiers,
|
||||
config=joinpath(config.base_dir, 'configs',
|
||||
'example','se.py'),
|
||||
config_args=['--cmd', joinpath(path, binary),
|
||||
'--cpu-type', cpu, '--caches'],
|
||||
valid_isas=(isa,),
|
||||
length = constants.long_tag,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user