bool IsAtomic, default="false", desc="Request was an atomic request";
AccessType AccessType, desc="Type of request (used for profiling)";
- Time IssueTime, desc="Time the request was issued";
+ Cycles IssueTime, desc="Time the request was issued";
RubyAccessMode AccessMode, desc="user/supervisor access type";
PrefetchBit Prefetch, desc="Is this a prefetch request";
}
void unset_tbe();
void wakeUpAllBuffers();
void wakeUpBuffers(Address a);
- Time curCycle();
+ Cycles curCycle();
TBETable L1_TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
// Update average latency
if (tbe.IssueCount <= 1) {
if (tbe.ExternalResponse == true) {
- updateAverageLatencyEstimate(TimeToCycles(curCycle() - tbe.IssueTime));
+ updateAverageLatencyEstimate(curCycle() - tbe.IssueTime);
}
}
bool AppliedSilentAcks, default="false", desc="for full-bit dir, does the pending msg count reflect the silent acks";
MachineID LastResponder, desc="last machine to send a response for this request";
MachineID CurOwner, desc="current owner of the block, used for UnblockS responses";
- Time InitialRequestTime, default="0", desc="time the initial requests was sent from the L1Cache";
- Time ForwardRequestTime, default="0", desc="time the dir forwarded the request";
- Time FirstResponseTime, default="0", desc="the time the first response was received";
+
+ Cycles InitialRequestTime, default="Cycles(0)",
+ desc="time the initial requests was sent from the L1Cache";
+ Cycles ForwardRequestTime, default="Cycles(0)",
+ desc="time the dir forwarded the request";
+ Cycles FirstResponseTime, default="Cycles(0)",
+ desc="the time the first response was received";
}
structure(TBETable, external="yes") {
void unset_tbe();
void wakeUpAllBuffers();
void wakeUpBuffers(Address a);
- Time curCycle();
+ Cycles curCycle();
Entry getCacheEntry(Address address), return_by_pointer="yes" {
Entry L2cache_entry := static_cast(Entry, "pointer", L2cacheMemory.lookup(address));
void set_tbe(TBE a);
void unset_tbe();
void wakeUpBuffers(Address a);
- Time curCycle();
+ Cycles curCycle();
// ** OBJECTS **
NetDest Destination, desc="Multicast destination mask";
MessageSizeType MessageSize, desc="size category of the message";
bool DirectedProbe, default="false", desc="probe filter directed probe";
- Time InitialRequestTime, default="0", desc="time the initial requests was sent from the L1Cache";
- Time ForwardRequestTime, default="0", desc="time the dir forwarded the request";
+
+ Cycles InitialRequestTime, default="Cycles(0)",
+ desc="time the initial requests was sent from the L1Cache";
+ Cycles ForwardRequestTime, default="Cycles(0)",
+ desc="time the dir forwarded the request";
int SilentAcks, default="0", desc="silent acks from the full-bit directory";
bool functionalRead(Packet *pkt) {
bool Dirty, desc="Is the data dirty (different than memory)?";
int Acks, default="0", desc="How many messages this counts as";
MessageSizeType MessageSize, desc="size category of the message";
- Time InitialRequestTime, default="0", desc="time the initial requests was sent from the L1Cache";
- Time ForwardRequestTime, default="0", desc="time the dir forwarded the request";
+
+ Cycles InitialRequestTime, default="Cycles(0)",
+ desc="time the initial requests was sent from the L1Cache";
+ Cycles ForwardRequestTime, default="Cycles(0)",
+ desc="time the dir forwarded the request";
int SilentAcks, default="0", desc="silent acks from the full-bit directory";
bool functionalRead(Packet *pkt) {
external_type(std::string, primitive="yes");
external_type(uint32_t, primitive="yes");
external_type(uint64, primitive="yes");
-external_type(Time, primitive="yes", default="0");
external_type(PacketPtr, primitive="yes");
external_type(Packet, primitive="yes");
external_type(Address);
-external_type(Cycles, primitive="yes");
+external_type(Cycles, primitive="yes", default="Cycles(0)");
structure(DataBlock, external = "yes", desc="..."){
void clear();
void profile_average_latency_estimate(int latency);
// profile the total message delay of a message across a virtual network
-void profileMsgDelay(int virtualNetwork, Time delayCycles);
+void profileMsgDelay(int virtualNetwork, Cycles delayCycles);
structure(InPort, external = "yes", primitive="yes") {
bool isReady();
void dequeue();
- Time dequeue_getDelayCycles();
+ Cycles dequeue_getDelayCycles();
void recycle();
bool isEmpty();
}
structure (Sequencer, external = "yes") {
void readCallback(Address, DataBlock);
void readCallback(Address, GenericMachineType, DataBlock);
- void readCallback(Address, GenericMachineType, DataBlock, Time, Time, Time);
+ void readCallback(Address, GenericMachineType, DataBlock,
+ Cycles, Cycles, Cycles);
+
void writeCallback(Address, DataBlock);
void writeCallback(Address, GenericMachineType, DataBlock);
- void writeCallback(Address, GenericMachineType, DataBlock, Time, Time, Time);
+ void writeCallback(Address, GenericMachineType, DataBlock,
+ Cycles, Cycles, Cycles);
+
void checkCoherence(Address);
void profileNack(Address, int, int, uint64);
void evictionCallback(Address);
void error(std::string msg);
void assert(bool condition);
int random(int number);
-Time zero_time();
-Cycles TimeToCycles(Time t);
+Cycles zero_time();
NodeID intToID(int nodenum);
int IDToInt(NodeID id);
-int time_to_int(Time time);
-Time getTimeModInt(Time time, int modulus);
-Time getTimePlusInt(Time addend1, int addend2);
-Time getTimeMinusTime(Time t1, Time t2);
void procProfileCoherenceRequest(NodeID node, bool needCLB);
void dirProfileCoherenceRequest(NodeID node, bool needCLB);
int max_tokens();
#define TYPEDEFINES_H
typedef unsigned long long uint64;
-
typedef long long int64;
typedef int64 Time;
double minutes = seconds / 60.0;
double hours = minutes / 60.0;
double days = hours / 24.0;
- Time ruby_cycles = g_system_ptr->getTime()-m_ruby_start;
+ Cycles ruby_cycles = g_system_ptr->getTime()-m_ruby_start;
if (!short_stats) {
out << "Elapsed_time_in_seconds: " << seconds << endl;
}
void
-Profiler::profilePFWait(Time waitTime)
+Profiler::profilePFWait(Cycles waitTime)
{
m_prefetchWaitHistogram.add(waitTime);
}
// non-zero cycle demand request
void
-Profiler::missLatency(Time cycles,
+Profiler::missLatency(Cycles cycles,
RubyRequestType type,
const GenericMachineType respondingMach)
{
}
void
-Profiler::missLatencyWcc(Time issuedTime,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime,
- Time completionTime)
+Profiler::missLatencyWcc(Cycles issuedTime,
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime,
+ Cycles completionTime)
{
if ((issuedTime <= initialRequestTime) &&
(initialRequestTime <= forwardRequestTime) &&
}
void
-Profiler::missLatencyDir(Time issuedTime,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime,
- Time completionTime)
+Profiler::missLatencyDir(Cycles issuedTime,
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime,
+ Cycles completionTime)
{
if ((issuedTime <= initialRequestTime) &&
(initialRequestTime <= forwardRequestTime) &&
// non-zero cycle prefetch request
void
-Profiler::swPrefetchLatency(Time cycles,
- RubyRequestType type,
+Profiler::swPrefetchLatency(Cycles cycles, RubyRequestType type,
const GenericMachineType respondingMach)
{
m_allSWPrefetchLatencyHistogram.add(cycles);
m_SWPrefetchLatencyHistograms[type].add(cycles);
m_SWPrefetchMachLatencyHistograms[respondingMach].add(cycles);
+
if (respondingMach == GenericMachineType_Directory ||
respondingMach == GenericMachineType_NUM) {
m_SWPrefetchL2MissLatencyHistogram.add(cycles);
void startTransaction(int cpu);
void endTransaction(int cpu);
- void profilePFWait(Time waitTime);
+ void profilePFWait(Cycles waitTime);
void controllerBusy(MachineID machID);
void bankBusy();
- void missLatency(Time t,
- RubyRequestType type,
+ void missLatency(Cycles t, RubyRequestType type,
const GenericMachineType respondingMach);
- void missLatencyWcc(Time issuedTime,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime,
- Time completionTime);
+ void missLatencyWcc(Cycles issuedTime, Cycles initialRequestTime,
+ Cycles forwardRequestTime, Cycles firstResponseTime,
+ Cycles completionTime);
- void missLatencyDir(Time issuedTime,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime,
- Time completionTime);
+ void missLatencyDir(Cycles issuedTime, Cycles initialRequestTime,
+ Cycles forwardRequestTime, Cycles firstResponseTime,
+ Cycles completionTime);
- void swPrefetchLatency(Time t,
- RubyRequestType type,
+ void swPrefetchLatency(Cycles t, RubyRequestType type,
const GenericMachineType respondingMach);
void sequencerRequests(int num) { m_sequencer_requests.add(num); }
bool watchAddress(Address addr);
// return Ruby's start time
- Time
- getRubyStartTime()
- {
- return m_ruby_start;
- }
+ Cycles getRubyStartTime() { return m_ruby_start; }
// added by SS
bool getHotLines() { return m_hot_lines; }
std::ostream* m_periodic_output_file_ptr;
int64_t m_stats_period;
- Time m_ruby_start;
+ Cycles m_ruby_start;
time_t m_real_time_start_time;
int64_t m_busyBankCount;
}
void
-AbstractController::profileMsgDelay(uint32_t virtualNetwork, Time delay)
+AbstractController::profileMsgDelay(uint32_t virtualNetwork, Cycles delay)
{
assert(virtualNetwork < m_delayVCHistogram.size());
m_delayHistogram.add(delay);
//! Profiles original cache requests including PUTs
void profileRequest(const std::string &request);
//! Profiles the delay associated with messages.
- void profileMsgDelay(uint32_t virtualNetwork, Time delay);
+ void profileMsgDelay(uint32_t virtualNetwork, Cycles delay);
protected:
int m_transitions_per_cycle;
return random() % n;
}
-inline Time
-zero_time()
-{
- return 0;
-}
-
+inline Cycles zero_time() { return Cycles(0); }
inline Cycles TimeToCycles(Time t) { return Cycles(t); }
inline NodeID
return nodenum;
}
-inline Time
-getTimeModInt(Time time, int modulus)
-{
- return time % modulus;
-}
-
-inline Time
-getTimePlusInt(Time addend1, int addend2)
-{
- return (Time) addend1 + addend2;
-}
-
-inline Time
-getTimeMinusTime(Time t1, Time t2)
-{
- assert(t1 >= t2);
- return t1 - t2;
-}
-
-// Return type for time_to_int is "Time" and not "int" so we get a
-// 64-bit integer
-inline Time
-time_to_int(Time time)
-{
- return time;
-}
-
// Appends an offset to an address
inline Address
setOffset(Address addr, int offset)
Prefetcher::getLRUindex(void)
{
uint32_t lru_index = 0;
- Time lru_access = m_array[lru_index].m_use_time;
+ Cycles lru_access = m_array[lru_index].m_use_time;
for (uint32_t i = 0; i < m_num_streams; i++) {
if (!m_array[i].m_is_valid) {
void
Sequencer::writeCallback(const Address& address,
- GenericMachineType mach,
+ GenericMachineType mach,
DataBlock& data)
{
- writeCallback(address, mach, data, 0, 0, 0);
+ writeCallback(address, mach, data, Cycles(0), Cycles(0), Cycles(0));
}
void
Sequencer::writeCallback(const Address& address,
- GenericMachineType mach,
+ GenericMachineType mach,
DataBlock& data,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime)
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime)
{
assert(address == line_address(address));
assert(m_writeRequestTable.count(line_address(address)));
m_controller->unblock(address);
}
- hitCallback(request, mach, data, success,
+ hitCallback(request, mach, data, success,
initialRequestTime, forwardRequestTime, firstResponseTime);
}
GenericMachineType mach,
DataBlock& data)
{
- readCallback(address, mach, data, 0, 0, 0);
+ readCallback(address, mach, data, Cycles(0), Cycles(0), Cycles(0));
}
void
Sequencer::readCallback(const Address& address,
GenericMachineType mach,
DataBlock& data,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime)
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime)
{
assert(address == line_address(address));
assert(m_readRequestTable.count(line_address(address)));
assert((request->m_type == RubyRequestType_LD) ||
(request->m_type == RubyRequestType_IFETCH));
- hitCallback(request, mach, data, true,
+ hitCallback(request, mach, data, true,
initialRequestTime, forwardRequestTime, firstResponseTime);
}
GenericMachineType mach,
DataBlock& data,
bool success,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime)
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime)
{
PacketPtr pkt = srequest->pkt;
Address request_address(pkt->getAddr());
Address request_line_address(pkt->getAddr());
request_line_address.makeLineAddress();
RubyRequestType type = srequest->m_type;
- Time issued_time = srequest->issue_time;
+ Cycles issued_time = srequest->issue_time;
// Set this cache entry to the most recently used
if (type == RubyRequestType_IFETCH) {
}
assert(curCycle() >= issued_time);
- Time miss_latency = curCycle() - issued_time;
+ Cycles miss_latency = curCycle() - issued_time;
// Profile the miss latency for all non-zero demand misses
if (miss_latency != 0) {
void writeCallback(const Address& address, DataBlock& data);
- void writeCallback(const Address& address,
- GenericMachineType mach,
+ void writeCallback(const Address& address,
+ GenericMachineType mach,
DataBlock& data);
- void writeCallback(const Address& address,
- GenericMachineType mach,
+ void writeCallback(const Address& address,
+ GenericMachineType mach,
DataBlock& data,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime);
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime);
void readCallback(const Address& address, DataBlock& data);
- void readCallback(const Address& address,
- GenericMachineType mach,
+ void readCallback(const Address& address,
+ GenericMachineType mach,
DataBlock& data);
- void readCallback(const Address& address,
- GenericMachineType mach,
+ void readCallback(const Address& address,
+ GenericMachineType mach,
DataBlock& data,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime);
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime);
RequestStatus makeRequest(PacketPtr pkt);
bool empty() const;
private:
void issueRequest(PacketPtr pkt, RubyRequestType type);
- void hitCallback(SequencerRequest* request,
+ void hitCallback(SequencerRequest* request,
GenericMachineType mach,
DataBlock& data,
bool success,
- Time initialRequestTime,
- Time forwardRequestTime,
- Time firstResponseTime);
+ Cycles initialRequestTime,
+ Cycles forwardRequestTime,
+ Cycles firstResponseTime);
RequestStatus insertRequest(PacketPtr pkt, RubyRequestType request_type);
int m_outstanding_count;
bool m_deadlock_check_scheduled;
- int m_store_waiting_on_load_cycles;
- int m_store_waiting_on_store_cycles;
- int m_load_waiting_on_store_cycles;
- int m_load_waiting_on_load_cycles;
+ uint32_t m_store_waiting_on_load_cycles;
+ uint32_t m_store_waiting_on_store_cycles;
+ uint32_t m_load_waiting_on_store_cycles;
+ uint32_t m_load_waiting_on_load_cycles;
bool m_usingNetworkTester;
#include "base/hashmap.hh"
#include "mem/ruby/common/Address.hh"
-#include "mem/ruby/common/Global.hh"
-#include "mem/ruby/profiler/Profiler.hh"
-#include "mem/ruby/system/System.hh"
template<class ENTRY>
class TBETable
#include "mem/ruby/system/TimerTable.hh"
TimerTable::TimerTable()
+ : m_next_time(0)
{
m_consumer_ptr = NULL;
m_clockobj_ptr = NULL;
m_next_valid = false;
m_next_address = Address(0);
- m_next_time = 0;
}
bool
typedef std::map<Address, Cycles> AddressMap;
AddressMap m_map;
mutable bool m_next_valid;
- mutable Time m_next_time; // Only valid if m_next_valid is true
+ mutable Cycles m_next_time; // Only valid if m_next_valid is true
mutable Address m_next_address; // Only valid if m_next_valid is true
//! Object used for querying time.
("Cycles", "int", "Cycles")]
elif self.op in ("+", "-", "*", "/"):
expected_types = [("int", "int", "int"),
- ("Time", "Time", "Time"),
("Cycles", "Cycles", "Cycles"),
("Cycles", "int", "Cycles"),
("int", "Cycles", "Cycles")]