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"
90 assert(!(
addr & 0xffffffff00000000));
97 assert(!(
addr & 0xffffffff00000000));
115 if ((
type == RubyRequestType_ST) ||
116 (
type == RubyRequestType_ATOMIC) ||
117 (
type == RubyRequestType_RMW_Read) ||
118 (
type == RubyRequestType_RMW_Write) ||
119 (
type == RubyRequestType_Store_Conditional) ||
120 (
type == RubyRequestType_Locked_RMW_Read) ||
121 (
type == RubyRequestType_Locked_RMW_Write) ||
122 (
type == RubyRequestType_FLUSH)) {
132 if ((
type == RubyRequestType_LD) ||
133 (
type == RubyRequestType_Load_Linked)) {
144 (
type == RubyRequestType_IFETCH)) {
154 if ((
type == RubyRequestType_HTM_Start) ||
155 (
type == RubyRequestType_HTM_Commit) ||
156 (
type == RubyRequestType_HTM_Cancel) ||
157 (
type == RubyRequestType_HTM_Abort)) {
164 inline RubyRequestType
167 if (pkt->
req->isHTMStart()) {
168 return RubyRequestType_HTM_Start;
169 }
else if (pkt->
req->isHTMCommit()) {
170 return RubyRequestType_HTM_Commit;
171 }
else if (pkt->
req->isHTMCancel()) {
172 return RubyRequestType_HTM_Cancel;
173 }
else if (pkt->
req->isHTMAbort()) {
174 return RubyRequestType_HTM_Abort;
177 panic(
"invalid ruby packet type\n");
209 if (pktLineAddr == lineAddr) {
211 unsigned int size_in_bytes = pkt->
getSize();
212 unsigned startByte = pkt->
getAddr() - lineAddr;
214 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
235 if (pktLineAddr == lineAddr) {
237 unsigned int size_in_bytes = pkt->
getSize();
238 unsigned startByte = pkt->
getAddr() - lineAddr;
239 bool was_read =
false;
241 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
242 if (
mask.test(
i + startByte)) {
264 if (pktLineAddr == lineAddr) {
266 unsigned int size_in_bytes = pkt->
getSize();
267 unsigned startByte = pkt->
getAddr() - lineAddr;
269 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
281 for (
const bool e: bVec) {
292 #endif //__MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_UTIL_HH__
NodeID intToID(int nodenum)
RubyRequestType htmCmdToRubyRequestType(const Packet *pkt)
uint8_t getByte(int whichByte) const
RequestPtr req
A pointer to the original request.
Addr makeLineAddress(Addr addr)
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
Cycles is a wrapper class for representing cycle counts, i.e.
Addr intToAddress(int addr)
bool isDataReadRequest(RubyRequestType type)
bool isReadRequest(RubyRequestType type)
Cycles intToCycles(int c)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool testAndReadMask(Addr addr, DataBlock &blk, WriteMask &mask, Packet *pkt)
This function accepts an address, a data block, a write mask and a packet.
uint64_t Tick
Tick count type.
const T * getConstPtr() const
bool isWriteRequest(RubyRequestType type)
void setByte(int whichByte, uint8_t data)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int addressToInt(Addr addr)
bool testAndRead(Addr addr, DataBlock &blk, Packet *pkt)
This function accepts an address, a data block and a packet.
bool isHtmCmdRequest(RubyRequestType type)
bool testAndWrite(Addr addr, DataBlock &blk, Packet *pkt)
This function accepts an address, a data block and a packet.
int countBoolVec(BoolVec bVec)
int addressOffset(Addr addr, Addr base)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
int mod(int val, int mod)
#define panic(...)
This implements a cprintf based panic() function.
T * getPtr()
get a pointer to the data ptr.
Generated on Wed May 4 2022 12:14:01 for gem5 by doxygen 1.8.17