• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ICSimulator.Flit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Router_Node

    	public Router_Node(Coord myCoord)
            : base(myCoord)
        {
        	// the node Router is just a Rong node. A Flit gets ejected or moves straight forward
        	linkOut = new Link[2];
        	linkIn = new Link[2];
        	m_injectSlot_CW = null;
        	m_injectSlot_CCW = null;
			throttle[ID] = false;
			starved[ID] = false;
			starveCounter = 0;
        }
开发者ID:anderson1008,项目名称:NOCulator,代码行数:12,代码来源:RouterRing.cs


示例17: trace

        public static void trace(Flit f, string loc, BufRingMultiNetwork_Coord c)
        {
            //return;

            if (f.packet.ID >= id && f.packet.ID < id2 && f.flitNr == 0) {
                BufRingMultiNetwork_Coord srcC = new BufRingMultiNetwork_Coord(f.packet.src.ID, Config.bufrings_levels - 1);
                BufRingMultiNetwork_Coord destC = new BufRingMultiNetwork_Coord(f.packet.dest.ID,
                        Config.bufrings_levels - 1);

                Console.WriteLine("cycle {0} flit {3}.0 (src {4} dest {5} ID {6}) at coord {1} loc {2}",
                        Simulator.CurrentRound, c, loc, f.packet.ID,
                        srcC, destC, f.packet.dest.ID);
            }
        }
开发者ID:hoangt,项目名称:NOCulator,代码行数:14,代码来源:BufRingNetwork_Multi.cs


示例18: _doStep

  protected override void _doStep()
  {
  	Flit eject = ejectLocal();
  	if (eject != null)
  		acceptFlit(eject);
 		if (linkIn[0].Out != null)
  	{
  		linkOut[0].In = linkIn[0].Out;
  		linkIn[0].Out = null;
  	}
  	if (m_injectSlot != null && linkOut[0].In == null)
  	{
  		linkOut[0].In = m_injectSlot;
  		m_injectSlot = null;
  	}
  }
开发者ID:hoangt,项目名称:NOCulator,代码行数:16,代码来源:RouterTorusSingleRing.cs


示例19: _doStep

        protected override void _doStep()
        {
            int slots = freeSpace();
            Flit[] input = new Flit[slots];
            int idx = 0;

            for (int i = 0; i < 4; i++)
                if (linkIn[i] != null && linkIn[i].Out != null)
                {
                    if (idx == slots) throw new Exception("got too many flits");
                    input[idx++] = linkIn[i].Out;
                    linkIn[i].Out = null;
                }
            if (idx < slots && m_injectSlot != null)
            {
                input[idx++] = m_injectSlot;
                m_injectSlot = null;
            }
        }
开发者ID:hirous,项目名称:test,代码行数:19,代码来源:RouterIdeal.cs


示例20: Golden

        public Golden()
        {
            int L = Config.network_nrX + Config.network_nrY;
          
            // TODO: scale L when rescuers?

            m_epochLen = (int)(Config.gp_epoch * L);
            m_nRescuers = Config.gp_rescuers;

            int n = Simulator.network.injectFlits(m_nRescuers, delegate()
                    {
                        Flit f = new Flit(null, 0);
                        f.state = Flit.State.Placeholder;
                        return f;
                    });

            if (n < m_nRescuers)
                throw new Exception("was not able to initialize all rescuers");
        }
开发者ID:hoangt,项目名称:NOCulator,代码行数:19,代码来源:Golden.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BusinessObjects.FormViewParameter类代码示例发布时间:2022-05-26
下一篇:
C# XmlEditor.XmlElementPath类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap