aboutsummaryrefslogtreecommitdiffstats
path: root/generic/main.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-01-07 16:16:47 +0000
committerGitHub <noreply@github.com>2022-01-07 16:16:47 +0000
commit3d24583b914bac37d9c22931e6fcee2e1408b284 (patch)
tree2ff879a3a856d19f61cc0c0875e7a3aa7fba7ac1 /generic/main.cc
parent089ca8258e6f4dc93f8d39594c1109a8578cdc98 (diff)
parente88bd34c02272ecdad6295123941d9040fa4f043 (diff)
downloadnextpnr-3d24583b914bac37d9c22931e6fcee2e1408b284.tar.gz
nextpnr-3d24583b914bac37d9c22931e6fcee2e1408b284.tar.bz2
nextpnr-3d24583b914bac37d9c22931e6fcee2e1408b284.zip
Merge pull request #893 from YosysHQ/gatecat/viaduct
Viaduct API for a hybrid between generic and full-custom arch
Diffstat (limited to 'generic/main.cc')
-rw-r--r--generic/main.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/main.cc b/generic/main.cc
index 387df6c6..d08ae381 100644
--- a/generic/main.cc
+++ b/generic/main.cc
@@ -44,8 +44,10 @@ GenericCommandHandler::GenericCommandHandler(int argc, char **argv) : CommandHan
po::options_description GenericCommandHandler::getArchOptions()
{
+ std::string all_uarches = ViaductArch::list();
+ std::string uarch_help = stringf("viaduct micro-arch to use (available: %s)", all_uarches.c_str());
po::options_description specific("Architecture specific options");
- specific.add_options()("generic", "set device type to generic");
+ specific.add_options()("uarch", po::value<std::string>(), uarch_help.c_str());
specific.add_options()("no-iobs", "disable automatic IO buffer insertion");
return specific;
}
@@ -63,6 +65,17 @@ std::unique_ptr<Context> GenericCommandHandler::createContext(dict<std::string,
auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
if (vm.count("no-iobs"))
ctx->settings[ctx->id("disable_iobs")] = Property::State::S1;
+ if (vm.count("uarch")) {
+ std::string uarch_name = vm["uarch"].as<std::string>();
+ dict<std::string, std::string> args; // TODO
+ auto uarch = ViaductArch::create(uarch_name, args);
+ if (!uarch) {
+ std::string all_uarches = ViaductArch::list();
+ log_error("Unknown viaduct uarch '%s'; available options: '%s'\n", uarch_name.c_str(), all_uarches.c_str());
+ }
+ ctx->uarch = std::move(uarch);
+ ctx->uarch->init(ctx.get());
+ }
return ctx;
}