Hi everyone,

I am new to gem5.

I am trying to use the following scripts to run spec2006,

"
#cmp.py
# Simple configuration script

import os, optparse, sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath

addToPath('../common')
addToPath('../ruby')
addToPath('../topologies')


import Options
import Ruby
import Simulation
from Caches import *
import CacheConfig
import cpu2006

# Get paths we might need.  It's expected this file is in
m5/configs/example.
config_path = os.path.dirname(os.path.abspath(__file__))
print config_path   # 'configs/cpu2006'
config_root = os.path.dirname(config_path)
print config_root
m5_root = os.path.dirname(config_root)
print m5_root

parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addSEOptions(parser)

# Benchmark options

parser.add_option("-b", "--benchmark", default="",
                 help="The benchmark to be loaded.")

parser.add_option("--chkpt", default="",
                 help="The checkpoint to load.")

execfile(os.path.join(config_root, "common", "Options.py"))

if '--ruby' in sys.argv:
    Ruby.define_options(parser)

(options, args) = parser.parse_args()

if args:
    print "Error: script doesn't take any positional arguments"
    sys.exit(1)

if options.benchmark == 'perlbench':
   process = cpu2006.perlbench
elif options.benchmark == 'bzip2':
   process = cpu2006.bzip2
   # intend to hide several codes of spec benchemarks claim
elif options.benchmark == 'specrand_f':
   process = cpu2006.specrand_f

if options.chkpt != "":
   process.chkpt = options.chkpt

(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)

CPUClass.clock = '1.0GHz'

#np = options.num_cpus
np = 1

system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
                physmem = SimpleMemory(range=AddrRange("1024MB")),
                membus = CoherentBus(), mem_mode = 'timing')

if options.ruby:
    if not (options.cpu_type == "detailed" or options.cpu_type == "timing"):
        print >> sys.stderr, "Ruby requires TimingSimpleCPU or O3CPU!!"
        sys.exit(1)

    options.use_map = True
    Ruby.create_system(options, system)
    assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))

    for i in xrange(np):
        ruby_port = system.ruby._cpu_ruby_ports[i]

        # Create the interrupt controller and connect its ports to Ruby
        # Note that the interrupt controller is always present but only
        # in x86 does it have message ports that need to be connected
        system.cpu[i].createInterruptController()

        # Connect the cpu's cache ports to Ruby
        system.cpu[i].icache_port = ruby_port.slave
        system.cpu[i].dcache_port = ruby_port.slave
        if buildEnv['TARGET_ISA'] == 'x86':
            system.cpu[i].interrupts.pio = ruby_port.master
            system.cpu[i].interrupts.int_master = ruby_port.slave
            system.cpu[i].interrupts.int_slave = ruby_port.master
            system.cpu[i].itb.walker.port = ruby_port.slave
            system.cpu[i].dtb.walker.port = ruby_port.slave
else:
    system.physmem.port = system.membus.master
    system.system_port = system.membus.slave
    CacheConfig.config_cache(options,system)

for i in xrange(np):
#    if options.caches:
#        system.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '64kB'),
#                                              L1Cache(size = '64kB'))
#    if options.l2cache:
#        system.l2 = L2Cache(size='2MB')
#        system.tol2bus = Bus()
#        system.l2.cpu_side = system.tol2bus.port
#        system.l2.mem_side = system.membus.port
#        system.cpu[i].connectMemPorts(system.tol2bus)
#    else:
#        system.cpu[i].connectMemPorts(system.membus)
    system.cpu[i].workload = process[i]
root = Root(full_system = False,system = system)
Simulation.run(options, root, system, FutureClass)
"

but i always get the following error:

"  File "<string>", line 1, in <module>
  File "/home/yang/gem5/src/python/m5/main.py", line 388, in main
    exec filecode in scope
  File "./configs/example/cmp.py", line 122, in <module>
    CPUClass.clock = '1.0GHz'
  File "/home/yang/gem5/src/python/m5/SimObject.py", line 349, in
__setattr__
    "Class %s has no parameter \'%s\'" % (cls.__name__, attr)
AttributeError: Class AtomicSimpleCPU has no parameter 'clock'"

I am wondering how this happens. The code is almost the same to the
examples in wiki.

Thanks,
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to