Beispiel #1
0
 public override IEnumerable <TAVerb> DoNothing()
 {
     yield return(Verb(ETVMode.Locked,
                       _host.A.Dual.Stick(StdLogicVector.DCs(_host.Width)),
                       _host.B.Dual.Stick(StdLogicVector.DCs(_host.Width)),
                       _host.Sel.Dual.Stick(StdLogicVector.DCs(1))));
 }
            public override IEnumerable <TAVerb> DoNothing()
            {
                IProcess action = _host.A.Dual.Stick(StdLogicVector.DCs(_host.Awidth));

                if (!_host.HasConstantInput)
                {
                    action = action.Par(_host.B.Dual.Stick(StdLogicVector.DCs(_host.Bwidth)));
                }
                if (_host.HasCE)
                {
                    action = action.Par(_host.CE.Dual.Stick <StdLogic>('1'));
                }
                if (_host.HasSCLR)
                {
                    action = action.Par(_host.SCLR.Dual.Stick <StdLogic>('0'));
                }
                if (_host.HasSSET)
                {
                    action = action.Par(_host.SSET.Dual.Stick <StdLogic>('0'));
                }
                if (_host.HasBypass)
                {
                    action = action.Par(_host.BYPASS.Dual.Stick <StdLogic>('-'));
                }
                if (_host.HasCarryIn)
                {
                    action = action.Par(_host.C_in.Dual.Stick <StdLogic>('-'));
                }
                yield return(Verb(ETVMode.Locked, action));
            }
Beispiel #3
0
 public override IEnumerable <TAVerb> DoNothing()
 {
     yield return(Verb(
                      ETVMode.Locked,
                      _host.X.Dual.Stick(StdLogicVector.DCs(_host.DataWidth)),
                      _host.Shift.Dual.Stick(StdLogicVector.DCs(_host.ShiftWidth)),
                      _host.Dir.Dual.Stick("-")));
 }
Beispiel #4
0
 private StdLogicVector CreateVector()
 {
     StdLogicVector[] r = new StdLogicVector[4];
     r[0] = StdLogicVector._0s(MaxWidth);
     r[1] = StdLogicVector._1s(MaxWidth);
     r[2] = StdLogicVector.DCs(MaxWidth);
     r[3] = StdLogicVector.Xs(MaxWidth);
     return(r[0].Concat(r[1].Concat(r[2].Concat(r[3]))));
 }
Beispiel #5
0
 public override IEnumerable <TAVerb> DoNothing()
 {
     IProcess[] actions = new IProcess[_host.NumWords];
     for (int i = 0; i < _host.NumWords; i++)
     {
         actions[i] = _host.Ops[i].Stick(StdLogicVector.DCs(_host.WordWidth));
     }
     yield return(Verb(ETVMode.Locked, actions));
 }
 public override IEnumerable <TAVerb> DoNothing()
 {
     if (_wrEnI == null)
     {
         yield return(Verb(ETVMode.Locked));
     }
     else
     {
         yield return(Verb(ETVMode.Locked,
                           _wrEnI.Stick(StdLogic._0),
                           _dataInI.Stick(StdLogicVector.DCs(_dataBits))));
     }
 }
            public override IEnumerable <TAVerb> DoNothing()
            {
                IProcess action = _host.A.Dual.Stick(StdLogicVector.DCs(_host.PortAWidth));

                if (_host.MultType == EMultiplierType.ParallelMultiplier)
                {
                    action = action.Par(_host.B.Dual.Stick(StdLogicVector.DCs(_host.PortBWidth)));
                }
                if (_host.HasCE)
                {
                    action = action.Par(_host.CE.Dual.Stick <StdLogic>('1'));
                }
                if (_host.HasSCLR)
                {
                    action = action.Par(_host.SCLR.Dual.Stick <StdLogic>('0'));
                }
                yield return(Verb(ETVMode.Locked, action));
            }
Beispiel #8
0
            public override IEnumerable <TAVerb> DoNothing()
            {
                if (_wrEnI != null)
                {
                    // Memory used as RAM

                    yield return(Verb(ETVMode.Locked,
                                      _wrEnI.Stick(StdLogic._0),
                                      _addrI.Stick(StdLogicVector.DCs(_addrBits)),
                                      _dataInI.Stick(StdLogicVector.DCs(_dataBits))));
                }
                else
                {
                    // Memory used as ROM

                    yield return(Verb(ETVMode.Locked,
                                      _addrI.Stick(StdLogicVector.DCs(_addrBits))));
                }
            }
Beispiel #9
0
            public override IEnumerable <TAVerb> DoNothing()
            {
                IProcess ctrl =
                    _host.DIVIDEND.Dual.Stick(StdLogicVector.DCs(_host.DividendAndQuotientWidth)).Par(
                        _host.DIVISOR.Dual.Stick(StdLogicVector.DCs(_host.DivisorWidth)));

                if (_host.HasCE)
                {
                    ctrl = ctrl.Par(_host.CE.Dual.Stick('1'));
                }
                if (_host.HasSCLR)
                {
                    ctrl = ctrl.Par(_host.SCLR.Dual.Stick('0'));
                }
                if (_host.HasND)
                {
                    ctrl = ctrl.Par(_host.ND.Dual.Stick('0'));
                }

                yield return(Verb(ETVMode.Locked, ctrl));
            }
Beispiel #10
0
        /// <summary>
        /// Checks whether a given dataflow transfers the don't care literal to its destination.
        /// </summary>
        /// <param name="flow">a dataflow</param>
        public static bool IsDontCareFlow(Flow flow)
        {
            ValueFlow vflow = flow as ValueFlow;

            if (vflow == null)
            {
                return(false);
            }
            StdLogicVector?slvdata = vflow.Value as StdLogicVector?;
            StdLogic?      sldata  = vflow.Value as StdLogic?;

            if (slvdata.HasValue)
            {
                return(slvdata.Value.Equals(StdLogicVector.DCs(slvdata.Value.Size)));
            }
            if (sldata.HasValue)
            {
                return(sldata.Value.Equals(StdLogic.DC));
            }
            return(false);
        }
Beispiel #11
0
 public IEnumerable <TAVerb> DoNothing()
 {
     yield return(new TAVerb(this, ETVMode.Locked, () => { },
                             _host.X.Dual.Drive(SignalSource.Create(StdLogicVector.DCs(_host.XIntWidth + _host.XFracWidth)))));
 }
Beispiel #12
0
            public override IEnumerable <TAVerb> DoNothing()
            {
                var inps = _inSignals.Select(s => s.Stick(StdLogicVector.DCs(s.InitialValue.Size)));

                yield return(Verb(ETVMode.Locked, inps.ToArray()));
            }
Beispiel #13
0
 public override IEnumerable <TAVerb> DoNothing()
 {
     yield return(Verb(ETVMode.Locked,
                       _host.Operand.Dual.Stick(StdLogicVector.DCs(_host.InputWidth))));
 }
Beispiel #14
0
        private void AssembleFlowMatrix()
        {
            _detailedFlow.AddNeutral(_flowSpec.NeutralFlow);
            if (_regsCur != null)
            {
                for (int i = 0; i < _regsCur.Length; i++)
                {
                    if (_regsCur[i] == null)
                    {
                        continue;
                    }

                    _detailedFlow.AddNeutral(
                        new SignalFlow(
                            _regsCur[i].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Cur),
                            _regsNext[i].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Next)));
                }
            }
            if (_memInstances != null)
            {
                for (int i = 0; i < _memInstances.Length; i++)
                {
                    _detailedFlow.AddNeutral(
                        new ValueFlow(
                            StdLogic._0, _memWrSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next)));
                    _detailedFlow.AddNeutral(
                        new ValueFlow(
                            StdLogicVector.DCs(_memInstances[i].AddrWidth),
                            _memAddrRSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next)));
                    _detailedFlow.AddNeutral(
                        new ValueFlow(
                            StdLogicVector.DCs(_memInstances[i].AddrWidth),
                            _memAddrWSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next)));
                    _detailedFlow.AddNeutral(
                        new ValueFlow(
                            StdLogicVector.DCs(_memInstances[i].Width),
                            _memDInSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next)));
                }
            }
            for (int i = 0; i < _flowSpec.NumCSteps; i++)
            {
                var pflow = _flowSpec.GetFlow(i);
                foreach (var flow in pflow.Flows)
                {
                    var sflow = flow as SignalFlow;
                    var vflow = flow as ValueFlow;

                    var target = flow.Target;
                    int tindex = flow.Target.GetTemporaryIndex();
                    if (tindex >= 0)
                    {
                        if (IsUnused(tindex))
                        {
                            continue;
                        }
                        int rep = _eqRegs.Find(tindex);
                        if (_isMemMap[rep])
                        {
                            int rindex = _idxMap[_eqMems.Find(rep)];
                            target = _memDInSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next);
                            _detailedFlow.Add(i,
                                              new ValueFlow(_memAddrs[rep],
                                                            _memAddrWSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next)));
                            _detailedFlow.Add(i,
                                              new ValueFlow(StdLogic._1,
                                                            _memWrSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next)));
                        }
                        else
                        {
                            int rindex = _idxMap[rep];
                            if (rindex < 0)
                            {
                                continue;
                            }
                            target = _regsNext[rindex].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Next);
                        }
                    }
                    if (sflow != null)
                    {
                        var source = sflow.Source;
                        int sindex = sflow.Source.GetTemporaryIndex();
                        if (sindex >= 0)
                        {
                            int rep = _eqRegs.Find(sindex);
                            if (_isMemMap[rep])
                            {
                                int rindex = _idxMap[_eqMems.Find(rep)];
                                source = _memDOutSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Cur);
                                _detailedFlow.Add(i - 1,
                                                  new ValueFlow(_memAddrs[rep],
                                                                _memAddrRSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next)));
                            }
                            else
                            {
                                int rindex = _idxMap[rep];
                                source = _regsCur[rindex].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Cur);
                            }
                        }
                        _detailedFlow.Add(i, new SignalFlow(source, target));
                    }
                    else
                    {
                        _detailedFlow.Add(i, new ValueFlow(vflow.Value, target));
                    }
                }
            }
        }
Beispiel #15
0
 public override IEnumerable <TAVerb> DoNothing()
 {
     yield return(Verb(ETVMode.Locked,
                       _host.DIn.Dual.Drive(SignalSource.Create(StdLogicVector.DCs(_host.FloatWidth)))));
 }
Beispiel #16
0
 public override IEnumerable <TAVerb> DoNothing()
 {
     yield return(Verb(ETVMode.Locked,
                       _host.EnIn.Dual.Stick <StdLogic>('0'),
                       _host.DIn.Dual.Stick(StdLogicVector.DCs(_host.DataWidth))));
 }
Beispiel #17
0
 public override IEnumerable <TAVerb> DoNothing()
 {
     yield return(Verb(ETVMode.Locked,
                       _enI.Stick <StdLogic>('0'),
                       _slvSignalI.Stick <StdLogicVector>(StdLogicVector.DCs(_dataWidth))));
 }
Beispiel #18
0
 /// <summary>
 /// Creates a dataflow which transfers the "don't care" literal to a signal target of choice
 /// </summary>
 /// <param name="target">signal target</param>
 /// <returns>the resulting dataflow</returns>
 public static ValueFlow CreateDontCareFlow(SignalRef target)
 {
     return(new ValueFlow(StdLogicVector.DCs(
                              Marshal.SerializeForHW(target.Desc.InitialValue).Size), target));
 }