예제 #1
0
파일: MPKI.cs 프로젝트: hirous/test
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     getMPKI();
     if (winner == null)
     {
         winner = candidate;
     }
     else if (mpki[winner.mreq.request.requesterID] < mpki[candidate.mreq.request.requesterID])
     {
         winner = candidate;
     }
     else if (mpki[winner.mreq.request.requesterID] == mpki[candidate.mreq.request.requesterID])
     {
         if (!winner.Urgent && candidate.Urgent)
         {
             winner = candidate;
         }
         else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
         {
             winner = candidate;
         }
         else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
         {
             winner = candidate;
         }
         else if (candidate.IsOlderThan(winner))
         {
             winner = candidate;
         }
     }
     return(winner);
 }
예제 #2
0
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if (winner == null)
     {
         winner = candidate;
     }
     else if (!winner.Urgent && candidate.Urgent)
     {
         winner = candidate;
     }
     else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     else if (ch.triggerCPUPrio && winner.mreq.from_GPU && !candidate.mreq.from_GPU) //Priritize CPU if GPU is not bursty
     {
         winner = candidate;
     }
     else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
     {
         winner = candidate;
     }
     else if (candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     return(winner);
 }
예제 #3
0
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if (winner == null)
     {
         winner = candidate;
     }
     else if (!winner.Urgent && candidate.Urgent)
     {
         winner = candidate;
     }
     else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     else if (!winner.marked && candidate.marked)
     {
         winner = candidate;
     }
     else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
     {
         winner = candidate;
     }
     else if (winner.rank > candidate.rank)
     {
         winner = candidate;
     }
     else if (candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     return(winner);
 }
예제 #4
0
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if (winner == null)
     {
         winner = candidate;
     }
     else if (!winner.Urgent && candidate.Urgent) // urgent wins over non-urgent
     {
         winner = candidate;
     }
     else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     else if (winner.FromGPU && !candidate.FromGPU) // cores win over GPU
     {
         winner = candidate;
     }
     else if (winner.IsWrite && !candidate.IsWrite) // reads win over writes
     {
         winner = candidate;
     }
     else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
     {
         winner = candidate;
     }
     else if (candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     return(winner);
 }
예제 #5
0
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
	{
            if(winner == null)
                winner = candidate;
	    else
	    {
		int winner_id = winner.mreq.request.requesterID;
		int candidate_id = candidate.mreq.request.requesterID;
		int winner_priority = getPriority(winner_id);
		int candidate_priority = getPriority(candidate_id);

		if( winner_priority < candidate_priority )
		{
		    winner = candidate;
		}
		else if( winner_priority == candidate_priority )
		{
		    if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() &&
			Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() )
		    {
			int winner_rank = Simulator.QoSCtrl.getHwaRank(winner.mreq.request.requesterID);
			int candidate_rank = Simulator.QoSCtrl.getHwaRank(candidate.mreq.request.requesterID);
			if( winner_rank > candidate_rank )
			    return winner;
			else if( winner_rank < candidate_rank )
			    return candidate;
		    }
		    if(( winner.index == top_index_in_buf[winner_id] ) &&
		       ( candidate.index != top_index_in_buf[candidate_id] ))
			return winner;
		    else if(( winner.index != top_index_in_buf[winner_id] ) &&
			    ( candidate.index == top_index_in_buf[candidate_id] ))
			return candidate;

		    if( winner_id != candidate_id )
		    {
			if( bw_required[winner_id] <= bw_required[candidate_id] ) return winner;
			return candidate;
		    }

		    if(!winner.Urgent && candidate.Urgent)
			winner = candidate;
		    else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
			winner = candidate;
		    else if(winner.Urgent && !candidate.Urgent)
			winner = winner;
		    else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
			winner = candidate;
		    else if(winner.IsRowBufferHit && !candidate.IsRowBufferHit )
			winner = winner;
		    else if(candidate.IsOlderThan(winner))
			winner = candidate;
		}		    
	    }
	    return winner;
	}
예제 #6
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if (winner == null)
            {
                winner = candidate;
            }
            else
            {
                if (Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() &&
                    Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())
                {
                    if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID)
                    {
                        if (candidate.IsOlderThan(winner))
                        {
                            winner = candidate;
                        }
                    }
                    else if (getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID))
                    {
                        winner = candidate;
                    }
//			else if( remainingTime(winner) > remainingTime(candidate) )
//			    winner = candidate;
                }
                else if (Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA())
                {
                }
                else if (Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())
                {
                    winner = candidate;
                }
                else
                {
                    if (!winner.Urgent && candidate.Urgent)
                    {
                        winner = candidate;
                    }
                    else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
                    {
                        winner = candidate;
                    }
                    else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit)    // prev not RB hit
                    {
                        winner = candidate;
                    }
                    else if (candidate.IsOlderThan(winner))
                    {
                        winner = candidate;
                    }
                }
            }
            return(winner);
        }
예제 #7
0
파일: FRFCFS.cs 프로젝트: hirous/test
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if(winner == null)
         winner = candidate;
     else if(!winner.Urgent && candidate.Urgent)
         winner = candidate;
     else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
         winner = candidate;
     else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
         winner = candidate;
     else if(candidate.IsOlderThan(winner))
         winner = candidate;
     return winner;
 }
예제 #8
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if (winner == null)
            {
                winner = candidate;
            }
            else
            {
                int winner_priority    = getPriority(winner.mreq.request.requesterID);
                int candidate_priority = getPriority(candidate.mreq.request.requesterID);
                if (winner_priority < candidate_priority)
                {
                    winner = candidate;
                }
                else if (winner_priority == candidate_priority)
                {
                    if (Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) &&
                        Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID))
                    {
//			    if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() &&
//				Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ){
                        if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID)
                        {
                            if (candidate.IsOlderThan(winner))
                            {
                                winner = candidate;
                            }
                        }
                    }

                    if (!winner.Urgent && candidate.Urgent)
                    {
                        winner = candidate;
                    }
                    else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
                    {
                        winner = candidate;
                    }
                    else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit)        // prev not RB hit
                    {
                        winner = candidate;
                    }
                    else if (candidate.IsOlderThan(winner))
                    {
                        winner = candidate;
                    }
                }
            }
            return(winner);
        }
예제 #9
0
파일: ATLAS.cs 프로젝트: hirous/test
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if(winner == null)
                winner = candidate;
            MemoryRequest req1 = winner.mreq;
            MemoryRequest req2 = candidate.mreq;
            bool marked1 = req1.is_marked;
            bool marked2 = req2.is_marked;
            if (marked1 ^ marked2) {
                if (marked1) return winner;
                else return candidate;
            }

            int rank1 = rank[req1.request.requesterID];
            int rank2 = rank[req2.request.requesterID];
            if (rank1 != rank2) {
                if (rank1 > rank2) return winner;
                else return candidate;
            }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;
            if (hit1 ^ hit2) {
                if (hit1) return winner;
                else return candidate;
            }
            if (candidate.IsOlderThan(winner)) return candidate;
            else return winner;
        }
예제 #10
0
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if(winner == null)
         winner = candidate;
     else if(!winner.Urgent && candidate.Urgent)
         winner = candidate;
     else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
         winner = candidate;
     else if(ch.triggerCPUPrio && winner.mreq.from_GPU && !candidate.mreq.from_GPU) //Priritize CPU if GPU is not bursty
         winner = candidate;
     else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
         winner = candidate;
     else if(candidate.IsOlderThan(winner))
         winner = candidate;
     return winner;
 }
예제 #11
0
파일: INVFCFS.cs 프로젝트: hirous/test
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if(winner == null)
         winner = candidate;
     else if(!candidate.IsOlderThan(winner))
         winner = candidate;
     return winner;
 }
예제 #12
0
파일: GFRFCFS.cs 프로젝트: hirous/test
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if(winner == null)
         winner = candidate;
     else if(!winner.Urgent && candidate.Urgent) // urgent wins over non-urgent
         winner = candidate;
     else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
         winner = candidate;
     else if(winner.FromGPU && !candidate.FromGPU) // cores win over GPU
         winner = candidate;
     else if(winner.IsWrite && !candidate.IsWrite) // reads win over writes
         winner = candidate;
     else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
         winner = candidate;
     else if(candidate.IsOlderThan(winner))
         winner = candidate;
     return winner;
 }
예제 #13
0
파일: GPARBS.cs 프로젝트: hirous/test
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if(winner == null)
         winner = candidate;
     else if(!winner.Urgent && candidate.Urgent)
         winner = candidate;
     else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
         winner = candidate;
     else if(winner.FromGPU && !candidate.FromGPU) // cores win over GPU
         winner = candidate;
     else if(!winner.marked && candidate.marked)
         winner = candidate;
     else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
         winner = candidate;
     else if(winner.rank > candidate.rank)
         winner = candidate;
     else if(candidate.IsOlderThan(winner))
         winner = candidate;
     return winner;
 }
예제 #14
0
파일: INVMPKI.cs 프로젝트: hirous/test
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     getMPKI();
     if(winner == null)
         winner = candidate;
     else if(mpki[winner.mreq.request.requesterID] > mpki[candidate.mreq.request.requesterID])
         winner = candidate;
     else if(mpki[winner.mreq.request.requesterID] == mpki[candidate.mreq.request.requesterID])
     {
         if(!winner.Urgent && candidate.Urgent)
             winner = candidate;
         else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
             winner = candidate;
         else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
             winner = candidate;
         else if(candidate.IsOlderThan(winner))
             winner = candidate;
     }
     return winner;
 }
예제 #15
0
파일: FCFS.cs 프로젝트: hirous/test
 // Override this for other algorithms
 override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if (winner == null)
     {
         winner = candidate;
     }
     else if (candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     return(winner);
 }
예제 #16
0
파일: Sched.cs 프로젝트: hirous/test
 // Override this for other algorithms
 virtual protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
 {
     if (winner == null)
     {
         winner = candidate;
     }
     else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
     {
         winner = candidate;
     }
     else if (candidate.IsOlderThan(winner))
     {
         winner = candidate;
     }
     return(winner);
 }
예제 #17
0
파일: TCM.cs 프로젝트: hirous/test
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if (winner == null)
            {
                winner = candidate;
            }
            MemoryRequest req1  = winner.mreq;
            MemoryRequest req2  = candidate.mreq;
            int           rank1 = rank[req1.request.requesterID];
            int           rank2 = rank[req2.request.requesterID];

            if (rank1 != rank2)
            {
                if (rank1 > rank2)
                {
                    return(winner);
                }
                else
                {
                    return(candidate);
                }
            }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;

            if (hit1 ^ hit2)
            {
                if (hit1)
                {
                    return(winner);
                }
                else
                {
                    return(candidate);
                }
            }

            if (candidate.IsOlderThan(winner))
            {
                return(candidate);
            }
            else
            {
                return(winner);
            }
        }
예제 #18
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if(winner == null)
                winner = candidate;
            MemoryRequest req1 = winner.mreq;
            MemoryRequest req2 = candidate.mreq;
            double rank1 = blp[req1.request.requesterID];
            double rank2 = blp[req2.request.requesterID];
            if (rank1 != rank2) {
                if (rank1 > rank2) return winner;
                else return candidate;
            }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;
            if (hit1 ^ hit2) {
                if (hit1) return winner;
                else return candidate;
            }

            if (candidate.IsOlderThan(winner)) return candidate;
            else return winner;
        }
예제 #19
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if(winner == null)
	    {
                winner = candidate;
 		return winner;
	    }

	    if( (!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) ) &&
		(!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) ))
//	    if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) &&
//		(!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()))
	    {
		MemoryRequest req1 = winner.mreq;
		MemoryRequest req2 = candidate.mreq;
		int rank1 = rank[req1.request.requesterID];
		int rank2 = rank[req2.request.requesterID];
		if (rank1 != rank2) {
		    if (rank1 > rank2) return winner;
		    else return candidate;
		}
	    }
	    else if( !Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) )
//	    else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() )
	    {
		return candidate;
	    }
	    else if( !Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) )
//	    else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() )
	    {
		return winner;
	    }
	    else
	    {
		if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID )
		{
		    if(candidate.IsOlderThan(winner))
		    {
			return candidate;				
		    }
		    else
		    {
			return winner;
		    }
		}
		else if( getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID))
		    return candidate;
		else
		    return winner;
	    }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;
            if (hit1 ^ hit2) {
                if (hit1) return winner;
                else return candidate;
            }

            if (candidate.IsOlderThan(winner)) return candidate;
            else return winner;
        }
예제 #20
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if(winner == null)
	    {
                winner = candidate;
 		return winner;
	    }
	    double winner_priority = getPriority( winner );
	    double candidate_priority = getPriority( candidate );

	    if( winner_priority < candidate_priority )
	    {
		winner = candidate;
		return winner;
	    }
	    else if( winner_priority > candidate_priority )
	    {
		return winner;
	    }
	    if( (!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) ) &&
		(!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) ))
//	    if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) &&
//		(!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()))
	    {
		MemoryRequest req1 = winner.mreq;
		MemoryRequest req2 = candidate.mreq;
		int rank1 = rank[req1.request.requesterID];
		int rank2 = rank[req2.request.requesterID];
		if (rank1 != rank2) {
		    if (rank1 > rank2) return winner;
		    else return candidate;
		}
	    }
	    else if( !Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) )
//	    else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() ) // winner is CPU, candidate is HWA
	    {
		MemoryRequest req1 = winner.mreq;
		MemoryRequest req2 = candidate.mreq;
		int rank1 = rank[req1.request.requesterID];
		if( !Simulator.QoSCtrl.schedule_cluster_check(1, req2.request.requesterID, chan.mem_id, chan.id ) )
		    return winner;
//		else if( icluster_size == 0 )
		else if( quantum_cnt == 0 )
		    return winner;
		if( rank1 >= icluster_size + Config.HWANum ) // CPU is low memory intensity
		{
//		    if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 ))
//			Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 );
		    return winner;
		}
		else if( rnd_value < 100 * Config.sched.ratio_allocated_sdl_cluster ) // CPU is high memory intensity, HWA is selected
		{
//		    if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 ))
//			Console.WriteLine("1-3,Id:{0} win against {1}, rnd_value:{2}, ratio:{3}", req2.request.requesterID, req1.request.requesterID, rnd_value, Config.sched.ratio_allocated_sdl_cluster );
		    return candidate;
		}
		else
		{
//		    if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 ))
//			Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 );
		    return winner;
		}
	    }
	    else if( !Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) )
//	    else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) // winner is HWA, candidate is CPU
	    {
		MemoryRequest req1 = candidate.mreq;
		MemoryRequest req2 = winner.mreq;
		int rank1 = rank[req1.request.requesterID];
		if( !Simulator.QoSCtrl.schedule_cluster_check(1, req2.request.requesterID, chan.mem_id, chan.id ) )
		    return candidate;
		else if( quantum_cnt == 0 )
		    return candidate;
		else if( rank1 >= icluster_size + Config.HWANum ) // CPU is low memory intensity
		{
//		    if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 ))
//			Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 );
		    return candidate;
		}
		else if( rnd_value < 100 * Config.sched.ratio_allocated_sdl_cluster ) // CPU is high memory intensity, HWA is selected
		{
//		    if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 ))
//			Console.WriteLine("1-3,Id:{0} win against {1}, rnd_value:{2}, ratio:{3}", req2.request.requesterID, req1.request.requesterID, rnd_value, Config.sched.ratio_allocated_sdl_cluster );
		    return winner; 
		}
		else
		{
//		    if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 ))
//			Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 );
		    return candidate;
		}
	    }
	    else // both are HWA
	    {
		if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID )
		{
		    if(candidate.IsOlderThan(winner))
			return candidate;				
		    else
			return winner;
		}

		if( remainingTime(winner.mreq.request.requesterID) > remainingTime(candidate.mreq.request.requesterID) )
		{
		    return candidate;
		}
		else
		{
		    return winner;
		}
	    }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;
            if (hit1 ^ hit2) {
                if (hit1) return winner;
                else return candidate;
            }

            if (candidate.IsOlderThan(winner)) return candidate;
            else return winner;
        }
예제 #21
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if (winner == null)
            {
                winner = candidate;
                return(winner);
            }

            if ((!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID)) &&
                (!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID)))
//	    if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) &&
//		(!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()))
            {
                MemoryRequest req1  = winner.mreq;
                MemoryRequest req2  = candidate.mreq;
                int           rank1 = rank[req1.request.requesterID];
                int           rank2 = rank[req2.request.requesterID];
                if (rank1 != rank2)
                {
                    if (rank1 > rank2)
                    {
                        return(winner);
                    }
                    else
                    {
                        return(candidate);
                    }
                }
            }
            else if (!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID))
//	    else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() )
            {
                return(candidate);
            }
            else if (!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID))
//	    else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() )
            {
                return(winner);
            }
            else
            {
                if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID)
                {
                    if (candidate.IsOlderThan(winner))
                    {
                        return(candidate);
                    }
                    else
                    {
                        return(winner);
                    }
                }
                else if (getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID))
                {
                    return(candidate);
                }
                else
                {
                    return(winner);
                }
            }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;

            if (hit1 ^ hit2)
            {
                if (hit1)
                {
                    return(winner);
                }
                else
                {
                    return(candidate);
                }
            }

            if (candidate.IsOlderThan(winner))
            {
                return(candidate);
            }
            else
            {
                return(winner);
            }
        }
예제 #22
0
파일: TCM_deadline.cs 프로젝트: hirous/test
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if(winner == null)
	    {
                winner = candidate;
 		return winner;
	    }
	    double winner_priority = getPriority( winner );
	    double candidate_priority = getPriority( candidate );

	    if( winner_priority < candidate_priority )
	    {
		winner = candidate;
		return winner;
	    }
	    else if( winner_priority > candidate_priority )
	    {
		return winner;
	    }
	    if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) &&
		(!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()))
	    {
		MemoryRequest req1 = winner.mreq;
		MemoryRequest req2 = candidate.mreq;
		int rank1 = rank[req1.request.requesterID];
		int rank2 = rank[req2.request.requesterID];
		if (rank1 != rank2) {
		    if (rank1 > rank2) return winner;
		    else return candidate;
		}
	    }
	    else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() ) // winner is CPU, candidate is HWA
	    {
		MemoryRequest req1 = winner.mreq;
		int rank1 = rank[req1.request.requesterID];
		if( rank1 >= icluster_size + Config.HWANum )
		{
		    return winner;
		}
		else
		{
		    return candidate;
		}
	    }
	    else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) // winner is HWA, candidate is CPU
	    {
		MemoryRequest req1 = candidate.mreq;
		int rank1 = rank[req1.request.requesterID];
		if( rank1 >= icluster_size + Config.HWANum )
		{
		    return candidate;
		}
		else
		{
		    return winner;
		}
	    }
	    else // both are HWA
	    {
		if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID )
		{
		    if(candidate.IsOlderThan(winner))
			return candidate;				
		    else
			return winner;
		}

		if( remainingTime(winner.mreq.request.requesterID) > remainingTime(candidate.mreq.request.requesterID) )
		{
		    return candidate;
		}
		else
		{
		    return winner;
		}
	    }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;
            if (hit1 ^ hit2) {
                if (hit1) return winner;
                else return candidate;
            }

            if (candidate.IsOlderThan(winner)) return candidate;
            else return winner;
        }
예제 #23
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if(winner == null)
                winner = candidate;
	    else
		{
		    if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() &&
			Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ){
			if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID )
			{
			    if(candidate.IsOlderThan(winner))
			    {
				winner = candidate;				
			    }
			}
			else if( getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID))
			    winner = candidate;
//			else if( remainingTime(winner) > remainingTime(candidate) )
//			    winner = candidate;
		    }
		    else if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() )
		    {
			
		    }
		    else if( Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() )
		    {
			winner = candidate;
		    }
		    else
		    {
			if(!winner.Urgent && candidate.Urgent)
			    winner = candidate;
			else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
			    winner = candidate;
			else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
			    winner = candidate;
			else if(candidate.IsOlderThan(winner))
			    winner = candidate;
		    }
		}
	    return winner;
        }
예제 #24
0
파일: TCM_deadline.cs 프로젝트: hirous/test
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if (winner == null)
            {
                winner = candidate;
                return(winner);
            }
            double winner_priority    = getPriority(winner);
            double candidate_priority = getPriority(candidate);

            if (winner_priority < candidate_priority)
            {
                winner = candidate;
                return(winner);
            }
            else if (winner_priority > candidate_priority)
            {
                return(winner);
            }
            if ((!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) &&
                (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()))
            {
                MemoryRequest req1  = winner.mreq;
                MemoryRequest req2  = candidate.mreq;
                int           rank1 = rank[req1.request.requesterID];
                int           rank2 = rank[req2.request.requesterID];
                if (rank1 != rank2)
                {
                    if (rank1 > rank2)
                    {
                        return(winner);
                    }
                    else
                    {
                        return(candidate);
                    }
                }
            }
            else if (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA())  // winner is CPU, candidate is HWA
            {
                MemoryRequest req1  = winner.mreq;
                int           rank1 = rank[req1.request.requesterID];
                if (rank1 >= icluster_size + Config.HWANum)
                {
                    return(winner);
                }
                else
                {
                    return(candidate);
                }
            }
            else if (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())  // winner is HWA, candidate is CPU
            {
                MemoryRequest req1  = candidate.mreq;
                int           rank1 = rank[req1.request.requesterID];
                if (rank1 >= icluster_size + Config.HWANum)
                {
                    return(candidate);
                }
                else
                {
                    return(winner);
                }
            }
            else // both are HWA
            {
                if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID)
                {
                    if (candidate.IsOlderThan(winner))
                    {
                        return(candidate);
                    }
                    else
                    {
                        return(winner);
                    }
                }

                if (remainingTime(winner.mreq.request.requesterID) > remainingTime(candidate.mreq.request.requesterID))
                {
                    return(candidate);
                }
                else
                {
                    return(winner);
                }
            }

            bool hit1 = winner.IsRowBufferHit;
            bool hit2 = candidate.IsRowBufferHit;

            if (hit1 ^ hit2)
            {
                if (hit1)
                {
                    return(winner);
                }
                else
                {
                    return(candidate);
                }
            }

            if (candidate.IsOlderThan(winner))
            {
                return(candidate);
            }
            else
            {
                return(winner);
            }
        }
예제 #25
0
        // Override this for other algorithms
        override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate)
        {
            if(winner == null)
                winner = candidate;
	    else
		{
		    int winner_priority = getPriority( winner.mreq.request.requesterID );
		    int candidate_priority = getPriority( candidate.mreq.request.requesterID );
		    if( winner_priority < candidate_priority )
			{
			    winner = candidate;
			}
		    else if( winner_priority == candidate_priority )
			{
			    
			    if( Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID)  &&
				Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) ){
//			    if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() &&
//				Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ){
				if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID )
				{
				    if(candidate.IsOlderThan(winner))
				    {
					winner = candidate;				
				    }
				}
			    }

			    if(!winner.Urgent && candidate.Urgent)
				winner = candidate;
			    else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner))
				winner = candidate;
			    else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit
				winner = candidate;
			    else if(candidate.IsOlderThan(winner))
				winner = candidate;
			}
		}
	    return winner;
        }