From b00949d88bb3185dfa2e27799de7f90e5a449be8 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 6 Apr 2012 13:46:31 -0400 Subject: MEM: Enable multiple distributed generalized memories This patch removes the assumption on having on single instance of PhysicalMemory, and enables a distributed memory where the individual memories in the system are each responsible for a single contiguous address range. All memories inherit from an AbstractMemory that encompasses the basic behaviuor of a random access memory, and provides untimed access methods. What was previously called PhysicalMemory is now SimpleMemory, and a subclass of AbstractMemory. All future types of memory controllers should inherit from AbstractMemory. To enable e.g. the atomic CPU and RubyPort to access the now distributed memory, the system has a wrapper class, called PhysicalMemory that is aware of all the memories in the system and their associated address ranges. This class thus acts as an infinitely-fast bus and performs address decoding for these "shortcut" accesses. Each memory can specify that it should not be part of the global address map (used e.g. by the functional memories by some testers). Moreover, each memory can be configured to be reported to the OS configuration table, useful for populating ATAG structures, and any potential ACPI tables. Checkpointing support currently assumes that all memories have the same size and organisation when creating and resuming from the checkpoint. A future patch will enable a more flexible re-organisation. --HG-- rename : src/mem/PhysicalMemory.py => src/mem/AbstractMemory.py rename : src/mem/PhysicalMemory.py => src/mem/SimpleMemory.py rename : src/mem/physical.cc => src/mem/abstract_mem.cc rename : src/mem/physical.hh => src/mem/abstract_mem.hh rename : src/mem/physical.cc => src/mem/simple_mem.cc rename : src/mem/physical.hh => src/mem/simple_mem.hh --- src/arch/arm/ArmSystem.py | 4 ---- src/arch/arm/linux/system.cc | 9 +++++++-- src/arch/arm/remote_gdb.hh | 1 - src/arch/arm/system.cc | 3 --- 4 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/arch/arm') diff --git a/src/arch/arm/ArmSystem.py b/src/arch/arm/ArmSystem.py index e744c026c..f4aedaf98 100644 --- a/src/arch/arm/ArmSystem.py +++ b/src/arch/arm/ArmSystem.py @@ -56,8 +56,6 @@ class ArmSystem(System): # 0x0 Revision midr_regval = Param.UInt32(0x350fc000, "MIDR value") boot_loader = Param.String("", "File that contains the boot loader code if any") - boot_loader_mem = Param.PhysicalMemory(NULL, - "Memory object that boot loader is to be loaded into") gic_cpu_addr = Param.Addr(0, "Addres of the GIC CPU interface") flags_addr = Param.Addr(0, "Address of the flags register for MP booting") @@ -67,5 +65,3 @@ class LinuxArmSystem(ArmSystem): machine_type = Param.ArmMachineType('RealView_PBX', "Machine id from http://www.arm.linux.org.uk/developer/machines/") atags_addr = Param.Addr(0x100, "Address where default atags structure should be written") - - diff --git a/src/arch/arm/linux/system.cc b/src/arch/arm/linux/system.cc index 64bda4b4d..0d9e73a53 100644 --- a/src/arch/arm/linux/system.cc +++ b/src/arch/arm/linux/system.cc @@ -125,9 +125,14 @@ LinuxArmSystem::initState() ac->pagesize(8192); ac->rootdev(0); + AddrRangeList atagRanges = physmem.getConfAddrRanges(); + if (atagRanges.size() != 1) { + fatal("Expected a single ATAG memory entry but got %d\n", + atagRanges.size()); + } AtagMem *am = new AtagMem; - am->memSize(params()->physmem->size()); - am->memStart(params()->physmem->start()); + am->memSize(atagRanges.begin()->size()); + am->memStart(atagRanges.begin()->start); AtagCmdline *ad = new AtagCmdline; ad->cmdline(params()->boot_osflags); diff --git a/src/arch/arm/remote_gdb.hh b/src/arch/arm/remote_gdb.hh index 9ff93b8e6..b75d921fb 100644 --- a/src/arch/arm/remote_gdb.hh +++ b/src/arch/arm/remote_gdb.hh @@ -37,7 +37,6 @@ class System; class ThreadContext; -class PhysicalMemory; namespace ArmISA { diff --git a/src/arch/arm/system.cc b/src/arch/arm/system.cc index 7fbabafcb..f6c4ad783 100644 --- a/src/arch/arm/system.cc +++ b/src/arch/arm/system.cc @@ -55,9 +55,6 @@ using namespace Linux; ArmSystem::ArmSystem(Params *p) : System(p), bootldr(NULL) { - if ((p->boot_loader == "") != (p->boot_loader_mem == NULL)) - fatal("If boot_loader is specifed, memory to load it must be also.\n"); - if (p->boot_loader != "") { bootldr = createObjectFile(p->boot_loader); -- cgit v1.2.3