Go to the documentation of this file.
40 #include "debug/HtmMem.hh"
41 #include "debug/RubyPort.hh"
53 const HtmFailedInCacheReason ruby_ret_code)
55 switch (ruby_ret_code) {
56 case HtmFailedInCacheReason_NO_FAIL:
58 case HtmFailedInCacheReason_FAIL_SELF:
60 case HtmFailedInCacheReason_FAIL_REMOTE:
62 case HtmFailedInCacheReason_FAIL_OTHER:
65 panic(
"Invalid htm return code\n");
71 ADD_STAT(m_htm_transaction_cycles,
"number of cycles spent in an outer "
73 ADD_STAT(m_htm_transaction_instructions,
"number of instructions spent "
74 "in an outer transaction"),
75 ADD_STAT(m_htm_transaction_abort_cause,
"cause of htm transaction abort")
98 for (
unsigned cause_idx = 0; cause_idx < num_causes; ++cause_idx) {
112 const HtmCallbackMode
mode,
113 const HtmFailedInCacheReason htm_return_code)
119 if (
mode == HtmCallbackMode_HTM_CMD) {
133 uint8_t* dataptr = pkt->
getPtr<uint8_t>();
134 memset(dataptr, 0, pkt->
getSize());
135 *dataptr = (uint8_t) htm_return_code;
138 if (htm_return_code == HtmFailedInCacheReason_NO_FAIL) {
139 if (pkt->
req->isHTMStart()) {
142 DPRINTF(HtmMem,
"htmStart - htmUid=%u\n",
144 }
else if (pkt->
req->isHTMCommit()) {
149 Counter transaction_instructions =
152 transaction_instructions);
154 DPRINTF(HtmMem,
"htmCommit - htmUid=%u\n",
156 }
else if (pkt->
req->isHTMAbort()) {
159 auto cause_idx =
static_cast<int>(cause);
161 DPRINTF(HtmMem,
"htmAbort - reason=%s - htmUid=%u\n",
166 DPRINTF(HtmMem,
"HTM_CMD: fail - htmUid=%u\n",
172 }
else if (
mode == HtmCallbackMode_LD_FAIL ||
173 mode == HtmCallbackMode_ST_FAIL) {
179 while (!seq_req_list.empty()) {
188 if (request.
m_type == RubyRequestType_Store_Conditional) {
189 pkt->
req->setExtraData(0);
192 DPRINTF(HtmMem,
"%s_FAIL: size=%d - "
193 "addr=0x%lx - htmUid=%d\n",
194 (
mode == HtmCallbackMode_LD_FAIL) ?
"LD" :
"ST",
201 seq_req_list.pop_front();
204 if (seq_req_list.empty()) {
208 panic(
"unrecognised HTM callback mode\n");
214 const HtmFailedInCacheReason htm_return_code)
226 assert(port !=
nullptr);
230 DPRINTF(HtmMem,
"HTM callback: start=%d, commit=%d, "
231 "cancel=%d, rc=%d\n",
232 pkt->
req->isHTMStart(), pkt->
req->isHTMCommit(),
233 pkt->
req->isHTMCancel(), htm_return_code);
262 for (; htm != htm_end; ++htm) {
267 panic(
"Possible Deadlock detected. Aborting!\n"
268 "version: %d m_htmCmdRequestTable: %d "
269 "current time: %u issue_time: %d difference: %d\n",
284 template <
class VALUE>
288 auto i = queue.begin();
289 auto end = queue.end();
292 for (;
i != end; ++
i)
313 RubyRequestType secondary_type)
320 return RequestStatus_BufferFull;
328 return RequestStatus_Ready;
Tick curTick()
The universal simulation clock.
std::unordered_map< Addr, std::list< SequencerRequest > > m_RequestTable
Cycles m_deadlock_threshold
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
void print(std::ostream &out) const override
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
RequestPtr req
A pointer to the original request.
const FlagsType nozero
Don't print if this is zero.
virtual RequestStatus insertRequest(PacketPtr pkt, RubyRequestType primary_type, RubyRequestType secondary_type)
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation.
const FlagsType nonan
Don't print if this is NAN.
HtmCacheFailure htmRetCodeConversion(const HtmFailedInCacheReason rc)
Htm return code conversion.
Addr makeLineAddress(Addr addr)
Counter m_htmstart_instruction
statistics::Histogram m_htm_transaction_cycles
Histogram of cycle latencies of HTM transactions.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
const FlagsType dist
Print the distribution.
Cycles is a wrapper class for representing cycle counts, i.e.
const FlagsType pdf
Print the percent of the total that this entry represents.
RequestStatus insertRequest(PacketPtr pkt, RubyRequestType primary_type, RubyRequestType secondary_type) override
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void htmCallback(Addr, const HtmCallbackMode, const HtmFailedInCacheReason)
uint64_t Tick
Tick count type.
uint64_t getHtmTransactionUid() const
If a packet/request originates in a CPU executing in transactional mode, i.e.
bool empty() const override
void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code)
Communicates to the core that a packet was processed by the memory subsystem while running in transac...
std::deque< SequencerRequest * > m_htmCmdRequestTable
virtual bool empty() const
bool needsResponse() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Histogram & init(size_type size)
Set the parameters of this histogram.
statistics::Histogram m_htm_transaction_instructions
Histogram of instruction lengths of HTM transactions.
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
virtual void print(std::ostream &out) const
bool isDeviceMemAddr(const PacketPtr &pkt) const
Similar to isMemAddr but for devices.
HTMSequencer(const RubyHTMSequencerParams &p)
std::string htmFailureToStr(HtmFailureFaultCause cause)
Convert enum into string to be used for debug purposes.
void rubyHtmCallback(PacketPtr pkt, const HtmFailedInCacheReason fail_r)
bool isHtmCmdRequest(RubyRequestType type)
double Counter
All counters are of 64-bit values.
statistics::Vector m_htm_transaction_abort_cause
Causes for HTM transaction aborts.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Cycles ticksToCycles(Tick t) const
void schedTimingResp(PacketPtr pkt, Tick when)
Schedule the sending of a timing response.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const FlagsType total
Print the total.
Derived & init(size_type size)
Set this vector to have the given size.
#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