ruby: added Packet interface to makeRequest and isReady.
[gem5.git] / src / mem / packet_access.hh
index 882aa98d0c94e57296fb3c203e660765828fe8f6..f70d508b21997237bbf1840180012b028e786918 100644 (file)
 // these functions and make the users do their own byte swapping since
 // the memory system does not in fact have an endianness.
 
-template<>
-inline Twin64_t
-Packet::get()
-{
-    Twin64_t d;
-    assert(staticData || dynamicData);
-    assert(sizeof(Twin64_t) <= size);
-    d.a = TheISA::gtoh(*(uint64_t*)data);
-    d.b = TheISA::gtoh(*((uint64_t*)data + 1));
-    return d;
-}
-
-
 /** return the value of what is pointed to in the packet. */
 template <typename T>
 inline T
 Packet::get()
 {
-    assert(staticData || dynamicData);
+    assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA));
     assert(sizeof(T) <= size);
     return TheISA::gtoh(*(T*)data);
 }
@@ -69,6 +56,7 @@ template <typename T>
 inline void
 Packet::set(T v)
 {
+    assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA));
     assert(sizeof(T) <= size);
     *(T*)data = TheISA::htog(v);
 }