RubyRequest.hh (9500:9c3e3d1c7a87) RubyRequest.hh (9508:dde110931867)
1/*
2 * Copyright (c) 2009 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 37 unchanged lines hidden (view full) ---

46 Address m_ProgramCounter;
47 RubyAccessMode m_AccessMode;
48 int m_Size;
49 PrefetchBit m_Prefetch;
50 uint8_t* data;
51 PacketPtr pkt;
52 unsigned m_contextId;
53
1/*
2 * Copyright (c) 2009 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 37 unchanged lines hidden (view full) ---

46 Address m_ProgramCounter;
47 RubyAccessMode m_AccessMode;
48 int m_Size;
49 PrefetchBit m_Prefetch;
50 uint8_t* data;
51 PacketPtr pkt;
52 unsigned m_contextId;
53
54 RubyRequest(Cycles curTime, uint64_t _paddr, uint8_t* _data, int _len,
54 RubyRequest(Tick curTime, uint64_t _paddr, uint8_t* _data, int _len,
55 uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
56 PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
57 unsigned _proc_id = 100)
58 : Message(curTime),
59 m_PhysicalAddress(_paddr),
60 m_Type(_type),
61 m_ProgramCounter(_pc),
62 m_AccessMode(_access_mode),
63 m_Size(_len),
64 m_Prefetch(_pb),
65 data(_data),
66 pkt(_pkt),
67 m_contextId(_proc_id)
68 {
69 m_LineAddress = m_PhysicalAddress;
70 m_LineAddress.makeLineAddress();
71 }
72
55 uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
56 PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
57 unsigned _proc_id = 100)
58 : Message(curTime),
59 m_PhysicalAddress(_paddr),
60 m_Type(_type),
61 m_ProgramCounter(_pc),
62 m_AccessMode(_access_mode),
63 m_Size(_len),
64 m_Prefetch(_pb),
65 data(_data),
66 pkt(_pkt),
67 m_contextId(_proc_id)
68 {
69 m_LineAddress = m_PhysicalAddress;
70 m_LineAddress.makeLineAddress();
71 }
72
73 RubyRequest(Cycles curTime) : Message(curTime)
74 {
75 }
73 RubyRequest(Tick curTime) : Message(curTime) {}
74 RubyRequest* clone() const { return new RubyRequest(*this); }
76
75
77 RubyRequest*
78 clone() const
79 {
80 return new RubyRequest(*this);
81 }
76 const Address& getLineAddress() const { return m_LineAddress; }
77 const Address& getPhysicalAddress() const { return m_PhysicalAddress; }
78 const RubyRequestType& getType() const { return m_Type; }
79 const Address& getProgramCounter() const { return m_ProgramCounter; }
80 const RubyAccessMode& getAccessMode() const { return m_AccessMode; }
81 const int& getSize() const { return m_Size; }
82 const PrefetchBit& getPrefetch() const { return m_Prefetch; }
82
83
83 const Address&
84 getLineAddress() const
85 {
86 return m_LineAddress;
87 }
88
89 const Address&
90 getPhysicalAddress() const
91 {
92 return m_PhysicalAddress;
93 }
94
95 const RubyRequestType&
96 getType() const
97 {
98 return m_Type;
99 }
100
101 const Address&
102 getProgramCounter() const
103 {
104 return m_ProgramCounter;
105 }
106
107 const RubyAccessMode&
108 getAccessMode() const
109 {
110 return m_AccessMode;
111 }
112
113 const int&
114 getSize() const
115 {
116 return m_Size;
117 }
118
119 const PrefetchBit&
120 getPrefetch() const
121 {
122 return m_Prefetch;
123 }
124
125 void print(std::ostream& out) const;
84 void print(std::ostream& out) const;
126
127 bool functionalRead(Packet *pkt);
128 bool functionalWrite(Packet *pkt);
129};
130
131inline std::ostream&
132operator<<(std::ostream& out, const RubyRequest& obj)
133{
134 obj.print(out);
135 out << std::flush;
136 return out;
137}
138
139#endif
85 bool functionalRead(Packet *pkt);
86 bool functionalWrite(Packet *pkt);
87};
88
89inline std::ostream&
90operator<<(std::ostream& out, const RubyRequest& obj)
91{
92 obj.print(out);
93 out << std::flush;
94 return out;
95}
96
97#endif