private void FullExecBtn_Click(object sender, EventArgs e) { //while (stopwatch.Elapsed < TimeSpan.FromSeconds(5)) //{ // // Execute your loop here... //} if (IsAssembled) { var stopwatch = new Stopwatch(); stopwatch.Start(); while (!IsDone) { SingleStepBtn.PerformClick(); if (stopwatch.Elapsed > TimeSpan.FromSeconds(20)) { UpdateErrorLog(ValidateInput.InfiniteLoopMsg()); break; } } } else { MessageBox.Show("Please resolve all errors or warning before simulation.", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); } //try //{ // if (IsAssembled) // { // MainCTRL.rxSG = MainCTRL.InitializeRegister(RegisterTab.ConvertDGtoDT("Register")); // foreach (var code in MainCTRL.txSG) // { // // Simulator MainCTRL.DataSGDT, MainCTRL.dxSG // MainCTRL.rxSG = OperationController.ExecuteOperation(code, MainCTRL.DataSGDT, MainCTRL.rxSG); // RegisterTab.SetTemplateDT(MainCTRL.GenerateRegisterSGDT()); // // Cache // SimulateCache(code); // } // //cacheHitRateLbl.Text = CacheController.CacheHitRate(); // UpdateErrorLog(ValidateInput.ExecuteMsg()); // } else // { // MessageBox.Show("Please resolve all errors or warning before simulation.", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); // } //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message); //} }