public void AddNamedPins(List<ContactNamed> inCts) { foreach(ContactNamed cnt in inCts) { Node fndNode = nodeList.Find(nd => nd.name == cnt.namePoint); if (diffusionException.FindIndex(name => name == cnt.namePoint) < 0 && fndNode != null) { ContactSimple smpl = new ContactSimple(cnt); smpl.SetInOut(); fndNode.arcCollection.Add(smpl); } } }
private NodePoint GetAnyPoint(ContactSimple inCnt) { if ( (inCnt.x >= 0) && (inCnt.x < wide) && (inCnt.y < Params.topEdge) && (inCnt.y >= 0) ) return layoutMap[inCnt.x][inCnt.y][inCnt.layer]; return blank; }
public NodePaths(string inName, ContactSimple inContact, int inNumberNode) { name = inName; startPoint = inContact;//new Contact(inContact) //currentEnds = new List<Contact>(); //currentEnds.Add(inContact.GetHigherPoint(0)); //currentEnds.Add(inContact.GetLowerPoint(0)); numberNode = inNumberNode; //seekNumbers = new List<int>(); }
public void SetStartLine(ContactSimple cnt1, ContactSimple cnt2, string inName, int inPriority, int inIdx) { if (cnt1.layer == Layers.siliconTrace) SetLine(new LineStruct(cnt1.GetInDiffusionEdge(), cnt2.GetInDiffusionEdge()), inName, inPriority, inIdx, true); else { if (Params.IsModelBusM1InMiddle()) { if (cnt1.y > cnt2.y) { SetLine(new LineStruct(cnt1.GetInDiffusionEdge(), cnt1.GetLowerPoint(2)), inName, inPriority, inIdx, true); SetLine(new LineStruct(cnt1.GetLowerPoint(2), cnt2.GetHigherPoint(2), Layers.metal2Trace), inName, inPriority, inIdx, true); SetLine(new LineStruct(cnt2.GetHigherPoint(2), cnt1.GetInDiffusionEdge()), inName, inPriority, inIdx, true); } else { SetLine(new LineStruct(cnt2.GetInDiffusionEdge(), cnt2.GetLowerPoint(2)), inName, inPriority, inIdx, true); SetLine(new LineStruct(cnt2.GetLowerPoint(2), cnt1.GetHigherPoint(2), Layers.metal2Trace), inName, inPriority, inIdx, true); SetLine(new LineStruct(cnt1.GetHigherPoint(2), cnt1.GetInDiffusionEdge()), inName, inPriority, inIdx, true); } } else { SetLine(new LineStruct(cnt1.GetInDiffusionEdge(), cnt2.GetInDiffusionEdge()), inName, inPriority, inIdx, true); } } }
/*public void SetPinContact(ContactSimple inCnt, string inName, int inNumNode, int inPrior)//int inX, int inY, int layer, ContactSimple inSample) { layoutMap[inCnt.x][inCnt.y][inCnt.layer].isReplace = false; layoutMap[inCnt.x][inCnt.y][inCnt.layer].name = inName; layoutMap[inCnt.x][inCnt.y][inCnt.layer].numberNode = inNumNode; layoutMap[inCnt.x][inCnt.y][inCnt.layer].priority = inPrior; layoutMap[inCnt.x][inCnt.y][inCnt.layer].isSource = true; layoutMap[inCnt.x][inCnt.y][inCnt.layer].number = 0; }*/ public void SetPinSource(ContactSimple inCnt) { layoutMap[inCnt.x][inCnt.y][inCnt.layer].isSource = true; }
public List<ContactSimple> ReturnAllWaveProcess(List<ContactSimple> inStart, NodePointProcess pntProcess) { string currentName = layoutMap[inStart[0].x][inStart[0].y][inStart[0].layer].name; List<ContactSimple> nextPoints = new List<ContactSimple>();//inStart.GetArroundPoints(wide); nextPoints.AddRange(inStart); List<ContactSimple> arround = new List<ContactSimple>(); List<ContactSimple> passedPoints = new List<ContactSimple>(); if (diffusionException.FindIndex(el => el == currentName) >= 0) { List<ContactSimple> thisWave = SetOneWave(nextPoints, passedPoints, pntProcess, currentName); SetOneWave(thisWave, passedPoints, pntProcess, currentName); nextPoints.AddRange(thisWave); passedPoints.AddRange(thisWave); } passedPoints.AddRange(inStart); do { arround.Clear(); foreach (ContactSimple cntOneLay in nextPoints) { foreach (int layer in Params.allLayersRange[cntOneLay.layer])//GetOppositeLayers(cntOneLay.layer)) { ContactSimple cnt = new ContactSimple(cntOneLay, layer); if ( IsPointsConnected(cnt, cntOneLay.layer, layer, currentName) )//GetPoint(cnt).name == currentName) { foreach (ContactSimple cntNebor in cnt.GetArroundPoints(wide)) { if ( (GetPoint(cntNebor).name == currentName) && (passedPoints.FindIndex(el => el == cntNebor) < 0) && (arround.FindIndex(el => el == cntNebor) < 0) ) { NodePoint pn1 = GetPoint(cntNebor); NodePoint pn2 = GetPoint(cntOneLay); if ( pn1.numberNode != pn2.numberNode) pn1 = GetPoint(cntNebor); arround.Add(cntNebor); } /*{ if ((cntNebor.layer != cntOneLay.layer) && (cntNebor.layer == Layers.siliconTrace || cntOneLay.layer == Layers.siliconTrace) && (GetPoint(cntNebor, Layers.contactTrace).name == Material.diffusionName) ) ; else { NodePoint pn1 = GetPoint(cntNebor); NodePoint pn2 = GetPoint(cntOneLay); if ( pn1.numberNode != pn2.numberNode) pn1 = GetPoint(cntNebor); if ( cntNebor.x == 31 && (cntNebor.y == 21 || cntNebor.y == 22) && cntNebor.layer == 1) pn1 = GetPoint(cntNebor); arround.Add(cntNebor); } }*/ } if (GetPoint(cnt).isSource) { NodePoint np2 = GetPoint(cnt); if (cnt.x == 19 && cnt.y == 33 && cnt.layer == 1) np2 = GetPoint(cnt); foreach (ContactSimple cntNebor in GetSourceContacts(cnt, currentName)) { NodePoint np1 = GetPoint(cntNebor); if (cnt.x == 19 && cnt.y == 33 && cnt.layer == 1) np1 = GetPoint(cntNebor); if ( GetPoint(cntNebor).isSource && (GetPoint(cntNebor).name == currentName) && (passedPoints.FindIndex(el => el == cntNebor) < 0) && (arround.FindIndex(el => el == cntNebor) < 0) )//&& FindSource(cnt) && FindSource(cntNebor) ) { NodePoint pn1 = GetPoint(cntNebor); NodePoint pn2 = GetPoint(cntOneLay); if ( pn1.numberNode != pn2.numberNode) pn1 = GetPoint(cntNebor); arround.Add(cntNebor); } } } } } } nextPoints.Clear(); nextPoints.AddRange(arround); passedPoints.AddRange(arround); pntProcess.IncrementNumber(); bool continueMark = false; do { List<ContactSimple> wave = SetOneWave(arround, passedPoints, pntProcess, currentName); nextPoints.AddRange(wave); passedPoints.AddRange(wave); arround = wave; continueMark = false; if (wave.Count > 0) continueMark = true; } while (continueMark); //passedPoints.AddRange(nextPoints); /*if (cntUnit.x == 14 && cntUnit.y == 5 && cntUnit.layer == Layers.siliconTrace) b = true;*/ } while (nextPoints.Count > 0); NodePoint np3 = GetPoint(inStart[0]); foreach(ContactSimple cnt in passedPoints) { if (cnt.x == 35 && cnt.y == 37 && cnt.layer == 1) np3 = GetPoint(cnt); } return passedPoints; }
public List<ContactSimple> GetSourceContacts(ContactSimple inCnt, string inName) { int coordY = Params.lineN; if (inCnt.y < Params.lineMiddle)//((inCnt.y - Params.lineP) <= 2) coordY = Params.lineP; //int layer = Layers.FromStrToNumber(inCnt.typePoint); List<ContactSimple> connectedCnt = new List<ContactSimple>(); if (inCnt.isInOut()) { connectedCnt.Add(new ContactSimple(inCnt)); return connectedCnt; } if (Params.IsModelWithDif() && (inCnt.layer == Layers.metal1Trace)) { if (diffusionException.FindIndex(el => el == inName) >= 0) { connectedCnt.Add(new ContactSimple(inCnt.x, coordY, inCnt.layer)); connectedCnt.Add(new ContactSimple(inCnt.x, coordY, inCnt.layer)); return connectedCnt; } //if (coordY < Params.topEdge) connectedCnt.Add(new ContactSimple(inCnt.x, coordY + 2, inCnt.layer)); //if (coordY >= Params.bottomEdge) connectedCnt.Add(new ContactSimple(inCnt.x, coordY - 2, inCnt.layer)); return connectedCnt; } connectedCnt.Add(new ContactSimple(inCnt.x, coordY + 1, inCnt.layer)); connectedCnt.Add(new ContactSimple(inCnt.x, coordY - 1, inCnt.layer)); if (diffusionException.FindIndex(el => el == inName) >= 0) { //if (coordY < Params.topEdge) connectedCnt.Add(new ContactSimple(inCnt.x, coordY + 3, inCnt.layer)); //if (coordY > Params.bottomEdge) connectedCnt.Add(new ContactSimple(inCnt.x, coordY - 3, inCnt.layer)); } return connectedCnt; }
private bool UniteWaves(ContactSimple inCnt) { bool findMerge = false; /*if (inCnt.x == 31 && (inCnt.y == 21 || inCnt.y == 22) && inCnt.layer == 1) { NodePoint pn1 = GetPoint (new ContactSimple(31, 21, 1)); NodePoint pn2 = GetPoint (new ContactSimple(31, 22, 1)); findMerge = false; }*/ NodePoint inPoint = GetPoint(inCnt); if (inPoint.name == Material.blankName) return false; int numb1 = -1, ndNum = -1; if (inCnt.x < (wide - 1) && (GetPoint(inCnt).name == layoutMap[inCnt.x + 1][inCnt.y][inCnt.layer].name) && (GetPoint(inCnt).numberNode != layoutMap[inCnt.x + 1][inCnt.y][inCnt.layer].numberNode)) { numb1 = GetPoint(inCnt).numberNode; ndNum = layoutMap[inCnt.x + 1][inCnt.y][inCnt.layer].numberNode; nodeDistanceDict[GetPoint(inCnt).name].UniteNodes(GetPoint(inCnt).numberNode, ndNum); findMerge = true; } if (inCnt.y < (Params.topEdge - 1) && (GetPoint(inCnt).name == layoutMap[inCnt.x][inCnt.y + 1][inCnt.layer].name) && (GetPoint(inCnt).numberNode != layoutMap[inCnt.x][inCnt.y + 1][inCnt.layer].numberNode)) { numb1 = GetPoint(inCnt).numberNode; ndNum = layoutMap[inCnt.x][inCnt.y + 1][inCnt.layer].numberNode; nodeDistanceDict[GetPoint(inCnt).name].UniteNodes(GetPoint(inCnt).numberNode, ndNum); findMerge = true; } if ( inPoint.isSource && (diffusionException.FindIndex(el => el == inPoint.name) < 0) )//!!! //(GetPoint(inCnt).numberNode != layoutMap[inCnt.x][inCnt.y + 1][inCnt.layer].numberNode)) { NodePoint ndPoint = DefineSourcePoint(inCnt, inCnt.layer); if ( (ndPoint.name == inPoint.name) && ( nodeDistanceDict[inPoint.name].GetNumber(inPoint.numberNode) != nodeDistanceDict[inPoint.name].GetNumber(ndPoint.numberNode) ) ) { nodeDistanceDict[inPoint.name].UniteNodes(inPoint.numberNode, ndPoint.numberNode); findMerge = true; } } /*int opposLayer = Layers.metal1Trace; if (inCnt.layer == Layers.metal1Trace) opposLayer = Layers.siliconTrace;*/ foreach (int opposLayer in Params.GetOppositeLayers(inCnt.layer)) { if (inCnt.layer == Layers.siliconTrace || opposLayer == Layers.siliconTrace) { if ( (GetPoint(inCnt).name == GetPoint(inCnt, opposLayer).name) && (GetPoint(inCnt, Layers.contactTrace).name != Material.diffusionName) && (GetPoint(inCnt).numberNode != GetPoint(inCnt, opposLayer).numberNode) ) { numb1 = GetPoint(inCnt).numberNode; ndNum = GetPoint(inCnt, opposLayer).numberNode; nodeDistanceDict[GetPoint(inCnt).name].UniteNodes(GetPoint(inCnt).numberNode, ndNum); findMerge = true; } } else { if ( (GetPoint(inCnt).name == GetPoint(inCnt, opposLayer).name) && (GetPoint(inCnt).numberNode != GetPoint(inCnt, opposLayer).numberNode) ) { numb1 = GetPoint(inCnt).numberNode; ndNum = GetPoint(inCnt, opposLayer).numberNode; nodeDistanceDict[GetPoint(inCnt).name].UniteNodes(GetPoint(inCnt).numberNode, ndNum); findMerge = true; } } } if (findMerge && GetPoint(inCnt).name == "N6859613") findMerge = true; return findMerge; }
/*private void SetPointWithExept(PairInt inCnt, List<NodePoint> best) { NodePoint bestPoint = best[0]; NodePoint bestMet1 = best[1]; NodePoint bestSil = best[2]; SetOneOfBest_old(inCnt, Layers.metal1Trace, bestMet1); SetOneOfBest_old(inCnt, Layers.siliconTrace, bestSil); } /*private void SetPointWithDiffusExept(PairInt inCnt, BestPointSet pnt, List<BestPointSet> best) { foreach (int lay in Params.LayersRange[pnt.point.layer]) { BestPointSet bst = best.Find(el => el.isOneLayer && (el.layer == replased)); SetOneOfBest(inCnt, Layers.metal1Trace, bestMet1); SetOneOfBest(inCnt, Layers.siliconTrace, bestSil); } }*/ bool IsJumpAble(PairInt inCnt, int inLayer) { string curName = GetPoint(inCnt, inLayer).name; if (curName == Material.blankName) return true; if (curName == Material.diffusionName ) return false; ContactSimple centrCnt = new ContactSimple(inCnt, inLayer); foreach(ContactSimple cnt in centrCnt.GetNeborPoints(wide))//GetArroundPoints(wide)) if (GetPoint(cnt).name != curName) return false; return true; }
private bool IsBridgeM1Si(ContactSimple inCnt, int opposLayer) { /*int opposLayer = Layers.metal1Trace; if (inCnt.layer == Layers.metal1Trace) opposLayer = Layers.siliconTrace;*/ string curName = GetPoint(inCnt).name; if (curName != GetPoint(inCnt, opposLayer).name || GetPoint(inCnt, Layers.contactTrace).name == Material.diffusionName) return false; bool isSpreadThisL = false; //bool isSpredOpposL = false; List<ContactSimple> arround = inCnt.GetArroundPoints(wide); foreach (ContactSimple cnt in arround) { if (GetPoint(cnt).name == curName && GetPoint(cnt, opposLayer).name == curName && GetPoint(cnt, Layers.contactTrace).name != Material.diffusionName) return false; if (GetPoint(cnt).name == curName && (GetPoint(cnt, opposLayer).name != curName || GetPoint(cnt, Layers.contactTrace).name == Material.diffusionName)) isSpreadThisL = true; //if (GetPoint(cnt).name != curName && (GetPoint(cnt, opposLayer).name == curName || // GetPoint(cnt, Layers.contactTrace).name == Material.diffusionName)) // isSpredOpposL = true; } bool isBridgeBool = false; if (isSpreadThisL)// && isSpredOpposL) //isSpredOpposL - delete isBridgeBool = true; if (!isBridgeBool && isSpreadThisL && IsOnlyConnectionM1Si(inCnt)) isBridgeBool = true; return isBridgeBool;//false; }
private bool IsBridgeM1M2(ContactSimple inCnt, int opposLayer) { /*int opposLayer = Layers.metal1Trace; if (inCnt.layer == Layers.metal1Trace) opposLayer = Layers.metal2Trace;*/ string curName = GetPoint(inCnt).name; if (curName != GetPoint(inCnt, opposLayer).name) return false; bool isSpreadThisL = false; //bool isSpredOpposL = false; List<ContactSimple> arround = inCnt.GetArroundPoints(wide); foreach (ContactSimple cnt in arround) { if (GetPoint(cnt).name == curName && GetPoint(cnt, opposLayer).name == curName) return false; if (GetPoint(cnt).name == curName && (GetPoint(cnt, opposLayer).name != curName)) isSpreadThisL = true; //if (GetPoint(cnt).name != curName && (GetPoint(cnt, opposLayer).name == curName)) // isSpredOpposL = true; } bool isBridgeBool = false; if (isSpreadThisL)// && isSpredOpposL) isBridgeBool = true; return isBridgeBool;//false; }
private bool IsBridge(ContactSimple inCnt) { bool isBridgeBool = false; List<int> layers = Params.GetOppositeLayers(inCnt.layer); foreach (int lay in layers) { bool curBridge = false; if (lay == Layers.siliconTrace || inCnt.layer == Layers.siliconTrace) curBridge = IsBridgeM1Si(inCnt, lay); else curBridge = IsBridgeM1M2(inCnt, lay); isBridgeBool = isBridgeBool || curBridge; } if ((!isBridgeBool) && (layers.Count > 1)) isBridgeBool = IsTwoLayerBridge(inCnt, layers); return isBridgeBool; }
private List<Section> GetSections(ContactSimple inCnt, string curName) { List<ContactSimple> nebors = new List<ContactSimple>(); List<ContactSimple> neborsFst = inCnt.GetAnyNeborPoints(); int start = neborsFst.FindIndex(el => GetAnyPoint(el).name == curName); int end = neborsFst.FindIndex(el => GetAnyPoint(el).name != curName); //if (b && ((end < 0) || (end == 0 && start < 0))) // b = true; /*foreach (ContactSimple cnt in neborsFst) { if (cnt.x == 39 && cnt.y == 14 && cnt.layer == 1) { NodePoint pn = GetPoint(cnt); if (pn.name == Material.blankName) b = false; } }*/ /*if (end < 0) return CheckBigArea(inCnt);//true if (end == 0 && start < 0 && (!IsBridge(inCnt))) return true;*/ int start2 = 0; if (end >= 0) start2 = neborsFst.FindIndex(end, el => GetAnyPoint(el).name == curName); /*if (end == 0 && start > 0) { end = neborsFst.FindIndex(start, el => GetAnyPoint(el).name == curName); start2 = neborsFst.FindIndex(end, el => GetAnyPoint(el).name == curName); } else// if (end == 0 && end < start) { nebors.AddRange(neborsFst.GetRange(start, neborsFst.Count - start)); nebors.AddRange(neborsFst.GetRange(0, start)); } else*/ if (end < start2) { nebors.AddRange(neborsFst.GetRange(start2, neborsFst.Count - start2)); nebors.AddRange(neborsFst.GetRange(0, start2)); } else nebors = neborsFst; List<Section> sections = new List<Section>(); List<PairInt> oneSection = new List<PairInt>(); bool sectEnd = true; bool isSection = false; for (int i = 0; i < nebors.Count; i++) { if ((nebors[i].y < Params.topEdge) && (nebors[i].x < wide) && (nebors[i].y >= 0) && (nebors[i].x >= 0) && (GetPoint(nebors[i]).name == curName)) { if (sectEnd) { oneSection.Clear(); isSection = false; } if (nebors[i].x == inCnt.x || nebors[i].y == inCnt.y) isSection = true; //sections.Add(new Section()); //sections[sectCount].points.Add(nebors[i]); oneSection.Add(new PairInt(nebors[i])); sectEnd = false; } else if (!sectEnd) { sectEnd = true; if (isSection) { sections.Add(new Section(oneSection)); isSection = false; } } } if (isSection) sections.Add(new Section(oneSection)); return sections; }
private List<ContactSimple> GetPointsInLayers(ContactSimple inCnt, string inName) { List<ContactSimple> connectedPoints = new List<ContactSimple>(); bool loopLayer = true; int curLayer = inCnt.layer; while(loopLayer) { loopLayer = false; foreach (int oneLayer in Params.allLayersRange[curLayer]) { if ( (oneLayer != inCnt.layer) && IsPointsConnected(inCnt, inCnt.layer, oneLayer, inName) &&//(GetPoint(inCnt, oneLayer).name == inName) && (connectedPoints.FindIndex(el => el.layer == oneLayer) < 0) ) { connectedPoints.Add(new ContactSimple(inCnt, oneLayer)); curLayer = oneLayer; loopLayer = true; } } } return connectedPoints; }
/*private ContactSimple GetOppositeContact(ContactSimple inCnt) { int oppositeLayer = Layers.siliconTrace; if (inCnt.layer == Layers.siliconTrace) oppositeLayer = Layers.metal1Trace; return new ContactSimple(inCnt, oppositeLayer); }*/ private NodePoint GetPoint(ContactSimple inCnt) { if (inCnt.x < 0 || inCnt.y < 0 || inCnt.y >= Params.topEdge) return layoutMap[0][Params.topEdge - 1][inCnt.layer]; return layoutMap[inCnt.x][inCnt.y][inCnt.layer]; }
private bool SetPoinProcess(ContactSimple prevCnt, ContactSimple inCnt, NodePointProcess pntProcess) { if ( (prevCnt.layer != inCnt.layer) && ((prevCnt.layer == Layers.siliconTrace || inCnt.layer == Layers.siliconTrace)) ) { if (GetPoint(inCnt, Layers.contactTrace).name != Material.diffusionName) { pntProcess.ProcessPoint(layoutMap[inCnt.x][inCnt.y][inCnt.layer]); return true; } } else { pntProcess.ProcessPoint(layoutMap[inCnt.x][inCnt.y][inCnt.layer]); } return false; }
/*private void SetPoint_old(PairInt inCnt) { bool replased = false; foreach (int curLayer in Params.UsedLayers) if (GetPoint(inCnt, curLayer).isReplace) replased = true; if (!replased) return; //if ((!GetPoint(inCnt, Layers.metal1Trace).isReplace) && // (!GetPoint(inCnt, Layers.siliconTrace).isReplace)) // return; bool b; if (inCnt.x == 20 && inCnt.y == 16 ) b = false; List<NodePoint> best = GetBest_old(inCnt); NodePoint bestPoint = best[0]; NodePoint bestMet1 = best[1]; NodePoint bestSil = best[2]; if (diffusionExeption.FindIndex(el => el == bestPoint.name) >= 0) { SetPointWithExept(inCnt, best); return; } if (bestPoint == bestMet1) { bool useBestPoint = false; if (GetPoint(inCnt, Layers.metal1Trace).isReplace) { if (SetOneOfBest_old(inCnt, Layers.metal1Trace, bestPoint) && GetPoint(inCnt, Layers.contactTrace).name != Material.diffusionName && IsJumpAble(inCnt, Layers.siliconTrace) && SetOneOfBest_old(inCnt, Layers.siliconTrace, bestPoint)) useBestPoint = true; } if (!useBestPoint) SetOneOfBest_old(inCnt, Layers.siliconTrace, bestSil); } else { bool useBestPoint = false; if (GetPoint(inCnt, Layers.siliconTrace).isReplace) { if (SetOneOfBest_old(inCnt, Layers.siliconTrace, bestPoint) && GetPoint(inCnt, Layers.contactTrace).name != Material.diffusionName && IsJumpAble(inCnt, Layers.metal1Trace) && SetOneOfBest_old(inCnt, Layers.metal1Trace, bestPoint)) useBestPoint = true; } if (!useBestPoint) SetOneOfBest_old(inCnt, Layers.metal1Trace, bestMet1); } }*/ private void SetPoint(PairInt inCnt) { bool replased = false; foreach (int curLayer in Params.UsedLayers) if (GetPoint(inCnt, curLayer).isReplace) replased = true; if (!replased) return; //if (inCnt.x == 12 && inCnt.y == 24 && (AddingSpace(layoutMap[13][24][Layers.metal2Trace].name) == "66204")) // replased = true; bool b = false; if (inCnt.x == 27 && inCnt.y == 17 )//"N6859613") b = false; List<BestPointSet> best = GetBest(inCnt); List<int> closedLayers = new List<int>(); if (Params.UsedLayers.Count > 2) best = SortBestPoints(best); if ( inCnt.x == 14 && (inCnt.y == 38) )// || inCnt.y == 37) ) { ContactSimple tmp = new ContactSimple(inCnt, 0); List<ContactSimple> tp = tmp.GetAnyNeborPoints(); List<NodePoint> p = new List<NodePoint> (); foreach(ContactSimple t in tp) p.Add(GetPoint(t)); p.Add(GetPoint(tmp)); } foreach (BestPointSet bestPoint in best) { if ((!bestPoint.isOneLayer) && (closedLayers.FindIndex(el => el == bestPoint.point.layer) < 0)) { if (diffusionException.FindIndex(el => el == bestPoint.point.name) >= 0) { if (Params.IsDiffusExeptionLayer(bestPoint.point.layer)) { SetOneOfBest(inCnt, bestPoint.point.layer, bestPoint.point); closedLayers.Add(bestPoint.point.layer); } } else { if (SetOneOfBest(inCnt, bestPoint.point.layer, bestPoint.point)) { foreach (int related in Params.LayersRange[bestPoint.point.layer]) { if ((related != bestPoint.point.layer) && IsDiffusionLimit(inCnt, related, bestPoint.point.layer) && IsJumpAble(inCnt, related) && SetOneOfBest(inCnt, related, bestPoint.point)) closedLayers.Add(related); } } else { foreach (int lay in DefineSameLayers(inCnt, bestPoint, best)) { if (SetOneOfBest(inCnt, lay, bestPoint.point)) { foreach (int related in Params.LayersRange[lay]) { if ((related != lay) && IsDiffusionLimit(inCnt, related, lay) && IsJumpAble(inCnt, related) && SetOneOfBest(inCnt, related, bestPoint.point)) closedLayers.Add(related); } } } } closedLayers.Add(bestPoint.point.layer); } } } foreach (BestPointSet bestPoint in best) { if ((bestPoint.isOneLayer) && (closedLayers.FindIndex(el => el == bestPoint.point.layer) < 0)) { SetOneOfBest(inCnt, bestPoint.point.layer, bestPoint.point); } } }
/*public List<ContactSimple> GetSourceContacts(ContactSimple inCnt, string inName) { int coordY = Params.lineN; if ((inCnt.y - Params.lineP) <= 2) coordY = Params.lineP; List<Contact> connectedCnt = new List<Contact>(); if (inCnt.isInOut()) { connectedCnt.Add(new Contact(inCnt)); return connectedCnt; } connectedCnt.Add(new Contact(inCnt.x, coordY + 1, inCnt.typePoint)); connectedCnt.Add(new Contact(inCnt.x, coordY - 1, inCnt.typePoint)); if (diffusionExeption.FindIndex(el => el == inName) >= 0) { connectedCnt.Add(new Contact(inCnt.x, coordY + 3, inCnt.typePoint)); connectedCnt.Add(new Contact(inCnt.x, coordY - 3, inCnt.typePoint)); } return connectedCnt; }*/ private bool IsOnlyConnectionM1Si(ContactSimple inCnt) { if (GetPoint(inCnt, Layers.contactTrace).name == Material.diffusionName) return false; int layOppos = Params.LayersRange[inCnt.layer][0]; if (layOppos == inCnt.layer) layOppos = Params.LayersRange[inCnt.layer][1]; if (inCnt.y < (Params.topEdge - 1) && GetPoint(inCnt.GetHigherPoint(0), Layers.contactTrace).name == Material.diffusionName) { if ( (GetPoint(inCnt).name == GetPoint(inCnt.GetHigherPoint(0)).name) && (GetPoint(inCnt).name == GetPoint(inCnt.GetHigherPoint(0), layOppos).name) && (GetPoint(inCnt).name == GetPoint( inCnt.GetHigherPoint(5) ).name) && (GetPoint(inCnt).name == GetPoint( inCnt.GetHigherPoint(5), layOppos).name) ) return false; return true; } if (inCnt.y > 0 && GetPoint(inCnt.GetLowerPoint(0), Layers.contactTrace).name == Material.diffusionName) { if ( (GetPoint(inCnt).name == GetPoint(inCnt.GetLowerPoint(0)).name) && (GetPoint(inCnt).name == GetPoint(inCnt.GetLowerPoint(0), layOppos).name) && (GetPoint(inCnt).name == GetPoint( inCnt.GetLowerPoint(5) ).name) && (GetPoint(inCnt).name == GetPoint( inCnt.GetLowerPoint(5), layOppos).name) ) return false; return true; } return false; }
public List<ContactSimple> FindStartPoint(ContactSimple inCnt, string inName) { List<ContactSimple> startPoints = new List<ContactSimple>(); if ((diffusionException.FindIndex(nameNode => nameNode == inName) >= 0) && GetPoint(inCnt).isFixed) { startPoints.AddRange(GetFixedPoints(inCnt)); return startPoints; } foreach (ContactSimple cnt in GetSourceContacts(inCnt, inName)) { if (GetPoint(cnt).name == inName) startPoints.Add(cnt); } if (startPoints.Count > 0) return startPoints; startPoints.Add(new ContactSimple(inCnt.x, (inCnt.y), inCnt.layer)); return startPoints; }
private bool IsPointFree(ContactSimple inPoint, string curName) { if (GetPoint(inPoint).name != curName && GetPoint(inPoint).name != Material.blankName) return false; foreach (ContactSimple pn in inPoint.GetArroundPoints(wide)) if (GetPoint(pn).name != curName && GetPoint(pn).name != Material.blankName) return false; return true; }
//string inType) public bool IsPointForContact(ContactSimple inCnt, int inType) { if ((inType == Material.csi_) && (GetPoint(inCnt, Layers.siliconTrace).name == Material.diffusionName)) return false; return true; }
private bool IsTwoLayerBridge(ContactSimple inCnt, List<int> opposLayers) { string curName = GetPoint(inCnt).name; foreach(int lay in opposLayers) if (GetPoint(inCnt, lay).name != curName) return false; List<ContactSimple> arround = inCnt.GetArroundPoints(wide); foreach (ContactSimple cnt in arround) { if (GetPoint(cnt).name == curName) return false; } return true; }
//int inX, int inY, int layer, ContactSimple inSample) public void SetContact(ContactSimple inCnt, string inName, int inNumNode, int inPrior, int inNumber) { //if (inCnt.x < 0 || inCnt.y < 0) // return; layoutMap[inCnt.x][inCnt.y][inCnt.layer].isReplace = false; layoutMap[inCnt.x][inCnt.y][inCnt.layer].name = inName; layoutMap[inCnt.x][inCnt.y][inCnt.layer].numberNode = inNumNode; layoutMap[inCnt.x][inCnt.y][inCnt.layer].priority = inPrior; layoutMap[inCnt.x][inCnt.y][inCnt.layer].number = inNumber; }
private bool SetNextCont(PairInt inChanged, int layerChanged, NodePoint inSample) { /*bool b = false; if (inChanged.x == 33 && (inChanged.y == 16 || inChanged.y == 18) && layerChanged == Layers.metal1Trace && inSample.name != "N6859613") b = false;*/ if (inSample.name == Material.blankName) return true; string curName = inSample.name; List<string> deletedNames = new List<string>(); ContactSimple curPoint = new ContactSimple(inChanged, layerChanged); List<ContactSimple> cntArround = curPoint.GetArroundPoints(wide); List<PairInt> cntArea = inChanged.GetBigArround(wide); cntArea.Add(inChanged); foreach (ContactSimple cntUnit in cntArround) { string unitName = GetPoint(cntUnit).name; if (unitName != curName && unitName!= Material.blankName && unitName != Material.diffusionName) { /*if (cntUnit.x == 33 && (cntUnit.y == 16 || cntUnit.y == 18) && cntUnit.layer == Layers.metal1Trace) b = false;*/ if (deletedNames.FindIndex(el => el == unitName) >= 0) { bool rem = CheckNebors(new ContactSimple(cntUnit, cntUnit.layer)); if (!rem) { layoutMap[cntUnit.x][cntUnit.y][cntUnit.layer].isReplace = rem; return false; } } deletedNames.Add(unitName); SetContact(cntUnit, Material.blankName, 0, 0, -1); //cntAdded.Add(cntUnit); if (GetPoint(cntUnit).isSource) { foreach (ContactSimple smp in GetSourceContacts(cntUnit, curName)) if (smp != cntUnit) cntArea.Add(smp); //cntArea.Add(GetSourceContacts //GetNearSource(cntUnit)); } //List<PairInt> cntForCheck = new List<PairInt>(); foreach (ContactSimple cnt in cntUnit.GetNeborPoints(wide)) { /*string bn = GetPoint(cnt).name; /*if (cnt.x == 38 && cnt.y == 14 && cnt.layer == 1 && bn != Material.blankName) b = false;*/ if ((GetPoint(cnt).name != curName) && (cntArea.FindIndex(el => el == cnt) < 0)) { cntArea.Add(cnt); //cntForCheck.Add(cnt); } } } } layoutMap[inChanged.x][inChanged.y][layerChanged].isReplace = false; layoutMap[inChanged.x][inChanged.y][layerChanged].name = inSample.name; layoutMap[inChanged.x][inChanged.y][layerChanged].numberNode = inSample.numberNode; layoutMap[inChanged.x][inChanged.y][layerChanged].priority = inSample.priority; layoutMap[inChanged.x][inChanged.y][layerChanged].number = inSample.number; foreach (PairInt cntUnit in cntArea) { foreach (int lay in Params.LayersRange[layerChanged]) { layoutMap[cntUnit.x][cntUnit.y][lay].isReplace = CheckNebors(new ContactSimple(cntUnit, lay)); } /*bool b; if (cntUnit.x == 20 && cntUnit.y == 16) b = true; layoutMap[cntUnit.x][cntUnit.y][Layers.metal1Trace].isReplace = CheckNebors(new ContactSimple(cntUnit, Layers.metal1Trace)); layoutMap[cntUnit.x][cntUnit.y][Layers.siliconTrace].isReplace = CheckNebors(new ContactSimple(cntUnit, Layers.siliconTrace));*/ } return true; }
public void SetReplace() { for (int x = 0; x < wide; x++) { for (int y = 0; y < Params.topEdge; y++) { ContactSimple cntUnit = new ContactSimple(x, y, Layers.metal1Trace); //if (CheckNebors(cntUnit)) layoutMap[x][y][Layers.metal1Trace].isReplace = CheckNebors(cntUnit); cntUnit = new ContactSimple(x, y, Layers.siliconTrace); //if (CheckNebors(cntUnit)) layoutMap[x][y][Layers.siliconTrace].isReplace = CheckNebors(cntUnit); } } }
private void SetNextCont_old(PairInt inChanged, int layerChanged, NodePoint inSample) { bool b = false; if (inChanged.x == 33 && (inChanged.y == 16 || inChanged.y == 18) && layerChanged == Layers.metal1Trace && inSample.name != "N6859613") b = false; if (inSample.name == Material.blankName) return; layoutMap[inChanged.x][inChanged.y][layerChanged].isReplace = false; layoutMap[inChanged.x][inChanged.y][layerChanged].name = inSample.name; layoutMap[inChanged.x][inChanged.y][layerChanged].numberNode = inSample.numberNode; layoutMap[inChanged.x][inChanged.y][layerChanged].priority = inSample.priority; layoutMap[inChanged.x][inChanged.y][layerChanged].number = inSample.number; string curName = inSample.name; ContactSimple curPoint = new ContactSimple(inChanged, layerChanged); List<ContactSimple> cntArround = curPoint.GetArroundPoints(wide); List<PairInt> cntArea = inChanged.GetBigArround(wide); cntArea.Add(inChanged); foreach (ContactSimple cntUnit in cntArround) { string unitName = GetPoint(cntUnit).name; if (unitName != curName && unitName!= Material.blankName && unitName != Material.diffusionName) { if (cntUnit.x == 33 && (cntUnit.y == 16 || cntUnit.y == 18) && cntUnit.layer == Layers.metal1Trace) b = false; SetContact(cntUnit, Material.blankName, 0, 0, -1); //cntAdded.Add(cntUnit); if (GetPoint(cntUnit).isSource) { foreach (ContactSimple smp in GetSourceContacts(cntUnit, curName)) if (smp != cntUnit) cntArea.Add(smp); //cntArea.Add(GetSourceContacts //GetNearSource(cntUnit)); } foreach (ContactSimple cnt in cntUnit.GetNeborPoints(wide)) { string bn = GetPoint(cnt).name; if (cnt.x == 38 && cnt.y == 14 && cnt.layer == 1 && bn != Material.blankName) b = false; if ((GetPoint(cnt).name != curName) && (cntArea.FindIndex(el => el == cnt) < 0)) cntArea.Add(cnt); } } } foreach (PairInt cntUnit in cntArea) { foreach (int lay in Params.LayersRange[layerChanged]) { layoutMap[cntUnit.x][cntUnit.y][lay].isReplace = CheckNebors(new ContactSimple(cntUnit, lay)); } } }
public void AddContact(ContactSimple inNewCont) { if (arcCollection.FindIndex(element => element == inNewCont) < 0) arcCollection.Add(inNewCont); }
/*private bool SetOneOfBest_old(PairInt inCnt, int inLayer, NodePoint inSample) { bool noLayer = false; int sourceBest = 0; ContactSimple simple = new ContactSimple(inCnt, inLayer); List<ContactSimple> arround = simple.GetArroundPoints(wide); foreach (ContactSimple cntArround in arround) { NodePoint pn = GetPoint(cntArround); if ((GetPoint(cntArround).name != inSample.name) && (!GetPoint(cntArround).isReplace) && (GetPoint(cntArround).name != Material.diffusionName)) noLayer = true; if (!noLayer && GetPoint(cntArround).isSource && (GetPoint(cntArround).name != inSample.name)) sourceBest++; } int sourseCount = 0; if ((sourceBest > 1) && (diffusionExeption.FindIndex(el => el == inSample.name) >= 0)) { foreach (ContactSimple cnt in GetSourceContacts(new ContactSimple(inCnt, inLayer), inSample.name)) { if (GetPoint(cnt).name == inSample.name) sourseCount++; } if (sourseCount > sourceBest) sourceBest = 1; } if (!noLayer && (sourceBest < 2) && (GetPoint(inCnt, inLayer).isReplace)) { SetNextCont(inCnt, inLayer, inSample);//error gap in line return true; } return false; }*/ private bool SetOneOfBest(PairInt inCnt, int inLayer, NodePointLayer inSample) { NodePoint crPnt = GetPoint(inCnt, inLayer); if (!crPnt.isReplace || inSample.name == Material.blankName || crPnt.name == inSample.name) return false; ContactSimple curCentr = new ContactSimple(inCnt, inLayer); SetContact(curCentr, Material.blankName, 0, 0, -1); /*layoutMap[inChanged.x][inChanged.y][layerChanged].isReplace = false; layoutMap[inChanged.x][inChanged.y][layerChanged].name = inSample.name; layoutMap[inChanged.x][inChanged.y][layerChanged].numberNode = inSample.numberNode; layoutMap[inChanged.x][inChanged.y][layerChanged].priority = inSample.priority; layoutMap[inChanged.x][inChanged.y][layerChanged].number = inSample.number; */ string curName = inSample.name; //ContactSimple curPoint = new ContactSimple(inChanged, layerChanged); List<ContactSimple> cntArround = curCentr.GetArroundPoints(wide); //List<PairInt> cntCheckRepl = inCnt.GetBigArround(wide); //cntCheckRepl.Add(inCnt); bool contSetting = true; bool retValue = true; //foreach (ContactSimple cntUnit in cntArround) while (contSetting) { contSetting = false; retValue = true; List<string> namesChanged = new List<string>(); foreach (ContactSimple cntUnit in cntArround) { NodePoint unitPnt = GetPoint(cntUnit); string unitName = unitPnt.name; if (unitName != curName && unitPnt.isReplace && unitName!= Material.blankName && unitName != Material.diffusionName) { contSetting = true; if (cntUnit.x == 29 && (cntUnit.y == 38) && cntUnit.layer == Layers.siliconTrace && unitName == "INC")//4 point !!!!! != 737 { List<NodePoint> ps = new List<NodePoint>(); foreach (ContactSimple cnt in cntUnit.GetNeborPoints(wide)) ps.Add(GetPoint(cnt)); contSetting = true; } namesChanged.Add(unitName); SetContact(cntUnit, Material.blankName, 0, 0, -1); //cntAdded.Add(cntUnit); if (GetPoint(cntUnit).isSource) { foreach (ContactSimple smp in GetSourceContacts(cntUnit, curName)) if (smp != cntUnit) layoutMap[smp.x][smp.y][smp.layer].isReplace = CheckNebors(new ContactSimple(smp, smp.layer)); //cntCheckRepl.Add(smp); } foreach (ContactSimple cnt in cntUnit.GetNeborPoints(wide)) { /*string bn = GetPoint(cnt).name; if (cnt.x == 38 && cnt.y == 14 && cnt.layer == 1 && bn != Material.blankName) b = false;*/ foreach (int lay in Params.LayersRange[inLayer]) { //if (GetPoint(cnt, lay).name == unitName)//curName) && (cntCheckRepl.FindIndex(el => el == cnt) < 0)) layoutMap[cnt.x][cnt.y][lay].isReplace = CheckNebors(new ContactSimple(cnt, lay)); //cntCheckRepl.Add(cnt); } } } else if (unitName != curName && unitName!= Material.blankName && unitName != Material.diffusionName) { retValue = false; if (namesChanged.FindIndex(el => el == unitPnt.name) >= 0)//--------delete layoutMap[cntUnit.x][cntUnit.y][cntUnit.layer].isReplace = CheckNebors(new ContactSimple(cntUnit, cntUnit.layer)); } } } if (retValue) { layoutMap[inCnt.x][inCnt.y][inLayer].isReplace = false; layoutMap[inCnt.x][inCnt.y][inLayer].name = inSample.name; layoutMap[inCnt.x][inCnt.y][inLayer].numberNode = inSample.numberNode; layoutMap[inCnt.x][inCnt.y][inLayer].priority = inSample.priority; layoutMap[inCnt.x][inCnt.y][inLayer].number = inSample.number; } List<PairInt> checkRepl = inCnt.GetBigArround(wide); checkRepl.Add(inCnt); foreach (PairInt cntUnit in checkRepl) { foreach (int lay in Params.LayersRange[inLayer]) { //if (GetPoint(cntUnit, lay).name == curName) layoutMap[cntUnit.x][cntUnit.y][lay].isReplace = CheckNebors(new ContactSimple(cntUnit, lay)); } } return retValue; //-------------------------- /*bool noLayer = false; int sourceBest = 0; ContactSimple simple = new ContactSimple(inCnt, inLayer); List<ContactSimple> arround = simple.GetArroundPoints(wide); foreach (ContactSimple cntArround in arround) { NodePoint pn = GetPoint(cntArround); if ((GetPoint(cntArround).name != inSample.name) && (!GetPoint(cntArround).isReplace) && (GetPoint(cntArround).name != Material.diffusionName)) noLayer = true; if (!noLayer && GetPoint(cntArround).isSource && (GetPoint(cntArround).name != inSample.name)) sourceBest++; } int sourseCount = 0; if ((sourceBest > 1) && (diffusionException.FindIndex(el => el == inSample.name) >= 0)) { foreach (ContactSimple cnt in GetSourceContacts(new ContactSimple(inCnt, inLayer), inSample.name)) { if (GetPoint(cnt).name == inSample.name) sourseCount++; } if (sourseCount > sourceBest) sourceBest = 1; } if (!noLayer && (sourceBest < 2) && (GetPoint(inCnt, inLayer).isReplace)) { if (!SetNextCont(inCnt, inLayer, inSample)) return false; return true; }*/ //return false; }
private List<ContactSimple> SetOneWave(List<ContactSimple> inWave, List<ContactSimple> bandedConts, NodePointProcess pntProcess, string currentName) { List<ContactSimple> thisWave = new List<ContactSimple>(); foreach (ContactSimple cntUnit in inWave) { //thisWave.Add(cntUnit); //passedPoints.Add(cntUnit); bool b; foreach (int opposLay in Params.GetOppositeLayers(cntUnit.layer)) { ContactSimple curCnt = new ContactSimple(cntUnit, opposLay); if (bandedConts.FindIndex(el => el == curCnt) < 0) { if ((opposLay == Layers.siliconTrace || cntUnit.layer == Layers.siliconTrace)) { if ((GetPoint(cntUnit, Layers.contactTrace).name != Material.diffusionName) && (GetPoint(cntUnit, opposLay).name == currentName)) { //pntProcess.ProcessPoint(layoutMap[cntUnit.x][cntUnit.y][opposLay]); //passedPoints.Add(new ContactSimple(cntUnit,opposLay)); if ( cntUnit.x == 31 && (cntUnit.y == 21 || cntUnit.y == 22))// && cntNebor.layer == 1) b = true; //pn1 = GetPoint(cntNebor); thisWave.Add(new ContactSimple(cntUnit,opposLay)); } } else { if (GetPoint(cntUnit, opposLay).name == currentName) { //pntProcess.ProcessPoint(layoutMap[cntUnit.x][cntUnit.y][opposLay]); //passedPoints.Add(new ContactSimple(cntUnit,opposLay)); if ( cntUnit.x == 31 && (cntUnit.y == 21 || cntUnit.y == 22))// && cntNebor.layer == 1) b = true; thisWave.Add(new ContactSimple(cntUnit,opposLay)); } } } } pntProcess.ProcessPoint(layoutMap[cntUnit.x][cntUnit.y][cntUnit.layer]); } return thisWave; }
private bool FindTrueSource(ContactSimple inCnt) { NodePoint sourcePoint = GetPoint(inCnt); if (!sourcePoint.isSource || sourcePoint.name == Material.blankName) return false; Node nd = nodeList.Find(el => el.name == sourcePoint.name); int coordY = Params.lineN; if ( inCnt.y < Params.lineMiddle ) coordY = Params.lineP; ContactSimple pin = new ContactSimple(inCnt.x, coordY, inCnt.layer); if (nd.arcCollection.FindIndex(el => el == pin) >= 0)//this node return true; return false; }