Example #1
0
def main():
    # Add options
    parser = optparse.OptionParser()
    Options.addCommonOptions(parser)
    Options.addFSOptions(parser)
    (options, args) = parser.parse_args()

    system = build_switch(options)
    root = Root(full_system = True, system = system)
    Simulation.run(options, root, None, None)
Example #2
0
    def genOptions(inZip):
        """ Generate options.
            Only format framework.
        """

        options = Options()
        options.inZip = inZip
        options.outZip = inZip + ".std.zip"
        options.formatFrw = True

        return options
Example #3
0
    def init_system(self, system):
        """Initialize a system.

        Arguments:
          system -- System to initialize.
        """
        self.create_clk_src(system)
        system.cpu = self.create_cpus(system.cpu_clk_domain)

        if _have_kvm_support and \
                any([isinstance(c, BaseKvmCPU) for c in system.cpu]):
            self.init_kvm(system)

        if self.use_ruby:
            # Add the ruby specific and protocol specific options
            parser = optparse.OptionParser()
            Options.addCommonOptions(parser)
            Ruby.define_options(parser)
            (options, args) = parser.parse_args()

            # Set the default cache size and associativity to be very
            # small to encourage races between requests and writebacks.
            options.l1d_size="32kB"
            options.l1i_size="32kB"
            options.l2_size="4MB"
            options.l1d_assoc=4
            options.l1i_assoc=2
            options.l2_assoc=8
            options.num_cpus = self.num_cpus
            options.num_dirs = 2

            bootmem = getattr(system, 'bootmem', None)
            Ruby.create_system(options, True, system, system.iobus,
                               system._dma_ports, bootmem)

            # Create a seperate clock domain for Ruby
            system.ruby.clk_domain = SrcClockDomain(
                clock = options.ruby_clock,
                voltage_domain = system.voltage_domain)
            for i, cpu in enumerate(system.cpu):
                if not cpu.switched_out:
                    cpu.createInterruptController()
                    cpu.connectCachedPorts(system.ruby._cpu_ports[i])
        else:
            sha_bus = self.create_caches_shared(system)
            for cpu in system.cpu:
                self.init_cpu(system, cpu, sha_bus)
Example #4
0
#  Author: Brad Beckmann
#

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

m5.util.addToPath("../configs/")

from ruby import Ruby
from common import Options

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

# add the gpu specific options expected by the the gpu and gpu_RfO
parser.add_option("-u", "--num-compute-units", type="int", default=8, help="number of compute units in the GPU")
parser.add_option("--num-cp", type="int", default=0, help="Number of GPU Command Processors (CP)")
parser.add_option("--simds-per-cu", type="int", default=4, help="SIMD units" "per CU")
parser.add_option("--wf-size", type="int", default=64, help="Wavefront size(in workitems)")
parser.add_option("--wfs-per-simd", type="int", default=10, help="Number of " "WF slots per SIMD")

# Add the ruby specific and protocol specific options
Ruby.define_options(parser)

(options, args) = parser.parse_args()

#
# Set the default cache size and associativity to be very small to encourage
Example #5
0
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

addToPath('../')

from common import Options
from ruby import Ruby

# Get paths we might need.
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)

parser = optparse.OptionParser()
Options.addNoISAOptions(parser)

parser.add_option("--maxloads", metavar="N", default=100,
                  help="Stop after N loads")
parser.add_option("-f", "--wakeup_freq", metavar="N", default=10,
                  help="Wakeup every N cycles")
parser.add_option("-u", "--num-compute-units", type="int", default=1,
                  help="number of compute units in the GPU")
parser.add_option("--num-cp", type="int", default=0,
                  help="Number of GPU Command Processors (CP)")
# not super important now, but to avoid putting the number 4 everywhere, make
# it an option/knob
parser.add_option("--cu-per-sqc", type="int", default=4, help="number of CUs \
                  sharing an SQC (icache, and thus icache TLB)")
parser.add_option("--simds-per-cu", type="int", default=4, help="SIMD units" \
                  "per CU")
Example #6
0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

__author__ = '*****@*****.**'


from os import sys

from common import Options, Log
from zipformatter import ZipFormatter


# Global
TAG="reverse-oatnormalize"
OPTIONS = Options()


if __name__ == "__main__":

    Log.DEBUG = True

    OPTIONS.handle(sys.argv)

    ZipFormatter.create(OPTIONS).format()

Example #7
0
 def port(self):
     """abstracts the port of the dialog"""
     try:
         return int(self.url.partition(':')[2])
     except ValueError:
         return Options.defaultPort()
            process.output = outputs[idx]
        if len(errouts) > idx:
            process.errout = errouts[idx]

        multiprocesses.append(process)
        idx += 1

    if options.smt:
        assert(options.cpu_type == "DerivO3CPU")
        return multiprocesses, idx
    else:
        return multiprocesses, 1


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

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

(options, args) = parser.parse_args()

if len(args) > 1:
    print("Error: Too many arguments")
    sys.exit(1)

multiprocesses = []
numThreads = 1

if options.bench:
Example #9
0
    # Create the appropriate memory controllers and connect them to the
    # memory bus
    drive_sys.mem_ctrls = [
        DriveMemClass(range=r) for r in drive_sys.mem_ranges
    ]
    for i in xrange(len(drive_sys.mem_ctrls)):
        drive_sys.mem_ctrls[i].port = drive_sys.membus.master

    drive_sys.init_param = options.init_param

    return drive_sys


# Add options
parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addFSOptions(parser)

# Add the ruby specific and protocol specific options
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)

# system under test can be any CPU
(TestCPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)
Example #10
0
def main():
    Options.setCommandLineOptions()
    if Options.CPROFILING:
        cProfile.run("run(sys.argv[1:])", sort=1)
    else:
        run(sys.argv[1:])
Example #11
0
 def port(self):
     """abstracts the port of the dialog"""
     try:
         return int(self.url.partition(':')[2])
     except ValueError:
         return Options.defaultPort()
Example #12
0
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

addToPath('../')

from common import Options
from ruby import Ruby

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

parser = optparse.OptionParser()
Options.addNoISAOptions(parser)

# GPU Ruby tester options
parser.add_option("--cache-size",
                  type="int",
                  default=0,
                  help="Cache sizes to use. Small encourages races between \
                        requests and writebacks. Large stresses write-through \
                        and/or write-back GPU caches. Range [0..1]")
parser.add_option("--system-size",
                  type="int",
                  default=0,
                  help="This option defines how many CUs, CPUs and cache \
                        components in the test system. Range[0..2]")
parser.add_option("--address-range",
                  type="int",