Browse Source

fix routing new wafer algorithm bug and add throughput trace log.

sangwq 10 months ago
parent
commit
8cb06f14db

+ 1 - 0
Venus/Venus_Core/EventDefine.cs

@@ -109,5 +109,6 @@ namespace Aitex.Core.RT.Log{
 		ERR_FA = 6003,
 		WARN_FA = 6004,
 		INFO_DEVICE_IO_MAGNET = 6005,
+		INFO_TROUGHPUT_ENHANCE_TRACE = 8888,
 	}
 }

+ 9 - 0
Venus/Venus_RT/Config/LogDefine.json

@@ -973,5 +973,14 @@
     "GlobalDescription_en": "IO Magnet Log: {0}",
     "Module": "PM",
     "Note": "IO Magnet Info"
+  },
+  {
+    "Id": 8888,
+    "Level": "Info",
+    "LogEnum": "INFO_TROUGHPUT_ENHANCE_TRACE",
+    "GlobalDescription_zh": "Throughput enhancement: {0}",
+    "GlobalDescription_en": "Throughput enhancement: {0}",
+    "Module": "System",
+    "Note": "Throughput enhancement: "
   }
 ]

+ 35 - 33
Venus/Venus_RT/Modules/SystemDispatcher.cs

@@ -962,6 +962,12 @@ namespace Venus_RT.Modules
             _cycleWatch.Stop();
             Clear();
 
+            // reset cycle/throughput couter
+            _lpCycleWafer = new Dictionary<ModuleName, int> { { ModuleName.LP1, 0 }, { ModuleName.LP2, 0 }, { ModuleName.LP3, 0 } };
+            _lpCycleCount = new Dictionary<ModuleName, int> { { ModuleName.LP1, 0 }, { ModuleName.LP2, 0 }, { ModuleName.LP3, 0 } };
+            _lpCycleSP = new Dictionary<ModuleName, int> { { ModuleName.LP1, 1 }, { ModuleName.LP2, 1 }, { ModuleName.LP3, 1 } };
+            _lpThroughput = new Dictionary<ModuleName, float> { { ModuleName.LP1, 0 }, { ModuleName.LP2, 0 }, { ModuleName.LP3, 0 } };
+
             return RState.Running;
         }
 
@@ -1362,11 +1368,10 @@ namespace Venus_RT.Modules
                 _cycleWatch.Restart();
             }
 
-            if (!_lpCycleWafer.Keys.Contains(ModuleHelper.Converter(cj.Module)))
-            {
-                _lpCycleCount.Add(ModuleHelper.Converter(cj.Module), 0);
-                _lpCycleWafer.Add(ModuleHelper.Converter(cj.Module), 0);
-            }
+            var lp = ModuleHelper.Converter(cj.Module);
+            _lpCycleCount[lp] = 0;
+            _lpCycleWafer[lp] = 0;
+            _lpThroughput[lp] = 0;
 
             _cycleState = RState.Running;
             return true;
@@ -1386,11 +1391,6 @@ namespace Venus_RT.Modules
                 _loadportControlJobDic[key] = null;
             }
 
-            _lpCycleWafer = new Dictionary<ModuleName, int> { { ModuleName.LP1, 0 }, { ModuleName.LP2, 0 }, { ModuleName.LP3, 0 } };
-            _lpCycleCount = new Dictionary<ModuleName, int> { { ModuleName.LP1, 0 }, { ModuleName.LP2, 0 }, { ModuleName.LP3, 0 } };
-            _lpCycleSP = new Dictionary<ModuleName, int> { { ModuleName.LP1, 1 }, { ModuleName.LP2, 1 }, { ModuleName.LP3, 1 } };
-            _lpThroughput = new Dictionary<ModuleName, float> { { ModuleName.LP1, 0 }, { ModuleName.LP2, 0 }, { ModuleName.LP3, 0 } };
-
             _lstWaferTasks.Clear();
             _qeWaitInWafers.Clear();
             _tmSchdActions.Clear();
@@ -2108,7 +2108,7 @@ namespace Venus_RT.Modules
                 {
                     if (_dictModuleTask[pm].Scheduler.IsOnline && !onDutyPms.ContainsKey(pm))
                     {
-                        onDutyPms[pm] = _lstWaferTasks.Where(wt => wt.destMod == pm).Count();
+                        onDutyPms[pm] = _lstWaferTasks.Where(wt => wt.destMod == pm || wt.currentMod == pm).Count();
                     }
                 }
             }
@@ -2189,6 +2189,8 @@ namespace Venus_RT.Modules
 
             _lstWaferTasks.Add(waferTask);
             _qeWaitInWafers.Enqueue(wafer.InnerId);
+
+            LOG.Write(eEvent.INFO_TROUGHPUT_ENHANCE_TRACE, waferTask.sourceMod, $"Routing wafer: {waferTask.sourceMod}.{waferTask.sourceSlot + 1} to {pm}");
         }
 
         private void ReDispatchBlockingWafers()
@@ -3191,46 +3193,46 @@ namespace Venus_RT.Modules
                 
                 if(robotWafers.Count == 0)
                 {
-                    // push wafer from LL to PM and avoid blocking two robot arms
-                    if (inLLModule.ReayForTMInTime(10) && inLLWaferStatus.inSlot.Count > 0)
+                    // keep out loadlock readyForTM State after put one wafer and wait for another out wafer
+                    var readyOutPMs = _dictModuleTask.Where(mod => ModuleHelper.IsPm(mod.Key) && mod.Value.HasWafer && mod.Value.TimeToReady < 20).OrderBy(mod => mod.Value.TimeToReady).ToList();
+                    if (readyOutPMs.Count > 0 && outLLModule.ReayForTMInTime(30) && outLLWaferStatus.emptySlot.Count > 0)
                     {
-                        var pickActions = new List<MoveItem>();
-                        var inLLWafers = _lstWaferTasks.FindAll(wt => wt.currentMod == inLL).ToList();
-                        if (inLLWaferStatus.inSlot.Count < 2 || inLLWafers.Exists(wt => !_dictModuleTask[wt.destMod].HasWafer && _dictModuleTask[wt.destMod].TimeToReady < 20))
+                        var placeActions = new List<MoveItem>();
+                        int pickCount = 0;
+                        foreach (var pm in readyOutPMs)
                         {
-                            for (int i = 0; i < Math.Min(inLLWaferStatus.inSlot.Count, freeHands.Count); i++)
+                            var pmWafer = _lstWaferTasks.Find(wt => wt.currentMod == pm.Key);
+                            if (pmWafer != null && pickCount < freeHands.Count && pickCount < outLLWaferStatus.emptySlot.Count)
                             {
-                                pickActions.Add(new MoveItem(inLL, inLLWaferStatus.inSlot[i], ModuleName.TMRobot, (int)freeHands[i], freeHands[i]));
+                                _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(pm.Key, 0, ModuleName.TMRobot, (int)freeHands[pickCount], freeHands[pickCount]) });
+                                placeActions.Add(new MoveItem(ModuleName.TMRobot, (int)freeHands[pickCount], outLL, outLLWaferStatus.emptySlot[pickCount], freeHands[pickCount]));
+                                pickCount++;
                             }
                         }
 
-                        if(pickActions.Count > 0)
+                        if (pickCount > 0)
                         {
-                            _tmSchdActions.Enqueue(pickActions);
+                            _tmSchdActions.Enqueue(placeActions);
                             return;
                         }
                     }
 
-                    // keep out loadlock readyForTM State after put one wafer and wait for another out wafer
-                    var readyOutPMs = _dictModuleTask.Where(mod => ModuleHelper.IsPm(mod.Key) && mod.Value.HasWafer && mod.Value.TimeToReady < 20).OrderBy(mod => mod.Value.TimeToReady).ToList();
-                    if(readyOutPMs.Count > 0 && outLLModule.ReayForTMInTime(30) && outLLWaferStatus.emptySlot.Count > 0)
+                    // push wafer from LL to PM and avoid blocking two robot arms
+                    if (inLLModule.ReayForTMInTime(10) && inLLWaferStatus.inSlot.Count > 0)
                     {
-                        var placeActions = new List<MoveItem>();
-                        int pickCount = 0;
-                        foreach(var pm in readyOutPMs)
+                        var pickActions = new List<MoveItem>();
+                        var inLLWafers = _lstWaferTasks.FindAll(wt => wt.currentMod == inLL).ToList();
+                        if (inLLWaferStatus.inSlot.Count < 2 || inLLWafers.Exists(wt => !_dictModuleTask[wt.destMod].HasWafer && _dictModuleTask[wt.destMod].TimeToReady < 20))
                         {
-                            var pmWafer = _lstWaferTasks.Find(wt => wt.currentMod == pm.Key);
-                            if(pmWafer != null && pickCount < freeHands.Count && pickCount < outLLWaferStatus.emptySlot.Count)
+                            for (int i = 0; i < Math.Min(inLLWaferStatus.inSlot.Count, freeHands.Count); i++)
                             {
-                                _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(pm.Key, 0, ModuleName.TMRobot, (int)freeHands[pickCount], freeHands[pickCount]) });
-                                placeActions.Add(new MoveItem(ModuleName.TMRobot, (int)freeHands[pickCount], outLL, outLLWaferStatus.emptySlot[pickCount], freeHands[pickCount]));
-                                pickCount++;    
+                                pickActions.Add(new MoveItem(inLL, inLLWaferStatus.inSlot[i], ModuleName.TMRobot, (int)freeHands[i], freeHands[i]));
                             }
                         }
 
-                        if(pickCount > 0)
+                        if(pickActions.Count > 0)
                         {
-                            _tmSchdActions.Enqueue(placeActions);
+                            _tmSchdActions.Enqueue(pickActions);
                             return;
                         }
                     }