aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/main.cc
diff options
context:
space:
mode:
authorYRabbit <rabbit@yrabbit.cyou>2022-06-23 11:42:58 +1000
committerYRabbit <rabbit@yrabbit.cyou>2022-06-23 11:42:58 +1000
commit590b9050ff5cc618b4df50e0877b4bf6d9e7949d (patch)
tree3531f7d3ae6fbffb9f812191b0769cab0c415715 /gowin/main.cc
parentb950f5cb6de869658564855eb64c46c50c4bc249 (diff)
downloadnextpnr-590b9050ff5cc618b4df50e0877b4bf6d9e7949d.tar.gz
nextpnr-590b9050ff5cc618b4df50e0877b4bf6d9e7949d.tar.bz2
nextpnr-590b9050ff5cc618b4df50e0877b4bf6d9e7949d.zip
gowin: add a separate router for the clocks
A simple router that takes advantage of the fact that in each cell with DFFs their CLK inputs can directly connect to the global clock network. Networks with a large number of such sinks are sought and then each network is assigned to the available independent global clock networks. There are limited possibilities for routing mixed networks, that is, when the sinks are not only CLKs: in this case an attempt is made to use wires such as SN10/20 and EW10/20, that is, one short transition can be added between the global clock network and the sink. * At this time, networks with a source other than the I/O pin are not supported. This is typical for Tangnano4k and runber boards. * Router is disabled by default, you need to specify option --enable-globals to activate * No new chip bases are required. This may change in the distant future. Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
Diffstat (limited to 'gowin/main.cc')
-rw-r--r--gowin/main.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/gowin/main.cc b/gowin/main.cc
index a45a49d4..36bd8656 100644
--- a/gowin/main.cc
+++ b/gowin/main.cc
@@ -51,6 +51,8 @@ po::options_description GowinCommandHandler::getArchOptions()
specific.add_options()("device", po::value<std::string>(), "device name");
specific.add_options()("family", po::value<std::string>(), "family name");
specific.add_options()("cst", po::value<std::string>(), "physical constraints file");
+ specific.add_options()("enable-globals", "separate routing of the clocks");
+ specific.add_options()("enable-auto-longwires", "automatic detection and routing of long wires");
return specific;
}
@@ -79,7 +81,19 @@ std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Pr
chipArgs.family = buf;
}
chipArgs.partnumber = match[0];
- return std::unique_ptr<Context>(new Context(chipArgs));
+
+ auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
+ // routing options
+ // the default values will change in the future
+ ctx->settings[ctx->id("arch.enable-globals")] = 0;
+ ctx->settings[ctx->id("arch.enable-auto-longwires")] = 0;
+ if (vm.count("enable-globals")) {
+ ctx->settings[ctx->id("arch.enable-globals")] = 1;
+ }
+ if (vm.count("enable-auto-longwires")) {
+ ctx->settings[ctx->id("arch.enable-auto-longwires")] = 1;
+ }
+ return ctx;
}
void GowinCommandHandler::customAfterLoad(Context *ctx)