aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-09-29 18:37:17 +0100
committerDavid Shah <davey1576@gmail.com>2018-09-29 18:37:17 +0100
commitab063b2456a6b1c3893af9a809d3cb276a6f8c21 (patch)
tree898c519b36b49fb7fa0fdbe917d520f823b01288
parent11cdc197bc48c9ce10dd9b718d44603adf2591b9 (diff)
downloadnextpnr-ab063b2456a6b1c3893af9a809d3cb276a6f8c21.tar.gz
nextpnr-ab063b2456a6b1c3893af9a809d3cb276a6f8c21.tar.bz2
nextpnr-ab063b2456a6b1c3893af9a809d3cb276a6f8c21.zip
clangformat
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r--ecp5/arch.cc8
-rw-r--r--ecp5/arch.h1
-rw-r--r--ecp5/globals.cc34
3 files changed, 19 insertions, 24 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index d42e77fa..830dfc7c 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -22,13 +22,13 @@
#include <cmath>
#include <cstring>
#include "gfx.h"
+#include "globals.h"
#include "log.h"
#include "nextpnr.h"
#include "placer1.h"
#include "router1.h"
-#include "util.h"
-#include "globals.h"
#include "timing.h"
+#include "util.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -45,7 +45,6 @@ static std::tuple<int, int, std::string> split_identifier_name(const std::string
// -----------------------------------------------------------------------
-
void IdString::initialize_arch(const BaseCtx *ctx)
{
#define X(t) initialize_add(ctx, #t, ID_##t);
@@ -392,7 +391,8 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay
bool Arch::place() { return placer1(getCtx(), Placer1Cfg(getCtx())); }
-bool Arch::route() {
+bool Arch::route()
+{
route_ecp5_globals(getCtx());
assign_budget(getCtx(), true);
return router1(getCtx(), Router1Cfg(getCtx()));
diff --git a/ecp5/arch.h b/ecp5/arch.h
index bbab3918..9eac3c9f 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -915,7 +915,6 @@ struct Arch : BaseCtx
IdString id_clk, id_lsr;
IdString id_clkmux, id_lsrmux;
IdString id_srmode, id_mode;
-
};
NEXTPNR_NAMESPACE_END
diff --git a/ecp5/globals.cc b/ecp5/globals.cc
index 15ef05d6..22fcbb05 100644
--- a/ecp5/globals.cc
+++ b/ecp5/globals.cc
@@ -17,13 +17,13 @@
*
*/
+#include "globals.h"
#include <algorithm>
#include <iomanip>
#include <queue>
-#include "nextpnr.h"
#include "cells.h"
-#include "globals.h"
#include "log.h"
+#include "nextpnr.h"
#define fmt_str(x) (static_cast<const std::ostringstream &>(std::ostringstream() << x).str())
@@ -67,7 +67,7 @@ class Ecp5GlobalRouter
if (is_clock_port(user))
clockCount[ni->name]++;
}
- //log_info("clkcount %s: %d\n", ni->name.c_str(ctx),clockCount[ni->name]);
+ // log_info("clkcount %s: %d\n", ni->name.c_str(ctx),clockCount[ni->name]);
}
std::vector<NetInfo *> clocks;
while (clocks.size() < 16) {
@@ -155,7 +155,6 @@ class Ecp5GlobalRouter
break;
ctx->bindPip(fnd->second, net, STRENGTH_LOCKED);
cursor = ctx->getPipDstWire(fnd->second);
-
}
// If the global network inside the tile isn't already set up,
// we also need to bind the buffers along the way
@@ -191,7 +190,8 @@ class Ecp5GlobalRouter
WireId get_global_wire(GlobalQuadrant quad, int network)
{
- return ctx->getWireByLocAndBasename(Location(0, 0), "G_" + get_quad_name(quad) + "PCLK" + std::to_string(network));
+ return ctx->getWireByLocAndBasename(Location(0, 0),
+ "G_" + get_quad_name(quad) + "PCLK" + std::to_string(network));
}
bool simple_router(NetInfo *net, WireId src, WireId dst, bool allow_fail = false)
@@ -229,14 +229,14 @@ class Ecp5GlobalRouter
auto fnd = backtrace.find(cursor);
if (fnd == backtrace.end())
break;
- NetInfo * bound = ctx->getBoundWireNet(cursor);
+ NetInfo *bound = ctx->getBoundWireNet(cursor);
if (bound != nullptr) {
NPNR_ASSERT(bound == net);
break;
}
ctx->bindPip(fnd->second, net, STRENGTH_LOCKED);
cursor = ctx->getPipSrcWire(fnd->second);
- }\
+ }
if (ctx->getBoundWireNet(src) == nullptr)
ctx->bindWire(src, net, STRENGTH_LOCKED);
return true;
@@ -257,9 +257,9 @@ class Ecp5GlobalRouter
return true;
}
-
// Attempt to place a DCC
- void place_dcc(CellInfo *dcc) {
+ void place_dcc(CellInfo *dcc)
+ {
for (auto bel : ctx->getBels()) {
if (ctx->getBelType(bel) == id_DCCA && ctx->checkBelAvail(bel)) {
if (ctx->isValidBelForCell(dcc, bel)) {
@@ -303,9 +303,9 @@ class Ecp5GlobalRouter
}
Context *ctx;
-
-public:
- void promote_and_route_globals() {
+ public:
+ void promote_and_route_globals()
+ {
log_info("Promoting and routing globals...\n");
auto clocks = get_clocks();
std::set<int> all_globals, fab_globals;
@@ -315,9 +315,8 @@ public:
fab_globals.insert(i);
}
for (auto clock : clocks) {
- bool drives_fabric = std::any_of(clock->users.begin(), clock->users.end(), [this](const PortRef &port) {
- return !is_clock_port(port);
- });
+ bool drives_fabric = std::any_of(clock->users.begin(), clock->users.end(),
+ [this](const PortRef &port) { return !is_clock_port(port); });
int glbid;
if (drives_fabric) {
if (fab_globals.empty())
@@ -338,11 +337,8 @@ public:
}
}
}
-
};
-void route_ecp5_globals(Context *ctx) {
- Ecp5GlobalRouter(ctx).promote_and_route_globals();
-}
+void route_ecp5_globals(Context *ctx) { Ecp5GlobalRouter(ctx).promote_and_route_globals(); }
NEXTPNR_NAMESPACE_END