summaryrefslogtreecommitdiff
path: root/src/mem/ruby/slicc_interface
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/slicc_interface')
-rw-r--r--src/mem/ruby/slicc_interface/RubyRequest.cc41
-rw-r--r--src/mem/ruby/slicc_interface/RubyRequest.hh104
-rw-r--r--src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh4
-rw-r--r--src/mem/ruby/slicc_interface/RubySlicc_Util.hh2
4 files changed, 97 insertions, 54 deletions
diff --git a/src/mem/ruby/slicc_interface/RubyRequest.cc b/src/mem/ruby/slicc_interface/RubyRequest.cc
index 2d8c94ed6..2aae61d7b 100644
--- a/src/mem/ruby/slicc_interface/RubyRequest.cc
+++ b/src/mem/ruby/slicc_interface/RubyRequest.cc
@@ -4,34 +4,17 @@
using namespace std;
-ostream&
-operator<<(ostream& out, const RubyRequest& obj)
+void
+RubyRequest::print(ostream& out) const
{
- out << hex << "0x" << obj.paddr << " data: 0x" << flush;
- for (int i = 0; i < obj.len; i++) {
- out << (int)obj.data[i];
- }
- out << dec << " type: " << RubyRequestType_to_string(obj.type) << endl;
- return out;
-}
-
-vector<string>
-tokenizeString(string str, string delims)
-{
- vector<string> tokens;
- char* pch;
- char* tmp;
- const char* c_delims = delims.c_str();
- tmp = new char[str.length()+1];
- strcpy(tmp, str.c_str());
- pch = strtok(tmp, c_delims);
- while (pch != NULL) {
- string tmp_str(pch);
- if (tmp_str == "null") tmp_str = "";
- tokens.push_back(tmp_str);
-
- pch = strtok(NULL, c_delims);
- }
- delete [] tmp;
- return tokens;
+ out << "[RubyRequest: ";
+ out << "LineAddress = " << m_LineAddress << " ";
+ out << "PhysicalAddress = " << m_PhysicalAddress << " ";
+ out << "Type = " << m_Type << " ";
+ out << "ProgramCounter = " << m_ProgramCounter << " ";
+ out << "AccessMode = " << m_AccessMode << " ";
+ out << "Size = " << m_Size << " ";
+ out << "Prefetch = " << m_Prefetch << " ";
+// out << "Time = " << getTime() << " ";
+ out << "]";
}
diff --git a/src/mem/ruby/slicc_interface/RubyRequest.hh b/src/mem/ruby/slicc_interface/RubyRequest.hh
index d7acfd578..06ca0de1c 100644
--- a/src/mem/ruby/slicc_interface/RubyRequest.hh
+++ b/src/mem/ruby/slicc_interface/RubyRequest.hh
@@ -40,40 +40,102 @@
typedef void* RubyPortHandle;
-class RubyRequest
+class RubyRequest : public Message
{
public:
- uint64_t paddr;
+ Address m_PhysicalAddress;
+ Address m_LineAddress;
+ RubyRequestType m_Type;
+ Address m_ProgramCounter;
+ RubyAccessMode m_AccessMode;
+ int m_Size;
+ PrefetchBit m_Prefetch;
uint8_t* data;
- int len;
- uint64_t pc;
- RubyRequestType type;
- RubyAccessMode access_mode;
PacketPtr pkt;
unsigned proc_id;
RubyRequest() {}
- RubyRequest(uint64_t _paddr,
- uint8_t* _data,
- int _len,
- uint64_t _pc,
- RubyRequestType _type,
- RubyAccessMode _access_mode,
- PacketPtr _pkt,
- unsigned _proc_id = 100)
- : paddr(_paddr),
+ RubyRequest(uint64_t _paddr, uint8_t* _data, int _len, uint64_t _pc,
+ RubyRequestType _type, RubyAccessMode _access_mode,
+ PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
+ unsigned _proc_id = 100)
+ : m_PhysicalAddress(_paddr),
+ m_Type(_type),
+ m_ProgramCounter(_pc),
+ m_AccessMode(_access_mode),
+ m_Size(_len),
+ m_Prefetch(_pb),
data(_data),
- len(_len),
- pc(_pc),
- type(_type),
- access_mode(_access_mode),
pkt(_pkt),
proc_id(_proc_id)
- {}
+ {
+ m_LineAddress = m_PhysicalAddress;
+ m_LineAddress.makeLineAddress();
+ }
+
+ static RubyRequest*
+ create()
+ {
+ return new RubyRequest();
+ }
+
+ RubyRequest*
+ clone() const
+ {
+ return new RubyRequest(*this);
+ }
+
+ const Address&
+ getLineAddress() const
+ {
+ return m_LineAddress;
+ }
+
+ const Address&
+ getPhysicalAddress() const
+ {
+ return m_PhysicalAddress;
+ }
+
+ const RubyRequestType&
+ getType() const
+ {
+ return m_Type;
+ }
+
+ const Address&
+ getProgramCounter() const
+ {
+ return m_ProgramCounter;
+ }
+
+ const RubyAccessMode&
+ getAccessMode() const
+ {
+ return m_AccessMode;
+ }
+
+ const int&
+ getSize() const
+ {
+ return m_Size;
+ }
+
+ const PrefetchBit&
+ getPrefetch() const
+ {
+ return m_Prefetch;
+ }
void print(std::ostream& out) const;
};
-std::ostream& operator<<(std::ostream& out, const RubyRequest& obj);
+inline std::ostream&
+operator<<(std::ostream& out, const RubyRequest& obj)
+{
+ obj.print(out);
+ out << std::flush;
+ return out;
+}
#endif
diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
index cabba286a..f23e15c91 100644
--- a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
+++ b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
@@ -56,8 +56,8 @@ void profile_request(const std::string& L1CacheStateStr,
const std::string& L2CacheStateStr,
const std::string& directoryStateStr,
const std::string& requestTypeStr);
-void profile_miss(const CacheMsg& msg, NodeID id);
-void profile_L1Cache_miss(const CacheMsg& msg, NodeID id);
+void profile_miss(const RubyRequest& msg, NodeID id);
+void profile_L1Cache_miss(const RubyRequest& msg, NodeID id);
void profile_token_retry(const Address& addr, AccessType type, int count);
void profile_filter_action(int action);
void profile_persistent_prediction(const Address& addr, AccessType type);
diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh
index bb23406b9..058a51bae 100644
--- a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh
+++ b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh
@@ -36,8 +36,6 @@
#include <cassert>
#include "mem/protocol/AccessType.hh"
-#include "mem/protocol/CacheMsg.hh"
-#include "mem/protocol/RubyRequestType.hh"
#include "mem/protocol/Directory_State.hh"
#include "mem/protocol/GenericRequestType.hh"
#include "mem/protocol/L1Cache_State.hh"