Included doxygen config.

This commit is contained in:
Lukas Steiner Laptop
2019-06-03 15:42:50 +02:00
parent b96121b4f8
commit fb781882f7
4 changed files with 1278 additions and 42 deletions

1
.gitignore vendored
View File

@@ -21,3 +21,4 @@ DRAMSys/analyzer/scripts/__pycache__/
*.autosave
*__pycache__*
DRAMSys/gem5/boot_linux/linux-aarch32-ael.img
DRAMSys/docs/doxygen

1228
DRAMSys/docs/doxyCfg.cfg Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -78,7 +78,7 @@ using namespace tlm;
DECLARE_EXTENDED_PHASE(PendingRequest);
class Controller: public sc_module, public IController
class Controller : public sc_module, public IController
{
public:
Controller(sc_module_name /*name*/) :

View File

@@ -54,7 +54,7 @@
using namespace std;
using namespace tlm;
struct Arbiter: public sc_module {
struct Arbiter : public sc_module {
public:
tlm_utils::multi_passthrough_initiator_socket<Arbiter> iSocket;
tlm_utils::multi_passthrough_target_socket<Arbiter> tSocket;
@@ -66,7 +66,8 @@ public:
// Anytime an transaction comes from a memory unity to the arbiter the "bw" callback is called.
iSocket.register_nb_transport_bw(this, &Arbiter::nb_transport_bw);
for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; ++i) {
for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; ++i)
{
channelIsFree.push_back(true);
pendingRequests.push_back(queue<tlm_generic_payload *>());
}
@@ -84,32 +85,16 @@ private:
vector<bool> channelIsFree;
//used to account for the request_accept_delay in the dram controllers
// used to account for the request_accept_delay in the dram controllers
// This is a queue of new transactions. The phase of a new request is BEGIN_REQ.
vector<queue<tlm_generic_payload *>> pendingRequests;
//used to account for the response_accept_delay in the initiators (traceplayer,core etc.)
// used to account for the response_accept_delay in the initiators (traceplayer, core etc.)
// This is a queue of responses comming from the memory side. The phase of these transactions is BEGIN_RESP.
std::map<unsigned int, queue<tlm_generic_payload *>> receivedResponses;
//used to map the transaction from devices to the arbiter's target socket ID.
// used to map the transaction from devices to the arbiter's target socket ID.
std::map<tlm_generic_payload *, int> routeMap;
// Initiated by dram side
// This function is called when an arbiter's initiator socket receives a transaction from a memory controller
tlm_sync_enum nb_transport_bw(int channelId, tlm_generic_payload &payload,
tlm_phase &phase, sc_time &bwDelay)
{
// Check channel ID
if ((unsigned int)channelId != DramExtension::getExtension(
payload).getChannel().ID()) {
SC_REPORT_FATAL("Arbiter", "Payload extension was corrupted");
}
printDebugMessage("[bw] " + phaseNameToString(phase) + " notification in " +
bwDelay.to_string());
payloadEventQueue.notify(payload, phase, bwDelay);
return TLM_ACCEPTED;
}
// Initiated by initiator side
// This function is called when an arbiter's target socket receives a transaction from a device
@@ -118,7 +103,8 @@ private:
{
sc_time notDelay = clkAlign(sc_time_stamp() + fwDelay) -
(sc_time_stamp() + fwDelay);
if (phase == BEGIN_REQ) {
if (phase == BEGIN_REQ)
{
// adjust address offset:
payload.set_address(payload.get_address() -
Configuration::getInstance().AddressOffset);
@@ -130,7 +116,9 @@ private:
// It will extracted from the payload and used later.
appendDramExtension(id, payload);
payload.acquire();
} else if (phase == END_RESP) {
}
else if (phase == END_RESP)
{
notDelay += Configuration::getInstance().memSpec.clk;
// Erase before the payload is released.
routeMap.erase(&payload);
@@ -143,6 +131,21 @@ private:
return TLM_ACCEPTED;
}
// Initiated by dram side
// This function is called when an arbiter's initiator socket receives a transaction from a memory controller
tlm_sync_enum nb_transport_bw(int channelId, tlm_generic_payload &payload,
tlm_phase &phase, sc_time &bwDelay)
{
// Check channel ID
if ((unsigned int)channelId != DramExtension::getExtension(payload).getChannel().ID())
SC_REPORT_FATAL("Arbiter", "Payload extension was corrupted");
printDebugMessage("[bw] " + phaseNameToString(phase) + " notification in " +
bwDelay.to_string());
payloadEventQueue.notify(payload, phase, bwDelay);
return TLM_ACCEPTED;
}
virtual unsigned int transport_dbg(int /*id*/, tlm::tlm_generic_payload &trans)
{
// adjust address offset:
@@ -164,7 +167,8 @@ private:
assert(channelId < Configuration::getInstance().NumberOfMemChannels);
// Phases initiated by the intiator side from arbiter's point of view (devices performing memory requests to the arbiter)
if (phase == BEGIN_REQ) {
if (phase == BEGIN_REQ)
{
if (channelIsFree[channelId]) {
// This channel was available. Forward the new transaction to the memory controller.
channelIsFree[channelId] = false;
@@ -173,21 +177,7 @@ private:
// This channel is busy. Enqueue the new transaction which phase is BEGIN_REQ.
pendingRequests[channelId].push(&payload);
}
} else if (phase == END_RESP) {
// Send the END_RESP message to the memory
sendToChannel(channelId, payload, phase, SC_ZERO_TIME);
// Drop one element of the queue of BEGIN_RESP from memory to this device
receivedResponses[initiatorSocket].pop();
// Check if there are queued transactoins with phase BEGIN_RESP from memory to this device
if (!receivedResponses[initiatorSocket].empty()) {
// The queue is not empty.
tlm_generic_payload *payloadToSend = receivedResponses[initiatorSocket].front();
// Send ONE extra BEGIN_RESP to the device
sendToInitiator(initiatorSocket, *payloadToSend, BEGIN_RESP, SC_ZERO_TIME);
}
}
// Phases initiated by the target side from arbiter's point of view (memory side)
else if (phase == END_REQ) {
channelIsFree[channelId] = true;
@@ -207,7 +197,9 @@ private:
// Mark the channel as busy again.
channelIsFree[channelId] = false;
}
} else if (phase == BEGIN_RESP) {
}
else if (phase == BEGIN_RESP)
{
// Validate the initiatorSocket ID
if ((int)initiatorSocket != routeMap[&payload]) {
SC_REPORT_FATAL("Arbiter", "Payload extension was corrupted");
@@ -221,10 +213,25 @@ private:
// Enqueue the transaction in BEGIN_RESP phase until the initiator
// device acknowledge it (phase changes to END_RESP).
receivedResponses[initiatorSocket].push(&payload);
} else {
}
else if (phase == END_RESP)
{
// Send the END_RESP message to the memory
sendToChannel(channelId, payload, phase, SC_ZERO_TIME);
// Drop one element of the queue of BEGIN_RESP from memory to this device
receivedResponses[initiatorSocket].pop();
// Check if there are queued transactoins with phase BEGIN_RESP from memory to this device
if (!receivedResponses[initiatorSocket].empty()) {
// The queue is not empty.
tlm_generic_payload *payloadToSend = receivedResponses[initiatorSocket].front();
// Send ONE extra BEGIN_RESP to the device
sendToInitiator(initiatorSocket, *payloadToSend, BEGIN_RESP, SC_ZERO_TIME);
}
}
else
SC_REPORT_FATAL(0,
"Payload event queue in arbiter was triggered with unknown phase");
}
}
void sendToChannel(unsigned int channelId, tlm_generic_payload &payload,