: 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") {
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
// ** OBJECTS **
+ int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
TBETable TBEs, template="<Directory_TBE>", constructor="m_number_of_TBEs";
void set_tbe(TBE tbe);
}
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;
}
}
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;
}
}
}
}
- 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);
// TRANSITIONS
-
transition(I, Fetch, IM) {
qf_queueMemoryFetchRequest;
- e_ownerIsRequestor;
j_popIncomingRequestQueue;
}
}
//added by SS
transition(M, CleanReplacement, I) {
- c_clearOwner;
a_sendAck;
k_popIncomingResponseQueue;
}
}
transition(MI, Memory_Ack, I) {
- c_clearOwner;
aa_sendAck;
l_popMemQueue;
kd_wakeUpDependents;
transition(M_DRDI, Memory_Ack, I) {
aa_sendAck;
- c_clearOwner;
l_popMemQueue;
kd_wakeUpDependents;
}
transition(M_DWRI, Memory_Ack, I) {
dwt_writeDMADataFromTBE;
aa_sendAck;
- c_clearOwner;
da_sendDMAAck;
w_deallocateTBE;
l_popMemQueue;