Code refactoring.
This commit is contained in:
@@ -47,7 +47,7 @@ std::pair<Command, tlm::tlm_generic_payload *> Fifo::getNextRequest(Bank bank)
|
||||
if (!buffer[bank].empty())
|
||||
{
|
||||
gp *payload = buffer[bank].front();
|
||||
Command command = IScheduler::getNextCommand(*payload);
|
||||
Command command = IScheduler::getNextCommand(payload);
|
||||
if (command == Command::Read || command == Command::ReadA
|
||||
|| command == Command::Write || command == Command::WriteA)
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ std::pair<Command, tlm::tlm_generic_payload *> FifoStrict::getNextRequest(
|
||||
// case of an already open row (due to a previous request) the
|
||||
// command itself could be directly issued.
|
||||
//
|
||||
Command command = IScheduler::getNextCommand(*payload);
|
||||
Command command = IScheduler::getNextCommand(payload);
|
||||
|
||||
if (commandIsIn(command, {Command::Read, Command::Write, Command::ReadA, Command::WriteA})) {
|
||||
buffer.pop_front();
|
||||
@@ -84,7 +84,7 @@ std::pair<Command, tlm::tlm_generic_payload *> FifoStrict::getNextRequest(
|
||||
|
||||
if (!buffer.empty()) {
|
||||
tlm::tlm_generic_payload *p = buffer.front().second;
|
||||
Command cmd = IScheduler::getNextCommand(*p);
|
||||
Command cmd = IScheduler::getNextCommand(p);
|
||||
if (commandIsIn(cmd, {Command::Read, Command::Write, Command::ReadA, Command::WriteA})) {
|
||||
Bank b = DramExtension::getBank(p);
|
||||
controller.blockedRequests.push(b);
|
||||
@@ -110,7 +110,7 @@ std::pair<Command, tlm::tlm_generic_payload *> FifoStrict::getNextRequest(
|
||||
// Reads and writes will not be issued since this
|
||||
// scheduler executes all read and writes in a strict
|
||||
// order.
|
||||
Command command = getNextCommand(*payload);
|
||||
Command command = getNextCommand(payload);
|
||||
if (commandIsIn(command, {Command::Read, Command::Write, Command::ReadA, Command::WriteA})) {
|
||||
// Reads and writes must be executed in order. Then if
|
||||
// the next command for this request is read or write
|
||||
|
||||
@@ -81,7 +81,7 @@ std::pair<Command, gp *> FR_FCFS::getNextRequest(Bank bank)
|
||||
if (it != buffer[bank].end()) {
|
||||
gp *payload = *it;
|
||||
buffer[bank].erase(it);
|
||||
return pair<Command, gp *>(getReadWriteCommand(*payload), payload);
|
||||
return pair<Command, gp *>(getReadWriteCommand(payload), payload);
|
||||
}
|
||||
|
||||
// If there is no row hit, the FR_FCFS takes always the oldest transaction
|
||||
|
||||
@@ -74,7 +74,7 @@ std::pair<Command, gp *> FR_FCFS_GRP::getNextRequest(Bank bank)
|
||||
if (hazardDetection(bank, it) == false) {
|
||||
buffer[bank].erase(it);
|
||||
printDebugMessage("Read Hit found");
|
||||
return pair<Command, gp *>(getReadWriteCommand(*read),
|
||||
return pair<Command, gp *>(getReadWriteCommand(read),
|
||||
read);
|
||||
} else {
|
||||
// If there was a hazard, switch the mode and try again:
|
||||
@@ -112,7 +112,7 @@ std::pair<Command, gp *> FR_FCFS_GRP::getNextRequest(Bank bank)
|
||||
.getRowInRowBuffer(bank)) {
|
||||
buffer[bank].erase(it);
|
||||
printDebugMessage("Write Hit found");
|
||||
return pair<Command, gp *>(getReadWriteCommand(*write),
|
||||
return pair<Command, gp *>(getReadWriteCommand(write),
|
||||
write);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ std::pair<Command, gp *> FR_FCFS_RP::getNextRequest(Bank bank)
|
||||
if (hazardDetection(bank, it) == false) {
|
||||
buffer[bank].erase(it);
|
||||
printDebugMessage("Read Hit found");
|
||||
return pair<Command, gp *>(getReadWriteCommand(*read), read);
|
||||
return pair<Command, gp *>(getReadWriteCommand(read), read);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ std::pair<Command, gp *> FR_FCFS_RP::getNextRequest(Bank bank)
|
||||
== controllerCore.getRowBufferStates().getRowInRowBuffer(bank)) {
|
||||
buffer[bank].erase(it);
|
||||
printDebugMessage("Write Hit found");
|
||||
return pair<Command, gp *>(getReadWriteCommand(*write), write);
|
||||
return pair<Command, gp *>(getReadWriteCommand(write), write);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ std::pair<Command, gp *> SMS::getNextRequest(Bank bank)
|
||||
return pair<Command, tlm::tlm_generic_payload *>(Command::NOP, NULL);
|
||||
} else {
|
||||
gp *payload = bankBuffers[bank].front();
|
||||
Command command = IScheduler::getNextCommand(*payload);
|
||||
Command command = IScheduler::getNextCommand(payload);
|
||||
if (command == Command::Read || command == Command::ReadA
|
||||
|| command == Command::Write
|
||||
|| command == Command::WriteA) {
|
||||
|
||||
@@ -74,7 +74,7 @@ std::pair<Command, gp *> GRP::getNextRequest(Bank bank)
|
||||
if (hazardDetection(bank, it) == false) {
|
||||
buffer[bank].erase(it);
|
||||
printDebugMessage("Read Hit found");
|
||||
return pair<Command, gp *>(getReadWriteCommand(*read),
|
||||
return pair<Command, gp *>(getReadWriteCommand(read),
|
||||
read);
|
||||
} else {
|
||||
// If there was a hazard, switch the mode and try again:
|
||||
@@ -106,7 +106,7 @@ std::pair<Command, gp *> GRP::getNextRequest(Bank bank)
|
||||
.getRowInRowBuffer(bank)) {
|
||||
buffer[bank].erase(it);
|
||||
printDebugMessage("Write Hit found");
|
||||
return pair<Command, gp *>(getReadWriteCommand(*write),
|
||||
return pair<Command, gp *>(getReadWriteCommand(write),
|
||||
write);
|
||||
} else {
|
||||
printDebugMessage("Write miss found");
|
||||
|
||||
Reference in New Issue
Block a user