Esempio n. 1
0
 public override void AssembleStagedDecoderComb(ValueFlowCoder vfc, LiteralReference lrCWSelSlice,
                                                IAlgorithmBuilder pbuilder, SLVSignal cwSignal, HashSet <ISignalOrPortDescriptor> sensitivity,
                                                bool registered)
 {
     _encFlow0.AssembleStagedDecoderComb(vfc, lrCWSelSlice, pbuilder, cwSignal, sensitivity, registered);
     _encFlow1.AssembleStagedDecoderComb(vfc, lrCWSelSlice, pbuilder, cwSignal, sensitivity, registered);
 }
Esempio n. 2
0
 private void ImplementFlow(ValueFlowCoder vfc, Flow flow, IAlgorithmBuilder pbuilder, SLVSignal cwSignal, HashSet <ISignalOrPortDescriptor> sensitivity)
 {
     if (FlowMatrix.IsDontCareFlow(flow))
     {
         int valOffset = vfc.GetValueWordOffset(flow.Target);
         int valWidth  = vfc.GetValueWordWidth(flow.Target);
         LiteralReference lrCWValSlice;
         if (flow.Target.Desc.ElementType.CILType.Equals(typeof(StdLogic)))
         {
             lrCWValSlice = new LiteralReference(
                 ((ISignal)cwSignal[valOffset])
                 .ToSignalRef(SignalRef.EReferencedProperty.Cur));
         }
         else
         {
             lrCWValSlice = new LiteralReference(
                 ((ISignal)cwSignal[valOffset + valWidth - 1, valOffset])
                 .ToSignalRef(SignalRef.EReferencedProperty.Cur));
         }
         pbuilder.Store(flow.Target, lrCWValSlice);
     }
     else if (flow is SignalFlow)
     {
         var sflow = flow as SignalFlow;
         pbuilder.Store(flow.Target, sflow.Source);
         sensitivity.Add(sflow.Source.Desc);
     }
     else
     {
         var vflow = flow as ValueFlow;
         pbuilder.Store(vflow.Target,
                        LiteralReference.CreateConstant(vflow.Value));
     }
 }
Esempio n. 3
0
 public MicroString(EncodedFlow encFlow, ValueFlowCoder vfc)
 {
     _encFlow = encFlow;
     _targets = encFlow.Targets;
     _vfc     = vfc;
     if (_encFlow.NumSymbols == 0)
     {
         SelWidth = 0;
     }
     else
     {
         SelWidth = MathExt.CeilLog2(_encFlow.NumSymbols);
     }
 }
Esempio n. 4
0
 private void ImplementFlow(ValueFlowCoder vfc, Flow flow, IAlgorithmBuilder pbuilder, SLVSignal cwSignal, HashSet<ISignalOrPortDescriptor> sensitivity)
 {
     if (FlowMatrix.IsDontCareFlow(flow))
     {
         int valOffset = vfc.GetValueWordOffset(flow.Target);
         int valWidth = vfc.GetValueWordWidth(flow.Target);
         LiteralReference lrCWValSlice;
         if (flow.Target.Desc.ElementType.CILType.Equals(typeof(StdLogic)))
         {
             lrCWValSlice = new LiteralReference(
                 ((ISignal)cwSignal[valOffset])
                     .ToSignalRef(SignalRef.EReferencedProperty.Cur));
         }
         else
         {
             lrCWValSlice = new LiteralReference(
                 ((ISignal)cwSignal[valOffset + valWidth - 1, valOffset])
                     .ToSignalRef(SignalRef.EReferencedProperty.Cur));
         }
         pbuilder.Store(flow.Target, lrCWValSlice);
     }
     else if (flow is SignalFlow)
     {
         var sflow = flow as SignalFlow;
         pbuilder.Store(flow.Target, sflow.Source);
         sensitivity.Add(sflow.Source.Desc);
     }
     else
     {
         var vflow = flow as ValueFlow;
         pbuilder.Store(vflow.Target,
             LiteralReference.CreateConstant(vflow.Value));
     }
 }
Esempio n. 5
0
 public MicrocodeDesigner()
 {
     _vcf = new ValueFlowCoder();
 }
Esempio n. 6
0
 public MicroString(EncodedFlow encFlow, ValueFlowCoder vfc)
 {
     _encFlow = encFlow;
     _targets = encFlow.Targets;
     _vfc = vfc;
     if (_encFlow.NumSymbols == 0)
         SelWidth = 0;
     else
         SelWidth = MathExt.CeilLog2(_encFlow.NumSymbols);
 }
Esempio n. 7
0
 public override void AssembleStagedDecoderComb(ValueFlowCoder vfc, LiteralReference lrCWSelSlice, 
     IAlgorithmBuilder pbuilder, SLVSignal cwSignal, HashSet<ISignalOrPortDescriptor> sensitivity,
     bool registered)
 {
     _encFlow0.AssembleStagedDecoderComb(vfc, lrCWSelSlice, pbuilder, cwSignal, sensitivity, registered);
     _encFlow1.AssembleStagedDecoderComb(vfc, lrCWSelSlice, pbuilder, cwSignal, sensitivity, registered);
 }
Esempio n. 8
0
        public virtual void AssembleStagedDecoderComb(
            ValueFlowCoder vfc,
            LiteralReference lrCWSelSlice,
            IAlgorithmBuilder pbuilder, SLVSignal cwSignal,
            HashSet<ISignalOrPortDescriptor> sensitivity,
            bool registered)
        {
            if (NumSymbols == 0)
            {
                foreach (var target in Targets)
                {
                    pbuilder.Store(target, LiteralReference.CreateConstant(target.Desc.InitialValue));
                }
            }
            else if (NumSymbols == 1)
            {
                var pflow = BwdEnc[0];
                foreach (var flow in pflow.Flows)
                {
                    ImplementFlow(vfc, flow, pbuilder, cwSignal, sensitivity);
                }
            }
            else
            {
                var symbol = registered ? _symbold : _symbol;
                pbuilder.Switch(symbol.SignalInstance.ToSignalRef(SignalRef.EReferencedProperty.Cur));

                for (int i = 0; i < NumSymbols; i++)
                {
                    var selValue = _selSymbols.GetValue(i);
                    var pflow = BwdEnc[i];

                    pbuilder.Case(LiteralReference.CreateConstant(selValue));
                    foreach (var flow in pflow.Flows)
                    {
                        ImplementFlow(vfc, flow, pbuilder, cwSignal, sensitivity);
                    }
                    pbuilder.EndCase();
                }

                var nulls = StdLogicVector._0s(NumSymbols);
                pbuilder.Case(LiteralReference.CreateConstant(nulls));
                {
                    foreach (var target in Targets)
                    {
                        int width = Marshal.SerializeForHW(target.Desc.InitialValue).Size;
                        pbuilder.Store(target, 
                            LiteralReference.CreateConstant(StdLogicVector._0s(width)));
                    }
                }
                pbuilder.EndCase();

                pbuilder.DefaultCase();
                {
                    foreach (var target in Targets)
                    {
                        int width = Marshal.SerializeForHW(target.Desc.InitialValue).Size;
                        pbuilder.Store(target,
                            LiteralReference.CreateConstant(StdLogicVector.Xs(width)));
                    }
                }
                pbuilder.EndCase();

                pbuilder.EndSwitch();
            }
        }
Esempio n. 9
0
 public MicrocodeDesigner()
 {
     _vcf = new ValueFlowCoder();
 }
Esempio n. 10
0
        public virtual void AssembleStagedDecoderComb(
            ValueFlowCoder vfc,
            LiteralReference lrCWSelSlice,
            IAlgorithmBuilder pbuilder, SLVSignal cwSignal,
            HashSet <ISignalOrPortDescriptor> sensitivity,
            bool registered)
        {
            if (NumSymbols == 0)
            {
                foreach (var target in Targets)
                {
                    pbuilder.Store(target, LiteralReference.CreateConstant(target.Desc.InitialValue));
                }
            }
            else if (NumSymbols == 1)
            {
                var pflow = BwdEnc[0];
                foreach (var flow in pflow.Flows)
                {
                    ImplementFlow(vfc, flow, pbuilder, cwSignal, sensitivity);
                }
            }
            else
            {
                var symbol = registered ? _symbold : _symbol;
                pbuilder.Switch(symbol.SignalInstance.ToSignalRef(SignalRef.EReferencedProperty.Cur));

                for (int i = 0; i < NumSymbols; i++)
                {
                    var selValue = _selSymbols.GetValue(i);
                    var pflow    = BwdEnc[i];

                    pbuilder.Case(LiteralReference.CreateConstant(selValue));
                    foreach (var flow in pflow.Flows)
                    {
                        ImplementFlow(vfc, flow, pbuilder, cwSignal, sensitivity);
                    }
                    pbuilder.EndCase();
                }

                var nulls = StdLogicVector._0s(NumSymbols);
                pbuilder.Case(LiteralReference.CreateConstant(nulls));
                {
                    foreach (var target in Targets)
                    {
                        int width = Marshal.SerializeForHW(target.Desc.InitialValue).Size;
                        pbuilder.Store(target,
                                       LiteralReference.CreateConstant(StdLogicVector._0s(width)));
                    }
                }
                pbuilder.EndCase();

                pbuilder.DefaultCase();
                {
                    foreach (var target in Targets)
                    {
                        int width = Marshal.SerializeForHW(target.Desc.InitialValue).Size;
                        pbuilder.Store(target,
                                       LiteralReference.CreateConstant(StdLogicVector.Xs(width)));
                    }
                }
                pbuilder.EndCase();

                pbuilder.EndSwitch();
            }
        }