Exemplo n.º 1
0
import sys

import m5
from m5.objects import *

sys.path.append('configs/common/')
import SimpleOpts

from system import MySystem

SimpleOpts.add_option("--script",
                      default='',
                      help="Script to execute in the simulated system")

if __name__ == "__m5_main__":
    (opts, args) = SimpleOpts.parse_args()

    system = MySystem(opts)

    system.readfile = opts.script

    root = Root(full_system=True, system=system)

    m5.instantiate()

    print("Running the simulation")
    exit_event = m5.simulate()
    print('Exiting @ tick %i because %s' %
          (m5.curTick(), exit_event.getCause()))
Exemplo n.º 2
0
if __name__ == "__m5_main__":
    (opts, args) = SimpleOpts.parse_args()
    kernel, disk, cpu, benchmark, size, num_cpus = args

    if not cpu in ['timing', 'kvm']:
        m5.fatal("cpu not supported")

    # create the system we are going to simulate
    system = MySystem(kernel, disk, int(num_cpus), opts, no_kvm=False)

    # Exit from guest on workbegin/workend
    system.exit_on_work_items = True

    # Create and pass a script to the simulated system to run the reuired
    # benchmark
    system.readfile = writeBenchScript(m5.options.outdir, benchmark, size)

    # set up the root SimObject and start the simulation
    root = Root(full_system = True, system = system)

    if system.getHostParallel():
        # Required for running kvm on multiple host cores.
        # Uses gem5's parallel event queue feature
        # Note: The simulator is quite picky about this number!
        root.sim_quantum = int(1e9) # 1 ms

    #needed for long running jobs
    m5.disableAllListeners()

    # instantiate all of the objects we've created above
    m5.instantiate()
Exemplo n.º 3
0
parser.add_argument('-rfbp', '--reg-fault-bit-posi', type = int, dest = 'bitPosition',
					help = 'Register fault bit position.')

parser.add_argument('-tb', '--tick-begin', type = int, dest = 'tickBegin',
					help = 'Start tick for register fault.')

parser.add_argument('-te', '--tick-end', type = int, dest = 'tickEnd',
					help = 'End tick for register fault.')

args = parser.parse_args()

if __name__ == "__m5_main__":

	system = MySystem(args)

	system.readfile = args.script

	root = Root(full_system = True, system = system)

	if args.faultEnabled:
		if args.tickBegin == 0 and args.tickEnd == -1:
			# If the fault is permanent
			root.registerPermanentFault = RegisterPermanentFault()
			root.registerPermanentFault.system = system
			root.registerPermanentFault.registerCategory = args.regCategory
			root.registerPermanentFault.faultRegister = args.faultReg
			root.registerPermanentFault.bitPosition = args.bitPosition
			root.registerPermanentFault.faultLabel = args.label
			root.registerPermanentFault.faultStuckBit = args.stuckBit
		elif args.tickBegin == args.tickEnd:
			# If the fault is transient
Exemplo n.º 4
0
from system import MySystem

SimpleOpts.add_option("--script", default='',
                      help="Script to execute in the simulated system")
SimpleOpts.add_option("--n", default='1',
                      help="No of processors")

if __name__ == "__m5_main__":
    (opts, args) = SimpleOpts.parse_args()

    # create the system we are going to simulate
    system = MySystem(opts)

    # Read in the script file passed in via an option.
    # This file gets read and executed by the simulated system after boot.
    # Note: The disk image needs to be configured to do this.
    system.readfile = opts.script

    # set up the root SimObject and start the simulation
    root = Root(full_system = True, system = system)

    # instantiate all of the objects we've created above
    m5.instantiate()

    # Keep running until we are done.
    print "Running the simulation"
    exit_event = m5.simulate()
    print 'Exiting @ tick %i because %s' % (m5.curTick(),
                                            exit_event.getCause())
Exemplo n.º 5
0
import SimpleOpts

from system import MySystem

SimpleOpts.add_option("--script",
                      default='',
                      help="Script to execute in the simulated system")

if __name__ == "__m5_main__":
    (opts, args) = SimpleOpts.parse_args()

    # create the system we are going to simulate
    system1 = MySystem(opts)

    # Read in the script file passed in via an option.
    # This file gets read and executed by the simulated system after boot.
    # Note: The disk image needs to be configured to do this.
    system1.readfile = opts.script  # '.readfile is an object of LinuxX86System

    # set up the root SimObject and start the simulation
    root = Root(full_system=True, system=system1)

    # instantiate all of the objects we've created above
    m5.instantiate()

    # Keep running until we are done.
    print("Running the simulation")
    exit_event = m5.simulate()
    print('Exiting @ tick %i because %s' %
          (m5.curTick(), exit_event.getCause()))