Implement batch scheduler as a SYSTEMC process
# Explain what has been changed # Explain why this change is being made # Provide links to any relevant tickets, articles or other resources
This commit is contained in:
@@ -68,8 +68,11 @@ void SMS::batchFormation()
|
||||
|
||||
void SMS::batchScheduler()
|
||||
{
|
||||
sc_time memClk = Configuration::getInstance().memSpec.clk;
|
||||
while (true)
|
||||
{
|
||||
wait(memClk);
|
||||
|
||||
srand(time(NULL));
|
||||
bool isSJF = (rand() % 100) < SJFprobability;
|
||||
if (!existReadyBatch())
|
||||
|
||||
@@ -26,10 +26,13 @@ public:
|
||||
memrequestcounter.emplace(Thread(threadID), 0);
|
||||
memoryIntensity.emplace(Thread(threadID), 0);
|
||||
}
|
||||
SC_THREAD(batchScheduler);
|
||||
}
|
||||
SC_HAS_PROCESS(SMS);
|
||||
virtual ~SMS(){}
|
||||
virtual void schedule(gp *payload) override;
|
||||
virtual std::pair<Command, gp*> getNextRequest(Bank bank) override;
|
||||
void batchScheduler();
|
||||
|
||||
private:
|
||||
std::map<Thread, std::deque<gp*>> buffer;
|
||||
@@ -40,7 +43,6 @@ private:
|
||||
std::map<Thread, float> memoryIntensity;
|
||||
unsigned int SJFprobability;
|
||||
|
||||
void batchScheduler();
|
||||
unsigned int totalMemoryRequests();
|
||||
void batchFormation();
|
||||
void selectSJF();
|
||||
|
||||
Reference in New Issue
Block a user