Beispiel #1
0
 /// <summary>
 /// FIFO Ordering for Insert Request into the BUS
 /// </summary>
 public void MakeRequestAux()
 {
     while (threadFlag.Flag)
     {
         if (clock.CLOCK_CCInterconection && !bussy && requestQueue.Count > 0)
         {
             clock.CLOCK_CCInterconection = false;
             CacheDataRequest newRequest = (CacheDataRequest)requestQueue.Dequeue();
             toCoreId   = newRequest.ToCoreId;
             fromCoreId = newRequest.MyCoreId;
             address    = newRequest.Address;
             type       = 1;
             bussy      = true;
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Method for Enqueue a request to the Cache Interconection
        /// The Method validate if the addres are in the table, if its true then put the request into the Queue
        /// </summary>
        /// <param name="myAddress"></param>
        /// <param name="myCoreId"></param>
        /// <returns></returns>
        public bool MakeRequest(string myAddress, string myCoreId)
        {
            bool result;

            result = false;
            foreach (CacheTableBlock temp in cacheTable)
            {
                if (temp.Address == myAddress && temp.Valid == true)
                {
                    CacheDataRequest request = new CacheDataRequest()
                    {
                        MyCoreId = myCoreId,
                        ToCoreId = temp.CoreId,
                        Address  = myAddress
                    };
                    requestQueue.Enqueue(request);
                    result = true;
                    Console.WriteLine(myCoreId + ": " + "Solitud de valor por red de Interconexión");
                    break;
                }
            }
            return(result);
        }