aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/arch.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/arch.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/arch.cc')
-rw-r--r--gowin/arch.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc
index 82f5018b..7b9097c9 100644
--- a/gowin/arch.cc
+++ b/gowin/arch.cc
@@ -25,6 +25,7 @@
#include <regex>
#include "embed.h"
#include "gfx.h"
+#include "globals.h"
#include "nextpnr.h"
#include "placer1.h"
#include "placer_heap.h"
@@ -341,6 +342,14 @@ BelInfo &Arch::bel_info(IdString bel)
return b->second;
}
+NetInfo &Arch::net_info(IdString net)
+{
+ auto b = nets.find(net);
+ if (b == nets.end())
+ NPNR_ASSERT_FALSE_STR("no net named " + net.str(this));
+ return *b->second;
+}
+
void Arch::addWire(IdString name, IdString type, int x, int y)
{
NPNR_ASSERT(wires.count(name) == 0);
@@ -657,6 +666,7 @@ bool aliasCompare(GlobalAliasPOD i, GlobalAliasPOD j)
return (i.dest_row < j.dest_row) || (i.dest_row == j.dest_row && i.dest_col < j.dest_col) ||
(i.dest_row == j.dest_row && i.dest_col == j.dest_col && i.dest_id < j.dest_id);
}
+
bool timingCompare(TimingPOD i, TimingPOD j) { return i.name_id < j.name_id; }
template <class T, class C> const T *genericLookup(const T *first, int len, const T val, C compare)
@@ -1865,6 +1875,11 @@ bool Arch::place()
bool Arch::route()
{
std::string router = str_or_default(settings, id_router, defaultRouter);
+
+ if (bool_or_default(settings, id("arch.enable-globals"))) {
+ route_gowin_globals(getCtx());
+ }
+
bool result;
if (router == "router1") {
result = router1(getCtx(), Router1Cfg(getCtx()));