Hello,everyone.

I am studying the code of MOESI_CMP_directory protocol of gem5.




In `MOESI_CMP_directory-L2cache.sm--`the action of 
`j_forwardGlobalRequestToLocalOwner`, the `"out_msg.Requestor"` of the request 
message is filled in the "machineID" of that L2 cache, so it is the correct 
requestor.




But  to response that message in `"MOESI_CMP_directory-L1cache.sm"--`the action 
of `"ee_sendDataExclusive"` ,when `in_msg.RequestorMachine == 
MachineType:L2Cache`, why is the `out_msg.Destination` filled in 
`"mapAddressToRange"`, instead of `"in_msg.Requestor"`? <br>(I think it is the 
`"out_msg.Requestor"` value of the request message.)




L2 cache:

   




    action(j_forwardGlobalRequestToLocalOwner, "j", desc="Forward external 
request to local owner") {

    peek(requestNetwork_in, RequestMsg) {

      enqueue( localRequestNetwork_out, RequestMsg, response_latency ) {

        out_msg.addr := in_msg.addr;

        out_msg.Type := in_msg.Type;

        out_msg.Requestor := machineID;// the machineID of the requestor L2

        out_msg.RequestorMachine := MachineType:L2Cache;

        out_msg.Destination.add(getLocalOwner(cache_entry, in_msg.addr));

        out_msg.Type := in_msg.Type;

        out_msg.MessageSize := MessageSizeType:Forwarded_Control;

        out_msg.Acks := 0 - 1;

      }

    }

  }

L1 cache:




    action(ee_sendDataExclusive, "\e", desc="Send data from cache to requestor, 
don't keep a shared copy") {

    peek(requestNetwork_in, RequestMsg) {

      assert(is_valid(cache_entry));

      if (in_msg.RequestorMachine == MachineType:L2Cache) {

        enqueue(responseNetwork_out, ResponseMsg, request_latency) {

          out_msg.addr := address;

          out_msg.Type := CoherenceResponseType:DATA_EXCLUSIVE;

          out_msg.Sender := machineID;

          out_msg.SenderMachine := MachineType:L1Cache;

          out_msg.Destination.add(mapAddressToRange(address, 
MachineType:L2Cache,

              l2_select_low_bit, l2_select_num_bits, intToID(0)));//why do not 
filled in "in_msg.Requestor" directly?                              

          out_msg.DataBlk := cache_entry.DataBlk;

          out_msg.Dirty := cache_entry.Dirty;

          out_msg.Acks := in_msg.Acks;

          out_msg.MessageSize := MessageSizeType:Response_Data;

        }

        DPRINTF(RubySlicc, "Sending exclusive data to L2\n");

      }

      else {

        enqueue(responseNetwork_out, ResponseMsg, request_latency) {

          out_msg.addr := address;

          out_msg.Type := CoherenceResponseType:DATA_EXCLUSIVE;

          out_msg.Sender := machineID;

          out_msg.SenderMachine := MachineType:L1Cache;

          out_msg.Destination.add(in_msg.Requestor);

          out_msg.DataBlk := cache_entry.DataBlk;

          out_msg.Dirty := cache_entry.Dirty;

          out_msg.Acks := in_msg.Acks;

          out_msg.MessageSize := MessageSizeType:ResponseLocal_Data;

        }

        DPRINTF(RubySlicc, "Sending exclusive data to L1\n");

      }

    }

  }





Thanks,























陈永铭 chenyongming







无线设计部/无线研究院/无线产品经营部 Wireless Design Dept./Wireless Product R&D 
Institute/Wireless Product Operation Division









南京市雨花台区花神大道6号中兴通讯二期 
ZTE Corporation,6#,Hashen Road,Yuhuatai District,Nanjing,P.R.China,210012 
T: +86 025  52877454 
E: [email protected] 
www.zte.com.cn
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to