Process.py revision 4597
14486Sbinkertn@umich.edu# Copyright (c) 2005-2007 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 293102SN/Afrom m5.SimObject import SimObject 303102SN/Afrom m5.params import * 313102SN/Afrom m5.proxy import * 324486Sbinkertn@umich.edu 331692SN/Aclass Process(SimObject): 341366SN/A type = 'Process' 351310SN/A abstract = True 361310SN/A output = Param.String('cout', 'filename for stdout/stderr') 372378SN/A system = Param.System(Parent.any, "system process will run on") 381310SN/A 391692SN/Aclass LiveProcess(Process): 401366SN/A type = 'LiveProcess' 411898SN/A executable = Param.String('', "executable (overrides cmd[0] if set)") 421310SN/A cmd = VectorParam.String("command line (executable plus arguments)") 434597Sbinkertn@umich.edu env = VectorParam.String([], "environment settings") 443669SN/A cwd = Param.String('', "current working directory") 451310SN/A input = Param.String('cin', "filename for stdin") 463066SN/A uid = Param.Int(100, 'user id') 473066SN/A euid = Param.Int(100, 'effective user id') 483066SN/A gid = Param.Int(100, 'group id') 493066SN/A egid = Param.Int(100, 'effective group id') 503066SN/A pid = Param.Int(100, 'process id') 513066SN/A ppid = Param.Int(99, 'parent process id') 52