}
}
+ GenericMachineType getNondirectHitMachType(MachineID sender) {
+ if (machineIDToMachineType(sender) == MachineType:L1Cache) {
+ //
+ // NOTE direct local hits should not call this
+ //
+ return GenericMachineType:L1Cache_wCC;
+ } else {
+ return ConvertMachToGenericMach(machineIDToMachineType(sender));
+ }
+ }
+
// NETWORK PORTS
action(r_load_hit, "r", desc="Notify sequencer the load completed.") {
DEBUG_EXPR(getCacheEntry(address).DataBlk);
- sequencer.readCallback(address, getCacheEntry(address).DataBlk);
+ sequencer.readCallback(address,
+ GenericMachineType:L1Cache,
+ getCacheEntry(address).DataBlk);
+ }
+
+ action(rx_load_hit, "rx", desc="External load completed.") {
+ peek(responseNetwork_in, ResponseMsg) {
+ DEBUG_EXPR(getCacheEntry(address).DataBlk);
+ sequencer.readCallback(address,
+ getNondirectHitMachType(in_msg.Sender),
+ getCacheEntry(address).DataBlk);
+ }
}
action(s_store_hit, "s", desc="Notify sequencer that store completed.") {
DEBUG_EXPR(getCacheEntry(address).DataBlk);
- sequencer.writeCallback(address, getCacheEntry(address).DataBlk);
+ sequencer.writeCallback(address,
+ GenericMachineType:L1Cache,
+ getCacheEntry(address).DataBlk);
}
+ action(sx_store_hit, "sx", desc="External store completed.") {
+ peek(responseNetwork_in, ResponseMsg) {
+ DEBUG_EXPR(getCacheEntry(address).DataBlk);
+ sequencer.writeCallback(address,
+ getNondirectHitMachType(in_msg.Sender),
+ getCacheEntry(address).DataBlk);
+ }
+ }
action(u_writeDataToCache, "u", desc="Write data to the cache") {
peek(responseNetwork_in, ResponseMsg) {
transition(IS, Data, M) {
u_writeDataToCache;
- r_load_hit;
+ rx_load_hit;
w_deallocateTBE;
n_popResponseQueue;
}
transition(IM, Data, M) {
u_writeDataToCache;
- s_store_hit;
+ sx_store_hit;
w_deallocateTBE;
n_popResponseQueue;
}
}
}
-// GenericMachineType getNondirectHitMachType(Address addr, MachineID sender) {
-// if (machineIDToMachineType(sender) == MachineType:L1Cache) {
-// return GenericMachineType:L1Cache_wCC; // NOTE direct L1 hits should not call this
-// } else if (machineIDToMachineType(sender) == MachineType:L2Cache) {
-//
-// if (sender == (mapAddressToRange(addr,
-// MachineType:L2Cache,
-// l2_select_low_bit,
-// l2_select_num_bits))) {
-//
-// return GenericMachineType:L2Cache;
-// } else {
-// return GenericMachineType:L2Cache_wCC;
-// }
-// } else {
-// return ConvertMachToGenericMach(machineIDToMachineType(sender));
-// }
-// }
+ GenericMachineType getNondirectHitMachType(Address addr, MachineID sender) {
+ if (machineIDToMachineType(sender) == MachineType:L1Cache) {
+ //
+ // NOTE direct local hits should not call this
+ //
+ return GenericMachineType:L1Cache_wCC;
+ } else if (machineIDToMachineType(sender) == MachineType:L2Cache) {
+
+ if (sender == (mapAddressToRange(addr,
+ MachineType:L2Cache,
+ l2_select_low_bit,
+ l2_select_num_bits))) {
+
+ return GenericMachineType:L2Cache;
+ } else {
+ return GenericMachineType:L2Cache_wCC;
+ }
+ } else {
+ return ConvertMachToGenericMach(machineIDToMachineType(sender));
+ }
+ }
bool okToIssueStarving(Address addr, MachineID machinID) {
return persistentTable.okToIssueStarving(addr, machineID);
action(h_load_hit, "h", desc="Notify sequencer the load completed.") {
DEBUG_EXPR(address);
DEBUG_EXPR(getCacheEntry(address).DataBlk);
- //sequencer.readCallback(address, getCacheEntry(address).DataBlk, GenericMachineType:L1Cache, PrefetchBit:No);
- sequencer.readCallback(address, getCacheEntry(address).DataBlk);
+
+ sequencer.readCallback(address,
+ GenericMachineType:L1Cache,
+ getCacheEntry(address).DataBlk);
+
}
action(x_external_load_hit, "x", desc="Notify sequencer the load completed.") {
DEBUG_EXPR(getCacheEntry(address).DataBlk);
peek(responseNetwork_in, ResponseMsg) {
- //sequencer.readCallback(address, getCacheEntry(address).DataBlk, getNondirectHitMachType(in_msg.Address, in_msg.Sender), PrefetchBit:No);
- sequencer.readCallback(address, getCacheEntry(address).DataBlk);
+ sequencer.readCallback(address,
+ getNondirectHitMachType(address, in_msg.Sender),
+ getCacheEntry(address).DataBlk);
+
}
}
action(hh_store_hit, "\h", desc="Notify sequencer that store completed.") {
DEBUG_EXPR(address);
DEBUG_EXPR(getCacheEntry(address).DataBlk);
- //sequencer.writeCallback(address, getCacheEntry(address).DataBlk, GenericMachineType:L1Cache, PrefetchBit:No);
- sequencer.writeCallback(address, getCacheEntry(address).DataBlk);
+
+ sequencer.writeCallback(address,
+ GenericMachineType:L1Cache,
+ getCacheEntry(address).DataBlk);
+
getCacheEntry(address).Dirty := true;
DEBUG_EXPR(getCacheEntry(address).DataBlk);
}
DEBUG_EXPR(address);
DEBUG_EXPR(getCacheEntry(address).DataBlk);
peek(responseNetwork_in, ResponseMsg) {
- //sequencer.writeCallback(address, getCacheEntry(address).DataBlk, getNondirectHitMachType(in_msg.Address, in_msg.Sender), PrefetchBit:No);
- sequencer.writeCallback(address, getCacheEntry(address).DataBlk);
+
+ sequencer.writeCallback(address,
+ getNondirectHitMachType(address, in_msg.Sender),
+ getCacheEntry(address).DataBlk);
+
}
getCacheEntry(address).Dirty := true;
DEBUG_EXPR(getCacheEntry(address).DataBlk);
State CacheState, desc="cache state";
bool Dirty, desc="Is the data dirty (different than memory)?";
DataBlock DataBlk, desc="data for the block";
+ bool FromL2, default="false", desc="block just moved from L2";
}
// TBE fields
bool Dirty, desc="Is the data dirty (different than memory)?";
int NumPendingMsgs, desc="Number of acks/data messages that this processor is waiting for";
bool Sharers, desc="On a GetS, did we find any other sharers in the system";
+ MachineID LastResponder, desc="last machine to send a response for this request";
}
external_type(TBETable) {
}
}
+ GenericMachineType getNondirectHitMachType(Address addr, MachineID sender) {
+ if (machineIDToMachineType(sender) == MachineType:L1Cache) {
+ //
+ // NOTE direct local hits should not call this
+ //
+ return GenericMachineType:L1Cache_wCC;
+ } else {
+ return ConvertMachToGenericMach(machineIDToMachineType(sender));
+ }
+ }
+
+ GenericMachineType testAndClearLocalHit(Address addr) {
+ if (getCacheEntry(addr).FromL2) {
+ getCacheEntry(addr).FromL2 := false;
+ return GenericMachineType:L2Cache;
+ } else {
+ return GenericMachineType:L1Cache;
+ }
+ }
+
MessageBuffer triggerQueue, ordered="true";
// ** OUT_PORTS **
action(h_load_hit, "h", desc="Notify sequencer the load completed.") {
DEBUG_EXPR(getCacheEntry(address).DataBlk);
- sequencer.readCallback(address, getCacheEntry(address).DataBlk);
+
+ sequencer.readCallback(address,
+ testAndClearLocalHit(address),
+ getCacheEntry(address).DataBlk);
+
+ }
+
+ action(hx_external_load_hit, "hx", desc="load required external msgs") {
+ DEBUG_EXPR(getCacheEntry(address).DataBlk);
+ peek(responseToCache_in, ResponseMsg) {
+
+ sequencer.readCallback(address,
+ getNondirectHitMachType(in_msg.Address, in_msg.Sender),
+ getCacheEntry(address).DataBlk);
+
+ }
}
action(hh_store_hit, "\h", desc="Notify sequencer that store completed.") {
DEBUG_EXPR(getCacheEntry(address).DataBlk);
- sequencer.writeCallback(address, getCacheEntry(address).DataBlk);
+
+ sequencer.writeCallback(address,
+ testAndClearLocalHit(address),
+ getCacheEntry(address).DataBlk);
+
+ getCacheEntry(address).Dirty := true;
+ }
+
+ action(sx_external_store_hit, "sx", desc="store required external msgs.") {
+ DEBUG_EXPR(getCacheEntry(address).DataBlk);
+ peek(responseToCache_in, ResponseMsg) {
+
+ sequencer.writeCallback(address,
+ getNondirectHitMachType(address, in_msg.Sender),
+ getCacheEntry(address).DataBlk);
+
+ }
+ getCacheEntry(address).Dirty := true;
+ }
+
+ action(sxt_trig_ext_store_hit, "sxt", desc="store required external msgs.") {
+ DEBUG_EXPR(getCacheEntry(address).DataBlk);
+
+ sequencer.writeCallback(address,
+ getNondirectHitMachType(address,
+ TBEs[address].LastResponder),
+ getCacheEntry(address).DataBlk);
+
getCacheEntry(address).Dirty := true;
}
DEBUG_EXPR(TBEs[address].NumPendingMsgs);
TBEs[address].NumPendingMsgs := TBEs[address].NumPendingMsgs - in_msg.Acks;
DEBUG_EXPR(TBEs[address].NumPendingMsgs);
+ TBEs[address].LastResponder := in_msg.Sender;
}
}
if (L1DcacheMemory.isTagPresent(address)) {
static_cast(Entry, L1DcacheMemory[address]).Dirty := static_cast(Entry, L2cacheMemory[address]).Dirty;
static_cast(Entry, L1DcacheMemory[address]).DataBlk := static_cast(Entry, L2cacheMemory[address]).DataBlk;
+ static_cast(Entry, L1DcacheMemory[address]).FromL2 := true;
} else {
static_cast(Entry, L1IcacheMemory[address]).Dirty := static_cast(Entry, L2cacheMemory[address]).Dirty;
static_cast(Entry, L1IcacheMemory[address]).DataBlk := static_cast(Entry, L2cacheMemory[address]).DataBlk;
+ static_cast(Entry, L1IcacheMemory[address]).FromL2 := true;
}
}
u_writeDataToCache;
m_decrementNumberOfMessages;
o_checkForCompletion;
- hh_store_hit;
+ sx_external_store_hit;
n_popResponseQueue;
}
}
transition(ISM, All_acks_no_sharers, MM) {
- hh_store_hit;
+ sxt_trig_ext_store_hit;
g_sendUnblock;
s_deallocateTBE;
j_popTriggerQueue;
}
transition(OM, {All_acks, All_acks_no_sharers}, MM) {
- hh_store_hit;
+ sxt_trig_ext_store_hit;
g_sendUnblock;
s_deallocateTBE;
j_popTriggerQueue;
u_writeDataToCache;
m_decrementNumberOfMessages;
o_checkForCompletion;
- h_load_hit;
+ hx_external_load_hit;
n_popResponseQueue;
}
u_writeDataToCache;
m_decrementNumberOfMessages;
o_checkForCompletion;
- h_load_hit;
+ hx_external_load_hit;
n_popResponseQueue;
}
r_setSharerBit;
m_decrementNumberOfMessages;
o_checkForCompletion;
- h_load_hit;
+ hx_external_load_hit;
n_popResponseQueue;
}
external_type(Sequencer) {
void readCallback(Address, DataBlock);
+ void readCallback(Address, GenericMachineType, DataBlock);
void writeCallback(Address, DataBlock);
+ void writeCallback(Address, GenericMachineType, DataBlock);
void checkCoherence(Address);
void profileNack(Address, int, int, uint64);
}
// non-zero cycle demand request
void
-Profiler::missLatency(Time t, RubyRequestType type)
+Profiler::missLatency(Time cycles,
+ RubyRequestType type,
+ const GenericMachineType respondingMach)
{
- m_allMissLatencyHistogram.add(t);
- m_missLatencyHistograms[type].add(t);
+ m_allMissLatencyHistogram.add(cycles);
+ m_missLatencyHistograms[type].add(cycles);
+ m_machLatencyHistograms[respondingMach].add(cycles);
}
// non-zero cycle prefetch request
void
-Profiler::swPrefetchLatency(Time t, CacheRequestType type,
- GenericMachineType respondingMach)
+Profiler::swPrefetchLatency(Time cycles,
+ CacheRequestType type,
+ const GenericMachineType respondingMach)
{
- m_allSWPrefetchLatencyHistogram.add(t);
- m_SWPrefetchLatencyHistograms[type].add(t);
- m_SWPrefetchMachLatencyHistograms[respondingMach].add(t);
+ m_allSWPrefetchLatencyHistogram.add(cycles);
+ m_SWPrefetchLatencyHistograms[type].add(cycles);
+ m_SWPrefetchMachLatencyHistograms[respondingMach].add(cycles);
if (respondingMach == GenericMachineType_Directory ||
respondingMach == GenericMachineType_NUM) {
- m_SWPrefetchL2MissLatencyHistogram.add(t);
+ m_SWPrefetchL2MissLatencyHistogram.add(cycles);
}
}
void controllerBusy(MachineID machID);
void bankBusy();
- void missLatency(Time t, RubyRequestType type);
- void swPrefetchLatency(Time t, CacheRequestType type,
- GenericMachineType respondingMach);
+
+ void missLatency(Time t,
+ RubyRequestType type,
+ const GenericMachineType respondingMach);
+
+ void swPrefetchLatency(Time t,
+ CacheRequestType type,
+ const GenericMachineType respondingMach);
+
void sequencerRequests(int num) { m_sequencer_requests.add(num); }
void profileTransition(const std::string& component, NodeID version,
void
Sequencer::writeCallback(const Address& address, DataBlock& data)
+{
+ writeCallback(address, GenericMachineType_NULL, data);
+}
+
+void
+Sequencer::writeCallback(const Address& address,
+ GenericMachineType mach,
+ DataBlock& data)
{
assert(address == line_address(address));
assert(m_writeRequestTable.count(line_address(address)));
m_controller->unblock(address);
}
- hitCallback(request, data);
+ hitCallback(request, mach, data);
}
void
Sequencer::readCallback(const Address& address, DataBlock& data)
+{
+ readCallback(address, GenericMachineType_NULL, data);
+}
+
+void
+Sequencer::readCallback(const Address& address,
+ GenericMachineType mach,
+ DataBlock& data)
{
assert(address == line_address(address));
assert(m_readRequestTable.count(line_address(address)));
(request->ruby_request.type == RubyRequestType_RMW_Read) ||
(request->ruby_request.type == RubyRequestType_IFETCH));
- hitCallback(request, data);
+ hitCallback(request, mach, data);
}
void
-Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data)
+Sequencer::hitCallback(SequencerRequest* srequest,
+ GenericMachineType mach,
+ DataBlock& data)
{
const RubyRequest & ruby_request = srequest->ruby_request;
Address request_address(ruby_request.paddr);
// Profile the miss latency for all non-zero demand misses
if (miss_latency != 0) {
- g_system_ptr->getProfiler()->missLatency(miss_latency, type);
+ g_system_ptr->getProfiler()->missLatency(miss_latency, type, mach);
if (Debug::getProtocolTrace()) {
g_system_ptr->getProfiler()->
void printProgress(std::ostream& out) const;
void writeCallback(const Address& address, DataBlock& data);
+
+ void writeCallback(const Address& address,
+ GenericMachineType mach,
+ DataBlock& data);
+
void readCallback(const Address& address, DataBlock& data);
+ void readCallback(const Address& address,
+ GenericMachineType mach,
+ DataBlock& data);
+
RequestStatus makeRequest(const RubyRequest & request);
RequestStatus getRequestStatus(const RubyRequest& request);
bool empty() const;
int size, DataBlock*& data_ptr);
void issueRequest(const RubyRequest& request);
- void hitCallback(SequencerRequest* request, DataBlock& data);
+ void hitCallback(SequencerRequest* request,
+ GenericMachineType mach,
+ DataBlock& data);
+
bool insertRequest(SequencerRequest* request);