clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
c89037db49
commit
a29a17f8f2
@ -391,7 +391,6 @@ po::options_description CommandHandler::getGeneralOptions()
|
||||
|
||||
general.add_options()("static-dump-density", "write density csv files during placer-static flow");
|
||||
|
||||
|
||||
#if !defined(NPNR_DISABLE_THREADS)
|
||||
general.add_options()("parallel-refine", "use new experimental parallelised engine for placement refinement");
|
||||
#endif
|
||||
@ -549,7 +548,6 @@ void CommandHandler::setupContext(Context *ctx)
|
||||
if (vm.count("static-dump-density"))
|
||||
ctx->settings[ctx->id("static/dump_density")] = true;
|
||||
|
||||
|
||||
// Setting default values
|
||||
if (ctx->settings.find(ctx->id("target_freq")) == ctx->settings.end())
|
||||
ctx->settings[ctx->id("target_freq")] = std::to_string(12e6);
|
||||
|
@ -71,9 +71,9 @@ struct ThreadState : DetailPlacerThreadState
|
||||
BelId old_bel = cell->bel;
|
||||
CellInfo *bound = nullptr;
|
||||
{
|
||||
#if !defined(NPNR_DISABLE_THREADS)
|
||||
std::shared_lock<std::shared_timed_mutex> l(g.archapi_mutex);
|
||||
#endif
|
||||
#if !defined(NPNR_DISABLE_THREADS)
|
||||
std::shared_lock<std::shared_timed_mutex> l(g.archapi_mutex);
|
||||
#endif
|
||||
bound = ctx->getBoundBelCell(new_bel);
|
||||
}
|
||||
if (bound && (bound->belStrength > STRENGTH_STRONG || bound->cluster != ClusterId()))
|
||||
@ -127,9 +127,9 @@ struct ThreadState : DetailPlacerThreadState
|
||||
used_bels.insert(db.second);
|
||||
CellInfo *bound = nullptr;
|
||||
{
|
||||
#if !defined(NPNR_DISABLE_THREADS)
|
||||
std::shared_lock<std::shared_timed_mutex> l(g.archapi_mutex);
|
||||
#endif
|
||||
#if !defined(NPNR_DISABLE_THREADS)
|
||||
std::shared_lock<std::shared_timed_mutex> l(g.archapi_mutex);
|
||||
#endif
|
||||
bound = ctx->getBoundBelCell(db.second);
|
||||
}
|
||||
if (bound) {
|
||||
@ -160,9 +160,9 @@ struct ThreadState : DetailPlacerThreadState
|
||||
} else {
|
||||
bool avail = false;
|
||||
{
|
||||
#if !defined(NPNR_DISABLE_THREADS)
|
||||
std::shared_lock<std::shared_timed_mutex> l(g.archapi_mutex);
|
||||
#endif
|
||||
#if !defined(NPNR_DISABLE_THREADS)
|
||||
std::shared_lock<std::shared_timed_mutex> l(g.archapi_mutex);
|
||||
#endif
|
||||
avail = ctx->checkBelAvail(db.second);
|
||||
}
|
||||
if (!avail)
|
||||
|
@ -420,7 +420,8 @@ class StaticPlacer
|
||||
if (!ctx->isBelLocationValid(bel)) {
|
||||
ctx->unbindBel(bel);
|
||||
} else {
|
||||
log_info(" placed potpourri cell '%s' at bel '%s'\n", ctx->nameOf(ci), ctx->nameOfBel(bel));
|
||||
log_info(" placed potpourri cell '%s' at bel '%s'\n", ctx->nameOf(ci),
|
||||
ctx->nameOfBel(bel));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1003,14 +1004,15 @@ class StaticPlacer
|
||||
float penalty_beta = 2.0e3f;
|
||||
float alpha_l = 1.05f, alpha_h = 1.06f;
|
||||
double penalty_incr = alpha_h - 1;
|
||||
void update_penalties() {
|
||||
void update_penalties()
|
||||
{
|
||||
float pot_norm = 0;
|
||||
// compute L2-norm of relative system potential
|
||||
std::vector<float> rel_pot;
|
||||
for (int g = 0; g < int(groups.size()); g++) {
|
||||
auto &group = groups.at(g);
|
||||
if (!group.enabled)
|
||||
continue;
|
||||
continue;
|
||||
float phi_hat = group.curr_potential / group.init_potential;
|
||||
rel_pot.push_back(phi_hat);
|
||||
pot_norm += phi_hat * phi_hat;
|
||||
@ -1019,17 +1021,16 @@ class StaticPlacer
|
||||
log_info("pot_norm: %f\n", pot_norm);
|
||||
// update penalty multiplier (ELFPlace equation 22)
|
||||
double log_term = std::log(penalty_beta * pot_norm + 1);
|
||||
penalty_incr = penalty_incr * ((log_term / (log_term + 1)) * (alpha_h - alpha_l) + alpha_l);
|
||||
penalty_incr = penalty_incr * ((log_term / (log_term + 1)) * (alpha_h - alpha_l) + alpha_l);
|
||||
// update density penalties (ELFPlace equation 21)
|
||||
for (int g = 0; g < int(groups.size()); g++) {
|
||||
if (!groups.at(g).enabled)
|
||||
continue;
|
||||
continue;
|
||||
float next_penalty = dens_penalty.at(g) + (penalty_incr * (rel_pot.at(g) / pot_norm));
|
||||
dens_penalty.at(g) = next_penalty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void initialise()
|
||||
{
|
||||
float initial_steplength = 0.01f;
|
||||
@ -1152,7 +1153,8 @@ class StaticPlacer
|
||||
RealPair drv_loc = cell_loc(ni->driver.cell, false);
|
||||
for (auto usr : ni->users.enumerate()) {
|
||||
RealPair usr_loc = cell_loc(usr.value.cell, false);
|
||||
delay_t est_delay = cfg.timing_c + cfg.timing_mx * std::abs(drv_loc.x - usr_loc.x) + cfg.timing_my * std::abs(drv_loc.y - usr_loc.y);
|
||||
delay_t est_delay = cfg.timing_c + cfg.timing_mx * std::abs(drv_loc.x - usr_loc.x) +
|
||||
cfg.timing_my * std::abs(drv_loc.y - usr_loc.y);
|
||||
tmg.set_route_delay(CellPortKey(usr.value), DelayPair(est_delay));
|
||||
}
|
||||
}
|
||||
|
@ -1548,7 +1548,7 @@ struct ECP5Bitgen
|
||||
cc.tiles[tile].add_enum(eclkb + ".MODE", "ECLKBRIDGECS");
|
||||
} else if (ci->type == id_DDRDLL) {
|
||||
Loc loc = ctx->getBelLocation(ci->bel);
|
||||
bool u = loc.y<15, r = loc.x> 15;
|
||||
bool u = loc.y < 15, r = loc.x > 15;
|
||||
std::string tiletype = fmt_str("DDRDLL_" << (u ? 'U' : 'L') << (r ? 'R' : 'L'));
|
||||
if ((ctx->args.type == ArchArgs::LFE5U_12F || ctx->args.type == ArchArgs::LFE5U_25F ||
|
||||
ctx->args.type == ArchArgs::LFE5UM_25F || ctx->args.type == ArchArgs::LFE5UM5G_25F) &&
|
||||
|
@ -134,9 +134,9 @@ void gfxTileBel(std::vector<GraphicElement> &g, int x, int y, int z, int w, int
|
||||
}
|
||||
g.push_back(el);
|
||||
} else if (bel_type == id_DCCA) {
|
||||
el.x1 = x + switchbox_x1 + (z)*0.025;
|
||||
el.x1 = x + switchbox_x1 + (z) * 0.025;
|
||||
el.y1 = y + 0.14;
|
||||
el.x2 = x + switchbox_x1 + (z)*0.025 + 0.020;
|
||||
el.x2 = x + switchbox_x1 + (z) * 0.025 + 0.020;
|
||||
el.y2 = y + 0.18;
|
||||
g.push_back(el);
|
||||
} else if (bel_type.in(id_DP16KD, id_MULT18X18D, id_ALU54B)) {
|
||||
|
@ -136,7 +136,7 @@ struct FabFasmWriter
|
||||
continue;
|
||||
unsigned pip_data = pip_tags.at(pip.index).data;
|
||||
unsigned from_pin = (pip_data >> 4) & 0xF;
|
||||
unsigned to_pin = (pip_data)&0xF;
|
||||
unsigned to_pin = (pip_data) & 0xF;
|
||||
NPNR_ASSERT(to_pin == i);
|
||||
phys_to_log[from_pin].push_back(i);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ class LineShader
|
||||
|
||||
public:
|
||||
LineShader(QObject *parent) : parent_(parent), program_(nullptr) {}
|
||||
~LineShader() { ((QOpenGLWidget*) parent_)->makeCurrent(); }
|
||||
~LineShader() { ((QOpenGLWidget *)parent_)->makeCurrent(); }
|
||||
|
||||
static constexpr const char *vertexShaderSource_ =
|
||||
"#version 150\n"
|
||||
|
@ -18,11 +18,11 @@
|
||||
*/
|
||||
|
||||
#include "arch.h"
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include "archdefs.h"
|
||||
#include "chipdb.h"
|
||||
#include "log.h"
|
||||
#include "nextpnr.h"
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include "command.h"
|
||||
#include "placer1.h"
|
||||
|
Loading…
Reference in New Issue
Block a user