Moved trace player files from library to simulator.
This commit is contained in:
@@ -153,15 +153,8 @@ add_library(DRAMSysLibrary
|
||||
|
||||
src/simulation/Arbiter.cpp
|
||||
src/simulation/DRAMSys.cpp
|
||||
src/simulation/ExampleInitiator.h
|
||||
src/simulation/MemoryManager.cpp
|
||||
src/simulation/ReorderBuffer.h
|
||||
src/simulation/StlPlayer.h
|
||||
src/simulation/TemperatureController.cpp
|
||||
src/simulation/TraceGenerator.h
|
||||
src/simulation/TracePlayer.cpp
|
||||
src/simulation/TracePlayerListener.h
|
||||
src/simulation/TraceSetup.cpp
|
||||
|
||||
src/simulation/dram/Dram.cpp
|
||||
src/simulation/dram/DramRecordable.cpp
|
||||
|
||||
@@ -193,8 +193,7 @@ void DRAMSys::instantiateModules(const std::string &traceName,
|
||||
|
||||
// Create and properly initialize TLM recorders.
|
||||
// They need to be ready before creating some modules.
|
||||
bool recordingEnabled = Configuration::getInstance().databaseRecording;
|
||||
if (recordingEnabled)
|
||||
if (Configuration::getInstance().databaseRecording)
|
||||
setupTlmRecorders(traceName, pathToResources);
|
||||
|
||||
// Create new ECC Controller
|
||||
@@ -218,7 +217,7 @@ void DRAMSys::instantiateModules(const std::string &traceName,
|
||||
std::string str = "controller" + std::to_string(i);
|
||||
|
||||
ControllerIF *controller;
|
||||
if (recordingEnabled)
|
||||
if (Configuration::getInstance().databaseRecording)
|
||||
controller = new ControllerRecordable(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
controller = new Controller(str.c_str());
|
||||
@@ -227,71 +226,52 @@ void DRAMSys::instantiateModules(const std::string &traceName,
|
||||
str = "dram" + std::to_string(i);
|
||||
Dram *dram;
|
||||
|
||||
if (memoryType == "DDR3")
|
||||
if (Configuration::getInstance().databaseRecording)
|
||||
{
|
||||
if (recordingEnabled)
|
||||
if (memoryType == "DDR3")
|
||||
dram = new DramRecordable<DramDDR3>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramDDR3(str.c_str());
|
||||
}
|
||||
else if (memoryType == "WIDEIO_SDR")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "WIDEIO_SDR")
|
||||
dram = new DramRecordable<DramWideIO>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramWideIO(str.c_str());
|
||||
}
|
||||
else if (memoryType == "DDR4")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "DDR4")
|
||||
dram = new DramRecordable<DramDDR4>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramDDR4(str.c_str());
|
||||
}
|
||||
else if (memoryType == "LPDDR4")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "LPDDR4")
|
||||
dram = new DramRecordable<DramLPDDR4>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramLPDDR4(str.c_str());
|
||||
}
|
||||
else if (memoryType == "WIDEIO2")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "WIDEIO2")
|
||||
dram = new DramRecordable<DramWideIO2>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramWideIO2(str.c_str());
|
||||
}
|
||||
else if (memoryType == "HBM2")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "HBM2")
|
||||
dram = new DramRecordable<DramHBM2>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramHBM2(str.c_str());
|
||||
}
|
||||
else if (memoryType == "GDDR5")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "GDDR5")
|
||||
dram = new DramRecordable<DramGDDR5>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramGDDR5(str.c_str());
|
||||
}
|
||||
else if (memoryType == "GDDR5X")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "GDDR5X")
|
||||
dram = new DramRecordable<DramGDDR5X>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramGDDR5X(str.c_str());
|
||||
}
|
||||
else if (memoryType == "GDDR6")
|
||||
{
|
||||
if (recordingEnabled)
|
||||
else if (memoryType == "GDDR6")
|
||||
dram = new DramRecordable<DramGDDR6>(str.c_str(), tlmRecorders[i]);
|
||||
else
|
||||
dram = new DramGDDR6(str.c_str());
|
||||
SC_REPORT_FATAL("DRAMSys", "Unsupported DRAM type");
|
||||
}
|
||||
else
|
||||
SC_REPORT_FATAL("DRAMSys", "Unsupported DRAM type");
|
||||
{
|
||||
if (memoryType == "DDR3")
|
||||
dram = new DramDDR3(str.c_str());
|
||||
else if (memoryType == "WIDEIO_SDR")
|
||||
dram = new DramWideIO(str.c_str());
|
||||
else if (memoryType == "DDR4")
|
||||
dram = new DramDDR4(str.c_str());
|
||||
else if (memoryType == "LPDDR4")
|
||||
dram = new DramLPDDR4(str.c_str());
|
||||
else if (memoryType == "WIDEIO2")
|
||||
dram = new DramWideIO2(str.c_str());
|
||||
else if (memoryType == "HBM2")
|
||||
dram = new DramHBM2(str.c_str());
|
||||
else if (memoryType == "GDDR5")
|
||||
dram = new DramGDDR5(str.c_str());
|
||||
else if (memoryType == "GDDR5X")
|
||||
dram = new DramGDDR5X(str.c_str());
|
||||
else if (memoryType == "GDDR6")
|
||||
dram = new DramGDDR6(str.c_str());
|
||||
else
|
||||
SC_REPORT_FATAL("DRAMSys", "Unsupported DRAM type");
|
||||
}
|
||||
|
||||
drams.push_back(dram);
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
#include "dram/Dram.h"
|
||||
#include "Arbiter.h"
|
||||
#include "TraceGenerator.h"
|
||||
#include "ReorderBuffer.h"
|
||||
#include <tlm_utils/multi_passthrough_target_socket.h>
|
||||
#include <tlm_utils/multi_passthrough_initiator_socket.h>
|
||||
|
||||
@@ -39,11 +39,15 @@
|
||||
#define REORDERBUFFER_H
|
||||
|
||||
#include <deque>
|
||||
#include <set>
|
||||
#include <systemc.h>
|
||||
#include <tlm.h>
|
||||
#include <set>
|
||||
#include <tlm_utils/simple_initiator_socket.h>
|
||||
#include <tlm_utils/simple_target_socket.h>
|
||||
#include <tlm_utils/peq_with_cb_and_phase.h>
|
||||
|
||||
struct ReorderBuffer: public sc_module {
|
||||
struct ReorderBuffer : public sc_module
|
||||
{
|
||||
public:
|
||||
tlm_utils::simple_initiator_socket<ReorderBuffer> iSocket;
|
||||
tlm_utils::simple_target_socket<ReorderBuffer> tSocket;
|
||||
|
||||
@@ -39,10 +39,20 @@ project(DRAMSysSimulator)
|
||||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Version")
|
||||
set(DCMAKE_SH="CMAKE_SH-NOTFOUND")
|
||||
|
||||
add_executable(DRAMSys main.cpp)
|
||||
add_executable(DRAMSys
|
||||
main.cpp
|
||||
ExampleInitiator.h
|
||||
MemoryManager.cpp
|
||||
StlPlayer.h
|
||||
TraceGenerator.h
|
||||
TracePlayer.cpp
|
||||
TracePlayerListener.h
|
||||
TraceSetup.cpp)
|
||||
|
||||
target_include_directories(DRAMSys
|
||||
PUBLIC ../library/src/simulation/
|
||||
PUBLIC ../library/src/
|
||||
)
|
||||
|
||||
target_link_libraries(DRAMSys
|
||||
${SYSTEMC_LIBRARY}
|
||||
DRAMSysLibrary
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "MemoryManager.h"
|
||||
#include "../common/dramExtensions.h"
|
||||
#include "common/dramExtensions.h"
|
||||
#include "TracePlayer.h"
|
||||
|
||||
struct ExampleInitiator : sc_module
|
||||
@@ -14,12 +14,11 @@ struct ExampleInitiator : sc_module
|
||||
tlm_utils::simple_initiator_socket<ExampleInitiator> socket;
|
||||
|
||||
SC_CTOR(ExampleInitiator)
|
||||
: socket("socket") // Construct and name socket
|
||||
, request_in_progress(0)
|
||||
, m_peq(this, &ExampleInitiator::peq_cb)
|
||||
: socket("socket"),
|
||||
request_in_progress(0),
|
||||
m_peq(this, &ExampleInitiator::peq_cb)
|
||||
{
|
||||
socket.register_nb_transport_bw(this, &ExampleInitiator::nb_transport_bw);
|
||||
|
||||
SC_THREAD(thread_process);
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
*/
|
||||
|
||||
#include "MemoryManager.h"
|
||||
#include "../common/DebugManager.h"
|
||||
#include "../configuration/Configuration.h"
|
||||
#include "common/DebugManager.h"
|
||||
#include "configuration/Configuration.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace tlm;
|
||||
@@ -47,8 +47,8 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "MemoryManager.h"
|
||||
#include "../configuration/Configuration.h"
|
||||
#include "../common/DebugManager.h"
|
||||
#include "configuration/Configuration.h"
|
||||
#include "common/DebugManager.h"
|
||||
#include "TracePlayerListener.h"
|
||||
|
||||
struct TracePlayer : public sc_module
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "../common/utils.h"
|
||||
#include "common/utils.h"
|
||||
#include "TracePlayer.h"
|
||||
#include "StlPlayer.h"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
|
||||
#include "DRAMSys.h"
|
||||
#include "simulation/DRAMSys.h"
|
||||
#include "TraceSetup.h"
|
||||
|
||||
std::string resources;
|
||||
|
||||
Reference in New Issue
Block a user