summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configs/ruby/MESI_CMP_directory.py1
-rw-r--r--src/mem/protocol/MESI_CMP_directory-dir.sm50
2 files changed, 12 insertions, 39 deletions
diff --git a/configs/ruby/MESI_CMP_directory.py b/configs/ruby/MESI_CMP_directory.py
index 2dba25b1a..95b4904a5 100644
--- a/configs/ruby/MESI_CMP_directory.py
+++ b/configs/ruby/MESI_CMP_directory.py
@@ -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)
diff --git a/src/mem/protocol/MESI_CMP_directory-dir.sm b/src/mem/protocol/MESI_CMP_directory-dir.sm
index 26a5c38df..eb87b8c9b 100644
--- a/src/mem/protocol/MESI_CMP_directory-dir.sm
+++ b/src/mem/protocol/MESI_CMP_directory-dir.sm
@@ -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;