Finished PCT example
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
JOBS=$(nproc --all)
|
||||
|
||||
rm -rf lib
|
||||
mkdir lib
|
||||
cd lib
|
||||
DRAMSYS_PCT=true qmake ../../simulator/library.pro
|
||||
|
||||
@@ -51,14 +51,12 @@
|
||||
::pct::set_simulation_build_project_setting Debug {Library Search Paths} [concat ../lib/ /usr/lib64/ ../../simulator/src/common/third_party/DRAMPower/src/]
|
||||
::pct::set_simulation_build_project_setting Debug {Defined Symbols} SC_INCLUDE_DYNAMIC_PROCESSES=1
|
||||
|
||||
# Configure for dynamic linking
|
||||
#::pct::set_encap_config_setting Project:DRAMSys/DRAMSys FromSource build dynamic_library true
|
||||
#::pct::add_encap_config_setting Project:DRAMSys/DRAMSys FromSource package dynamic_library_search_path [concat [glob -type d ../../build*]/simulator/] *
|
||||
|
||||
# Disable Fast Linking and Caching and Elaboration
|
||||
::pct::set_simulation_build_project_setting Debug {Cache Objects} false
|
||||
::pct::set_simulation_build_project_setting Debug {Fast Linking} false
|
||||
::scsh::build-options -skip-elab on
|
||||
### TODO: count number of cores:
|
||||
::pct::set_simulation_build_project_setting Debug {Make Jobs} 16
|
||||
|
||||
# Configure DDR3 Example:
|
||||
::pct::set_param_value /HARDWARE/i_DRAMSys {Constructor Arguments} pathToResources ../../simulator/resources/
|
||||
@@ -73,7 +71,12 @@
|
||||
::pct::create_connection C_1 /HARDWARE /HARDWARE/i_ClockGenerator/CLK /HARDWARE/i_GFRBM_TLM2/CLK
|
||||
|
||||
# Configure GFRBM:
|
||||
::pct::set_param_value /HARDWARE/i_GFRBM_TLM2 {Scml Properties} InputFile ../../simulator/resources/traces/ddr3_example.stl
|
||||
::pct::set_param_value /HARDWARE/i_GFRBM_TLM2 {Scml Properties} InputFile ../../simulator/resources/traces/pct.stl
|
||||
::pct::set_param_value /HARDWARE/i_GFRBM_TLM2 {Template Arguments} NUM_IN_IRQ 0
|
||||
::pct::set_param_value /HARDWARE/i_GFRBM_TLM2 {Template Arguments} NUM_OUT_IRQ 0
|
||||
::pct::set_param_value /HARDWARE/i_GFRBM_TLM2 {Extra properties} /all_encaps/LogFile foo.log
|
||||
::pct::set_param_value /HARDWARE/i_GFRBM_TLM2 {Extra properties} /all_encaps/DebugLevel 6
|
||||
|
||||
# Design:
|
||||
::pct::set_background_color_rgb /HARDWARE/i_DRAMSys 113 200 55 255
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ $$eval(dramsys_pct) {
|
||||
message(PCT Simulation Feature Enabled)
|
||||
systemc_home = /software/Synopsys_CoWare/K-2015.12-SP1/SLS/linux/common
|
||||
INCLUDEPATH += $${systemc_home}/include/tlm
|
||||
|
||||
DEFINES += DRAMSYS_PCT
|
||||
}
|
||||
|
||||
message(SystemC home is $${systemc_home})
|
||||
|
||||
@@ -56,7 +56,7 @@ using namespace std;
|
||||
|
||||
DRAMSys::DRAMSys(sc_module_name __attribute__((unused)) name,
|
||||
string simulationToRun,
|
||||
string pathToResources)
|
||||
string pathToResources) : tSocket("DRAMSys_tSocket")
|
||||
{
|
||||
logo();
|
||||
|
||||
@@ -108,7 +108,6 @@ DRAMSys::DRAMSys(sc_module_name __attribute__((unused)) name,
|
||||
// Instantiate all internal DRAMSys modules:
|
||||
instantiateModules(Configuration::getInstance().SimulationName,
|
||||
pathToResources);
|
||||
|
||||
// Connect all internal DRAMSys modules:
|
||||
bindSockets();
|
||||
|
||||
@@ -159,19 +158,19 @@ void DRAMSys::setupTlmRecorders(const string &traceName,
|
||||
+ ".tdb";
|
||||
|
||||
std::string recorderName = "tlmRecorder" + std::to_string(i);
|
||||
|
||||
TlmRecorder *tlmRecorder =
|
||||
new TlmRecorder(recorderName.c_str(),
|
||||
sqlScriptURI.c_str(),
|
||||
dbName.c_str(),
|
||||
Configuration::getInstance().DatabaseRecording);
|
||||
|
||||
tlmRecorder->recordMCconfig(Configuration::getInstance().mcconfigUri);
|
||||
tlmRecorder->recordMemspec(Configuration::getInstance().memspecUri);
|
||||
|
||||
tlmRecorders.push_back(tlmRecorder);
|
||||
|
||||
std::string traceNames = Configuration::getInstance().SimulationName;
|
||||
tlmRecorder->recordTracenames(traceNames);
|
||||
|
||||
tlmRecorders.push_back(tlmRecorder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +188,6 @@ void DRAMSys::instantiateModules(const string &traceName,
|
||||
arbiter = new Arbiter("arbiter");
|
||||
arbiter->setTlmRecorders(tlmRecorders);
|
||||
|
||||
|
||||
for (size_t i = 0;
|
||||
i < Configuration::getInstance().NumberOfMemChannels;
|
||||
i++)
|
||||
@@ -216,10 +214,10 @@ void DRAMSys::instantiateModules(const string &traceName,
|
||||
|
||||
void DRAMSys::bindSockets()
|
||||
{
|
||||
tSocket.bind(arbiter->tSocket);
|
||||
tSocket.bind(arbiter->tSocket);
|
||||
|
||||
if(Configuration::getInstance().CheckTLM2Protocol)
|
||||
{
|
||||
|
||||
for (size_t i = 0;
|
||||
i < Configuration::getInstance().NumberOfMemChannels;
|
||||
i++)
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
#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>
|
||||
#include "../controller/Controller.h"
|
||||
#include "../common/third_party/tinyxml2/tinyxml2.h"
|
||||
#include "../common/tlm2_base_protocol_checker.h"
|
||||
@@ -68,6 +70,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
std::string traceName;
|
||||
//DramSetup setup;
|
||||
|
||||
|
||||
@@ -390,8 +390,9 @@ struct Dram : sc_module
|
||||
}
|
||||
else if (phase == BEGIN_WR)
|
||||
{
|
||||
|
||||
#ifndef DRAMSYS_PCT
|
||||
assert(payload.get_data_length() == bytesPerBurst);
|
||||
#endif
|
||||
|
||||
if(powerAnalysis == true){DRAMPower->doCommand(MemCommand::WR, bank, cycle);}
|
||||
numberOfTransactionsServed++;
|
||||
|
||||
Reference in New Issue
Block a user