I vote to get rid of the dead code, if someone needs that function later, can code it up. Rather than wasting storage, compile time, and your time to read/understand the code.
Jack Harvard On Sat, Aug 11, 2012 at 11:17 AM, Nathanaël Prémillieu <[email protected]> wrote: > Hi Ali, > > While the numLoadsReady function is indeed not used at the moment, why would > you want to remove it? This code can be useful in the future. Moreover, the > bug is quite easy to correct (you just have to increment load_idx). So > should I provide a patch that correct the bug or one that remove the code ? > > Thanks, > > Nathanaël > > Le 10/08/2012 18:45, Ali Saidi a écrit : > >> >> >> Hi Nathanaël, >> >> Thanks again for your continued feedback and bug >> reporting. We really appreciate it. It looks like you've found another >> issue. Both the LSQ unit code and the LSQ numLoadsReady seems to suffer >> from this problem. Could you post a patch to review board with all this >> code removed that we could commit? >> >> Thanks again, >> >> Ali >> >> On 09.08.2012 >> 09:36, Nathanaël Prémillieu wrote: >> >>> Hi all, >>> I am currently trying >> >> to learn how the O3 cpu model is working. While >>> >>> reading the code, I >> >> have found this function (in >>> >>> src/cpu/o3/lsq_unit_impl.hh): >>> >>> >> template >>> >>> int >>> LSQUnit::numLoadsReady() >>> { >>> int load_idx = >> >> loadHead; >>> >>> int retval = 0; >>> >>> while (load_idx != loadTail) { >>> >> assert(loadQueue[load_idx]); >>> >>> >>> if >> >> (loadQueue[load_idx]->readyToIssue()) { >>> >>> ++retval; >>> } >>> } >>> >>> return >> >> retval; >>> >>> } >>> >>> As the load_idx is never changed, this is an infinite >> >> loop. >>> >>> >>> Fortunately, this function seems not to be used in the global >> >> code. But >>> >>> I think leaving a bug even in dead code is not a good >> >> idea. >>> >>> >>> Thanks, >>> >>> Nathanaël Prémillieu >>> >> _______________________________________________ >>> >>> gem5-dev mailing >> >> list >>> >>> [email protected] >>> http://m5sim.org/mailman/listinfo/gem5-dev >> >> >> >> _______________________________________________ >> gem5-dev mailing list >> [email protected] >> http://m5sim.org/mailman/listinfo/gem5-dev >> > _______________________________________________ > gem5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/gem5-dev _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
