ruby: remove get_time()

This patch replaces get_time() in *.sm files with curCycle() which
is now possible since controllers are clocked objects.
This commit is contained in:
Nilay Vaish 2013-01-28 06:14:18 -06:00
parent 31659e83fb
commit a8eb5b18e0
5 changed files with 19 additions and 23 deletions

View file

@ -179,6 +179,7 @@ machine(L1Cache, "Token protocol")
void unset_tbe();
void wakeUpAllBuffers();
void wakeUpBuffers(Address a);
Time curCycle();
TBETable L1_TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
@ -1344,7 +1345,7 @@ machine(L1Cache, "Token protocol")
tbe.Prefetch := in_msg.Prefetch;
tbe.AccessMode := in_msg.AccessMode;
}
tbe.IssueTime := get_time();
tbe.IssueTime := curCycle();
}
action(ta_traceStalledAddress, "ta", desc="Trace Stalled Address") {
@ -1447,7 +1448,7 @@ machine(L1Cache, "Token protocol")
// Update average latency
if (tbe.IssueCount <= 1) {
if (tbe.ExternalResponse == true) {
updateAverageLatencyEstimate(time_to_int(get_time()) - time_to_int(tbe.IssueTime));
updateAverageLatencyEstimate(time_to_int(curCycle()) - time_to_int(tbe.IssueTime));
}
}

View file

@ -181,6 +181,7 @@ machine(L1Cache, "AMD Hammer-like protocol")
void unset_tbe();
void wakeUpAllBuffers();
void wakeUpBuffers(Address a);
Time curCycle();
Entry getCacheEntry(Address address), return_by_pointer="yes" {
Entry L2cache_entry := static_cast(Entry, "pointer", L2cacheMemory.lookup(address));
@ -545,7 +546,7 @@ machine(L1Cache, "AMD Hammer-like protocol")
out_msg.Requestor := machineID;
out_msg.Destination.add(map_Address_to_Directory(address));
out_msg.MessageSize := MessageSizeType:Request_Control;
out_msg.InitialRequestTime := get_time();
out_msg.InitialRequestTime := curCycle();
tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
}
}
@ -558,7 +559,7 @@ machine(L1Cache, "AMD Hammer-like protocol")
out_msg.Requestor := machineID;
out_msg.Destination.add(map_Address_to_Directory(address));
out_msg.MessageSize := MessageSizeType:Request_Control;
out_msg.InitialRequestTime := get_time();
out_msg.InitialRequestTime := curCycle();
tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
}
}
@ -572,7 +573,7 @@ machine(L1Cache, "AMD Hammer-like protocol")
out_msg.Requestor := machineID;
out_msg.Destination.add(map_Address_to_Directory(address));
out_msg.MessageSize := MessageSizeType:Request_Control;
out_msg.InitialRequestTime := get_time();
out_msg.InitialRequestTime := curCycle();
}
}
tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
@ -586,7 +587,7 @@ machine(L1Cache, "AMD Hammer-like protocol")
out_msg.Requestor := machineID;
out_msg.Destination.add(map_Address_to_Directory(address));
out_msg.MessageSize := MessageSizeType:Request_Control;
out_msg.InitialRequestTime := get_time();
out_msg.InitialRequestTime := curCycle();
tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
}
}
@ -982,7 +983,7 @@ machine(L1Cache, "AMD Hammer-like protocol")
tbe.ForwardRequestTime := in_msg.ForwardRequestTime;
}
if (tbe.FirstResponseTime == zero_time()) {
tbe.FirstResponseTime := get_time();
tbe.FirstResponseTime := curCycle();
}
}
}

View file

@ -179,6 +179,7 @@ machine(Directory, "AMD Hammer-like protocol")
void set_tbe(TBE a);
void unset_tbe();
void wakeUpBuffers(Address a);
Time curCycle();
// ** OBJECTS **
@ -877,7 +878,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.Destination.setNetDest(MachineType:L1Cache, fwd_set);
out_msg.MessageSize := MessageSizeType:Multicast_Control;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
assert(tbe.SilentAcks > 0);
out_msg.SilentAcks := tbe.SilentAcks;
}
@ -893,7 +894,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.Destination.remove(in_msg.Requestor); // Don't include the original requestor
out_msg.MessageSize := MessageSizeType:Broadcast_Control;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
}
}
}
@ -953,7 +954,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.Destination.setNetDest(MachineType:L1Cache, fwd_set);
out_msg.MessageSize := MessageSizeType:Multicast_Control;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
out_msg.SilentAcks := machineCount(MachineType:L1Cache) - fwd_set.count();
out_msg.SilentAcks := out_msg.SilentAcks - 1;
}
@ -967,7 +968,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.Destination.remove(in_msg.Requestor); // Don't include the original requestor
out_msg.MessageSize := MessageSizeType:Broadcast_Control;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
}
}
}
@ -1007,7 +1008,7 @@ machine(Directory, "AMD Hammer-like protocol")
}
out_msg.MessageSize := MessageSizeType:Request_Control;
out_msg.InitialRequestTime := zero_time();
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
}
}
}
@ -1025,7 +1026,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.MessageSize := MessageSizeType:Request_Control;
out_msg.DirectedProbe := true;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
}
}
} else {
@ -1038,7 +1039,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.Destination.remove(in_msg.Requestor); // Don't include the original requestor
out_msg.MessageSize := MessageSizeType:Broadcast_Control;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
}
}
}
@ -1059,7 +1060,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.MessageSize := MessageSizeType:Request_Control;
out_msg.DirectedProbe := true;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
}
}
}
@ -1073,7 +1074,7 @@ machine(Directory, "AMD Hammer-like protocol")
out_msg.Destination.remove(in_msg.Requestor); // Don't include the original requestor
out_msg.MessageSize := MessageSizeType:Broadcast_Control;
out_msg.InitialRequestTime := in_msg.InitialRequestTime;
out_msg.ForwardRequestTime := get_time();
out_msg.ForwardRequestTime := curCycle();
}
}
}

View file

@ -32,7 +32,6 @@
void error(std::string msg);
void assert(bool condition);
int random(int number);
Time get_time();
Time zero_time();
NodeID intToID(int nodenum);
int IDToInt(NodeID id);

View file

@ -47,12 +47,6 @@ random(int n)
return random() % n;
}
inline Time
get_time()
{
return g_system_ptr->getTime();
}
inline Time
zero_time()
{