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 "config/full_system.hh"
45#include "mem/packet_access.hh"
46#include "mem/physical.hh"
47#include "sim/eventq.hh"
48#include "sim/host.hh"
49
50using namespace std;
51using namespace TheISA;
52
53PhysicalMemory::PhysicalMemory(const Params *p)
54 : MemObject(p), pmemAddr(NULL), lat(p->latency)
55{
56 if (params()->range.size() % TheISA::PageBytes != 0)
57 panic("Memory Size not divisible by page size\n");
58
59 int map_flags = MAP_ANON | MAP_PRIVATE;
60 pmemAddr = (uint8_t *)mmap(NULL, params()->range.size(),
61 PROT_READ | PROT_WRITE, map_flags, -1, 0);
62
--- 48 unchanged lines hidden (view full) ---
111{
112 //Can accept anysize request
113 return 0;
114}
115
116Tick
117PhysicalMemory::calculateLatency(PacketPtr pkt)
118{
119 return lat;
120}
121
122
123
124// Add load-locked to tracking list. Should only be called if the
125// operation is a load and the LOCKED flag is set.
126void
127PhysicalMemory::trackLoadLocked(PacketPtr pkt)
--- 429 unchanged lines hidden ---
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 "config/full_system.hh"
45#include "mem/packet_access.hh"
46#include "mem/physical.hh"
47#include "sim/eventq.hh"
48#include "sim/host.hh"
49
50using namespace std;
51using namespace TheISA;
52
53PhysicalMemory::PhysicalMemory(const Params *p)
54 : MemObject(p), pmemAddr(NULL), lat(p->latency)
55{
56 if (params()->range.size() % TheISA::PageBytes != 0)
57 panic("Memory Size not divisible by page size\n");
58
59 int map_flags = MAP_ANON | MAP_PRIVATE;
60 pmemAddr = (uint8_t *)mmap(NULL, params()->range.size(),
61 PROT_READ | PROT_WRITE, map_flags, -1, 0);
62
--- 48 unchanged lines hidden (view full) ---
111{
112 //Can accept anysize request
113 return 0;
114}
115
116Tick
117PhysicalMemory::calculateLatency(PacketPtr pkt)
118{
119 return lat;
120}
121
122
123
124// Add load-locked to tracking list. Should only be called if the
125// operation is a load and the LOCKED flag is set.
126void
127PhysicalMemory::trackLoadLocked(PacketPtr pkt)
--- 429 unchanged lines hidden ---