Fix Trace Analyzer cmake.
This commit is contained in:
@@ -42,7 +42,6 @@ project(TraceAnalyzer)
|
||||
|
||||
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp)
|
||||
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
||||
#file(GLOB_RECURSE UI_FILES CONFIGURE_DEPENDS *.ui)
|
||||
|
||||
# Add Python3 Dependency:
|
||||
find_package(Python3 COMPONENTS Development)
|
||||
|
||||
@@ -19,6 +19,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER lib)
|
||||
### Compile options ###
|
||||
# refer to https://www.sqlite.org/compile.html
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC SQLITE_ENABLE_RTREE)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC SQLITE_ENABLE_RTREE SQLITE_OMIT_LOAD_EXTENSION)
|
||||
|
||||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||
@@ -42,10 +42,6 @@ set(DCMAKE_SH="CMAKE_SH-NOTFOUND")
|
||||
|
||||
find_library(GEM5_LIBRARY gem5_${GEM5_VARIANT} PATHS $ENV{GEM5}/build/${GEM5_ISA}/)
|
||||
|
||||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../library/src/simulation/DRAMSysRecordable.cpp)
|
||||
add_definitions(-DRECORDING)
|
||||
endif()
|
||||
|
||||
add_executable(DRAMSys_gem5
|
||||
main.cpp
|
||||
$ENV{GEM5}/util/systemc/gem5_within_systemc/sc_logger.cc
|
||||
|
||||
@@ -52,10 +52,7 @@
|
||||
|
||||
#include "Configuration.h"
|
||||
#include "simulation/DRAMSys.h"
|
||||
|
||||
#ifdef RECORDING
|
||||
#include "simulation/DRAMSysRecordable.h"
|
||||
#endif
|
||||
|
||||
using namespace sc_core;
|
||||
using namespace tlm;
|
||||
@@ -167,11 +164,9 @@ int sc_main(int argc, char **argv)
|
||||
// Instantiate DRAMSys:
|
||||
std::unique_ptr<DRAMSys> dramSys;
|
||||
|
||||
#ifdef RECORDING
|
||||
if (configLib.simConfig.databaseRecording.value_or(false))
|
||||
dramSys = std::make_unique<DRAMSysRecordable>("DRAMSys", configLib);
|
||||
else
|
||||
#endif
|
||||
dramSys = std::make_unique<DRAMSys>("DRAMSys", configLib);
|
||||
|
||||
// Instantiate gem5:
|
||||
|
||||
@@ -62,9 +62,9 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace sc_core;
|
||||
namespace DRAMSys {
|
||||
|
||||
DRAMSysRecordable::DRAMSysRecordable(const sc_module_name& name, const ::DRAMSys::Config::Configuration& configLib)
|
||||
DRAMSysRecordable::DRAMSysRecordable(const sc_core::sc_module_name& name, const ::DRAMSys::Config::Configuration& configLib)
|
||||
: DRAMSys(name, configLib, false)
|
||||
{
|
||||
// If a simulation file is passed as argument to DRAMSys the simulation ID
|
||||
@@ -89,15 +89,16 @@ void DRAMSysRecordable::end_of_simulation()
|
||||
// Report power before TLM recorders are finalized
|
||||
if (config.powerAnalysis)
|
||||
{
|
||||
for (auto& dram : drams)
|
||||
for (auto& dram: drams)
|
||||
dram->reportPower();
|
||||
}
|
||||
|
||||
for (auto& tlmRecorder : tlmRecorders)
|
||||
for (auto& tlmRecorder: tlmRecorders)
|
||||
tlmRecorder.finalize();
|
||||
}
|
||||
|
||||
void DRAMSysRecordable::setupTlmRecorders(const std::string& traceName, const ::DRAMSys::Config::Configuration& configLib)
|
||||
void DRAMSysRecordable::setupTlmRecorders(const std::string& traceName,
|
||||
const ::DRAMSys::Config::Configuration& configLib)
|
||||
{
|
||||
// Create TLM Recorders, one per channel.
|
||||
// Reserve is required because the recorders use double buffers that are accessed with pointers.
|
||||
@@ -116,8 +117,8 @@ void DRAMSysRecordable::setupTlmRecorders(const std::string& traceName, const ::
|
||||
}
|
||||
}
|
||||
|
||||
void DRAMSysRecordable::instantiateModules(const std::string &traceName,
|
||||
const ::DRAMSys::Config::Configuration &configLib)
|
||||
void DRAMSysRecordable::instantiateModules(const std::string& traceName,
|
||||
const ::DRAMSys::Config::Configuration& configLib)
|
||||
{
|
||||
addressDecoder = std::make_unique<AddressDecoder>(config, configLib.addressMapping);
|
||||
addressDecoder->print();
|
||||
@@ -192,3 +193,5 @@ void DRAMSysRecordable::instantiateModules(const std::string &traceName,
|
||||
(("TLMCheckerController" + std::to_string(i)).c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,10 +42,12 @@
|
||||
|
||||
#include "DRAMSys/config/DRAMSysConfiguration.h"
|
||||
|
||||
class DRAMSysRecordable : public DRAMSys::DRAMSys
|
||||
namespace DRAMSys {
|
||||
|
||||
class DRAMSysRecordable : public DRAMSys
|
||||
{
|
||||
public:
|
||||
DRAMSysRecordable(const sc_core::sc_module_name &name, const ::DRAMSys::Config::Configuration& configLib);
|
||||
DRAMSysRecordable(const sc_core::sc_module_name& name, const ::DRAMSys::Config::Configuration& configLib);
|
||||
|
||||
protected:
|
||||
void end_of_simulation() override;
|
||||
@@ -55,8 +57,11 @@ private:
|
||||
// They generate the output databases.
|
||||
std::vector<TlmRecorder> tlmRecorders;
|
||||
|
||||
void setupTlmRecorders(const std::string &traceName, const ::DRAMSys::Config::Configuration& configLib);
|
||||
void instantiateModules(const std::string &traceName, const ::DRAMSys::Config::Configuration& configLib);
|
||||
void setupTlmRecorders(const std::string& traceName, const ::DRAMSys::Config::Configuration& configLib);
|
||||
|
||||
void instantiateModules(const std::string& traceName, const ::DRAMSys::Config::Configuration& configLib);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // DRAMSYSRECORDABLE_H
|
||||
|
||||
@@ -46,10 +46,6 @@ file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
||||
add_executable(DRAMSys ${SOURCE_FILES} ${HEADER_FILES})
|
||||
target_include_directories(DRAMSys PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../library/src/simulation/DRAMSysRecordable.cpp)
|
||||
target_compile_definitions(DRAMSys PRIVATE RECORDING)
|
||||
endif()
|
||||
|
||||
target_link_libraries(DRAMSys
|
||||
PRIVATE
|
||||
Threads::Threads
|
||||
|
||||
@@ -41,9 +41,7 @@
|
||||
#include "simulator/TrafficInitiator.h"
|
||||
|
||||
#include "DRAMSys/simulation/DRAMSys.h"
|
||||
#ifdef RECORDING
|
||||
#include "DRAMSys/simulation/DRAMSysRecordable.h"
|
||||
#endif
|
||||
#include "DRAMSys/config/DRAMSysConfiguration.h"
|
||||
|
||||
#include <iostream>
|
||||
@@ -101,11 +99,9 @@ int sc_main(int argc, char **argv)
|
||||
// Instantiate DRAMSys:
|
||||
std::unique_ptr<DRAMSys::DRAMSys> dramSys;
|
||||
|
||||
#ifdef RECORDING
|
||||
if (configLib.simConfig.databaseRecording.value_or(false))
|
||||
dramSys = std::make_unique<DRAMSysRecordable>("DRAMSys", configLib);
|
||||
dramSys = std::make_unique<DRAMSys::DRAMSysRecordable>("DRAMSys", configLib);
|
||||
else
|
||||
#endif
|
||||
dramSys = std::make_unique<DRAMSys::DRAMSys>("DRAMSys", configLib);
|
||||
|
||||
if (!configLib.traceSetup.has_value())
|
||||
|
||||
Reference in New Issue
Block a user