ruby: eliminate type Time
authorNilay Vaish <nilay@cs.wisc.edu>
Mon, 1 Sep 2014 21:55:41 +0000 (16:55 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Mon, 1 Sep 2014 21:55:41 +0000 (16:55 -0500)
There is another type Time in src/base class which results in a conflict.

12 files changed:
src/cpu/testers/rubytest/Check.cc
src/cpu/testers/rubytest/Check.hh
src/cpu/testers/rubytest/RubyTester.cc
src/cpu/testers/rubytest/RubyTester.hh
src/mem/ruby/common/TypeDefines.hh
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh
src/mem/ruby/profiler/StoreTrace.cc
src/mem/ruby/profiler/StoreTrace.hh
src/mem/ruby/slicc_interface/RubySlicc_Util.hh
src/mem/ruby/system/CacheRecorder.cc
src/mem/ruby/system/CacheRecorder.hh

index ae74da67f2f4eeb93f6bb1800ddea8202dac1b85..b2b679018cfb2e7de496e5281a434b749f93a60f 100644 (file)
@@ -266,7 +266,7 @@ Check::initiateCheck()
 }
 
 void
-Check::performCallback(NodeID proc, SubBlock* data, Time curTime)
+Check::performCallback(NodeID proc, SubBlock* data, Cycles curTime)
 {
     Address address = data->getAddress();
 
index 47d790b1ec3a2eda02c0c39e1a272841653c62e6..3e8061ee7533e989bc2a337b1a0e9729cd5c3e01 100644 (file)
@@ -50,7 +50,7 @@ class Check
           int _num_readers, RubyTester* _tester);
 
     void initiate(); // Does Action or Check or nether
-    void performCallback(NodeID proc, SubBlock* data, Time curTime);
+    void performCallback(NodeID proc, SubBlock* data, Cycles curTime);
     const Address& getAddress() { return m_address; }
     void changeAddress(const Address& address);
 
index 68f76f1a6e002c670e74bdafe6b16f1041d69890..229b3e0a9d29d353881547c95f9e00cb3c4c2632 100644 (file)
@@ -102,7 +102,7 @@ RubyTester::init()
 
     m_last_progress_vector.resize(m_num_cpus);
     for (int i = 0; i < m_last_progress_vector.size(); i++) {
-        m_last_progress_vector[i] = 0;
+        m_last_progress_vector[i] = Cycles(0);
     }
 
     m_num_writers = writePorts.size();
@@ -225,7 +225,7 @@ void
 RubyTester::checkForDeadlock()
 {
     int size = m_last_progress_vector.size();
-    Time current_time = curCycle();
+    Cycles current_time = curCycle();
     for (int processor = 0; processor < size; processor++) {
         if ((current_time - m_last_progress_vector[processor]) >
                 m_deadlock_threshold) {
index df1bc1fbb2ed46f88d7492aefa342826f65370fc..e1b829a7d47d957f088d8f128a19ef60855f0193 100644 (file)
@@ -141,7 +141,7 @@ class RubyTester : public MemObject
     RubyTester& operator=(const RubyTester& obj);
 
     CheckTable* m_checkTable_ptr;
-    std::vector<Time> m_last_progress_vector;
+    std::vector<Cycles> m_last_progress_vector;
 
     int m_num_cpus;
     uint64 m_checks_completed;
index 391c9365a52ccbc2492bfbbc290bda91a9f9f30f..9996fb0f4c900c607d7647cbf980f8182ba2d906 100644 (file)
@@ -33,7 +33,6 @@
 typedef unsigned long long uint64;
 typedef long long int64;
 
-typedef int64 Time;
 typedef uint64 physical_address_t;
 
 typedef int64 Index;            // what the address bit ripper returns
index 5f9493806466e762f878d7b736218bf100bf733f..db71c997470fa050746888c0ac3919a98fed7dc3 100644 (file)
@@ -60,7 +60,7 @@ NetworkInterface_d::NetworkInterface_d(const Params *p)
     // instantiating the NI flit buffers
     for (int i = 0; i < m_num_vcs; i++) {
         m_ni_buffers[i] = new flitBuffer_d();
-        m_ni_enqueue_time[i] = INFINITE_;
+        m_ni_enqueue_time[i] = Cycles(INFINITE_);
     }
 
     m_vc_allocator.resize(m_virtual_networks); // 1 allocator per vnet
@@ -330,7 +330,7 @@ NetworkInterface_d::scheduleOutputLink()
 
             if (t_flit->get_type() == TAIL_ ||
                t_flit->get_type() == HEAD_TAIL_) {
-                m_ni_enqueue_time[vc] = INFINITE_;
+                m_ni_enqueue_time[vc] = Cycles(INFINITE_);
             }
             return;
         }
index 0b8b9f12fd77bca3f5105bb888678c72184fe7c2..05142cd28a332cc49deb202c509e376371d34111 100644 (file)
@@ -86,7 +86,7 @@ class NetworkInterface_d : public ClockedObject, public Consumer
     // Input Flit Buffers
     // The flit buffers which will serve the Consumer
     std::vector<flitBuffer_d *>   m_ni_buffers;
-    std::vector<Time> m_ni_enqueue_time;
+    std::vector<Cycles> m_ni_enqueue_time;
 
     // The Message buffers that takes messages from the protocol
     std::vector<MessageBuffer *> inNode_ptr;
index 84b05ea8611f1e170e051036d0240fe6ff885eff..1c462dd2513cf7218065dca54b4253259fbf5272 100644 (file)
@@ -127,7 +127,7 @@ void
 StoreTrace::downgrade(NodeID node)
 {
     if (node == m_last_writer) {
-        Time current = curTick();
+        Tick current = curTick();
         assert(m_stores_this_interval != 0);
         assert(m_last_store != 0);
         assert(m_first_store != 0);
index 293871723b849dba67ce16ded27abac1bd9c39c4..ac38a420bb0afb781e9637da5c0f1ac095215421 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <iostream>
 
+#include "base/types.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Histogram.hh"
 
@@ -61,8 +62,8 @@ class StoreTrace
 
     Address m_addr;
     NodeID m_last_writer;
-    Time m_first_store;
-    Time m_last_store;
+    Tick m_first_store;
+    Tick m_last_store;
     int m_stores_this_interval;
 
     int64 m_total_samples; // Total number of store lifetimes of this line
index 52a47518f945be0b633c8eb2d369ce2b512d03b8..4398a4a00892bb0d7c79c2b0a6aed3a633daec22 100644 (file)
@@ -47,7 +47,6 @@ random(int n)
 }
 
 inline Cycles zero_time() { return Cycles(0); }
-inline Cycles TimeToCycles(Time t) { return Cycles(t); }
 
 inline NodeID
 intToID(int nodenum)
index 3a76a64f7545b1fe08f26f46feb3f1ddce427ffe..542d91aef973a55f65f5dc643f252f8091b5c12e 100644 (file)
@@ -143,7 +143,7 @@ CacheRecorder::enqueueNextFetchRequest()
 void
 CacheRecorder::addRecord(int cntrl, const physical_address_t data_addr,
                          const physical_address_t pc_addr,
-                         RubyRequestType type, Time time, DataBlock& data)
+                         RubyRequestType type, Tick time, DataBlock& data)
 {
     TraceRecord* rec = (TraceRecord*)malloc(sizeof(TraceRecord) +
                                             m_block_size_bytes);
index 2156b0689dfa585a9f584f4c412b336e1b8cef01..ad1223dcea51630fab3cbba22d890d8a9702c7f9 100644 (file)
@@ -38,6 +38,7 @@
 #include <vector>
 
 #include "base/hashmap.hh"
+#include "base/types.hh"
 #include "mem/protocol/RubyRequestType.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/DataBlock.hh"
@@ -54,7 +55,7 @@ class Sequencer;
 class TraceRecord {
   public:
     int m_cntrl_id;
-    Time m_time;
+    Tick m_time;
     physical_address_t m_data_address;
     physical_address_t m_pc_address;
     RubyRequestType m_type;
@@ -75,7 +76,7 @@ class CacheRecorder
                   uint64_t block_size_bytes);
     void addRecord(int cntrl, const physical_address_t data_addr,
                    const physical_address_t pc_addr,  RubyRequestType type,
-                   Time time, DataBlock& data);
+                   Tick time, DataBlock& data);
 
     uint64 aggregateRecords(uint8_t** data, uint64 size);