当前位置: 首页>>代码示例>>C#>>正文


C# ICSimulator.Flit类代码示例

本文整理汇总了C#中ICSimulator.Flit的典型用法代码示例。如果您正苦于以下问题:C# Flit类的具体用法?C# Flit怎么用?C# Flit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Flit类属于ICSimulator命名空间,在下文中一共展示了Flit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: canInjectFlit

 public override bool canInjectFlit(Flit f)
 {
     for (int i = 0; i < _nic_count; i++)
         if (_nics[i].Inject == null)
             return true;
     return false;
 }
开发者ID:anderson1008,项目名称:NOCulator,代码行数:7,代码来源:BufRingNetwork.cs

示例2: rankFlits

        public override int rankFlits(Flit f1, Flit f2)
        {
            // rule 1: older batch (lower batchID) is greater
            int cmp1 = 0;
            if (f1.packet.batchID != f2.packet.batchID)
                cmp1 = - cmp(f1.packet.batchID, f2.packet.batchID);

            // rule 2: higher STC priority is greater
            int cmp2 = 0;
            if (f1.packet.requesterID != -1 &&
                    f2.packet.requesterID != -1 &&
                    f1.packet.requesterID != f2.packet.requesterID)
                cmp2 = cmp(stc.priorities[f1.packet.requesterID], stc.priorities[f2.packet.requesterID]);

            // rule 3: older packet is greater
            int cmp3 = cmp(f1.packet.creationTime, f2.packet.creationTime);

            // rule 4: packet ID
            int cmp4 = cmp(f1.packet.ID, f2.packet.ID);

            // rule 5: lower-sequence flit is greater
            int cmp5 = cmp(f1.flitNr, f2.flitNr);

            if (cmp1 != 0) return cmp1;
            if (cmp2 != 0) return cmp2;
            if (cmp3 != 0) return cmp3;
            if (cmp4 != 0) return cmp4;
            return cmp5;
        }
开发者ID:hoangt,项目名称:NOCulator,代码行数:29,代码来源:Controller_STC.cs

示例3: canInjectFlit

        // Only one inject Slot now. 
        //TODO: Create 2 injuct Slots, one for clockwise network, one for counter-clockwise network		
        public override bool canInjectFlit(Flit f)   
        {
			if (throttle[ID])
				return false;
			bool can;
        	if (f.parity == 0)
			{
				if (m_injectSlot_CW != null) 
					f.timeWaitToInject ++;
        		can = m_injectSlot_CW == null;
			}
        	else if (f.parity == 1)
			{
				if (m_injectSlot_CCW != null)
					f.timeWaitToInject ++;
        		can = m_injectSlot_CCW == null;
			}
        	else if (f.parity == -1)
			{
				if (m_injectSlot_CW != null && m_injectSlot_CCW != null)
					f.timeWaitToInject ++;
				can = (m_injectSlot_CW == null || m_injectSlot_CCW == null);
			}
        	else throw new Exception("Unkown parity value!");
			if (!can)
			{
				starveCounter ++;
				Simulator.stats.injStarvation.Add();
			}
			if (starveCounter == Config.starveThreshold)
				starved[ID] = true;

			return can;
        }
开发者ID:anderson1008,项目名称:NOCulator,代码行数:36,代码来源:RouterRing.cs

示例4: acceptFlit

 protected void acceptFlit(Flit f)
 {
    	statsEjectFlit(f);
     if (f.packet.nrOfArrivedFlits + 1 == f.packet.nrOfFlits)
         statsEjectPacket(f.packet);
     m_n.receiveFlit(f);
 }
开发者ID:hoangt,项目名称:NOCulator,代码行数:7,代码来源:RouterTorusSingleRing.cs

示例5: Router_Flit

 public Router_Flit(Coord myCoord)
     : base(myCoord)
 {
     m_injectSlot  = null;
     m_injectSlot2 = null;
     rBuf = new ResubBuffer();
 }
开发者ID:hoangt,项目名称:NOCulator,代码行数:7,代码来源:RouterFlit.cs

示例6: InjectFlit

 public override void InjectFlit(Flit f)
 {
     if (m_injectSlot == null)
         m_injectSlot = f;
     else
         throw new Exception("Could not inject flit!");
 }
开发者ID:hirous,项目名称:test,代码行数:7,代码来源:RouterIdeal.cs

示例7: age

 public static ulong age(Flit f)
 {
     if (Config.net_age_arbitration)
         return Simulator.CurrentRound - f.packet.injectionTime;
     else
         return (Simulator.CurrentRound - f.packet.creationTime) /
                 (ulong)Config.cheap_of;
 }
开发者ID:hirous,项目名称:test,代码行数:8,代码来源:RouterAFC.cs

示例8: canInjectFlit

		public override bool canInjectFlit(Flit f)
		{
			int m_class  = getClass(f) % 2;
			if (injBuffer[m_class].Count == depth)
				return false;
			else
				return true;
		}
开发者ID:hoangt,项目名称:NOCulator,代码行数:8,代码来源:Router_NIC.cs

示例9: enqueue

        public void enqueue(Flit f)
        {
            if (buf.Count == bufSize)
                throw new Exception("Cannot enqueue into the ring buffer due to size limit.");

            buf.Enqueue(f);
            Simulator.stats.totalBufferEnqCount.Add();
        }
开发者ID:anderson1008,项目名称:NOCulator,代码行数:8,代码来源:BufRouterRing.cs

示例10: Router_Flit

		public Router_Flit(Coord myCoord)
            : base(myCoord)
        {
            m_injectSlot = null;
            m_injectSlot2 = null;
			ejectBuffer = new Queue<Flit>[4];
			for (int n = 0; n < 4; n++)
				ejectBuffer[n] = new Queue<Flit>();
        }
开发者ID:anderson1008,项目名称:NOCulator,代码行数:9,代码来源:RouterFlit.cs

示例11: getCredit

 public bool getCredit(Flit f, object sender, int bubble)
 {
     if (_credits > bubble) {
         _credits--;
         return true;
     }
     else
         return false;
 }
开发者ID:anderson1008,项目名称:NOCulator,代码行数:9,代码来源:BufRingNetwork.cs

示例12: oldestFirst

		private int oldestFirst(Flit f1, Flit f2)
		{
			if(f1.injectionTime > f2.injectionTime)
				return -1;
			else if(f1.injectionTime < f2.injectionTime)
				return  1;
			else
				return (Config.RSBuffer_randomVariant) ? (Simulator.rand.Next(0,3) - 1) : 0;
			
		}
开发者ID:hoangt,项目名称:NOCulator,代码行数:10,代码来源:ResubBuffer.cs

示例13: InjectFlit

 public override void InjectFlit(Flit f)
 {
     int baseIdx = Simulator.rand.Next(_nic_count);
     for (int i = 0; i < _nic_count; i++)
         if (_nics[(i+baseIdx)%_nic_count].Inject == null) {
             _nics[(i+baseIdx)%_nic_count].Inject = f;
             return;
         }
     throw new Exception("Could not inject flit -- no free slots!");
 }
开发者ID:anderson1008,项目名称:NOCulator,代码行数:10,代码来源:BufRingNetwork.cs

示例14: visitFlits

        public void visitFlits(Flit.Visitor fv)
        {
            for (int i = 0; i < m_delay; i++)
                if (m_fifo[i] != null)
                    fv(m_fifo[i]);

            if (Out != null)
                fv(Out);
            if (In != null)
                fv(In);
        }
开发者ID:hirous,项目名称:test,代码行数:11,代码来源:Link.cs

示例15: getFreeBufferSlot

 AFCBufferSlot getFreeBufferSlot(Flit f)
 {
     if (m_freeAFCSlots.Count > 0)
     {
         AFCBufferSlot s = m_freeAFCSlots.Dequeue();
         s.flit = f;
         s.getNewTimeStamp();
         return s;
     }
     else
         return new AFCBufferSlot(f);
 }
开发者ID:hirous,项目名称:test,代码行数:12,代码来源:RouterGPU.cs


注:本文中的ICSimulator.Flit类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。