simconfig and thermalconfig to json
This commit is contained in:
15
DRAMSys/library/resources/configs/thermalsim/config.json
Normal file
15
DRAMSys/library/resources/configs/thermalsim/config.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"thermalsimconfig": {
|
||||
"TemperatureScale": "Celsius",
|
||||
"StaticTemperatureDefaultValue": "89",
|
||||
"ThermalSimPeriod":"100",
|
||||
"ThermalSimUnit":"us",
|
||||
"PowerInfoFile": "powerInfo.xml",
|
||||
"IceServerIp": "127.0.0.1",
|
||||
"IceServerPort": "11880",
|
||||
"SimPeriodAdjustFactor" : "10",
|
||||
"NPowStableCyclesToIncreasePeriod": "5",
|
||||
"GenerateTemperatureMap": "1",
|
||||
"GeneratePowerMap": "1"
|
||||
}
|
||||
}
|
||||
14
DRAMSys/library/resources/simulations/ddr3-example.json
Normal file
14
DRAMSys/library/resources/simulations/ddr3-example.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"simulation": {
|
||||
"simulationid": "ddr3-example-all-json",
|
||||
"simconfig": "ddr3.json",
|
||||
"thermalconfig": "config.json",
|
||||
"memspec": "MICRON_1Gb_DDR3-1600_8bit_G.json",
|
||||
"addressmapping": "congen_extended_solution.json",
|
||||
"mcconfig":"fifoStrict.json",
|
||||
"tracesetup": [{
|
||||
"_clkMhz": "800",
|
||||
"__text": "ddr3_example.stl"}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<simulation>
|
||||
<!-- Simulation file identifier -->
|
||||
<simulationid id="ddr3-example-solution"></simulationid>
|
||||
<simulationid id="ddr3-example-all-json"></simulationid>
|
||||
<!-- Configuration for the DRAMSys Simulator -->
|
||||
<simconfig src="ddr3.xml" />
|
||||
<simconfig src="ddr3.json" />
|
||||
<!-- Temperature Simulator Configuration -->
|
||||
<thermalconfig src="config.xml" />
|
||||
<thermalconfig src="config.json" />
|
||||
<!-- Memory Device Specification: Which Device is on the DDR3 DIMM -->
|
||||
<memspec src="MICRON_1Gb_DDR3-1600_8bit_G.json"></memspec>
|
||||
<!-- Addressmapping Configuration of the Memory Controller -->
|
||||
|
||||
@@ -54,29 +54,20 @@ using json = nlohmann::json;
|
||||
void ConfigurationLoader::loadSimConfig(Configuration &config,
|
||||
std::string simconfigUri)
|
||||
{
|
||||
tinyxml2::XMLDocument doc;
|
||||
|
||||
loadXML(simconfigUri, doc);
|
||||
XMLElement *simconfig = doc.FirstChildElement("simconfig");
|
||||
loadConfig(config, simconfig);
|
||||
json doc = json::parse(std::ifstream(simconfigUri));
|
||||
auto simconfig = doc["simconfig"].get_ptr<json::object_t*>();
|
||||
loadConfigJson(config, simconfig);
|
||||
}
|
||||
|
||||
void ConfigurationLoader::loadSimConfig(Configuration &config,
|
||||
XMLElement *simconfig)
|
||||
{
|
||||
if (simconfig->Attribute("src")) {
|
||||
XMLDocument doc;
|
||||
std::string src(simconfig->Attribute("src"));
|
||||
loadXML(src, doc);
|
||||
loadSimConfig(config, doc.FirstChildElement("simconfig"));
|
||||
}
|
||||
loadConfig(config, simconfig);
|
||||
}
|
||||
|
||||
void ConfigurationLoader::loadTemperatureSimConfig(Configuration &config,
|
||||
std::string thermalsimconfigUri)
|
||||
{
|
||||
loadConfigFromUri(config, thermalsimconfigUri, "thermalsimconfig");
|
||||
json doc = json::parse(std::ifstream(thermalsimconfigUri));
|
||||
auto thermalconfig = doc["thermalsimconfig"].get_ptr<json::object_t*>();
|
||||
loadConfigJson(config, thermalconfig);
|
||||
|
||||
}
|
||||
|
||||
void ConfigurationLoader::loadTemperatureSimConfig(Configuration &config,
|
||||
|
||||
@@ -53,8 +53,6 @@ public:
|
||||
|
||||
|
||||
static void loadSimConfig(Configuration &config, std::string simconfigUri);
|
||||
static void loadSimConfig(Configuration &config,
|
||||
tinyxml2::XMLElement *simconfig);
|
||||
|
||||
static void loadMemSpec(Configuration &config, std::string memspecUri);
|
||||
static void loadMemSpec(Configuration &config, nlohmann::json::object_t *memspec);
|
||||
|
||||
Reference in New Issue
Block a user