Exemplo n.º 1
0
            public override void Establish(IAutoBinder binder)
            {
                if (_allocated)
                {
                    return;
                }

                _brAltFlagP = (SLVSignal)binder.GetSignal(EPortUsage.Default, "BCU_BrP", null, StdLogicVector._0s(1));
                _brAltFlagN = (SLVSignal)binder.GetSignal(EPortUsage.Default, "BCU_BrN", null, StdLogicVector._1s(1));

                _curState = binder.GetSignal(EPortUsage.State, "BCU_CurState", null, null).Descriptor;
                _tState   = _curState.ElementType.CILType;
                Array  enumValues   = _tState.GetEnumValues();
                int    numStates    = enumValues.Length;
                object defaultState = Activator.CreateInstance(_tState);

                _incState  = binder.GetSignal(EPortUsage.Default, "BCU_IncState", null, defaultState).Descriptor;
                _altState  = binder.GetSignal(EPortUsage.Default, "BCU_AltState", null, defaultState).Descriptor;
                _nextState = binder.GetSignal(EPortUsage.Default, "BCU_NextState", null, defaultState).Descriptor;
                IncStateProcessBuilder ispb = new IncStateProcessBuilder(this);
                Function incStateFn         = ispb.GetAlgorithm();

                incStateFn.Name = "BCU_IncState";
                binder.CreateProcess(Process.EProcessKind.Triggered, incStateFn, _curState);
                SyncProcessBuilder spb         = new SyncProcessBuilder(this, binder);
                Function           syncStateFn = spb.GetAlgorithm();

                syncStateFn.Name = "BCU_FSM";
                ISignalOrPortDescriptor sdClock = binder.GetSignal <StdLogic>(EPortUsage.Clock, "Clk", null, '0').Descriptor;

                binder.CreateProcess(Process.EProcessKind.Triggered, syncStateFn, sdClock);

                _allocated = true;
            }
Exemplo n.º 2
0
            public override void Establish(IAutoBinder binder)
            {
                if (_allocated)
                    return;

                _brAltFlagP = (SLVSignal)binder.GetSignal(EPortUsage.Default, "BCU_BrP", null, StdLogicVector._0s(1));
                _brAltFlagN = (SLVSignal)binder.GetSignal(EPortUsage.Default, "BCU_BrN", null, StdLogicVector._1s(1));

                _curState = binder.GetSignal(EPortUsage.State, "BCU_CurState", null, null).Descriptor;
                _tState = _curState.ElementType.CILType;
                Array enumValues = _tState.GetEnumValues();
                int numStates = enumValues.Length;
                object defaultState = Activator.CreateInstance(_tState);
                _incState = binder.GetSignal(EPortUsage.Default, "BCU_IncState", null, defaultState).Descriptor;
                _altState = binder.GetSignal(EPortUsage.Default, "BCU_AltState", null, defaultState).Descriptor;
                _nextState = binder.GetSignal(EPortUsage.Default, "BCU_NextState", null, defaultState).Descriptor;
                IncStateProcessBuilder ispb = new IncStateProcessBuilder(this);
                Function incStateFn = ispb.GetAlgorithm();
                incStateFn.Name = "BCU_IncState";
                binder.CreateProcess(Process.EProcessKind.Triggered, incStateFn, _curState);
                SyncProcessBuilder spb = new SyncProcessBuilder(this, binder);
                Function syncStateFn = spb.GetAlgorithm();
                syncStateFn.Name = "BCU_FSM";
                ISignalOrPortDescriptor sdClock = binder.GetSignal<StdLogic>(EPortUsage.Clock, "Clk", null, '0').Descriptor;
                binder.CreateProcess(Process.EProcessKind.Triggered, syncStateFn, sdClock);

                _allocated = true;
            }