aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/design_utils.cc8
-rw-r--r--common/log.cc12
-rw-r--r--common/log.h18
-rw-r--r--common/place_sa.cc8
-rw-r--r--common/route.cc1
-rw-r--r--frontend/json/jsonparse.cc9
-rw-r--r--ice40/pack.cc28
7 files changed, 36 insertions, 48 deletions
diff --git a/common/design_utils.cc b/common/design_utils.cc
index 4fbd16f1..535b6fda 100644
--- a/common/design_utils.cc
+++ b/common/design_utils.cc
@@ -64,11 +64,13 @@ void print_utilisation(const Context *ctx)
for (auto bel : ctx->getBels()) {
available_types[ctx->getBelType(bel)]++;
}
- log("\nDesign utilisation:\n");
+ log_break();
+ log_info("Device utilisation:\n");
for (auto type : available_types) {
- log("\t%20s: %5d/%5d\n", ctx->belTypeToId(type.first).c_str(ctx),
- get_or_default(used_types, type.first, 0), type.second);
+ log_info("\t%20s: %5d/%5d\n", ctx->belTypeToId(type.first).c_str(ctx),
+ get_or_default(used_types, type.first, 0), type.second);
}
+ log_break();
}
NEXTPNR_NAMESPACE_END
diff --git a/common/log.cc b/common/log.cc
index 2868e03f..b0cd802a 100644
--- a/common/log.cc
+++ b/common/log.cc
@@ -212,7 +212,7 @@ void log_cmd_error(const char *format, ...)
logv_error(format, ap);
}
-void log_spacer()
+void log_break()
{
if (log_newline_count < 2)
log("\n");
@@ -220,12 +220,6 @@ void log_spacer()
log("\n");
}
-void log_push() {}
-
-void log_pop() { log_flush(); }
-
-void log_reset_stack() { log_flush(); }
-
void log_flush()
{
for (auto f : log_files)
@@ -235,8 +229,4 @@ void log_flush()
f->flush();
}
-void log_cell(CellInfo *cell, std::string indent) {}
-
-void log_net(NetInfo *net, std::string indent) {}
-
NEXTPNR_NAMESPACE_END
diff --git a/common/log.h b/common/log.h
index 597b5fac..381843b3 100644
--- a/common/log.h
+++ b/common/log.h
@@ -71,25 +71,9 @@ NXP_NORETURN void log_error(const char *format, ...)
NXP_NORETURN void log_cmd_error(const char *format, ...)
NXP_ATTRIBUTE(format(printf, 1, 2), noreturn);
-void log_spacer();
-void log_push();
-void log_pop();
-
-void log_backtrace(const char *prefix, int levels);
-void log_reset_stack();
+void log_break();
void log_flush();
-/*
-const char *log_id(RTLIL::IdString id);
-
-template<typename T> static inline const char *log_id(T *obj) {
- return log_id(obj->name);
-}
-*/
-
-void log_cell(CellInfo *cell, std::string indent = "");
-void log_net(NetInfo *net, std::string indent = "");
-
#ifndef NDEBUG
static inline void log_assert_worker(bool cond, const char *expr,
const char *file, int line)
diff --git a/common/place_sa.cc b/common/place_sa.cc
index 2f8fb122..591766aa 100644
--- a/common/place_sa.cc
+++ b/common/place_sa.cc
@@ -77,6 +77,8 @@ class SAPlacer
bool place()
{
+ log_break();
+
size_t placed_cells = 0;
// Initial constraints placer
for (auto cell_entry : ctx->cells) {
@@ -408,9 +410,9 @@ class SAPlacer
delta = new_wirelength - curr_wirelength;
n_move++;
// SA acceptance criterea
- if (delta < 0 ||
- (temp > 1e-6 && (ctx->rng() / float(0x3fffffff)) <=
- std::exp(-(delta / 2) / temp))) {
+ if (delta < 0 || (temp > 1e-6 &&
+ (ctx->rng() / float(0x3fffffff)) <=
+ std::exp(-(delta / 2) / temp))) {
n_accept++;
if (delta < 2)
improved = true;
diff --git a/common/route.cc b/common/route.cc
index cf87ebaa..bdb2f5b5 100644
--- a/common/route.cc
+++ b/common/route.cc
@@ -406,6 +406,7 @@ bool route_design(Context *ctx)
delay_t ripup_penalty = ctx->getRipupDelayPenalty();
RipupScoreboard scores;
+ log_break();
log_info("Routing..\n");
std::unordered_set<IdString> netsQueue;
diff --git a/frontend/json/jsonparse.cc b/frontend/json/jsonparse.cc
index a936bdaa..32ae0953 100644
--- a/frontend/json/jsonparse.cc
+++ b/frontend/json/jsonparse.cc
@@ -659,7 +659,8 @@ static void insert_iobuf(Context *ctx, NetInfo *net, PortType type,
std::copy(net->attrs.begin(), net->attrs.end(),
std::inserter(iobuf->attrs, iobuf->attrs.begin()));
if (type == PORT_IN) {
- log_info("processing input port %s\n", name.c_str());
+ if (ctx->verbose)
+ log_info("processing input port %s\n", name.c_str());
iobuf->type = ctx->id("$nextpnr_ibuf");
iobuf->ports[ctx->id("O")] = PortInfo{ctx->id("O"), net, PORT_OUT};
// Special case: input, etc, directly drives inout
@@ -671,7 +672,8 @@ static void insert_iobuf(Context *ctx, NetInfo *net, PortType type,
net->driver.port = ctx->id("O");
net->driver.cell = iobuf;
} else if (type == PORT_OUT) {
- log_info("processing output port %s\n", name.c_str());
+ if (ctx->verbose)
+ log_info("processing output port %s\n", name.c_str());
iobuf->type = ctx->id("$nextpnr_obuf");
iobuf->ports[ctx->id("I")] = PortInfo{ctx->id("I"), net, PORT_IN};
PortRef ref;
@@ -679,7 +681,8 @@ static void insert_iobuf(Context *ctx, NetInfo *net, PortType type,
ref.port = ctx->id("I");
net->users.push_back(ref);
} else if (type == PORT_INOUT) {
- log_info("processing inout port %s\n", name.c_str());
+ if (ctx->verbose)
+ log_info("processing inout port %s\n", name.c_str());
iobuf->type = ctx->id("$nextpnr_iobuf");
iobuf->ports[ctx->id("I")] = PortInfo{ctx->id("I"), nullptr, PORT_IN};
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 853f510e..8a6f1c45 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -36,8 +36,9 @@ static void pack_lut_lutffs(Context *ctx)
std::vector<CellInfo *> new_cells;
for (auto cell : ctx->cells) {
CellInfo *ci = cell.second;
- log_info("cell '%s' is of type '%s'\n", ci->name.c_str(ctx),
- ci->type.c_str(ctx));
+ if (ctx->verbose)
+ log_info("cell '%s' is of type '%s'\n", ci->name.c_str(ctx),
+ ci->type.c_str(ctx));
if (is_lut(ctx, ci)) {
CellInfo *packed = create_ice_cell(ctx, "ICESTORM_LC",
ci->name.str(ctx) + "_LC");
@@ -45,8 +46,9 @@ static void pack_lut_lutffs(Context *ctx)
std::inserter(packed->attrs, packed->attrs.begin()));
packed_cells.insert(ci->name);
new_cells.push_back(packed);
- log_info("packed cell %s into %s\n", ci->name.c_str(ctx),
- packed->name.c_str(ctx));
+ if (ctx->verbose)
+ log_info("packed cell %s into %s\n", ci->name.c_str(ctx),
+ packed->name.c_str(ctx));
// See if we can pack into a DFF
// TODO: LUT cascade
NetInfo *o = ci->ports.at(ctx->id("O")).net;
@@ -54,7 +56,8 @@ static void pack_lut_lutffs(Context *ctx)
auto lut_bel = ci->attrs.find(ctx->id("BEL"));
bool packed_dff = false;
if (dff) {
- log_info("found attached dff %s\n", dff->name.c_str(ctx));
+ if (ctx->verbose)
+ log_info("found attached dff %s\n", dff->name.c_str(ctx));
auto dff_bel = dff->attrs.find(ctx->id("BEL"));
if (lut_bel != ci->attrs.end() && dff_bel != dff->attrs.end() &&
lut_bel->second != dff_bel->second) {
@@ -66,8 +69,9 @@ static void pack_lut_lutffs(Context *ctx)
if (dff_bel != dff->attrs.end())
packed->attrs[ctx->id("BEL")] = dff_bel->second;
packed_cells.insert(dff->name);
- log_info("packed cell %s into %s\n", dff->name.c_str(ctx),
- packed->name.c_str(ctx));
+ if (ctx->verbose)
+ log_info("packed cell %s into %s\n",
+ dff->name.c_str(ctx), packed->name.c_str(ctx));
packed_dff = true;
}
}
@@ -99,8 +103,9 @@ static void pack_nonlut_ffs(Context *ctx)
ci->name.str(ctx) + "_DFFLC");
std::copy(ci->attrs.begin(), ci->attrs.end(),
std::inserter(packed->attrs, packed->attrs.begin()));
- log_info("packed cell %s into %s\n", ci->name.c_str(ctx),
- packed->name.c_str(ctx));
+ if (ctx->verbose)
+ log_info("packed cell %s into %s\n", ci->name.c_str(ctx),
+ packed->name.c_str(ctx));
packed_cells.insert(ci->name);
new_cells.push_back(packed);
dff_to_lc(ctx, ci, packed, true);
@@ -242,8 +247,9 @@ static void set_net_constant(const Context *ctx, NetInfo *orig,
for (auto user : orig->users) {
if (user.cell != nullptr) {
CellInfo *uc = user.cell;
- log_info("%s user %s\n", orig->name.c_str(ctx),
- uc->name.c_str(ctx));
+ if (ctx->verbose)
+ log_info("%s user %s\n", orig->name.c_str(ctx),
+ uc->name.c_str(ctx));
if ((is_lut(ctx, uc) || is_lc(ctx, uc)) &&
(user.port.str(ctx).at(0) == 'I') && !constval) {
uc->ports[user.port].net = nullptr;