clangformat
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
11cdc197bc
commit
ab063b2456
@ -22,13 +22,13 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
#include "globals.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "nextpnr.h"
|
#include "nextpnr.h"
|
||||||
#include "placer1.h"
|
#include "placer1.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
#include "util.h"
|
|
||||||
#include "globals.h"
|
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
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)
|
void IdString::initialize_arch(const BaseCtx *ctx)
|
||||||
{
|
{
|
||||||
#define X(t) initialize_add(ctx, #t, ID_##t);
|
#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::place() { return placer1(getCtx(), Placer1Cfg(getCtx())); }
|
||||||
|
|
||||||
bool Arch::route() {
|
bool Arch::route()
|
||||||
|
{
|
||||||
route_ecp5_globals(getCtx());
|
route_ecp5_globals(getCtx());
|
||||||
assign_budget(getCtx(), true);
|
assign_budget(getCtx(), true);
|
||||||
return router1(getCtx(), Router1Cfg(getCtx()));
|
return router1(getCtx(), Router1Cfg(getCtx()));
|
||||||
|
@ -915,7 +915,6 @@ struct Arch : BaseCtx
|
|||||||
IdString id_clk, id_lsr;
|
IdString id_clk, id_lsr;
|
||||||
IdString id_clkmux, id_lsrmux;
|
IdString id_clkmux, id_lsrmux;
|
||||||
IdString id_srmode, id_mode;
|
IdString id_srmode, id_mode;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "globals.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include "nextpnr.h"
|
|
||||||
#include "cells.h"
|
#include "cells.h"
|
||||||
#include "globals.h"
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "nextpnr.h"
|
||||||
|
|
||||||
#define fmt_str(x) (static_cast<const std::ostringstream &>(std::ostringstream() << x).str())
|
#define fmt_str(x) (static_cast<const std::ostringstream &>(std::ostringstream() << x).str())
|
||||||
|
|
||||||
@ -155,7 +155,6 @@ class Ecp5GlobalRouter
|
|||||||
break;
|
break;
|
||||||
ctx->bindPip(fnd->second, net, STRENGTH_LOCKED);
|
ctx->bindPip(fnd->second, net, STRENGTH_LOCKED);
|
||||||
cursor = ctx->getPipDstWire(fnd->second);
|
cursor = ctx->getPipDstWire(fnd->second);
|
||||||
|
|
||||||
}
|
}
|
||||||
// If the global network inside the tile isn't already set up,
|
// If the global network inside the tile isn't already set up,
|
||||||
// we also need to bind the buffers along the way
|
// we also need to bind the buffers along the way
|
||||||
@ -191,7 +190,8 @@ class Ecp5GlobalRouter
|
|||||||
|
|
||||||
WireId get_global_wire(GlobalQuadrant quad, int network)
|
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)
|
bool simple_router(NetInfo *net, WireId src, WireId dst, bool allow_fail = false)
|
||||||
@ -236,7 +236,7 @@ class Ecp5GlobalRouter
|
|||||||
}
|
}
|
||||||
ctx->bindPip(fnd->second, net, STRENGTH_LOCKED);
|
ctx->bindPip(fnd->second, net, STRENGTH_LOCKED);
|
||||||
cursor = ctx->getPipSrcWire(fnd->second);
|
cursor = ctx->getPipSrcWire(fnd->second);
|
||||||
}\
|
}
|
||||||
if (ctx->getBoundWireNet(src) == nullptr)
|
if (ctx->getBoundWireNet(src) == nullptr)
|
||||||
ctx->bindWire(src, net, STRENGTH_LOCKED);
|
ctx->bindWire(src, net, STRENGTH_LOCKED);
|
||||||
return true;
|
return true;
|
||||||
@ -257,9 +257,9 @@ class Ecp5GlobalRouter
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Attempt to place a DCC
|
// Attempt to place a DCC
|
||||||
void place_dcc(CellInfo *dcc) {
|
void place_dcc(CellInfo *dcc)
|
||||||
|
{
|
||||||
for (auto bel : ctx->getBels()) {
|
for (auto bel : ctx->getBels()) {
|
||||||
if (ctx->getBelType(bel) == id_DCCA && ctx->checkBelAvail(bel)) {
|
if (ctx->getBelType(bel) == id_DCCA && ctx->checkBelAvail(bel)) {
|
||||||
if (ctx->isValidBelForCell(dcc, bel)) {
|
if (ctx->isValidBelForCell(dcc, bel)) {
|
||||||
@ -303,9 +303,9 @@ class Ecp5GlobalRouter
|
|||||||
}
|
}
|
||||||
Context *ctx;
|
Context *ctx;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void promote_and_route_globals() {
|
void promote_and_route_globals()
|
||||||
|
{
|
||||||
log_info("Promoting and routing globals...\n");
|
log_info("Promoting and routing globals...\n");
|
||||||
auto clocks = get_clocks();
|
auto clocks = get_clocks();
|
||||||
std::set<int> all_globals, fab_globals;
|
std::set<int> all_globals, fab_globals;
|
||||||
@ -315,9 +315,8 @@ public:
|
|||||||
fab_globals.insert(i);
|
fab_globals.insert(i);
|
||||||
}
|
}
|
||||||
for (auto clock : clocks) {
|
for (auto clock : clocks) {
|
||||||
bool drives_fabric = std::any_of(clock->users.begin(), clock->users.end(), [this](const PortRef &port) {
|
bool drives_fabric = std::any_of(clock->users.begin(), clock->users.end(),
|
||||||
return !is_clock_port(port);
|
[this](const PortRef &port) { return !is_clock_port(port); });
|
||||||
});
|
|
||||||
int glbid;
|
int glbid;
|
||||||
if (drives_fabric) {
|
if (drives_fabric) {
|
||||||
if (fab_globals.empty())
|
if (fab_globals.empty())
|
||||||
@ -338,11 +337,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void route_ecp5_globals(Context *ctx) {
|
void route_ecp5_globals(Context *ctx) { Ecp5GlobalRouter(ctx).promote_and_route_globals(); }
|
||||||
Ecp5GlobalRouter(ctx).promote_and_route_globals();
|
|
||||||
}
|
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
Loading…
Reference in New Issue
Block a user