1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 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; --- 27 unchanged lines hidden (view full) --- 36#include <unistd.h> 37#include <zlib.h> 38 39#include <iostream> 40#include <string> 41 42#include "arch/isa_traits.hh" 43#include "base/misc.hh" |
44#include "base/random.hh" |
45#include "config/full_system.hh" 46#include "mem/packet_access.hh" 47#include "mem/physical.hh" 48#include "sim/eventq.hh" 49#include "sim/host.hh" 50 51using namespace std; 52using namespace TheISA; 53 54PhysicalMemory::PhysicalMemory(const Params *p) |
55 : MemObject(p), pmemAddr(NULL), lat(p->latency), 56 lat_var(p->latency_var) |
57{ 58 if (params()->range.size() % TheISA::PageBytes != 0) 59 panic("Memory Size not divisible by page size\n"); 60 61 int map_flags = MAP_ANON | MAP_PRIVATE; 62 pmemAddr = (uint8_t *)mmap(NULL, params()->range.size(), 63 PROT_READ | PROT_WRITE, map_flags, -1, 0); 64 --- 48 unchanged lines hidden (view full) --- 113{ 114 //Can accept anysize request 115 return 0; 116} 117 118Tick 119PhysicalMemory::calculateLatency(PacketPtr pkt) 120{ |
121 Tick latency = lat; 122 if (lat_var != 0) 123 latency += random_mt.random<Tick>(0, lat_var); 124 return latency; |
125} 126 127 128 129// Add load-locked to tracking list. Should only be called if the 130// operation is a load and the LOCKED flag is set. 131void 132PhysicalMemory::trackLoadLocked(PacketPtr pkt) --- 429 unchanged lines hidden --- |