System.py (8596:e6e22fa77883) System.py (8597:45c9f664a365)
1# Copyright (c) 2005-2007 The Regents of The University of Michigan
2# Copyright (c) 2011 Regents of the University of California
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;
9# redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the
11# documentation and/or other materials provided with the distribution;
12# neither the name of the copyright holders nor the names of its
13# contributors may be used to endorse or promote products derived from
14# this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# Authors: Nathan Binkert
29# Rick Strong
30
31from m5.SimObject import SimObject
32from m5.defines import buildEnv
33from m5.params import *
34from m5.proxy import *
35
36from PhysicalMemory import *
37
38class MemoryMode(Enum): vals = ['invalid', 'atomic', 'timing']
39
40class System(SimObject):
41 type = 'System'
42
1# Copyright (c) 2005-2007 The Regents of The University of Michigan
2# Copyright (c) 2011 Regents of the University of California
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;
9# redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the
11# documentation and/or other materials provided with the distribution;
12# neither the name of the copyright holders nor the names of its
13# contributors may be used to endorse or promote products derived from
14# this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# Authors: Nathan Binkert
29# Rick Strong
30
31from m5.SimObject import SimObject
32from m5.defines import buildEnv
33from m5.params import *
34from m5.proxy import *
35
36from PhysicalMemory import *
37
38class MemoryMode(Enum): vals = ['invalid', 'atomic', 'timing']
39
40class System(SimObject):
41 type = 'System'
42
43 # This method is temporarily obsolete. Its functionality will be
44 # restored in a future changeset.
45 @classmethod
43 @classmethod
46 def swig_objdecls(cls, code):
47 code('%include "python/swig/system.i"')
44 def export_method_cxx_predecls(cls, code):
45 code('#include "sim/system.hh"')
48
46
47 @classmethod
48 def export_methods(cls, code):
49 code('''
50 Enums::MemoryMode getMemoryMode();
51 void setMemoryMode(Enums::MemoryMode mode);
52''')
53
49 physmem = Param.PhysicalMemory("Physical Memory")
50 mem_mode = Param.MemoryMode('atomic', "The mode the memory system is in")
51 memories = VectorParam.PhysicalMemory(Self.all, "All memories is the system")
52
53 work_item_id = Param.Int(-1, "specific work item id")
54 work_begin_cpu_id_exit = Param.Int(-1,
55 "work started on specific id, now exit simulation")
56 work_begin_ckpt_count = Param.Counter(0,
57 "create checkpoint when work items begin count value is reached")
58 work_begin_exit_count = Param.Counter(0,
59 "exit simulation when work items begin count value is reached")
60 work_end_ckpt_count = Param.Counter(0,
61 "create checkpoint when work items end count value is reached")
62 work_end_exit_count = Param.Counter(0,
63 "exit simulation when work items end count value is reached")
64 work_cpus_ckpt_count = Param.Counter(0,
65 "create checkpoint when active cpu count value is reached")
66
67 if buildEnv['FULL_SYSTEM']:
68 abstract = True
69 boot_cpu_frequency = Param.Frequency(Self.cpu[0].clock.frequency,
70 "boot processor frequency")
71 init_param = Param.UInt64(0, "numerical value to pass into simulator")
72 boot_osflags = Param.String("a", "boot flags to pass to the kernel")
73 kernel = Param.String("", "file that contains the kernel code")
74 readfile = Param.String("", "file to read startup script from")
75 symbolfile = Param.String("", "file to get the symbols from")
76 load_addr_mask = Param.UInt64(0xffffffffff,
77 "Address to mask loading binaries with");
54 physmem = Param.PhysicalMemory("Physical Memory")
55 mem_mode = Param.MemoryMode('atomic', "The mode the memory system is in")
56 memories = VectorParam.PhysicalMemory(Self.all, "All memories is the system")
57
58 work_item_id = Param.Int(-1, "specific work item id")
59 work_begin_cpu_id_exit = Param.Int(-1,
60 "work started on specific id, now exit simulation")
61 work_begin_ckpt_count = Param.Counter(0,
62 "create checkpoint when work items begin count value is reached")
63 work_begin_exit_count = Param.Counter(0,
64 "exit simulation when work items begin count value is reached")
65 work_end_ckpt_count = Param.Counter(0,
66 "create checkpoint when work items end count value is reached")
67 work_end_exit_count = Param.Counter(0,
68 "exit simulation when work items end count value is reached")
69 work_cpus_ckpt_count = Param.Counter(0,
70 "create checkpoint when active cpu count value is reached")
71
72 if buildEnv['FULL_SYSTEM']:
73 abstract = True
74 boot_cpu_frequency = Param.Frequency(Self.cpu[0].clock.frequency,
75 "boot processor frequency")
76 init_param = Param.UInt64(0, "numerical value to pass into simulator")
77 boot_osflags = Param.String("a", "boot flags to pass to the kernel")
78 kernel = Param.String("", "file that contains the kernel code")
79 readfile = Param.String("", "file to read startup script from")
80 symbolfile = Param.String("", "file to get the symbols from")
81 load_addr_mask = Param.UInt64(0xffffffffff,
82 "Address to mask loading binaries with");