Go to the documentation of this file.
40 #include "debug/HtmMem.hh"
41 #include "debug/RubyPort.hh"
49 const HtmFailedInCacheReason ruby_ret_code)
51 switch (ruby_ret_code) {
52 case HtmFailedInCacheReason_NO_FAIL:
54 case HtmFailedInCacheReason_FAIL_SELF:
56 case HtmFailedInCacheReason_FAIL_REMOTE:
58 case HtmFailedInCacheReason_FAIL_OTHER:
61 panic(
"Invalid htm return code\n");
66 RubyHTMSequencerParams::create()
84 const HtmCallbackMode
mode,
85 const HtmFailedInCacheReason htm_return_code)
91 if (
mode == HtmCallbackMode_HTM_CMD) {
105 uint8_t* dataptr = pkt->
getPtr<uint8_t>();
106 memset(dataptr, 0, pkt->
getSize());
107 *dataptr = (uint8_t) htm_return_code;
110 if (htm_return_code == HtmFailedInCacheReason_NO_FAIL) {
111 if (pkt->
req->isHTMStart()) {
114 DPRINTF(HtmMem,
"htmStart - htmUid=%u\n",
116 }
else if (pkt->
req->isHTMCommit()) {
121 Counter transaction_instructions =
124 transaction_instructions);
126 DPRINTF(HtmMem,
"htmCommit - htmUid=%u\n",
128 }
else if (pkt->
req->isHTMAbort()) {
131 auto cause_idx =
static_cast<int>(cause);
133 DPRINTF(HtmMem,
"htmAbort - reason=%s - htmUid=%u\n",
138 DPRINTF(HtmMem,
"HTM_CMD: fail - htmUid=%u\n",
144 }
else if (
mode == HtmCallbackMode_LD_FAIL ||
145 mode == HtmCallbackMode_ST_FAIL) {
151 while (!seq_req_list.empty()) {
160 if (request.
m_type == RubyRequestType_Store_Conditional) {
161 pkt->
req->setExtraData(0);
164 DPRINTF(HtmMem,
"%s_FAIL: size=%d - "
165 "addr=0x%lx - htmUid=%d\n",
166 (
mode == HtmCallbackMode_LD_FAIL) ?
"LD" :
"ST",
173 seq_req_list.pop_front();
176 if (seq_req_list.empty()) {
180 panic(
"unrecognised HTM callback mode\n");
192 .
name(
name() +
".htm_transaction_cycles")
193 .
desc(
"number of cycles spent in an outer transaction")
198 .
name(
name() +
".htm_transaction_instructions")
199 .
desc(
"number of instructions spent in an outer transaction")
205 .
name(
name() +
".htm_transaction_abort_cause")
206 .desc(
"cause of htm transaction abort")
210 for (
unsigned cause_idx = 0; cause_idx < num_causes; ++cause_idx) {
219 const HtmFailedInCacheReason htm_return_code)
231 assert(port !=
nullptr);
235 DPRINTF(HtmMem,
"HTM callback: start=%d, commit=%d, "
236 "cancel=%d, rc=%d\n",
237 pkt->
req->isHTMStart(), pkt->
req->isHTMCommit(),
238 pkt->
req->isHTMCancel(), htm_return_code);
267 for (; htm != htm_end; ++htm) {
272 panic(
"Possible Deadlock detected. Aborting!\n"
273 "version: %d m_htmCmdRequestTable: %d "
274 "current time: %u issue_time: %d difference: %d\n",
289 template <
class VALUE>
293 auto i = queue.begin();
294 auto end = queue.end();
297 for (;
i != end; ++
i)
318 RubyRequestType secondary_type)
325 return RequestStatus_BufferFull;
333 return RequestStatus_Ready;
void print(std::ostream &out) const override
virtual bool empty() const
void htmCallback(Addr, const HtmCallbackMode, const HtmFailedInCacheReason)
Counter m_htmstart_instruction
Addr makeLineAddress(Addr addr)
Stats::Histogram m_htm_transaction_instructions
Histogram of instruction lengths of HTM transactions.
uint64_t Tick
Tick count type.
RequestPtr req
A pointer to the original request.
void schedTimingResp(PacketPtr pkt, Tick when)
Schedule the sending of a timing response.
std::unordered_map< Addr, std::list< SequencerRequest > > m_RequestTable
Stats::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.
virtual void print(std::ostream &out) const
int64_t Counter
Statistics counter type.
virtual RequestStatus insertRequest(PacketPtr pkt, RubyRequestType primary_type, RubyRequestType secondary_type)
bool needsResponse() const
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
HtmCacheFailure htmRetCodeConversion(const HtmFailedInCacheReason rc)
Htm return code conversion.
void regStats() override
Callback to set stat parameters.
void rubyHtmCallback(PacketPtr pkt, const HtmFailedInCacheReason fail_r)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
RequestStatus insertRequest(PacketPtr pkt, RubyRequestType primary_type, RubyRequestType secondary_type) override
HTMSequencer(const RubyHTMSequencerParams *p)
const FlagsType dist
Print the distribution.
Derived & init(size_type size)
Set this vector to have the given size.
const FlagsType nozero
Don't print if this is zero.
uint64_t getHtmTransactionUid() const
If a packet/request originates in a CPU executing in transactional mode, i.e.
Stats::Histogram m_htm_transaction_cycles
Histogram of cycle latencies of HTM transactions.
virtual const std::string name() const
void regStats() override
Callback to set stat parameters.
bool isDeviceMemAddr(PacketPtr pkt) const
Similar to isMemAddr but for devices.
Overload hash function for BasicBlockRange type.
Cycles m_deadlock_threshold
Cycles ticksToCycles(Tick t) const
const FlagsType pdf
Print the percent of the total that this entry represents.
void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code)
Communicates to the core that a packet was processed by the memory subsystem while running in transac...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
bool empty() const override
std::string htmFailureToStr(HtmFailureFaultCause cause)
Convert enum into string to be used for debug purposes.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
Cycles is a wrapper class for representing cycle counts, i.e.
T * getPtr()
get a pointer to the data ptr.
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.
std::deque< SequencerRequest * > m_htmCmdRequestTable
Histogram & init(size_type size)
Set the parameters of this histogram.
const FlagsType total
Print the total.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
std::ostream & operator<<(ostream &out, const std::deque< VALUE > &queue)
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.
const FlagsType nonan
Don't print if this is NAN.
#define panic(...)
This implements a cprintf based panic() function.
bool isHtmCmdRequest(RubyRequestType type)
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17