From 0406a30bba21a460a7d195100b23212fef92070e Mon Sep 17 00:00:00 2001 From: jigglypuff96 Date: Fri, 22 Nov 2024 12:20:20 -0500 Subject: [PATCH] removed extra comments --- timing/rob/rob.go | 65 +++++------------------------------------------ 1 file changed, 7 insertions(+), 58 deletions(-) diff --git a/timing/rob/rob.go b/timing/rob/rob.go index 4ba4a866..f439d408 100644 --- a/timing/rob/rob.go +++ b/timing/rob/rob.go @@ -118,9 +118,6 @@ func (b *ReorderBuffer) discardTransactions( b.toBottomReqIDToTransactionTable = make(map[string]*list.Element) b.transactions.Init() b.controlPort.Retrieve(now) - - // fmt.Printf("%.10f, %s, rob flushed\n", now, b.Name()) - return true } @@ -196,16 +193,13 @@ func (b *ReorderBuffer) topDown(now sim.VTimeInSec) bool { req := item.(mem.AccessReq) if b.isFull() { tracing.TraceDelay(req, b, b.topPort.Name(), now, "Delay", "Resources/storage not available", "rob") - // 0506 b.topPort.Name() -> b.Name()+".Buffer" return false } - // 加progress 记时间 trans := b.createTransaction(req) trans.reqToBottom.Meta().Src = b.bottomPort trans.reqToBottom.Meta().SendTime = now err := b.bottomPort.Send(trans.reqToBottom) - // 0506 这是send to bottomPort的意思 ,而不是 从 bottomPort send吧? if err != nil { tracing.TraceDelay(req, b, b.topPort.Name(), now, "Delay", "Port network not available", "rob") return false @@ -213,7 +207,6 @@ func (b *ReorderBuffer) topDown(now sim.VTimeInSec) bool { b.topPort.Retrieve(now) tracing.TraceReqReceive(req, b) - // 0506 一个新的req_in 产生了!但它的req_out什么时候出现呢? trans.reqOutTaskID = req.Meta().ID+"_req_out"; currentProgressID := req.Meta().ID+"_"+b.topPort.Name(); @@ -222,17 +215,10 @@ func (b *ReorderBuffer) topDown(now sim.VTimeInSec) bool { tracing.TraceDependency(currentProgressID, b, dependentIDs) - parentTaskID := tracing.MsgIDAtReceiver(req, b); // 0506 这是个req_in + parentTaskID := tracing.MsgIDAtReceiver(req, b); tracing.TraceReqInitiate(trans.reqToBottom, b, parentTaskID) - // taskID := tracing.TraceReqInitiate(trans.reqToBottom, b, - // parentTaskID) - // 它的req_out 出现了!但这其中似乎没有任何delay的空间? trans.reqInTaskID = parentTaskID; - - //0506 从 req_in发下去了,并req_out那条bar也建立了 - // progressID := req.Meta().ID+"_"+b.topPort.Name(); - // tracing.TraceProgress(progressID, trans.reqInTaskID, b, now, "rob", "Initiate request"); b.addTransaction(trans) return true @@ -246,49 +232,21 @@ func (b *ReorderBuffer) parseBottom(now sim.VTimeInSec) bool { } rsp := item.(mem.AccessRsp) - rspTo := rsp.GetRspTo() //0506 ID of corresponding task that would receive the response + rspTo := rsp.GetRspTo() transElement, found := b.toBottomReqIDToTransactionTable[rspTo] if found { - //0506 这里found了 所以就把这个transaction完成 trans := transElement.Value.(*transaction) trans.rspFromBottom = rsp tracing.TraceReqFinalize(trans.reqToBottom, b) - // taskID := tracing.TraceReqFinalize(trans.reqToBottom, b) - // 0506 terminates the message task。sender receive response那这算是 发出response的task还是收到response的task的step呢? - // receiverTaskID := fmt.Sprintf("%s@%s", rspTo, b.Name()); // 0506 cannot directly use tracing.MsgIDAtReceiver(rsp, b); 因为是rspTo 在receive transactionProgressID := sim.GetIDGenerator().Generate() - // tracing.TraceProgress(transactionProgressID, trans.reqOutTaskID, b, now, "rob") tracing.TraceProgress(transactionProgressID, trans.reqInTaskID, b, now, "rob", "Data not available") //0506 dependentIDs := b.PrintParseBottomTransactions(); tracing.TraceDependency(transactionProgressID, b, dependentIDs); - - //???? } - // 0506 那如果没有 found呢?就不用end message了?因为没有message task可end?就看看bottom port里有什么就拿什么 - // 没found,就被discard (page migration相关 不用考虑) b.bottomPort.Retrieve(now) - // msg := b.bottomPort.Retrieve(now) - // 这里是说 bottomPort就紧接着那一个新的任务可以下次输出,所以这里不能算一个progress - // 0506 这里和上面的 b.topPort.Retrieve(now)对比 为什么retrieve之后没有再建一个新的task?难道是完成了当时的req_out task? - // 0506 为什么msg.RespondTo() 的ID和rspTo的id不一样? - // 查询了一下trace结果,好像并没有msg.RespondTo()的ID对应的task - - - // tracing.TraceDelay(rsp, b, b.bottomPort.Name(), now, "Step", "", "rob") - // dependentIDs := extractIDs(b.bottomPort.GetAllBufferElements()); - // tracing.TraceDependency(rsp, b, dependentIDs) - - // bottomPortProgressID := sim.GetIDGenerator().Generate(); - // tracing.TraceProgress(bottomPortProgressID, "", b, now, "rob") - // dependentIDs := extractIDs(b.bottomPort.GetAllBufferElements(), b.bottomPort.Name()); - // tracing.TraceDependency(bottomPortProgressID, b, dependentIDs) - - // dependeIDs2 := b.PrintParseBottomTransactions(); - // tracing.TraceDependency(rsp, b, dependeIDs2) - return true } @@ -303,14 +261,13 @@ func (b *ReorderBuffer) bottomUp(now sim.VTimeInSec) bool { trans := elem.Value.(*transaction) if trans.rspFromBottom == nil { - tracing.TraceDelay(trans.reqFromTop, b, b.bottomPort.Name(), now, "Delay", "data not available", "rob") //??? - // tracing.TraceDelay(now, b, "rob") // Jijie: add id, data not available + tracing.TraceDelay(trans.reqFromTop, b, b.bottomPort.Name(), now, "Delay", "data not available", "rob") + // tracing.TraceDelay(now, b, "rob") //TODO: add id, data not available return false } transactionProgressID := sim.GetIDGenerator().Generate(); - tracing.TraceProgress(transactionProgressID, trans.reqInTaskID, b, now, "rob", "Data not available") // 改成记录第一次成功的时间, 判断有没有记录过 + tracing.TraceProgress(transactionProgressID, trans.reqInTaskID, b, now, "rob", "Data not available") - //0506有来自bottomport的response了,可以往上发了 rsp := b.duplicateRsp(trans.rspFromBottom, trans.reqFromTop.Meta().ID) rsp.Meta().Dst = trans.reqFromTop.Meta().Src @@ -318,28 +275,20 @@ func (b *ReorderBuffer) bottomUp(now sim.VTimeInSec) bool { rsp.Meta().SendTime = now err := b.topPort.Send(rsp) - //0506 应该要往上发了 从topPort send出去? 不是应该send 到topPort吗? if err != nil { // Port network not available - tracing.TraceDelay(trans.rspFromBottom, b, b.topPort.Name(), now, "Delay", "Port network not available", "rob") //??? + tracing.TraceDelay(trans.rspFromBottom, b, b.topPort.Name(), now, "Delay", "Port network not available", "rob") fmt.Printf("Delay, no available top port: %.20f\n", now) return false } - //0506下面往上发完了 ? 上面收完了?上面发完了? - // tracing.TraceDelay(trans.rspFromBottom, b, "", now, "Step", "", "rob") // b.topPort.Name() 变成空着 0318 done transactionProgressID = sim.GetIDGenerator().Generate(); - // tracing.TraceProgress(transactionProgressID, trans.reqOutTaskID, b, now, "rob") - // receiverTaskID := rsp.GetRspTo(); - // tracing.TraceProgress(transactionProgressID, receiverTaskID, b, now, "rob") - tracing.TraceProgress(transactionProgressID, trans.reqInTaskID, b, now, "rob", "Port network not available")//050666 + tracing.TraceProgress(transactionProgressID, trans.reqInTaskID, b, now, "rob", "Port network not available") dependentIDs := b.PrintBottomUpTransactions(); - // dependentIDs := extractIDs(b.topPort.GetAllBufferElements()); // b.transactions Jijie todo 0318 遍历 并且反过来 tracing.TraceDependency(transactionProgressID, b, dependentIDs) b.deleteTransaction(elem) tracing.TraceReqComplete(trans.reqFromTop, b) - // 0506此transaction正式完结,需要一个额外的progress吗? return true