Exemplo n.º 1
0
        public void Tick()
        {
            // If no I/O step is set, we're idle
            if (CurrentStep == null)
            {
                return;
            }

            // At I/O start, the step instance is unset
            if (mCurrentStepInstance == null)
            {
                mCurrentStepInstance                 = GetCurrentStepInstance();
                mCurrentStepInstance.Operands        = mCurrentOperands;
                mCurrentStepInstance.ReportingEvent += StepInstance_Reporting;
            }

            // Current step still busy? If so, we're done here
            if (!mCurrentStepInstance.Tick())
            {
                return;
            }

            CurrentStep = CurrentStep.NextStep;

            // Have we reached the end of the I/O step chain? If so, trigger interrupt and quit
            if (CurrentStep == null)
            {
                mCurrentStepInstance = null;
                mCurrentOperands.InterruptQueueCallback?.Invoke(new Interrupt(Id));

                return;
            }

            // Move on to next I/O step
            var currentStepInstance = GetCurrentStepInstance();

            currentStepInstance.Operands              = mCurrentOperands;
            currentStepInstance.ReportingEvent       += StepInstance_Reporting;
            currentStepInstance.InputFromPreviousStep = mCurrentStepInstance.OutputForNextStep;
            mCurrentStepInstance = currentStepInstance;
        }
Exemplo n.º 2
0
 public virtual void Reset()
 {
     CurrentStep          = null;
     mCurrentStepInstance = null;
 }