physical.hh (8711:c7e14f52c682) physical.hh (8719:d70a85ee7062)
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;

--- 24 unchanged lines hidden (view full) ---

33
34#ifndef __PHYSICAL_MEMORY_HH__
35#define __PHYSICAL_MEMORY_HH__
36
37#include <map>
38#include <string>
39
40#include "base/range.hh"
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;

--- 24 unchanged lines hidden (view full) ---

33
34#ifndef __PHYSICAL_MEMORY_HH__
35#define __PHYSICAL_MEMORY_HH__
36
37#include <map>
38#include <string>
39
40#include "base/range.hh"
41#include "base/statistics.hh"
41#include "mem/mem_object.hh"
42#include "mem/packet.hh"
43#include "mem/tport.hh"
44#include "params/PhysicalMemory.hh"
45#include "sim/eventq.hh"
42#include "mem/mem_object.hh"
43#include "mem/packet.hh"
44#include "mem/tport.hh"
45#include "params/PhysicalMemory.hh"
46#include "sim/eventq.hh"
47#include "sim/stats.hh"
46
47//
48// Functional model for a contiguous block of physical memory. (i.e. RAM)
49//
50class PhysicalMemory : public MemObject
51{
52 protected:
53

--- 95 unchanged lines hidden (view full) ---

149 uint8_t *pmemAddr;
150 Tick lat;
151 Tick lat_var;
152 std::vector<MemoryPort*> ports;
153 typedef std::vector<MemoryPort*>::iterator PortIterator;
154
155 uint64_t _size;
156 uint64_t _start;
48
49//
50// Functional model for a contiguous block of physical memory. (i.e. RAM)
51//
52class PhysicalMemory : public MemObject
53{
54 protected:
55

--- 95 unchanged lines hidden (view full) ---

151 uint8_t *pmemAddr;
152 Tick lat;
153 Tick lat_var;
154 std::vector<MemoryPort*> ports;
155 typedef std::vector<MemoryPort*>::iterator PortIterator;
156
157 uint64_t _size;
158 uint64_t _start;
159
160 /** Number of total bytes read from this memory */
161 Stats::Scalar bytesRead;
162 /** Number of instruction bytes read from this memory */
163 Stats::Scalar bytesInstRead;
164 /** Number of bytes written to this memory */
165 Stats::Scalar bytesWritten;
166 /** Number of read requests */
167 Stats::Scalar numReads;
168 /** Number of write requests */
169 Stats::Scalar numWrites;
170 /** Number of other requests */
171 Stats::Scalar numOther;
172 /** Read bandwidth from this memory */
173 Stats::Formula bwRead;
174 /** Read bandwidth from this memory */
175 Stats::Formula bwInstRead;
176 /** Write bandwidth from this memory */
177 Stats::Formula bwWrite;
178 /** Total bandwidth from this memory */
179 Stats::Formula bwTotal;
180
157 public:
158 uint64_t size() { return _size; }
159 uint64_t start() { return _start; }
160
161 public:
162 typedef PhysicalMemoryParams Params;
163 PhysicalMemory(const Params *p);
164 virtual ~PhysicalMemory();

--- 12 unchanged lines hidden (view full) ---

177 unsigned int drain(Event *de);
178
179 protected:
180 Tick doAtomicAccess(PacketPtr pkt);
181 void doFunctionalAccess(PacketPtr pkt);
182 virtual Tick calculateLatency(PacketPtr pkt);
183
184 public:
181 public:
182 uint64_t size() { return _size; }
183 uint64_t start() { return _start; }
184
185 public:
186 typedef PhysicalMemoryParams Params;
187 PhysicalMemory(const Params *p);
188 virtual ~PhysicalMemory();

--- 12 unchanged lines hidden (view full) ---

201 unsigned int drain(Event *de);
202
203 protected:
204 Tick doAtomicAccess(PacketPtr pkt);
205 void doFunctionalAccess(PacketPtr pkt);
206 virtual Tick calculateLatency(PacketPtr pkt);
207
208 public:
209 /**
210 * Register Statistics
211 */
212 void regStats();
213
185 virtual void serialize(std::ostream &os);
186 virtual void unserialize(Checkpoint *cp, const std::string &section);
187
188};
189
190#endif //__PHYSICAL_MEMORY_HH__
214 virtual void serialize(std::ostream &os);
215 virtual void unserialize(Checkpoint *cp, const std::string &section);
216
217};
218
219#endif //__PHYSICAL_MEMORY_HH__