Add the resource directory option to the json converter

This commit is contained in:
2023-08-14 10:38:36 +02:00
parent c352ca4372
commit a18bbc7465

View File

@@ -41,14 +41,18 @@
int main(int argc, char **argv)
{
if (argc != 2)
if (argc < 2)
{
std::cerr << "Must specify a simulation json as single argument.\n";
return -1;
}
std::string pathToJson = argv[1];
auto configuration = DRAMSys::Config::from_path(pathToJson);
std::string resourceDirectory = argc <= 2 ? DRAMSYS_RESOURCE_DIR : argv[2];
auto configuration = DRAMSys::Config::from_path(pathToJson, resourceDirectory);
nlohmann::json json;
json["simulation"] = configuration;