summaryrefslogtreecommitdiff
path: root/src/mem/bus.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-10-11 06:38:43 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-10-11 06:38:43 -0400
commit43ca8415e8747145cb1a410d4672d4cd2247c695 (patch)
tree079d9c95eb41033870017b84205c625e95febf00 /src/mem/bus.hh
parent5dba9225f7cdbcef342fd64c70f91b5bbea2a1a1 (diff)
downloadgem5-43ca8415e8747145cb1a410d4672d4cd2247c695.tar.xz
Mem: Determine bus block size during initialisation
This patch moves the block size computation from findBlockSize to initialisation time, once all the neighbouring ports are connected. There is no need to dynamically update the block size, and the caching of the value effectively avoided that anyhow. This is very similar to what was already in place, just with a slightly leaner implementation.
Diffstat (limited to 'src/mem/bus.hh')
-rw-r--r--src/mem/bus.hh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mem/bus.hh b/src/mem/bus.hh
index 95699cf22..a3469a478 100644
--- a/src/mem/bus.hh
+++ b/src/mem/bus.hh
@@ -321,11 +321,13 @@ class BaseBus : public MemObject
Tick calcPacketTiming(PacketPtr pkt);
/**
- * Ask everyone on the bus what their size is
+ * Ask everyone on the bus what their size is and determine the
+ * bus size as either the maximum, or if no device specifies a
+ * block size return the default.
*
- * @return the max of all the sizes
+ * @return the max of all the sizes or the default if none is set
*/
- unsigned findBlockSize();
+ unsigned deviceBlockSize() const;
std::set<PortID> inRecvRangeChange;
@@ -348,9 +350,7 @@ class BaseBus : public MemObject
addresses not handled by another port to default device. */
const bool useDefaultRange;
- const uint32_t defaultBlockSize;
- uint32_t cachedBlockSize;
- bool cachedBlockSizeValid;
+ uint32_t blockSize;
BaseBus(const BaseBusParams *p);
@@ -358,6 +358,8 @@ class BaseBus : public MemObject
public:
+ virtual void init();
+
/** A function used to return the port associated with this bus object. */
virtual MasterPort& getMasterPort(const std::string& if_name, int idx = -1);
virtual SlavePort& getSlavePort(const std::string& if_name, int idx = -1);