Improved FR_FCFS_GRP
This commit is contained in:
@@ -61,7 +61,7 @@ void Controller::buildScheduler()
|
||||
}
|
||||
else if (selectedScheduler == "FR_FCFS_GRP")
|
||||
{
|
||||
scheduler = new FR_FCFS_GRP(*controllerCore);
|
||||
scheduler = new FR_FCFS_GRP(*controllerCore,this);
|
||||
}
|
||||
else if (selectedScheduler == "SMS")
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ using namespace tlm;
|
||||
|
||||
DECLARE_EXTENDED_PHASE(PendingRequest);
|
||||
|
||||
struct Controller: public sc_module, public IController
|
||||
class Controller: public sc_module, public IController
|
||||
{
|
||||
public:
|
||||
Controller(sc_module_name /*name*/, TlmRecorder *rec) :
|
||||
@@ -109,12 +109,12 @@ public:
|
||||
tlm_utils::simple_initiator_socket<Controller> iSocket;
|
||||
tlm_utils::simple_target_socket<Controller> tSocket;
|
||||
unsigned int getTotalNumberOfPayloadsInSystem();
|
||||
void scheduleNextFromScheduler(Bank bank) override;
|
||||
|
||||
private:
|
||||
void buildScheduler();
|
||||
void payloadEntersSystem(tlm_generic_payload& payload);
|
||||
void payloadLeavesSystem(tlm_generic_payload& payload);
|
||||
void scheduleNextFromScheduler(Bank bank) override;
|
||||
|
||||
// --- FRONTEND ------
|
||||
tlm_sync_enum nb_transport_fw(tlm_generic_payload& payload, tlm_phase& phase, sc_time& fwDelay);
|
||||
|
||||
@@ -154,11 +154,23 @@ std::pair<Command, gp*> FR_FCFS_GRP::getNextRequest(Bank bank)
|
||||
}
|
||||
}
|
||||
|
||||
// If nothing was found we check the other banks before we switch the mode:
|
||||
pair<Command, gp*> other(Command::NOP, NULL);
|
||||
unsigned int B = Configuration::getInstance().memSpec.NumberOfBanks;
|
||||
|
||||
for(unsigned int i=1; i<B; i++)
|
||||
{
|
||||
Bank nextBank((bank.ID()+i) % B);
|
||||
ctrl->scheduleNextFromScheduler(nextBank);
|
||||
}
|
||||
|
||||
// If nothing was found in the current mode, switch the mode and try again:
|
||||
// FIXME: this is in my opinion not so clever yet, because we switch maybe
|
||||
// even though there are still reads/writes request on other banks ...
|
||||
readMode = !readMode;
|
||||
return getNextRequest(bank);
|
||||
|
||||
reportFatal("FR_FCFS_RP", "Never should go here ...");
|
||||
reportFatal("FR_FCFS_GRP", "Never should go here ...");
|
||||
}
|
||||
|
||||
// There is a hazard if a read is found which will be scheduled before a write
|
||||
|
||||
@@ -37,19 +37,26 @@
|
||||
#define FR_FCFS_GROUPER_H
|
||||
|
||||
#include "Fr_Fcfs.h"
|
||||
#include "../Controller.h"
|
||||
|
||||
class Controller;
|
||||
|
||||
class FR_FCFS_GRP : public FR_FCFS
|
||||
{
|
||||
public:
|
||||
FR_FCFS_GRP(ControllerCore &controllerCore) : FR_FCFS(controllerCore),
|
||||
readMode(true)
|
||||
{}
|
||||
FR_FCFS_GRP(ControllerCore &controllerCore, Controller * c) :
|
||||
FR_FCFS(controllerCore),
|
||||
ctrl(c),
|
||||
readMode(true)
|
||||
{
|
||||
}
|
||||
|
||||
std::pair<Command, tlm::tlm_generic_payload*>
|
||||
getNextRequest(Bank bank) override;
|
||||
|
||||
private:
|
||||
|
||||
Controller * ctrl;
|
||||
bool hazardDetection(Bank bank, std::deque<gp*>::iterator ext);
|
||||
unsigned int getNumberOfRequest(tlm::tlm_command cmd);
|
||||
void printDebugMessage(std::string message);
|
||||
|
||||
Reference in New Issue
Block a user