diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-08-08 20:14:18 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-08-08 20:14:18 +0200 |
commit | 61bce47f3cb7b4adf1d5292b3c431ca4048ad038 (patch) | |
tree | 18ff4129f05a457f0afaf8edcef90fe73252ad24 /ice40/project.cc | |
parent | b326b03a5261a824f428fe0811a5376c8758b929 (diff) | |
download | nextpnr-61bce47f3cb7b4adf1d5292b3c431ca4048ad038.tar.gz nextpnr-61bce47f3cb7b4adf1d5292b3c431ca4048ad038.tar.bz2 nextpnr-61bce47f3cb7b4adf1d5292b3c431ca4048ad038.zip |
Use settings for json and pcf
Diffstat (limited to 'ice40/project.cc')
-rw-r--r-- | ice40/project.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ice40/project.cc b/ice40/project.cc index d1f1674a..8ca10e36 100644 --- a/ice40/project.cc +++ b/ice40/project.cc @@ -25,11 +25,13 @@ NEXTPNR_NAMESPACE_BEGIN -void ProjectHandler::saveArch(Context *ctx, pt::ptree &root) +void ProjectHandler::saveArch(Context *ctx, pt::ptree &root, std::string path) { root.put("project.arch.package", ctx->archArgs().package); - // if(!pcfFilename.empty()) - // root.put("project.input.pcf", pcfFilename); + if (ctx->settings.find(ctx->id("project/input/pcf")) != ctx->settings.end()) { + std::string fn = ctx->settings[ctx->id("project/input/pcf")]; + root.put("project.input.pcf", make_relative(fn, path).string()); + } } std::unique_ptr<Context> ProjectHandler::createContext(pt::ptree &root) @@ -64,7 +66,7 @@ void ProjectHandler::loadArch(Context *ctx, pt::ptree &root, std::string path) auto input = root.get_child("project").get_child("input"); boost::filesystem::path pcf = boost::filesystem::path(path) / input.get<std::string>("pcf"); std::ifstream f(pcf.string()); - if (!apply_pcf(ctx, f)) + if (!apply_pcf(ctx, input.get<std::string>("pcf"), f)) log_error("Loading PCF failed.\n"); } |