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/RubyProtocol.hh"
53 #include "debug/RubySlicc.hh"
60 #include "mem/ruby/protocol/RubyRequestType.hh"
91 assert(!(
addr & 0xffffffff00000000));
98 assert(!(
addr & 0xffffffff00000000));
116 if ((
type == RubyRequestType_ST) ||
117 (
type == RubyRequestType_ATOMIC) ||
118 (
type == RubyRequestType_RMW_Read) ||
119 (
type == RubyRequestType_RMW_Write) ||
120 (
type == RubyRequestType_Store_Conditional) ||
121 (
type == RubyRequestType_Locked_RMW_Read) ||
122 (
type == RubyRequestType_Locked_RMW_Write) ||
123 (
type == RubyRequestType_FLUSH)) {
133 if ((
type == RubyRequestType_LD) ||
134 (
type == RubyRequestType_Load_Linked)) {
145 (
type == RubyRequestType_IFETCH)) {
155 if ((
type == RubyRequestType_HTM_Start) ||
156 (
type == RubyRequestType_HTM_Commit) ||
157 (
type == RubyRequestType_HTM_Cancel) ||
158 (
type == RubyRequestType_HTM_Abort)) {
168 if ((
type == RubyRequestType_TLBI) ||
169 (
type == RubyRequestType_TLBI_SYNC) ||
170 (
type == RubyRequestType_TLBI_EXT_SYNC) ||
171 (
type == RubyRequestType_TLBI_EXT_SYNC_COMP)) {
178 inline RubyRequestType
181 if (pkt->
req->isHTMStart()) {
182 return RubyRequestType_HTM_Start;
183 }
else if (pkt->
req->isHTMCommit()) {
184 return RubyRequestType_HTM_Commit;
185 }
else if (pkt->
req->isHTMCancel()) {
186 return RubyRequestType_HTM_Cancel;
187 }
else if (pkt->
req->isHTMAbort()) {
188 return RubyRequestType_HTM_Abort;
191 panic(
"invalid ruby packet type\n");
195 inline RubyRequestType
198 if (pkt->
req->isTlbi()) {
199 return RubyRequestType_TLBI;
200 }
else if (pkt->
req->isTlbiSync()) {
201 return RubyRequestType_TLBI_SYNC;
202 }
else if (pkt->
req->isTlbiExtSync()) {
203 return RubyRequestType_TLBI_EXT_SYNC;
204 }
else if (pkt->
req->isTlbiExtSyncComp()) {
205 return RubyRequestType_TLBI_EXT_SYNC_COMP;
207 panic(
"invalid ruby packet type\n");
239 if (pktLineAddr == lineAddr) {
241 unsigned int size_in_bytes = pkt->
getSize();
242 unsigned startByte = pkt->
getAddr() - lineAddr;
244 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
265 if (pktLineAddr == lineAddr) {
267 unsigned int size_in_bytes = pkt->
getSize();
268 unsigned startByte = pkt->
getAddr() - lineAddr;
269 bool was_read =
false;
271 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
272 if (
mask.test(
i + startByte)) {
294 if (pktLineAddr == lineAddr) {
296 unsigned int size_in_bytes = pkt->
getSize();
297 unsigned startByte = pkt->
getAddr() - lineAddr;
299 for (
unsigned i = 0;
i < size_in_bytes; ++
i) {
311 for (
const bool e: bVec) {
322 #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)
RubyRequestType tlbiCmdToRubyRequestType(const Packet *pkt)
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 isTlbiCmdRequest(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 Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17