| 13 | using namespace std; |
| 14 | |
| 15 | void Myconfig::load_config() { |
| 16 | FILE *fp = fopen(config_path.c_str(), "r"); |
| 17 | auto yamlconfig = fkyaml::node::deserialize(fp); |
| 18 | assert(yamlconfig["L1"]["path"].is_sequence()); |
| 19 | assert(yamlconfig["L2"]["size"].is_sequence()); |
| 20 | |
| 21 | n_l1 = yamlconfig["L1"]["path"].size(); |
| 22 | uint64_t l1_size = |
| 23 | Utils::convert_size_str(yamlconfig["L1"]["size"].as_str()); |
| 24 | for (int i = 0; i < n_l1; i++) { |
| 25 | l1_sizes.push_back(l1_size); |
| 26 | l1_sizes_str.push_back(yamlconfig["L1"]["size"].as_str()); |
| 27 | } |
| 28 | |
| 29 | for (std::size_t i = 0; i < n_l1; i++) { |
| 30 | l1_trace_path.push_back(yamlconfig["L1"]["path"][i].as_str()); |
| 31 | } |
| 32 | |
| 33 | for (std::size_t i = 0; i < yamlconfig["L2"]["size"].size(); i++) { |
| 34 | string sz = yamlconfig["L2"]["size"][i].as_str(); |
| 35 | l2_sizes.push_back(Utils::convert_size_str(sz)); |
| 36 | l2_sizes_str.push_back(sz); |
| 37 | } |
| 38 | |
| 39 | output_path = yamlconfig["output"].as_str(); |
| 40 | } |
| 41 | |
| 42 | void Myconfig::_prepare() { |
| 43 | for (int i = 0; i < n_l1; i++) { |
nothing calls this directly
no test coverage detected