Finish multiple ready batch formation
This commit is contained in:
@@ -54,19 +54,36 @@ void SMS::batchScheduler()
|
||||
|
||||
while (true)
|
||||
{
|
||||
// updateMPKCs(memClk);
|
||||
// if (isRequestBuffersEmpty() && !existReadyBatches()) {
|
||||
// wait(newRequest);
|
||||
// } else {
|
||||
// batchFormation(memClk);
|
||||
// if (existReadyBatches()) {
|
||||
// if (!isSystemLightlyLoaded() && (existLowIntensityThread() || distribution(generator))) {
|
||||
// selectSJF(memClk);
|
||||
// } else {
|
||||
// selectRR(memClk);
|
||||
// }
|
||||
// } else {
|
||||
// wait(memClk);
|
||||
// }
|
||||
// }
|
||||
updateMPKCs(memClk);
|
||||
if (isRequestBuffersEmpty() && !existReadyBatches()) {
|
||||
wait(newRequest);
|
||||
if (isRequestBuffersEmpty()) {
|
||||
wait(newRequest);
|
||||
} else {
|
||||
batchFormation(memClk);
|
||||
if (existReadyBatches()) {
|
||||
if (!isSystemLightlyLoaded() && (existLowIntensityThread() || distribution(generator))) {
|
||||
selectSJF(memClk);
|
||||
} else {
|
||||
selectRR(memClk);
|
||||
multiBatchFormation(memClk);
|
||||
if (!isSystemLightlyLoaded() && (existLowIntensityThread() || distribution(generator))) {
|
||||
if (pickSJF()) {
|
||||
drain(memClk, readyBatchesIter[(*lastSelectedThread).first].front());
|
||||
readyBatchesIter[(*lastSelectedThread).first].pop_front();
|
||||
}
|
||||
} else {
|
||||
wait(memClk);
|
||||
if (pickRR()) {
|
||||
drain(memClk, readyBatchesIter[(*lastSelectedThread).first].front());
|
||||
readyBatchesIter[(*lastSelectedThread).first].pop_front();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ public:
|
||||
SMS(sc_module_name /*_name*/, ControllerCore &controllerCore, unsigned int SJFprobability) : IScheduler(controllerCore), SJFprobability(SJFprobability), debugManager(DebugManager::getInstance())
|
||||
{
|
||||
// initialize selected thread iterator
|
||||
lastSelectedThread = readybatches.end();
|
||||
// lastSelectedThread = requestBuffers.end();
|
||||
// lastSelectedThread = readybatches.end();
|
||||
lastSelectedThread = requestBuffers.end();
|
||||
SC_THREAD(batchScheduler);
|
||||
}
|
||||
SC_HAS_PROCESS(SMS);
|
||||
|
||||
Reference in New Issue
Block a user