Go to the documentation of this file.
46 #ifndef __MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_UTIL_HH__
47 #define __MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_UTIL_HH__
52 #include "debug/RubySlicc.hh"
59 #include "mem/ruby/protocol/RubyRequestType.hh"
84 assert(!(
addr & 0xffffffff00000000));
91 assert(!(
addr & 0xffffffff00000000));
109 if ((
type == RubyRequestType_ST) ||
110 (
type == RubyRequestType_ATOMIC) ||
111 (
type == RubyRequestType_RMW_Read) ||
112 (
type == RubyRequestType_RMW_Write) ||
113 (
type == RubyRequestType_Store_Conditional) ||
114 (
type == RubyRequestType_Locked_RMW_Read) ||
115 (
type == RubyRequestType_Locked_RMW_Write) ||
116 (
type == RubyRequestType_FLUSH)) {
126 if ((
type == RubyRequestType_LD) ||
127 (
type == RubyRequestType_Load_Linked)) {
138 (
type == RubyRequestType_IFETCH)) {
148 if ((
type == RubyRequestType_HTM_Start) ||
149 (
type == RubyRequestType_HTM_Commit) ||
150 (
type == RubyRequestType_HTM_Cancel) ||
151 (
type == RubyRequestType_HTM_Abort)) {
158 inline RubyRequestType
161 if (pkt->
req->isHTMStart()) {
162 return RubyRequestType_HTM_Start;
163 }
else if (pkt->
req->isHTMCommit()) {
164 return RubyRequestType_HTM_Commit;
165 }
else if (pkt->
req->isHTMCancel()) {
166 return RubyRequestType_HTM_Cancel;
167 }
else if (pkt->
req->isHTMAbort()) {
168 return RubyRequestType_HTM_Abort;
171 panic(
"invalid ruby packet type\n");
203 if (pktLineAddr == lineAddr) {
205 unsigned int size_in_bytes = pkt->
getSize();
206 unsigned startByte = pkt->
getAddr() - lineAddr;
208 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
229 if (pktLineAddr == lineAddr) {
231 unsigned int size_in_bytes = pkt->
getSize();
232 unsigned startByte = pkt->
getAddr() - lineAddr;
233 bool was_read =
false;
235 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
236 if (
mask.test(
i + startByte)) {
258 if (pktLineAddr == lineAddr) {
260 unsigned int size_in_bytes = pkt->
getSize();
261 unsigned startByte = pkt->
getAddr() - lineAddr;
263 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
275 for (
const bool e: bVec) {
283 #endif //__MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_UTIL_HH__
RubyRequestType htmCmdToRubyRequestType(const Packet *pkt)
Addr makeLineAddress(Addr addr)
int addressOffset(Addr addr, Addr base)
int mod(int val, int mod)
uint64_t Tick
Tick count type.
RequestPtr req
A pointer to the original request.
Cycles intToCycles(int c)
bool testAndRead(Addr addr, DataBlock &blk, Packet *pkt)
This function accepts an address, a data block and a packet.
int addressToInt(Addr addr)
bool testAndReadMask(Addr addr, DataBlock &blk, WriteMask &mask, Packet *pkt)
This function accepts an address, a data block, a write mask and a packet.
bool isWriteRequest(RubyRequestType type)
int countBoolVec(BoolVec bVec)
void setByte(int whichByte, uint8_t data)
bool testAndWrite(Addr addr, DataBlock &blk, Packet *pkt)
This function accepts an address, a data block and a packet.
Addr intToAddress(int addr)
bool isDataReadRequest(RubyRequestType type)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool isReadRequest(RubyRequestType type)
uint8_t getByte(int whichByte) const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Cycles is a wrapper class for representing cycle counts, i.e.
NodeID intToID(int nodenum)
T * getPtr()
get a pointer to the data ptr.
const T * getConstPtr() const
#define panic(...)
This implements a cprintf based panic() function.
bool isHtmCmdRequest(RubyRequestType type)
Generated on Tue Mar 23 2021 19:41:28 for gem5 by doxygen 1.8.17