ruby: re-added the addressToInt slicc interface function
authorBrad Beckmann <Brad.Beckmann@amd.com>
Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)
This helper function is very useful converting address offsets to integers
that can be used for protocol specific destination mapping.

src/mem/protocol/RubySlicc_Util.sm
src/mem/ruby/slicc_interface/RubySlicc_Util.hh

index 0d0e63d85b103e16fc983b7d9b205f377955d7c8..ad06c4e4122ec1de7f621f2d4bea57be02ba76af 100644 (file)
@@ -35,6 +35,7 @@ int random(int number);
 Cycles zero_time();
 NodeID intToID(int nodenum);
 int IDToInt(NodeID id);
+int addressToInt(Address addr);
 void procProfileCoherenceRequest(NodeID node, bool needCLB);
 void dirProfileCoherenceRequest(NodeID node, bool needCLB);
 int max_tokens();
index dd9a1f2a4821047ea5c9a9c4a8b272932c98b7a4..6318d8e33bd9860b5ba0dde61a037ab2214fd0e3 100644 (file)
@@ -56,6 +56,14 @@ IDToInt(NodeID id)
     return nodenum;
 }
 
+inline int
+addressToInt(Address addr)
+{
+    assert(!(addr.getAddress() & 0xffffffff00000000));
+
+    return (int)addr.getAddress();
+}
+
 // Appends an offset to an address
 inline Address
 setOffset(Address addr, int offset)