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 |
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 */ |
146 Stats::Vector bytesRead; |
147 /** Number of instruction bytes read from this memory */ |
148 Stats::Vector bytesInstRead; |
149 /** Number of bytes written to this memory */ |
150 Stats::Vector bytesWritten; |
151 /** Number of read requests */ |
152 Stats::Vector numReads; |
153 /** Number of write requests */ |
154 Stats::Vector numWrites; |
155 /** Number of other requests */ |
156 Stats::Vector numOther; |
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 |
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 |
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 --- |