System.py revision 9524
14486Sbinkertn@umich.edu# Copyright (c) 2005-2007 The Regents of The University of Michigan 27897Shestness@cs.utexas.edu# Copyright (c) 2011 Regents of the University of California 34486Sbinkertn@umich.edu# All rights reserved. 44486Sbinkertn@umich.edu# 54486Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without 64486Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are 74486Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright 84486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer; 94486Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright 104486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the 114486Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution; 124486Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its 134486Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from 144486Sbinkertn@umich.edu# this software without specific prior written permission. 154486Sbinkertn@umich.edu# 164486Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 174486Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 184486Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 194486Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 204486Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 214486Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 224486Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 234486Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 244486Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 254486Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 264486Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 274486Sbinkertn@umich.edu# 284486Sbinkertn@umich.edu# Authors: Nathan Binkert 297897Shestness@cs.utexas.edu# Rick Strong 304486Sbinkertn@umich.edu 313102SN/Afrom m5.SimObject import SimObject 326654Snate@binkert.orgfrom m5.defines import buildEnv 333102SN/Afrom m5.params import * 343102SN/Afrom m5.proxy import * 356654Snate@binkert.org 368931Sandreas.hansson@arm.comfrom SimpleMemory import * 372212SN/A 389524SAndreas.Sandberg@ARM.comclass MemoryMode(Enum): vals = ['invalid', 'atomic', 'timing', 399524SAndreas.Sandberg@ARM.com 'atomic_noncaching'] 402902SN/A 418703Sandreas.hansson@arm.comclass System(MemObject): 421783SN/A type = 'System' 439338SAndreas.Sandberg@arm.com cxx_header = "sim/system.hh" 448839Sandreas.hansson@arm.com system_port = MasterPort("System port") 457673Snate@binkert.org 467673Snate@binkert.org # Override the clock from the ClockedObject which looks at the 478597Ssteve.reinhardt@amd.com # parent clock by default. The 1 GHz default system clock serves 488597Ssteve.reinhardt@amd.com # as a start for the modules that rely on the parent to provide 498597Ssteve.reinhardt@amd.com # the clock. 508597Ssteve.reinhardt@amd.com clock = '1GHz' 518597Ssteve.reinhardt@amd.com 528597Ssteve.reinhardt@amd.com @classmethod 539524SAndreas.Sandberg@ARM.com def export_method_cxx_predecls(cls, code): 548597Ssteve.reinhardt@amd.com code('#include "sim/system.hh"') 558597Ssteve.reinhardt@amd.com 564859Snate@binkert.org @classmethod 578931Sandreas.hansson@arm.com def export_methods(cls, code): 588931Sandreas.hansson@arm.com code(''' 592902SN/A Enums::MemoryMode getMemoryMode() const; 609408Sandreas.hansson@arm.com void setMemoryMode(Enums::MemoryMode mode); 619408Sandreas.hansson@arm.com''') 629408Sandreas.hansson@arm.com 639408Sandreas.hansson@arm.com memories = VectorParam.AbstractMemory(Self.all, 649408Sandreas.hansson@arm.com "All memories in the system") 659408Sandreas.hansson@arm.com mem_mode = Param.MemoryMode('atomic', "The mode the memory system is in") 669814Sandreas.hansson@arm.com 679814Sandreas.hansson@arm.com # The memory ranges are to be populated when creating the system 687914SBrad.Beckmann@amd.com # such that these can be passed from the I/O subsystem through an 698666SPrakash.Ramrakhyani@arm.com # I/O bridge or cache 707914SBrad.Beckmann@amd.com mem_ranges = VectorParam.AddrRange([], "Ranges that constitute main memory") 717914SBrad.Beckmann@amd.com 727914SBrad.Beckmann@amd.com work_item_id = Param.Int(-1, "specific work item id") 737914SBrad.Beckmann@amd.com num_work_ids = Param.Int(16, "Number of distinct work item types") 747914SBrad.Beckmann@amd.com work_begin_cpu_id_exit = Param.Int(-1, 757914SBrad.Beckmann@amd.com "work started on specific id, now exit simulation") 767914SBrad.Beckmann@amd.com work_begin_ckpt_count = Param.Counter(0, 777914SBrad.Beckmann@amd.com "create checkpoint when work items begin count value is reached") 787914SBrad.Beckmann@amd.com work_begin_exit_count = Param.Counter(0, 797914SBrad.Beckmann@amd.com "exit simulation when work items begin count value is reached") 807914SBrad.Beckmann@amd.com work_end_ckpt_count = Param.Counter(0, 817914SBrad.Beckmann@amd.com "create checkpoint when work items end count value is reached") 827914SBrad.Beckmann@amd.com work_end_exit_count = Param.Counter(0, 838769Sgblack@eecs.umich.edu "exit simulation when work items end count value is reached") 848769Sgblack@eecs.umich.edu work_cpus_ckpt_count = Param.Counter(0, 858769Sgblack@eecs.umich.edu "create checkpoint when active cpu count value is reached") 868769Sgblack@eecs.umich.edu 878769Sgblack@eecs.umich.edu init_param = Param.UInt64(0, "numerical value to pass into simulator") 888769Sgblack@eecs.umich.edu boot_osflags = Param.String("a", "boot flags to pass to the kernel") 898769Sgblack@eecs.umich.edu kernel = Param.String("", "file that contains the kernel code") 90 readfile = Param.String("", "file to read startup script from") 91 symbolfile = Param.String("", "file to get the symbols from") 92 load_addr_mask = Param.UInt64(0xffffffffff, 93 "Address to mask loading binaries with"); 94