ARM: Add support for initparam m5 op
This commit is contained in:
parent
3f9e352de4
commit
80a6907927
4 changed files with 24 additions and 6 deletions
|
@ -63,7 +63,8 @@ parser.add_option("--work-end-exit-count", action="store", type="int",
|
||||||
help="exit at specified work end count")
|
help="exit at specified work end count")
|
||||||
parser.add_option("--work-begin-exit-count", action="store", type="int",
|
parser.add_option("--work-begin-exit-count", action="store", type="int",
|
||||||
help="exit at specified work begin count")
|
help="exit at specified work begin count")
|
||||||
|
parser.add_option("--init-param", action="store", type="int", default=0,
|
||||||
|
help="Parameter available in simulation with m5 initparam")
|
||||||
|
|
||||||
# Checkpointing options
|
# Checkpointing options
|
||||||
###Note that performing checkpointing via python script files will override
|
###Note that performing checkpointing via python script files will override
|
||||||
|
|
|
@ -151,6 +151,8 @@ if options.kernel is not None:
|
||||||
if options.script is not None:
|
if options.script is not None:
|
||||||
test_sys.readfile = options.script
|
test_sys.readfile = options.script
|
||||||
|
|
||||||
|
test_sys.init_param = options.init_param
|
||||||
|
|
||||||
test_sys.cpu = [TestCPUClass(cpu_id=i) for i in xrange(np)]
|
test_sys.cpu = [TestCPUClass(cpu_id=i) for i in xrange(np)]
|
||||||
|
|
||||||
CacheConfig.config_cache(options, test_sys)
|
CacheConfig.config_cache(options, test_sys)
|
||||||
|
@ -199,6 +201,7 @@ if len(bm) == 2:
|
||||||
if options.kernel is not None:
|
if options.kernel is not None:
|
||||||
drive_sys.kernel = binary(options.kernel)
|
drive_sys.kernel = binary(options.kernel)
|
||||||
|
|
||||||
|
drive_sys.init_param = options.init_param
|
||||||
root = makeDualRoot(test_sys, drive_sys, options.etherdump)
|
root = makeDualRoot(test_sys, drive_sys, options.etherdump)
|
||||||
elif len(bm) == 1:
|
elif len(bm) == 1:
|
||||||
root = Root(system=test_sys)
|
root = Root(system=test_sys)
|
||||||
|
|
|
@ -191,16 +191,18 @@ let {{
|
||||||
|
|
||||||
initparamCode = '''
|
initparamCode = '''
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
Rt = PseudoInst::initParam(xc->tcBase());
|
uint64_t ip_val = PseudoInst::initParam(xc->tcBase());
|
||||||
|
R0 = bits(ip_val, 31, 0);
|
||||||
|
R1 = bits(ip_val, 63, 32);
|
||||||
#else
|
#else
|
||||||
PseudoInst::panicFsOnlyPseudoInst("initparam");
|
PseudoInst::panicFsOnlyPseudoInst("initparam");
|
||||||
Rt = 0;
|
|
||||||
#endif
|
#endif
|
||||||
'''
|
'''
|
||||||
|
|
||||||
initparamIop = InstObjParams("initparam", "Initparam", "PredOp",
|
initparamIop = InstObjParams("initparam", "Initparam", "PredOp",
|
||||||
{ "code": initparamCode,
|
{ "code": initparamCode,
|
||||||
"predicate_test": predicateTest })
|
"predicate_test": predicateTest },
|
||||||
|
["IsNonSpeculative"])
|
||||||
header_output += BasicDeclare.subst(initparamIop)
|
header_output += BasicDeclare.subst(initparamIop)
|
||||||
decoder_output += BasicConstructor.subst(initparamIop)
|
decoder_output += BasicConstructor.subst(initparamIop)
|
||||||
exec_output += PredOpExecute.subst(initparamIop)
|
exec_output += PredOpExecute.subst(initparamIop)
|
||||||
|
|
16
util/m5/m5.c
16
util/m5/m5.c
|
@ -1,4 +1,16 @@
|
||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2011 ARM Limited
|
||||||
|
* All rights reserved
|
||||||
|
*
|
||||||
|
* The license below extends only to copyright in the software and shall
|
||||||
|
* not be construed as granting a license to any other intellectual
|
||||||
|
* property including but not limited to intellectual property relating
|
||||||
|
* to a hardware implementation of the functionality of the software
|
||||||
|
* licensed hereunder. You may use the software subject to the license
|
||||||
|
* terms below provided that you ensure that this notice is replicated
|
||||||
|
* unmodified and in its entirety in all distributions of the software,
|
||||||
|
* modified or unmodified, in source code or in binary form.
|
||||||
|
*
|
||||||
* Copyright (c) 2003-2005 The Regents of The University of Michigan
|
* Copyright (c) 2003-2005 The Regents of The University of Michigan
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -160,8 +172,8 @@ do_initparam(int argc, char *argv[])
|
||||||
if (argc != 0)
|
if (argc != 0)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
uint64_t val = m5_initparam();
|
||||||
printf("%ld", m5_initparam());
|
printf("%"PRIu64, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue