diff --git a/src/DRAMPower/DRAMPower/data/energy.cpp b/src/DRAMPower/DRAMPower/data/energy.cpp index b3a43263..0fba2620 100644 --- a/src/DRAMPower/DRAMPower/data/energy.cpp +++ b/src/DRAMPower/DRAMPower/data/energy.cpp @@ -24,7 +24,7 @@ double energy_info_t::total() const return total; }; -void energy_info_t::to_json(nlohmann::json &j) const +void energy_info_t::to_json(json_t &j) const { j = nlohmann::json{ {"ACT", E_act}, @@ -80,7 +80,7 @@ double DRAMPower::energy_t::total() const return total; } -void DRAMPower::interface_energy_info_t::to_json(nlohmann::json &j) const +void DRAMPower::interface_energy_info_t::to_json(json_t &j) const { j = nlohmann::json{}; j["controller"]["dynamicEnergy"] = controller.dynamicEnergy; @@ -89,7 +89,7 @@ void DRAMPower::interface_energy_info_t::to_json(nlohmann::json &j) const j["dram"]["staticEnergy"] = dram.staticEnergy; } -void DRAMPower::energy_t::to_json(nlohmann::json &j) const +void DRAMPower::energy_t::to_json(json_t &j) const { j = nlohmann::json{ {"E_bg_act_shared", E_bg_act_shared}, @@ -103,7 +103,7 @@ void DRAMPower::energy_t::to_json(nlohmann::json &j) const auto energy_arr = nlohmann::json::array(); for (const energy_info_t& energy : bank_energy) { - nlohmann::json bank_energy_json; + json_t bank_energy_json; energy.to_json(bank_energy_json); energy_arr.push_back(bank_energy_json); } diff --git a/src/DRAMPower/DRAMPower/data/energy.h b/src/DRAMPower/DRAMPower/data/energy.h index eb268ebd..6aa357a6 100644 --- a/src/DRAMPower/DRAMPower/data/energy.h +++ b/src/DRAMPower/DRAMPower/data/energy.h @@ -5,7 +5,8 @@ #include #include -#include + +#include namespace DRAMPower { @@ -29,7 +30,7 @@ struct energy_info_t double E_ref_2B = 0.0; double total() const; - void to_json(nlohmann::json &j) const; + void to_json(json_t &j) const; energy_info_t& operator+=(const energy_info_t & other); // Operator << for std::cout friend std::ostream & operator<<(std::ostream & os, const energy_info_t & ei) @@ -57,7 +58,7 @@ struct energy_t { std::vector bank_energy; energy_info_t total_energy(); // TODO rename - void to_json(nlohmann::json &j) const; + void to_json(json_t &j) const; constexpr inline const char * const get_Bank_energy_keyword() const { return "BankEnergy"; @@ -137,7 +138,7 @@ struct interface_energy_info_t os << "Total: " << e.total() << std::endl; return os; } - void to_json(nlohmann::json &j) const; + void to_json(json_t &j) const; }; }; diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpec.cpp b/src/DRAMPower/DRAMPower/memspec/MemSpec.cpp index 9ddef668..edcfd407 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpec.cpp +++ b/src/DRAMPower/DRAMPower/memspec/MemSpec.cpp @@ -38,6 +38,6 @@ using namespace DRAMPower; -using json = nlohmann::json; +using json_t = nlohmann::json; diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpec.h b/src/DRAMPower/DRAMPower/memspec/MemSpec.h index 009f6c15..97c112c6 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpec.h +++ b/src/DRAMPower/DRAMPower/memspec/MemSpec.h @@ -42,14 +42,13 @@ #include -#include +#include #include #include #include -using json = nlohmann::json; namespace DRAMPower { struct MemSpecContainer diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.cpp b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.cpp index 0165bd7f..46c0e8cb 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.cpp +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.cpp @@ -37,7 +37,7 @@ #include "MemSpecDDR4.h" using namespace DRAMPower; -using json = nlohmann::json; +using json_t = nlohmann::json; MemSpecDDR4::MemSpecDDR4(const DRAMUtils::MemSpec::MemSpecDDR4 &memspec) diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.h b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.h index d8c1fe67..cecb75a4 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.h +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR4.h @@ -39,10 +39,12 @@ #define DRAMPOWER_MEMSPEC_MEMSPECDDR4_H #include "MemSpec.h" + #include -#include -using json = nlohmann::json; +#include + + namespace DRAMPower { class MemSpecDDR4 final : public MemSpec @@ -59,8 +61,8 @@ class MemSpecDDR4 final : public MemSpec MemSpecDDR4(const DRAMUtils::MemSpec::MemSpecDDR4 &memspec); - MemSpecDDR4(json &data) = delete; - MemSpecDDR4(const json &data) = delete; + MemSpecDDR4(json_t &data) = delete; + MemSpecDDR4(const json_t &data) = delete; ~MemSpecDDR4() = default; diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.cpp b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.cpp index 8eb7878d..51f46273 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.cpp +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.cpp @@ -1,6 +1,6 @@ #include "MemSpecDDR5.h" using namespace DRAMPower; -using json = nlohmann::json; +using json_t = nlohmann::json; MemSpecDDR5::MemSpecDDR5(const DRAMUtils::MemSpec::MemSpecDDR5 &memspec) diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.h b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.h index 591e56bb..1b2029ae 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.h +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecDDR5.h @@ -2,6 +2,7 @@ #define DRAMPOWER_MEMSPEC_MEMSPECDDR5_H #include "MemSpec.h" + #include @@ -20,8 +21,8 @@ namespace DRAMPower { MemSpecDDR5(const DRAMUtils::MemSpec::MemSpecDDR5 &memspec); - MemSpecDDR5(json &data) = delete; - MemSpecDDR5(const json &data) = delete; + MemSpecDDR5(json_t &data) = delete; + MemSpecDDR5(const json_t &data) = delete; ~MemSpecDDR5() = default; diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.cpp b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.cpp index d9dcffd7..b56ca160 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.cpp +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.cpp @@ -1,6 +1,6 @@ #include "MemSpecLPDDR4.h" using namespace DRAMPower; -using json = nlohmann::json; +using json_t = nlohmann::json; MemSpecLPDDR4::MemSpecLPDDR4(const DRAMUtils::MemSpec::MemSpecLPDDR4 &memspec) diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.h b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.h index 9742272c..0dd265d1 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.h +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR4.h @@ -2,6 +2,7 @@ #define DRAMPOWER_MEMSPEC_MEMSPECLPDDR4_H #include "MemSpec.h" + #include @@ -21,8 +22,8 @@ class MemSpecLPDDR4 final : public MemSpec MemSpecLPDDR4(const DRAMUtils::MemSpec::MemSpecLPDDR4 &memspec); - MemSpecLPDDR4(json &data) = delete; - MemSpecLPDDR4(const json &data) = delete; + MemSpecLPDDR4(json_t &data) = delete; + MemSpecLPDDR4(const json_t &data) = delete; ~MemSpecLPDDR4() = default; uint64_t timeToCompletion(CmdType type) override; diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.cpp b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.cpp index 6c7c6cc9..e63e79ec 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.cpp +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.cpp @@ -1,7 +1,7 @@ #include "DRAMPower/memspec/MemSpecLPDDR5.h" using namespace DRAMPower; -using json = nlohmann::json; +using json_t = nlohmann::json; MemSpecLPDDR5::MemSpecLPDDR5(const DRAMUtils::MemSpec::MemSpecLPDDR5 &memspec) : MemSpec(memspec) @@ -163,3 +163,8 @@ void MemSpecLPDDR5::parseImpedanceSpec(const DRAMUtils::MemSpec::MemSpecLPDDR5 & memImpedanceSpec.R_eq_rb = memspec.memimpedancespec.R_eq_rb; memImpedanceSpec.R_eq_wb = memspec.memimpedancespec.R_eq_wb; } + +MemSpecLPDDR5 MemSpecLPDDR5::from_memspec(const DRAMUtils::MemSpec::MemSpecVariant& memSpec) +{ + return std::get(memSpec.getVariant()); +} diff --git a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.h b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.h index af43542e..2b769302 100644 --- a/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.h +++ b/src/DRAMPower/DRAMPower/memspec/MemSpecLPDDR5.h @@ -25,8 +25,8 @@ namespace DRAMPower { MemSpecLPDDR5(const DRAMUtils::MemSpec::MemSpecLPDDR5 &memspec); - MemSpecLPDDR5(json &data) = delete; - MemSpecLPDDR5(const json &data) = delete; + MemSpecLPDDR5(json_t &data) = delete; + MemSpecLPDDR5(const json_t &data) = delete; ~MemSpecLPDDR5() = default; @@ -108,6 +108,9 @@ namespace DRAMPower { private: void parseImpedanceSpec(const DRAMUtils::MemSpec::MemSpecLPDDR5 &memspec); + + public: + static MemSpecLPDDR5 from_memspec(const DRAMUtils::MemSpec::MemSpecVariant&); }; } // namespace DRAMPower diff --git a/tests/tests_drampower/base/test_pattern_pre_cycles.cpp b/tests/tests_drampower/base/test_pattern_pre_cycles.cpp index 5498ef2e..84c8cbbc 100644 --- a/tests/tests_drampower/base/test_pattern_pre_cycles.cpp +++ b/tests/tests_drampower/base/test_pattern_pre_cycles.cpp @@ -36,7 +36,7 @@ class DramPowerTest_Pre_Cycles : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/DDR4/ddr4_multidevice_tests.cpp b/tests/tests_drampower/core/DDR4/ddr4_multidevice_tests.cpp index eb452e50..91e58040 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_multidevice_tests.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_multidevice_tests.cpp @@ -63,7 +63,7 @@ class DramPowerTest_DDR4_MultiDevice : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfDevices = 5; diff --git a/tests/tests_drampower/core/DDR4/ddr4_multirank_tests.cpp b/tests/tests_drampower/core/DDR4/ddr4_multirank_tests.cpp index cbb53980..017c493b 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_multirank_tests.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_multirank_tests.cpp @@ -36,7 +36,7 @@ class DDR4_MultirankTests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); spec->numberOfRanks = 2; diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_0.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_0.cpp index 033c602d..5d761100 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_0.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_0.cpp @@ -35,7 +35,7 @@ class DramPowerTest_DDR4_0 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_1.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_1.cpp index dc29206f..d7c59c45 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_1.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_1.cpp @@ -36,7 +36,7 @@ class DramPowerTest_DDR4_1 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_10.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_10.cpp index 325fa99a..f5970f64 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_10.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_10.cpp @@ -45,7 +45,7 @@ class DramPowerTest_DDR4_10 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_11.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_11.cpp index 5f3b7dfc..2349075e 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_11.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_11.cpp @@ -58,7 +58,7 @@ class DramPowerTest_DDR4_11 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_12.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_12.cpp index de46ce5b..d1aeaac3 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_12.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_12.cpp @@ -44,7 +44,7 @@ class DramPowerTest_DDR4_12 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_13.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_13.cpp index d17adee6..2ae8f99d 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_13.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_13.cpp @@ -38,7 +38,7 @@ class DramPowerTest_DDR4_13 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_14.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_14.cpp index 746adc46..dcac4f8d 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_14.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_14.cpp @@ -36,7 +36,7 @@ class DramPowerTest_DDR4_14 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_15.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_15.cpp index 5b560e7f..fc82286c 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_15.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_15.cpp @@ -37,7 +37,7 @@ class DramPowerTest_DDR4_15 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_2.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_2.cpp index c9cf947d..2e475a15 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_2.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_2.cpp @@ -37,7 +37,7 @@ class DramPowerTest_DDR4_2 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_3.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_3.cpp index 1e6063ea..032643d2 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_3.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_3.cpp @@ -39,7 +39,7 @@ class DramPowerTest_DDR4_3 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_4.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_4.cpp index 5b281d19..d4b68244 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_4.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_4.cpp @@ -40,7 +40,7 @@ class DramPowerTest_DDR4_4 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_5.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_5.cpp index c0c2938e..8dbcf3a6 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_5.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_5.cpp @@ -41,7 +41,7 @@ class DramPowerTest_DDR4_5 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_6.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_6.cpp index 220c42a1..5273a757 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_6.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_6.cpp @@ -40,7 +40,7 @@ class DramPowerTest_DDR4_6 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_7.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_7.cpp index de12360a..46248c46 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_7.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_7.cpp @@ -36,7 +36,7 @@ class DramPowerTest_DDR4_7 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_8.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_8.cpp index 18fc1a14..b402f009 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_8.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_8.cpp @@ -41,7 +41,7 @@ class DramPowerTest_DDR4_8 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_9.cpp b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_9.cpp index e4931725..dea1cc13 100644 --- a/tests/tests_drampower/core/DDR4/ddr4_test_pattern_9.cpp +++ b/tests/tests_drampower/core/DDR4/ddr4_test_pattern_9.cpp @@ -45,7 +45,7 @@ class DramPowerTest_DDR4_9 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_multidevice_tests.cpp b/tests/tests_drampower/core/DDR5/ddr5_multidevice_tests.cpp index 606eb46a..51c62001 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_multidevice_tests.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_multidevice_tests.cpp @@ -63,7 +63,7 @@ class DramPowerTest_DDR5_MultiDevice : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfDevices = 5; diff --git a/tests/tests_drampower/core/DDR5/ddr5_multirank_tests.cpp b/tests/tests_drampower/core/DDR5/ddr5_multirank_tests.cpp index efb76f3b..3fccb2ae 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_multirank_tests.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_multirank_tests.cpp @@ -44,7 +44,7 @@ class DDR5_MultirankTests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_0.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_0.cpp index e4b8e256..ce615d4b 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_0.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_0.cpp @@ -36,7 +36,7 @@ class DramPowerTest_DDR5_0 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_1.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_1.cpp index 3c3b2909..81dd8c70 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_1.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_1.cpp @@ -37,7 +37,7 @@ class DramPowerTest_DDR5_1 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_10.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_10.cpp index b2a3a5ea..024af698 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_10.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_10.cpp @@ -40,7 +40,7 @@ class DramPowerTest_DDR5_10 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_11.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_11.cpp index 8a20c4c6..157ac1fb 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_11.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_11.cpp @@ -42,7 +42,7 @@ class DramPowerTest_DDR5_11 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_12.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_12.cpp index 147ddb82..652af1b3 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_12.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_12.cpp @@ -41,7 +41,7 @@ class DramPowerTest_DDR5_12 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.bitWidth = 16; diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_13.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_13.cpp index 857792d6..56b92db8 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_13.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_13.cpp @@ -58,7 +58,7 @@ class DramPowerTest_DDR5_13 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.bitWidth = 16; diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_14.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_14.cpp index 3cbad8b1..507b7aca 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_14.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_14.cpp @@ -44,7 +44,7 @@ class DramPowerTest_DDR5_14 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.bitWidth = 16; diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_15.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_15.cpp index 132158c2..a2ac8b68 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_15.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_15.cpp @@ -38,7 +38,7 @@ class DramPowerTest_DDR5_15 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.bitWidth = 16; diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_16.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_16.cpp index a64e33d4..6484444b 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_16.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_16.cpp @@ -37,7 +37,7 @@ class DramPowerTest_DDR5_16 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.bitWidth = 16; diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_17.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_17.cpp index a182d439..00ebd1ed 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_17.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_17.cpp @@ -36,7 +36,7 @@ class DramPowerTest_DDR5_17 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.bitWidth = 16; diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_18.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_18.cpp index 4cd420a4..73545dcf 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_18.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_18.cpp @@ -37,7 +37,7 @@ class DramPowerTest_DDR5_18 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.bitWidth = 16; diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_2.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_2.cpp index 78fa3e70..9a9b6dc1 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_2.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_2.cpp @@ -37,7 +37,7 @@ class DramPowerTest_DDR5_2 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_3.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_3.cpp index c308bcbf..14710988 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_3.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_3.cpp @@ -39,7 +39,7 @@ class DramPowerTest_DDR5_3 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_4.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_4.cpp index 723bc4a2..7aceaa48 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_4.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_4.cpp @@ -40,7 +40,7 @@ class DramPowerTest_DDR5_4 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_5.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_5.cpp index 4a8d29cf..60723bf5 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_5.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_5.cpp @@ -41,7 +41,7 @@ class DramPowerTest_DDR5_5 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_6.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_6.cpp index 078424ea..524292b9 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_6.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_6.cpp @@ -40,7 +40,7 @@ class DramPowerTest_DDR5_6 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_7.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_7.cpp index 64a6d204..b929b930 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_7.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_7.cpp @@ -36,7 +36,7 @@ class DramPowerTest_DDR5_7 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_8.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_8.cpp index d9cdd3cd..a2ea3b6e 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_8.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_8.cpp @@ -38,7 +38,7 @@ class DramPowerTest_DDR5_8 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_9.cpp b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_9.cpp index 56eb5d0f..a7019881 100644 --- a/tests/tests_drampower/core/DDR5/ddr5_test_pattern_9.cpp +++ b/tests/tests_drampower/core/DDR5/ddr5_test_pattern_9.cpp @@ -44,7 +44,7 @@ class DramPowerTest_DDR5_9 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_multidevice_tests.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_multidevice_tests.cpp index 746167b2..d65a6871 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_multidevice_tests.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_multidevice_tests.cpp @@ -63,7 +63,7 @@ class DramPowerTest_LPDDR4_MultiDevice : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfDevices = 5; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_multirank_test.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_multirank_test.cpp index 651433e3..6304bd22 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_multirank_test.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_multirank_test.cpp @@ -44,7 +44,7 @@ class LPDDR4_MultirankTests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); spec->numberOfRanks = 2; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_0.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_0.cpp index b0d5179b..e88d4b05 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_0.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_0.cpp @@ -35,7 +35,7 @@ class DramPowerTest_LPDDR4_0 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_1.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_1.cpp index de463a38..65acb321 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_1.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_1.cpp @@ -36,7 +36,7 @@ class DramPowerTest_LPDDR4_1 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_10.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_10.cpp index 3a9c3439..e63276fe 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_10.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_10.cpp @@ -40,7 +40,7 @@ class DramPowerTest_LPDDR4_10 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_11.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_11.cpp index 297d01f8..826b9129 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_11.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_11.cpp @@ -43,7 +43,7 @@ class DramPowerTest_LPDDR4_11 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_12.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_12.cpp index 4790a82d..0e45aafc 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_12.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_12.cpp @@ -58,7 +58,7 @@ class DramPowerTest_LPDDR4_12 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_13.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_13.cpp index ff2ad67c..191d64c0 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_13.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_13.cpp @@ -44,7 +44,7 @@ class DramPowerTest_LPDDR4_13 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_14.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_14.cpp index e653a233..67fb8e5f 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_14.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_14.cpp @@ -38,7 +38,7 @@ class DramPowerTest_LPDDR4_14 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_15.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_15.cpp index 0bad4e1c..7358af72 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_15.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_15.cpp @@ -40,7 +40,7 @@ class DramPowerTest_LPDDR4_15 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_16.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_16.cpp index a898b325..72f12293 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_16.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_16.cpp @@ -36,7 +36,7 @@ class DramPowerTest_LPDDR4_16 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_17.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_17.cpp index 29ebd169..1646a222 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_17.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_17.cpp @@ -37,7 +37,7 @@ class DramPowerTest_LPDDR4_17 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_18.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_18.cpp index cea7e3d1..99cdf134 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_18.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_18.cpp @@ -35,7 +35,7 @@ class DramPowerTest_LPDDR4_18 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_2.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_2.cpp index 27c55e40..7292dc96 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_2.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_2.cpp @@ -37,7 +37,7 @@ class DramPowerTest_LPDDR4_2 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_3.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_3.cpp index cb7f08a3..3e0b3fc1 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_3.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_3.cpp @@ -39,7 +39,7 @@ class DramPowerTest_LPDDR4_3 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_4.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_4.cpp index cf2b7cd5..9f03534c 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_4.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_4.cpp @@ -40,7 +40,7 @@ class DramPowerTest_LPDDR4_4 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_5.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_5.cpp index 7317582e..6f7b8f34 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_5.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_5.cpp @@ -41,7 +41,7 @@ class DramPowerTest_LPDDR4_5 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_6.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_6.cpp index e4c475a5..d6e3d188 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_6.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_6.cpp @@ -40,7 +40,7 @@ class DramPowerTest_LPDDR4_6 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_7.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_7.cpp index a1b3e729..76265399 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_7.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_7.cpp @@ -36,7 +36,7 @@ class DramPowerTest_LPDDR4_7 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_8.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_8.cpp index 9d8dd5a3..fb1daf3d 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_8.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_8.cpp @@ -38,7 +38,7 @@ class DramPowerTest_LPDDR4_8 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_9.cpp b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_9.cpp index eb49ccad..a6ca7783 100644 --- a/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_9.cpp +++ b/tests/tests_drampower/core/LPDDR4/lpddr4_test_pattern_9.cpp @@ -44,7 +44,7 @@ class DramPowerTest_LPDDR4_9 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_12.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_12.cpp index a2d0ed48..d3b2f4be 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_12.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_12.cpp @@ -39,15 +39,9 @@ class DramPowerTest_LPDDR5_12 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.banksPerGroup = 8; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_13.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_13.cpp index bcb6b383..18bd98a6 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_13.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_13.cpp @@ -52,15 +52,9 @@ class DramPowerTest_LPDDR5_13 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.banksPerGroup = 8; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_14.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_14.cpp index 17938e85..da4cbeea 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_14.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_14.cpp @@ -38,15 +38,9 @@ class DramPowerTest_LPDDR5_14 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.banksPerGroup = 8; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_15.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_15.cpp index a0c96c05..637b91db 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_15.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_15.cpp @@ -32,15 +32,9 @@ class DramPowerTest_LPDDR5_15 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.banksPerGroup = 8; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_16.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_16.cpp index f742a90a..f663fb44 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_16.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_16.cpp @@ -34,15 +34,9 @@ class DramPowerTest_LPDDR5_16 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.banksPerGroup = 8; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_17.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_17.cpp index 18276f38..29ee4669 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_17.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_17.cpp @@ -28,15 +28,9 @@ class DramPowerTest_LPDDR5_17 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.numberOfBankGroups = 2; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_18.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_18.cpp index 5a90aeae..bc79c5aa 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_18.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_18.cpp @@ -30,15 +30,9 @@ class DramPowerTest_LPDDR5_18 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.numberOfBankGroups = 2; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_19.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_19.cpp index e4ea9b84..a69b2774 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_19.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_19.cpp @@ -31,15 +31,9 @@ class DramPowerTest_LPDDR5_19 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.numberOfBankGroups = 2; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_20.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_20.cpp index 50937c5f..848a8241 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_20.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_20.cpp @@ -29,15 +29,9 @@ class DramPowerTest_LPDDR5_20 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); + memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.numberOfBankGroups = 2; diff --git a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_21.cpp b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_21.cpp index 5e409083..62bcd009 100644 --- a/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_21.cpp +++ b/tests/tests_drampower/core/LPDDR5/LPDDR5_test_pattern_21.cpp @@ -30,15 +30,9 @@ class DramPowerTest_LPDDR5_21 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; memSpec.numberOfBanks = 8; memSpec.numberOfBankGroups = 2; diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_multidevice_tests.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_multidevice_tests.cpp index e13fe7f3..9c0e2162 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_multidevice_tests.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_multidevice_tests.cpp @@ -57,15 +57,9 @@ class DramPowerTest_LPDDR5_MultiDevice : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfDevices = 5; numberOfDevices = memSpec.numberOfDevices; diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_multirank_test.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_multirank_test.cpp index 520e99a4..f1bd1af9 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_multirank_test.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_multirank_test.cpp @@ -38,15 +38,8 @@ class LPDDR5_MultirankTests : public ::testing::Test { } void initSpec() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + spec = std::make_unique(std::get(data->getVariant())); spec->numberOfRanks = 2; } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_0.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_0.cpp index 2bca8a5c..859cfd18 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_0.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_0.cpp @@ -29,15 +29,8 @@ class DramPowerTest_LPDDR5_0 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_1.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_1.cpp index 397fb232..969f8c9f 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_1.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_1.cpp @@ -30,15 +30,8 @@ class DramPowerTest_LPDDR5_1 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_10.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_10.cpp index d100c31a..3d4ad12f 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_10.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_10.cpp @@ -34,15 +34,8 @@ class DramPowerTest_LPDDR5_10 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_11.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_11.cpp index 7a745e5c..b1e639e1 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_11.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_11.cpp @@ -34,15 +34,8 @@ class DramPowerTest_LPDDR5_11 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_2.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_2.cpp index 2bf269a5..4c83e201 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_2.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_2.cpp @@ -31,15 +31,8 @@ class DramPowerTest_LPDDR5_2 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_3.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_3.cpp index 5cc49ed0..bfdc5b39 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_3.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_3.cpp @@ -33,15 +33,8 @@ class DramPowerTest_LPDDR5_3 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_4.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_4.cpp index 945fdfef..d501879b 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_4.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_4.cpp @@ -34,15 +34,8 @@ class DramPowerTest_LPDDR5_4 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_5.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_5.cpp index 445b44c0..be1dc715 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_5.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_5.cpp @@ -35,15 +35,8 @@ class DramPowerTest_LPDDR5_5 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_6.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_6.cpp index 99b3614c..c1eeba9b 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_6.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_6.cpp @@ -34,15 +34,8 @@ class DramPowerTest_LPDDR5_6 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_7.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_7.cpp index dae127ec..1f8b5e5a 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_7.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_7.cpp @@ -30,15 +30,8 @@ class DramPowerTest_LPDDR5_7 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_8.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_8.cpp index 760a5539..3c5ff7ce 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_8.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_8.cpp @@ -32,15 +32,8 @@ class DramPowerTest_LPDDR5_8 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_9.cpp b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_9.cpp index 1692db25..6c50729c 100644 --- a/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_9.cpp +++ b/tests/tests_drampower/core/LPDDR5/lpddr5_test_pattern_9.cpp @@ -38,15 +38,8 @@ class DramPowerTest_LPDDR5_9 : public ::testing::Test { virtual void SetUp() { - std::ifstream f(std::string(TEST_RESOURCE_DIR) + "lpddr5.json"); - - if(!f.is_open()){ - std::cout << "Error: Could not open memory specification" << std::endl; - exit(1); - } - json data = json::parse(f); - DRAMPower::MemSpecContainer memspeccontainer = data; - MemSpecLPDDR5 memSpec(std::get(memspeccontainer.memspec.getVariant())); + auto data = DRAMUtils::parse_memspec_from_file(std::filesystem::path(TEST_RESOURCE_DIR) / "lpddr5.json"); + auto memSpec = DRAMPower::MemSpecLPDDR5::from_memspec(*data); ddr = std::make_unique(memSpec); } diff --git a/tests/tests_drampower/interface/test_interface_ddr4.cpp b/tests/tests_drampower/interface/test_interface_ddr4.cpp index 32a317a6..3d3406b3 100644 --- a/tests/tests_drampower/interface/test_interface_ddr4.cpp +++ b/tests/tests_drampower/interface/test_interface_ddr4.cpp @@ -87,7 +87,7 @@ class DDR4_WindowStats_Tests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); } @@ -412,7 +412,7 @@ class DDR4_Energy_Tests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/interface/test_interface_ddr5.cpp b/tests/tests_drampower/interface/test_interface_ddr5.cpp index 8cee791e..ceafba35 100644 --- a/tests/tests_drampower/interface/test_interface_ddr5.cpp +++ b/tests/tests_drampower/interface/test_interface_ddr5.cpp @@ -71,7 +71,7 @@ class DDR5_WindowStats_Tests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); spec->bitWidth = 16; @@ -188,7 +188,7 @@ class DDR5_Energy_Tests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); diff --git a/tests/tests_drampower/interface/test_interface_lpddr4.cpp b/tests/tests_drampower/interface/test_interface_lpddr4.cpp index b332bfaf..62624129 100644 --- a/tests/tests_drampower/interface/test_interface_lpddr4.cpp +++ b/tests/tests_drampower/interface/test_interface_lpddr4.cpp @@ -76,7 +76,7 @@ class DramPowerTest_Interface_LPDDR4 : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); DRAMPower::MemSpecContainer memspeccontainer = data; MemSpecLPDDR4 memSpec(std::get(memspeccontainer.memspec.getVariant())); memSpec.numberOfRanks = 1; diff --git a/tests/tests_drampower/interface/test_interface_lpddr5.cpp b/tests/tests_drampower/interface/test_interface_lpddr5.cpp index 7f75b294..49b88f24 100644 --- a/tests/tests_drampower/interface/test_interface_lpddr5.cpp +++ b/tests/tests_drampower/interface/test_interface_lpddr5.cpp @@ -82,7 +82,7 @@ class LPDDR5_WindowStats_Tests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant())); @@ -339,7 +339,7 @@ class LPDDR5_Energy_Tests : public ::testing::Test { std::cout << "Error: Could not open memory specification" << std::endl; exit(1); } - json data = json::parse(f); + json_t data = json_t::parse(f); MemSpecContainer memspeccontainer = data; spec = std::make_unique(std::get(memspeccontainer.memspec.getVariant()));