Exemplo n.º 1
0
        /*public ConstructorLayout()
         * {
         *      placedN = new List<string>();
         *      placedP = new List<string>();
         *      bestRouting = new HistoryPairs();
         *      InitSampleTraces();
         * }*/

        public ConstructorLayout(List <string> inPlacedN, List <string> inPlacedP, List <Node> inNodeList)
        {
            placedN = inPlacedN;
            placedP = inPlacedP;
            //nodeList = inNodeList;

            nodeDistanceDict   = new Dictionary <string, NodeDistanceBase>();
            nodeConnectionDict = new Dictionary <string, NodeTraces>();

            //Params.SetModel(Params.ModelBusM2InMiddle);
            //TraceVccGndBus();
            fixedConnections = new List <LineStruct>();

            wide = placedN.Count * 2 + Params.leftBorder + Params.rightBorder;

            diffusionExcep = new List <string>();
            diffusionExcep.Add("&0");
            diffusionExcep.Add("VCC");
            //-----------------
            trace = new TraceGlobe();

            trace.SetDiffusionExcep(diffusionExcep);
            trace.InitTransistors(placedN, placedP);
            trace.InitNodesDict(nodeDistanceDict, inNodeList);
            step = 0;
        }
Exemplo n.º 2
0
        /*public ConstructorLayout()
        {
            placedN = new List<string>();
            placedP = new List<string>();
            bestRouting = new HistoryPairs();
            InitSampleTraces();
        }*/
        public ConstructorLayout(List<string> inPlacedN, List<string> inPlacedP, List<Node> inNodeList)
        {
            placedN = inPlacedN;
            placedP = inPlacedP;
            //nodeList = inNodeList;

            nodeDistanceDict = new Dictionary<string, NodeDistanceBase>();
            nodeConnectionDict = new Dictionary<string, NodeTraces>();

            //Params.SetModel(Params.ModelBusM2InMiddle);
            //TraceVccGndBus();
            fixedConnections = new List<LineStruct>();

            wide = placedN.Count*2 + Params.leftBorder + Params.rightBorder;

            diffusionExcep = new List<string>();
            diffusionExcep.Add("&0");
            diffusionExcep.Add("VCC");
            //-----------------
            trace = new TraceGlobe();

            trace.SetDiffusionExcep(diffusionExcep);
            trace.InitTransistors(placedN, placedP);
            trace.InitNodesDict(nodeDistanceDict, inNodeList);
            step = 0;
        }
Exemplo n.º 3
0
        /*private void SetInitPoint()
         * {
         *  for (int i = 0; i < processNode.arcCollection.Count; i++)
         *  {
         *      trace.SetContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetHigherPoint(0)), processNode.name, i, 0);
         *      trace.SetContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetLowerPoint(0)), processNode.name, i, 0);
         *  }
         * }*/

        private void SetStartPriority(TraceGlobe trace)
        {
            List <NodeDistanceBase> lst = nodeDistanceDict.Values.ToList();

            lst.Sort(NodeDistanceBase.CompareBaseByDist);
            int countNd = lst.Count;

            //bestHighPrior = lst.First().name;
            trace.SetHighPriority(lst.First().name);

            int curPrior = Params.maxPriority;

            foreach (NodeDistanceBase disBase in lst)//Node curNode in nodeList)
            {
                processNode = trace.GetNodeByName(disBase.name);

                if (diffusionExcep.FindIndex(el => el == processNode.name) >= 0)
                {
                    SetStartVccGndConnections(curPrior);
                }
                else
                {
                    //List<int> markedPin = new List<int>();
                    for (int i = 0; i < processNode.arcCollection.Count; i++)
                    {
                        int           idx = nodeDistanceDict[processNode.name].GetNumber(i);
                        ContactSimple cnt = processNode.arcCollection[i];

                        //List<Contact> sours = trace.GetSourceContacts(processNode.arcCollection[i])

                        trace.SetPinSource(trace.GetSourceContacts(processNode.arcCollection[i], processNode.name));

                        bool notOpposite = true;
                        for (int j = i + 1; j < processNode.arcCollection.Count; j++)
                        {
                            if (processNode.arcCollection[i].x == processNode.arcCollection[j].x)
                            {
                                //trace.SetLine(new LineStruct(processNode.arcCollection[i].GetInDiffusionEdge(), processNode.arcCollection[j].GetInDiffusionEdge()),
                                //	          processNode.name, curPrior, idx, true);
                                trace.SetStartLine(processNode.arcCollection[i], processNode.arcCollection[j],
                                                   processNode.name, curPrior, idx);


                                trace.SetContact(processNode.arcCollection[i].GetInDiffusionEdge(), processNode.name, idx, curPrior, 0);

                                List <ContactSimple> startWave = new List <ContactSimple>();
                                startWave.Add(new ContactSimple(processNode.arcCollection[i].GetInDiffusionEdge()));
                                NodePointProcess proc = new NodePointProcess(0, curPrior, idx, false);
                                trace.CompleteSpreadWaveProcess(startWave, proc);                //SpreadWaveProcess

                                notOpposite = false;
                            }
                        }

                        if (notOpposite)        //markedPin.FindIndex(el => el == i) < 0)
                        {
                            trace.SetContact(processNode.arcCollection[i].GetInDiffusionEdge(), processNode.name, idx, curPrior, 0);

                            /*trace.SetPinContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetHigherPoint(0)),
                             *                  processNode.name, idx, curPrior);
                             * trace.SetPinContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetLowerPoint(0)),
                             *                  processNode.name, idx, curPrior);*/
                        }
                    }
                }
                curPrior--;
            }
        }
Exemplo n.º 4
0
        /*private void SetInitPoint()
        {
            for (int i = 0; i < processNode.arcCollection.Count; i++)
            {
                trace.SetContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetHigherPoint(0)), processNode.name, i, 0);
                trace.SetContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetLowerPoint(0)), processNode.name, i, 0);
            }
        }*/
        private void SetStartPriority(TraceGlobe trace)
        {
            List<NodeDistanceBase> lst = nodeDistanceDict.Values.ToList();

            lst.Sort(NodeDistanceBase.CompareBaseByDist);
            int countNd = lst.Count;

            //bestHighPrior = lst.First().name;
            trace.SetHighPriority(lst.First().name);

            int curPrior = Params.maxPriority;

            foreach (NodeDistanceBase disBase in lst)//Node curNode in nodeList)
            {
                processNode = trace.GetNodeByName(disBase.name);

                if (diffusionExcep.FindIndex(el => el == processNode.name) >= 0)
                    SetStartVccGndConnections(curPrior);
                else
                {
                    //List<int> markedPin = new List<int>();
                    for (int i = 0; i < processNode.arcCollection.Count; i++)
                    {
                        int idx = nodeDistanceDict[processNode.name].GetNumber(i);
                        ContactSimple cnt = processNode.arcCollection[i];

                        //List<Contact> sours = trace.GetSourceContacts(processNode.arcCollection[i])

                        trace.SetPinSource(trace.GetSourceContacts(processNode.arcCollection[i], processNode.name));

                        bool notOpposite = true;
                        for (int j = i + 1; j < processNode.arcCollection.Count; j++)
                        {
                            if (processNode.arcCollection[i].x == processNode.arcCollection[j].x)
                            {
                                //trace.SetLine(new LineStruct(processNode.arcCollection[i].GetInDiffusionEdge(), processNode.arcCollection[j].GetInDiffusionEdge()),
                                //	          processNode.name, curPrior, idx, true);
                                trace.SetStartLine(processNode.arcCollection[i], processNode.arcCollection[j],
                                                   processNode.name, curPrior, idx);

                                trace.SetContact(processNode.arcCollection[i].GetInDiffusionEdge(), processNode.name, idx, curPrior, 0);

                                List<ContactSimple> startWave = new List<ContactSimple>();
                                startWave.Add( new ContactSimple(processNode.arcCollection[i].GetInDiffusionEdge()) );
                                NodePointProcess proc = new NodePointProcess(0, curPrior, idx, false);
                                trace.CompleteSpreadWaveProcess(startWave, proc);//SpreadWaveProcess

                                notOpposite = false;
                            }
                        }

                        if (notOpposite)//markedPin.FindIndex(el => el == i) < 0)
                        {
                            trace.SetContact(processNode.arcCollection[i].GetInDiffusionEdge(), processNode.name, idx, curPrior, 0);
                            /*trace.SetPinContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetHigherPoint(0)),
                                                processNode.name, idx, curPrior);
                            trace.SetPinContact(Params.FromSimpleToCont(processNode.arcCollection[i].GetLowerPoint(0)),
                                                processNode.name, idx, curPrior);*/
                        }
                    }
                }
                curPrior--;
            }
        }