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); }
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 ; }
private void Process() { DesignContext.WriteLine(Context.CurTime.ToString() + ": " + DataIn.Cur.ToString()); }