15361Srstrong@cs.ucsd.edu# Copyright (c) 2005-2008 The Regents of The University of Michigan
24486Sbinkertn@umich.edu# All rights reserved.
34486Sbinkertn@umich.edu#
44486Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without
54486Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are
64486Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright
74486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer;
84486Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright
94486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the
104486Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution;
114486Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its
124486Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
134486Sbinkertn@umich.edu# this software without specific prior written permission.
144486Sbinkertn@umich.edu#
154486Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
164486Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
174486Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
184486Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
194486Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
204486Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
214486Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
224486Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
234486Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
244486Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
254486Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
264486Sbinkertn@umich.edu#
274486Sbinkertn@umich.edu# Authors: Nathan Binkert
284486Sbinkertn@umich.edu
2911988Sandreas.sandberg@arm.comfrom m5.SimObject import *
303102SN/Afrom m5.params import *
313102SN/Afrom m5.proxy import *
3213883Sdavid.hashe@amd.comfrom os import getcwd
334486Sbinkertn@umich.edu
341692SN/Aclass Process(SimObject):
351366SN/A    type = 'Process'
369338SAndreas.Sandberg@arm.com    cxx_header = "sim/process.hh"
3711988Sandreas.sandberg@arm.com
3811988Sandreas.sandberg@arm.com    @cxxMethod
3911988Sandreas.sandberg@arm.com    def map(self, vaddr, paddr, size, cacheable=False):
4011988Sandreas.sandberg@arm.com        pass
4111988Sandreas.sandberg@arm.com
425154Sgblack@eecs.umich.edu    input = Param.String('cin', "filename for stdin")
435514SMichael.Adler@intel.com    output = Param.String('cout', 'filename for stdout')
445514SMichael.Adler@intel.com    errout = Param.String('cerr', 'filename for stderr')
452378SN/A    system = Param.System(Parent.any, "system process will run on")
4610299Salexandru.dutu@amd.com    useArchPT = Param.Bool('false', 'maintain an in-memory version of the page\
4710299Salexandru.dutu@amd.com                            table in an architecture-specific format')
4810554Salexandru.dutu@amd.com    kvmInSE = Param.Bool('false', 'initialize the process for KvmCPU in SE')
4911886Sbrandon.potter@amd.com    maxStackSize = Param.MemorySize('64MB', 'maximum size of the stack')
501310SN/A
5111801Sbrandon.potter@amd.com    uid = Param.Int(100, 'user id')
5211801Sbrandon.potter@amd.com    euid = Param.Int(100, 'effective user id')
5311801Sbrandon.potter@amd.com    gid = Param.Int(100, 'group id')
5411801Sbrandon.potter@amd.com    egid = Param.Int(100, 'effective group id')
5511801Sbrandon.potter@amd.com    pid = Param.Int(100, 'process id')
5611885Sbrandon.potter@amd.com    ppid = Param.Int(0, 'parent process id')
5711885Sbrandon.potter@amd.com    pgid = Param.Int(100, 'process group id')
5811801Sbrandon.potter@amd.com
591898SN/A    executable = Param.String('', "executable (overrides cmd[0] if set)")
601310SN/A    cmd = VectorParam.String("command line (executable plus arguments)")
614597Sbinkertn@umich.edu    env = VectorParam.String([], "environment settings")
6213883Sdavid.hashe@amd.com    cwd = Param.String(getcwd(), "current working directory")
635361Srstrong@cs.ucsd.edu    simpoint = Param.UInt64(0, 'simulation point at which to start simulation')
6410496Ssteve.reinhardt@amd.com    drivers = VectorParam.EmulatedDriver([], 'Available emulated drivers')
6514014Sciro.santilli@arm.com    release = Param.String('5.1.0', "Linux kernel uname release")
6610496Ssteve.reinhardt@amd.com
6711851Sbrandon.potter@amd.com    @classmethod
6811851Sbrandon.potter@amd.com    def export_methods(cls, code):
6911851Sbrandon.potter@amd.com        code('bool map(Addr vaddr, Addr paddr, int sz, bool cacheable=true);')
7011851Sbrandon.potter@amd.com
7111851Sbrandon.potter@amd.comclass EmulatedDriver(SimObject):
7211851Sbrandon.potter@amd.com    type = 'EmulatedDriver'
7311851Sbrandon.potter@amd.com    cxx_header = "sim/emul_driver.hh"
7411851Sbrandon.potter@amd.com    abstract = True
7511851Sbrandon.potter@amd.com    filename = Param.String("device file name (under /dev)")
76