From 01c55983737273c70e44e0181e75453e01c5da34 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 7 Jan 2013 13:05:38 -0500 Subject: mem: Add interleaving bits to the address ranges This patch adds support for interleaving bits for the address ranges. What was previously just a start and end address, now has an additional three fields, for the high bit, and number of bits to use for interleaving, and a match value to compare against. If the number of interleaving bits is set to zero it is effectively disabled. A number of convenience functions are added to the range to enquire about the interleaving, its granularity and the number of stripes it is part of. --- src/mem/physical.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mem/physical.cc') diff --git a/src/mem/physical.cc b/src/mem/physical.cc index ae5da82fd..140e2b1c0 100644 --- a/src/mem/physical.cc +++ b/src/mem/physical.cc @@ -119,9 +119,13 @@ void PhysicalMemory::createBackingStore(AddrRange range, const vector& _memories) { + if (range.interleaved()) + panic("Cannot create backing store for interleaved range %s\n", + range.to_string()); + // perform the actual mmap - DPRINTF(BusAddrRanges, "Creating backing store for range %s\n", - range.to_string()); + DPRINTF(BusAddrRanges, "Creating backing store for range %s with size %d\n", + range.to_string(), range.size()); int map_flags = MAP_ANON | MAP_PRIVATE; uint8_t* pmem = (uint8_t*) mmap(NULL, range.size(), PROT_READ | PROT_WRITE, -- cgit v1.2.3