abstract_mem.hh (8931:7a1dfb191e3f) abstract_mem.hh (9053:9cad1c26c3b3)
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

48
49#ifndef __ABSTRACT_MEMORY_HH__
50#define __ABSTRACT_MEMORY_HH__
51
52#include "mem/mem_object.hh"
53#include "params/AbstractMemory.hh"
54#include "sim/stats.hh"
55
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

48
49#ifndef __ABSTRACT_MEMORY_HH__
50#define __ABSTRACT_MEMORY_HH__
51
52#include "mem/mem_object.hh"
53#include "params/AbstractMemory.hh"
54#include "sim/stats.hh"
55
56
57class System;
58
56/**
57 * An abstract memory represents a contiguous block of physical
58 * memory, with an associated address range, and also provides basic
59 * functionality for reading and writing this memory without any
60 * timing information. It is a MemObject since any subclass must have
61 * at least one slave port.
62 */
63class AbstractMemory : public MemObject

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

135 return !isLLSC; // only do write if not an sc
136 } else {
137 // iterate over list...
138 return checkLockedAddrList(pkt);
139 }
140 }
141
142 /** Number of total bytes read from this memory */
59/**
60 * An abstract memory represents a contiguous block of physical
61 * memory, with an associated address range, and also provides basic
62 * functionality for reading and writing this memory without any
63 * timing information. It is a MemObject since any subclass must have
64 * at least one slave port.
65 */
66class AbstractMemory : public MemObject

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

138 return !isLLSC; // only do write if not an sc
139 } else {
140 // iterate over list...
141 return checkLockedAddrList(pkt);
142 }
143 }
144
145 /** Number of total bytes read from this memory */
143 Stats::Scalar bytesRead;
146 Stats::Vector bytesRead;
144 /** Number of instruction bytes read from this memory */
147 /** Number of instruction bytes read from this memory */
145 Stats::Scalar bytesInstRead;
148 Stats::Vector bytesInstRead;
146 /** Number of bytes written to this memory */
149 /** Number of bytes written to this memory */
147 Stats::Scalar bytesWritten;
150 Stats::Vector bytesWritten;
148 /** Number of read requests */
151 /** Number of read requests */
149 Stats::Scalar numReads;
152 Stats::Vector numReads;
150 /** Number of write requests */
153 /** Number of write requests */
151 Stats::Scalar numWrites;
154 Stats::Vector numWrites;
152 /** Number of other requests */
155 /** Number of other requests */
153 Stats::Scalar numOther;
156 Stats::Vector numOther;
154 /** Read bandwidth from this memory */
155 Stats::Formula bwRead;
156 /** Read bandwidth from this memory */
157 Stats::Formula bwInstRead;
158 /** Write bandwidth from this memory */
159 Stats::Formula bwWrite;
160 /** Total bandwidth from this memory */
161 Stats::Formula bwTotal;
162
157 /** Read bandwidth from this memory */
158 Stats::Formula bwRead;
159 /** Read bandwidth from this memory */
160 Stats::Formula bwInstRead;
161 /** Write bandwidth from this memory */
162 Stats::Formula bwWrite;
163 /** Total bandwidth from this memory */
164 Stats::Formula bwTotal;
165
166 /** Pointor to the System object.
167 * This is used for getting the number of masters in the system which is
168 * needed when registering stats
169 */
170 System *_system;
171
172
163 private:
164
165 // Prevent copying
166 AbstractMemory(const AbstractMemory&);
167
168 // Prevent assignment
169 AbstractMemory& operator=(const AbstractMemory&);
170
171 public:
172
173 typedef AbstractMemoryParams Params;
174
175 AbstractMemory(const Params* p);
176 virtual ~AbstractMemory();
177
173 private:
174
175 // Prevent copying
176 AbstractMemory(const AbstractMemory&);
177
178 // Prevent assignment
179 AbstractMemory& operator=(const AbstractMemory&);
180
181 public:
182
183 typedef AbstractMemoryParams Params;
184
185 AbstractMemory(const Params* p);
186 virtual ~AbstractMemory();
187
188 /** read the system pointer
189 * Implemented for completeness with the setter
190 * @return pointer to the system object */
191 System* system() const { return _system; }
192
193 /** Set the system pointer on this memory
194 * This can't be done via a python parameter because the system needs
195 * pointers to all the memories and the reverse would create a cycle in the
196 * object graph. An init() this is set.
197 * @param sys system pointer to set
198 */
199 void system(System *sys) { _system = sys; }
200
178 const Params *
179 params() const
180 {
181 return dynamic_cast<const Params *>(_params);
182 }
183
184 /**
185 * Get the address range

--- 65 unchanged lines hidden ---
201 const Params *
202 params() const
203 {
204 return dynamic_cast<const Params *>(_params);
205 }
206
207 /**
208 * Get the address range

--- 65 unchanged lines hidden ---