Beispiel #1
0
        void synthGen(double rate)
        {
            if (Simulator.rand.NextDouble() < rate)
            {
                if (m_inj_pool.Count > Config.synthQueueLimit)
                {
                    Simulator.stats.synth_queue_limit_drop.Add();
                }
                else
                {
                    int   dest = m_coord.ID;
                    Coord c    = new Coord(dest);
                    switch (Config.synthPattern)
                    {
                    case SynthTrafficPattern.UR:
                        dest = Simulator.rand.Next(Config.N);
                        c    = new Coord(dest);
                        break;

                    case SynthTrafficPattern.BC:
                        dest = ~dest & (Config.N - 1);
                        c    = new Coord(dest);
                        break;

                    case SynthTrafficPattern.TR:
                        c = new Coord(m_coord.y, m_coord.x);
                        break;
                    }
                    SynthPacket p = new SynthPacket(m_coord, c);
                    queuePacket(p);
                }
            }
        }
Beispiel #2
0
 void synthGen(double rate)
 {
     if (Simulator.rand.NextDouble() < rate)
     {
         if (m_inj_pool.Count > Config.synthQueueLimit)
             Simulator.stats.synth_queue_limit_drop.Add();
         else
         {
             int dest = m_coord.ID;
             Coord c = new Coord(dest);
             switch (Config.synthPattern) {
                 case SynthTrafficPattern.UR:
                     dest = Simulator.rand.Next(Config.N);
                     c = new Coord(dest);
                     break;
                 case SynthTrafficPattern.BC:
                     dest = ~dest & (Config.N - 1);
                     c = new Coord(dest);
                     break;
                 case SynthTrafficPattern.TR:
                     c = new Coord(m_coord.y, m_coord.x);
                     break;
             }
             SynthPacket p = new SynthPacket(m_coord, c);
             queuePacket(p);
         }
     }
 }