System.py revision 3812
1from m5.SimObject import SimObject 2from m5.params import * 3from m5.proxy import * 4from m5 import build_env 5from PhysicalMemory import * 6 7class MemoryMode(Enum): vals = ['invalid', 'atomic', 'timing'] 8 9class System(SimObject): 10 type = 'System' 11 physmem = Param.PhysicalMemory(Parent.any, "phsyical memory") 12 mem_mode = Param.MemoryMode('atomic', "The mode the memory system is in") 13 if build_env['FULL_SYSTEM']: 14 boot_cpu_frequency = Param.Frequency(Self.cpu[0].clock.frequency, 15 "boot processor frequency") 16 init_param = Param.UInt64(0, "numerical value to pass into simulator") 17 boot_osflags = Param.String("a", "boot flags to pass to the kernel") 18 kernel = Param.String("", "file that contains the kernel code") 19 readfile = Param.String("", "file to read startup script from") 20 symbolfile = Param.String("", "file to get the symbols from") 21 22class AlphaSystem(System): 23 type = 'AlphaSystem' 24 console = Param.String("file that contains the console code") 25 pal = Param.String("file that contains palcode") 26 system_type = Param.UInt64("Type of system we are emulating") 27 system_rev = Param.UInt64("Revision of system we are emulating") 28 29class SparcSystem(System): 30 type = 'SparcSystem' 31 _rom_base = 0xfff0000000 32 _nvram_base = 0x1f11000000 33 _hypervisor_desc_base = 0x1f12080000 34 _partition_desc_base = 0x1f12000000 35 # ROM for OBP/Reset/Hypervisor 36 rom = Param.PhysicalMemory(PhysicalMemory(range = AddrRange(_rom_base, size = '8MB')), 37 "Memory to hold the ROM data") 38 # nvram 39 nvram = Param.PhysicalMemory( 40 PhysicalMemory(range = AddrRange(_nvram_base, size = '8kB')), 41 "Memory to hold the nvram data") 42 # hypervisor description 43 hypervisor_desc = Param.PhysicalMemory( 44 PhysicalMemory(range = AddrRange(_hypervisor_desc_base, size = '8kB')), 45 "Memory to hold the hypervisor description") 46 # partition description 47 partition_desc = Param.PhysicalMemory( 48 PhysicalMemory(range = AddrRange(_partition_desc_base, size = '8kB')), 49 "Memory to hold the partition description") 50 51 reset_addr = Param.Addr(_rom_base, "Address to load ROM at") 52 hypervisor_addr = Param.Addr(Addr('64kB') + _rom_base, 53 "Address to load hypervisor at") 54 openboot_addr = Param.Addr(Addr('512kB') + _rom_base, 55 "Address to load openboot at") 56 nvram_addr = Param.Addr(_nvram_base, "Address to put the nvram") 57 hypervisor_desc_addr = Param.Addr(_hypervisor_desc_base, 58 "Address for the hypervisor description") 59 partition_desc_addr = Param.Addr(_partition_desc_base, 60 "Address for the partition description") 61 62 reset_bin = Param.String("file that contains the reset code") 63 hypervisor_bin = Param.String("file that contains the hypervisor code") 64 openboot_bin = Param.String("file that contains the openboot code") 65 nvram_bin = Param.String("file that contains the contents of nvram") 66 hypervisor_desc_bin = Param.String("file that contains the hypervisor description") 67 partition_desc_bin = Param.String("file that contains the partition description") 68 69