The checkSignalsAndUpdate() routine seems to be taking care of > squashes for each thread. FirstStage::processStage() proceeds to fetch > instructions after that. So, why not just insert the check on > drainPending between the two tasks? Let me know if my understanding is > incorrect. >
Yea, I just double checked this and you are probably on the right path in terms of where to insert the drainPending check at (Although checkSignals should be checking both squash and stall signals , not just stall signals).. Ideally, that checkSignals function should also be able to set the pipeline stage to a "Blocked" state such that that processThread functions never gets called if the stage is blocked in the first place. Since the "drain Pending" can essentially be seen as a signal to the CPU it might be best to somehow fit that in the checkSignals function. BUT, if you put something in checkSignals it's going to affect all of the pipeline stages and we dont want to block all the pipeline stages, just the first one. So it's better to just edit the code in first_stage.cc in the place you suggested. Yes, this is pretty simple. Since instDone() only schedules > instructions to be removed from the global instruction list of active > instructions, I added this logic in cleanUpRemovedInsts(). > Okay, so you're saying that you need to catch instructions that might get squashed and instDone() will only catch committed instructions... If possible, It'd be nice to keep that functionality out of cleanUpRemovedInsts since I believe that function is primarily for memory management purposes and we dont want to confuse things. Hmmm....I'm wondering if there isnt a "removeFromActiveList" function (and if not, do we need to write one), so that we can add a check there for the drainPending. Would that make sense for a more general solution? -- - Korey
_______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
