private void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e) { m_context.IncrementCycle(); Console.WriteLine("-------------------- Cycle {0} --------------------", m_context.CurrentCycle); m_component.Pulse(); Console.WriteLine("-------------------- End Cycle --------------------\n"); if (m_context.IsHalted) { m_timer.Stop(); m_semStop.Release(); } }
public void Start(IProcessorComponent component, ProcessorContext context) { component.Initialize(context); while (!context.IsHalted) { context.IncrementCycle(); Console.WriteLine("-------------------- Cycle {0} --------------------", context.CurrentCycle); component.Pulse(); Console.WriteLine("-------------------- End Cycle --------------------\n"); } }