clangformat

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2019-03-22 10:39:05 +00:00
parent 801675a2c6
commit 23f2fff1c8
4 changed files with 23 additions and 21 deletions

View File

@ -318,7 +318,7 @@ class SAPlacer
"%.0f, wirelen = %.0f, dia = %d, Ra = %.02f \n", "%.0f, wirelen = %.0f, dia = %d, Ra = %.02f \n",
iter, temp, double(curr_timing_cost), double(curr_wirelen_cost), diameter, Raccept); iter, temp, double(curr_timing_cost), double(curr_wirelen_cost), diameter, Raccept);
if (curr_wirelen_cost < 0.95 * avg_wirelen && curr_wirelen_cost > 0) { if (curr_wirelen_cost < 0.95 * avg_wirelen && curr_wirelen_cost > 0) {
avg_wirelen = 0.8 * avg_wirelen + 0.2 * curr_wirelen_cost; avg_wirelen = 0.8 * avg_wirelen + 0.2 * curr_wirelen_cost;
} else { } else {
double diam_next = diameter * (1.0 - 0.44 + Raccept); double diam_next = diameter * (1.0 - 0.44 + Raccept);

View File

@ -904,10 +904,9 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
if (!warn_on_failure || passed) if (!warn_on_failure || passed)
log_info("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "", log_info("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "",
clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target); clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target);
else else if (bool_or_default(ctx->settings, ctx->id("timing/allowFail"), false))
if (bool_or_default(ctx->settings, ctx->id("timing/allowFail"), false))
log_warning("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "", log_warning("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "",
clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target); clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target);
else else
log_nonfatal_error("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "", log_nonfatal_error("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "",
clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target); clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target);

View File

@ -448,25 +448,28 @@ struct ArchArgs
} speed = SPEED_6; } speed = SPEED_6;
}; };
struct DelayKey { struct DelayKey
{
IdString celltype, from, to; IdString celltype, from, to;
inline bool operator==(const DelayKey &other) const { inline bool operator==(const DelayKey &other) const
{
return celltype == other.celltype && from == other.from && to == other.to; return celltype == other.celltype && from == other.from && to == other.to;
} }
}; };
NEXTPNR_NAMESPACE_END NEXTPNR_NAMESPACE_END
namespace std { namespace std {
template<> template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DelayKey>
struct hash<NEXTPNR_NAMESPACE_PREFIX DelayKey> { {
std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DelayKey &dk) const noexcept { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DelayKey &dk) const noexcept
std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.celltype); {
seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.from) + 0x9e3779b9 + (seed << 6) + (seed >> 2); std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.celltype);
seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2); seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.from) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
return seed; seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
} return seed;
}; }
} };
} // namespace std
NEXTPNR_NAMESPACE_BEGIN NEXTPNR_NAMESPACE_BEGIN
struct Arch : BaseCtx struct Arch : BaseCtx

View File

@ -645,10 +645,10 @@ void FPGAViewWidget::mousePressEvent(QMouseEvent *event)
return; return;
bool shift = QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier); bool shift = QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
bool ctrl = QApplication::keyboardModifiers().testFlag(Qt::ControlModifier); bool ctrl = QApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
bool btn_right = event->buttons() & Qt::RightButton; bool btn_right = event->buttons() & Qt::RightButton;
bool btn_mid = event->buttons() & Qt::MidButton; bool btn_mid = event->buttons() & Qt::MidButton;
bool btn_left = event->buttons() & Qt::LeftButton; bool btn_left = event->buttons() & Qt::LeftButton;
if (btn_right || btn_mid || (btn_left && shift)) { if (btn_right || btn_mid || (btn_left && shift)) {
lastDragPos_ = event->pos(); lastDragPos_ = event->pos();
@ -687,8 +687,8 @@ void FPGAViewWidget::mouseMoveEvent(QMouseEvent *event)
bool shift = QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier); bool shift = QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
bool btn_right = event->buttons() & Qt::RightButton; bool btn_right = event->buttons() & Qt::RightButton;
bool btn_mid = event->buttons() & Qt::MidButton; bool btn_mid = event->buttons() & Qt::MidButton;
bool btn_left = event->buttons() & Qt::LeftButton; bool btn_left = event->buttons() & Qt::LeftButton;
if (btn_right || btn_mid || (btn_left && shift)) { if (btn_right || btn_mid || (btn_left && shift)) {
const int dx = event->x() - lastDragPos_.x(); const int dx = event->x() - lastDragPos_.x();