ruby: mesi: remove owner and sharer fields from directory tags
authorNilay Vaish <nilay@cs.wisc.edu>
Sat, 21 Dec 2013 02:34:03 +0000 (20:34 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Sat, 21 Dec 2013 02:34:03 +0000 (20:34 -0600)
The directory controller should not have the sharer field since there is
only one level 2 cache. Anyway the field was not in use.  The owner field
was being used to track the l2 cache version (in case of distributed l2) that
has the cache block under consideration.  The information is not required
since the version of the level 2 cache can be obtained from a subset of the
address bits.

configs/ruby/MESI_CMP_directory.py
src/mem/protocol/MESI_CMP_directory-dir.sm

index 2dba25b1a51f4793e3d6cd8c8d6795b0a33b98df..95b4904a5e05a0495324d68fcb7c345506a554ca 100644 (file)
@@ -174,6 +174,7 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
                                                              use_map =
                                                            options.use_map),
                                          memBuffer = mem_cntrl,
+                                         l2_select_num_bits = l2_bits,
                                          transitions_per_cycle = options.ports,
                                          ruby_system = ruby_system)
 
index 26a5c38dfe9a81c55cda8836e70032a99ea7964f..eb87b8c9be83ef045ae2bd9bdf9dda1888a3d2d1 100644 (file)
@@ -38,14 +38,15 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
  : DirectoryMemory * directory,
    MemoryControl * memBuffer,
    Cycles to_mem_ctrl_latency = 1,
-   Cycles directory_latency = 6
+   Cycles directory_latency = 6,
+   int l2_select_num_bits
 {
-
-  MessageBuffer requestToDir, network="From", virtual_network="0", ordered="false", vnet_type="request";
-  MessageBuffer responseToDir, network="From", virtual_network="1", ordered="false", vnet_type="response";
-
-  MessageBuffer requestFromDir, network="To", virtual_network="0", ordered="false", vnet_type="request";
-  MessageBuffer responseFromDir, network="To", virtual_network="1", ordered="false", vnet_type="response";
+  MessageBuffer requestToDir, network="From", virtual_network="0",
+        ordered="false", vnet_type="request";
+  MessageBuffer responseToDir, network="From", virtual_network="1",
+        ordered="false", vnet_type="response";
+  MessageBuffer responseFromDir, network="To", virtual_network="1",
+        ordered="false", vnet_type="response";
 
   // STATES
   state_declaration(State, desc="Directory states", default="Directory_State_I") {
@@ -82,8 +83,6 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
   structure(Entry, desc="...", interface="AbstractEntry") {
     State DirectoryState,          desc="Directory state";
     DataBlock DataBlk,             desc="data for the block";
-    NetDest Sharers,                   desc="Sharers for this block";
-    NetDest Owner,                     desc="Owner of this block";
   }
 
   // TBE entries for DMA requests
@@ -104,6 +103,7 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
 
   // ** OBJECTS **
 
+  int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
   TBETable TBEs, template="<Directory_TBE>", constructor="m_number_of_TBEs";
 
   void set_tbe(TBE tbe);
@@ -133,21 +133,11 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
   }
 
   void setState(TBE tbe, Address addr, State state) {
-
     if (is_valid(tbe)) {
       tbe.TBEState := state;
     }
 
     if (directory.isPresent(addr)) {
-
-      if (state == State:I)  {
-        assert(getDirectoryEntry(addr).Owner.count() == 0);
-        assert(getDirectoryEntry(addr).Sharers.count() == 0);
-      } else if (state == State:M) {
-        assert(getDirectoryEntry(addr).Owner.count() == 1);
-        assert(getDirectoryEntry(addr).Sharers.count() == 0);
-      }
-
       getDirectoryEntry(addr).DirectoryState := state;
     }
   }
@@ -416,22 +406,14 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
     requestNetwork_in.recycle();
   }
 
-
-  action(e_ownerIsRequestor, "e", desc="The owner is now the requestor") {
-    peek(requestNetwork_in, RequestMsg) {
-      getDirectoryEntry(address).Owner.clear();
-      getDirectoryEntry(address).Owner.add(in_msg.Requestor);
-    }
-  }
-
-
   action(inv_sendCacheInvalidate, "inv", desc="Invalidate a cache block") {
     peek(requestNetwork_in, RequestMsg) {
       enqueue(responseNetwork_out, ResponseMsg, latency=directory_latency) {
       out_msg.Addr := address;
       out_msg.Type := CoherenceResponseType:INV;
       out_msg.Sender := machineID;
-      out_msg.Destination := getDirectoryEntry(address).Owner;
+      out_msg.Destination.add(mapAddressToRange(address, MachineType:L2Cache,
+                                     l2_select_low_bit, l2_select_num_bits));
       out_msg.MessageSize := MessageSizeType:Response_Control;
       }
     }
@@ -450,10 +432,6 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
     }
   }
 
-  action(c_clearOwner, "c", desc="Clear the owner field") {
-    getDirectoryEntry(address).Owner.clear();
-  }
-
   action(v_allocateTBE, "v", desc="Allocate TBE") {
     peek(requestNetwork_in, RequestMsg) {
       TBEs.allocate(address);
@@ -500,10 +478,8 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
 
   // TRANSITIONS
 
-
   transition(I, Fetch, IM) {
     qf_queueMemoryFetchRequest;
-    e_ownerIsRequestor;
     j_popIncomingRequestQueue;
   }
 
@@ -514,7 +490,6 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
   }
 //added by SS
   transition(M, CleanReplacement, I) {
-    c_clearOwner;
     a_sendAck;
     k_popIncomingResponseQueue;
   }
@@ -526,7 +501,6 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
   }
 
   transition(MI, Memory_Ack, I) {
-    c_clearOwner;
     aa_sendAck;
     l_popMemQueue;
     kd_wakeUpDependents;
@@ -580,7 +554,6 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
 
   transition(M_DRDI, Memory_Ack, I) {
     aa_sendAck;
-    c_clearOwner;
     l_popMemQueue;
     kd_wakeUpDependents;
   }
@@ -600,7 +573,6 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
   transition(M_DWRI, Memory_Ack, I) {
     dwt_writeDMADataFromTBE;
     aa_sendAck;
-    c_clearOwner;
     da_sendDMAAck;
     w_deallocateTBE;
     l_popMemQueue;