Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/mem/dcmem_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ DCMemInterface::DCMemInterface(const DCMemInterfaceParams &_p)
{}

void
DCMemInterface::setCtrl(DcacheCtrl* _ctrl, unsigned int command_window)
DCMemInterface::setCtrl(QoS::MemCtrl* _ctrl, unsigned int command_window)
{
ctrl = _ctrl;
if (dynamic_cast<DcacheCtrl*>(_ctrl) != nullptr) {
ctrl = dynamic_cast<DcacheCtrl*>(_ctrl);
} else {
ctrl = dynamic_cast<MemCtrl*>(_ctrl);
}
maxCommandsPerWindow = command_window / tCK;
}

Expand Down
6 changes: 4 additions & 2 deletions src/mem/dcmem_interface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "mem/abstract_mem.hh"
#include "mem/dcache_ctrl.hh"
#include "mem/dramcachepower.hh"
#include "mem/mem_ctrl.hh"
#include "mem/qos/mem_ctrl.hh"
#include "params/DCMemInterface.hh"
#include "params/DRAMDCInterface.hh"
#include "params/NVMDCInterface.hh"
Expand Down Expand Up @@ -67,7 +69,7 @@ class DCMemInterface : public AbstractMemory
/**
* A pointer to the parent DcacheCtrl instance
*/
DcacheCtrl* ctrl;
QoS::MemCtrl* ctrl;

/**
* Number of commands that can issue in the defined controller
Expand Down Expand Up @@ -139,7 +141,7 @@ class DCMemInterface : public AbstractMemory
* @param command_window size of command window used to
* check command bandwidth
*/
void setCtrl(DcacheCtrl* _ctrl, unsigned int command_window);
void setCtrl(QoS::MemCtrl* _ctrl, unsigned int command_window);

/**
* Get an address in a dense range which starts from 0. The input
Expand Down
34 changes: 34 additions & 0 deletions src/mem/qos/mem_ctrl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,40 @@ class MemCtrl : public ClockedObject
*/
BusState getBusState() const { return busState; }

/**some virtual functions
* that will be implemented in the mem
* controllers
*/
virtual Tick verifyMultiCmd(Tick cmd_tick, Tick max_cmds_per_burst,
Tick max_multi_cmd_split = 0) {
panic("QoS::MemCtrl verifyMultiCmd should not be called \n");
return curTick();
};

virtual Tick verifySingleCmd(Tick cmd_tick, Tick max_cmds_per_burst) {
panic("QoS::MemCtrl verifySingleCmd should not be called \n");
return curTick();
};

virtual bool inReadBusState(bool next_state) const {
panic("QoS::MemCtrl inReadBusState should not be called \n");
return false;
};

virtual bool inWriteBusState(bool next_state) const {
panic("QoS::MemCtrl inWriteBusState should not be called \n");
return false;
};

virtual bool requestEventScheduled() const {
panic("QoS::MemCtrl requestEventScheduled wrongly called \n");
return false;
};

virtual void restartScheduler(Tick tick) {
panic("QoS::MemCtrl restartScheduler should not be called \n");
};

/**
* Gets the next bus state
*
Expand Down