67 lines
1.5 KiB
C++
67 lines
1.5 KiB
C++
/*
|
|
* Configuration.h
|
|
*
|
|
* Created on: Mar 6, 2014
|
|
* Author: jonny
|
|
*/
|
|
|
|
#ifndef CONFIGURATION_H_
|
|
#define CONFIGURATION_H_
|
|
|
|
#include <systemc.h>
|
|
#include <string>
|
|
#include "MemSpec.h"
|
|
|
|
namespace core{
|
|
|
|
enum class EPowerDownMode{NoPowerDown, Staggered, TimeoutPDN, TimeoutSREF};
|
|
|
|
|
|
struct Configuration
|
|
{
|
|
static std::string memspecUri;
|
|
static std::string memconfigUri;
|
|
|
|
static inline Configuration& getInstance()
|
|
{
|
|
static Configuration configuration;
|
|
return configuration;
|
|
}
|
|
|
|
//MemConfig
|
|
bool BankwiseLogic = false;
|
|
bool OpenPagePolicy = true;
|
|
bool AdaptiveOpenPagePolicy = false;
|
|
bool RefreshAwareScheduling = false;
|
|
unsigned int MaxNrOfTransactions = 50;
|
|
std::string Scheduler;
|
|
unsigned int Capsize = 5;
|
|
sc_time getPowerDownTimeout(){return powerDownTimeoutInClk*memSpec.clk;}
|
|
EPowerDownMode PowerDownMode = EPowerDownMode::Staggered;
|
|
unsigned int Buswidth = 128;
|
|
bool ReadWriteGrouping = false;
|
|
bool ModelStorage = false;
|
|
bool ModelErrorInjection = false;
|
|
bool ReorderBuffer = false;
|
|
|
|
//SimConfig
|
|
bool DatabaseRecording = true;
|
|
bool PowerAnalysys = false;
|
|
bool Debug = false;
|
|
|
|
//MemSpec(from DRAM-Power XML)
|
|
MemSpec memSpec;
|
|
|
|
void setParameter(std::string name, std::string value);
|
|
void setParameters(std::map<std::string, std::string> parameterMap);
|
|
|
|
private:
|
|
Configuration();
|
|
unsigned int powerDownTimeoutInClk = 3;
|
|
};
|
|
|
|
} /* namespace core */
|
|
|
|
|
|
#endif /* CONFIGURATION_H_ */
|