예제 #1
0
            private async void BusMasterProcess()
            {
                Request.Next = '0';

                await Tick;

                do
                {
                    DesignContext.WriteLine(DesignContext.Instance.CurTime + ": " + _deviceNum + " request");
                    Request.Next = '1';

                    do
                    {
                        await Tick;
                    } while (Grant.Cur != '1');

                    DesignContext.WriteLine(DesignContext.Instance.CurTime + ": " + _deviceNum + " grant");

                    for (int i = 0; i < _busyTime; i++)
                    {
                        await Tick;
                    }

                    DesignContext.WriteLine(DesignContext.Instance.CurTime + ": " + _deviceNum + " release");
                    Request.Next = '0';

                    for (int i = 0; i < _idleTime; i++)
                    {
                        await Tick;
                    }
                } while (true);
            }
예제 #2
0
        static void Main(string[] args)
        {
            ///run simulation
            Program.Run();

            ///calculate duration
            long duration = System.DateTime.Now.Ticks - Start;

            ///notify completion
            DesignContext.WriteLine("Done.  [ #counters = " + SimpleCounterTestbench.NumCounters + ", #cycles = " + Cycles + " ]");

            ///wait for user input
            Console.ReadLine();

            ///return exit code
            ;
        }
예제 #3
0
 private void Process()
 {
     DesignContext.WriteLine(Context.CurTime.ToString() + ": " + DataIn.Cur.ToString());
 }