From 6d23461bcd83d27c6b365948a5e85db80389832e Mon Sep 17 00:00:00 2001 From: "D. Shah" Date: Fri, 29 Jan 2021 12:12:12 +0000 Subject: ecp5: Proof-of-concept using IdStringList for bel names This uses the new IdStringList API to store bel names for the ECP5. Note that other arches and the GUI do not yet build with this proof-of-concept patch. getBelByName still uses the old implementation and could be more efficiently implemented with further development. Signed-off-by: D. Shah --- ecp5/globals.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ecp5/globals.cc') diff --git a/ecp5/globals.cc b/ecp5/globals.cc index 218090e1..ad99272e 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -176,8 +176,8 @@ class Ecp5GlobalRouter } } if (upstream.size() > 30000) { - log_error("failed to route HPBX%02d00 to %s.%s\n", global_index, - ctx->getBelName(user.cell->bel).c_str(ctx), user.port.c_str(ctx)); + log_error("failed to route HPBX%02d00 to %s.%s\n", global_index, ctx->nameOfBel(user.cell->bel), + user.port.c_str(ctx)); } } // Set all the pips we found along the way @@ -300,7 +300,7 @@ class Ecp5GlobalRouter if (drv.cell == nullptr) { return 0; } else if (drv.cell->attrs.count(ctx->id("BEL"))) { - drv_bel = ctx->getBelByName(ctx->id(drv.cell->attrs.at(ctx->id("BEL")).as_string())); + drv_bel = ctx->getBelByNameStr(drv.cell->attrs.at(ctx->id("BEL")).as_string()); } else { // Check if driver is a singleton BelId last_bel; -- cgit v1.2.3 From 9388df19d3ab3ca1b127defafe6fa3f71147f451 Mon Sep 17 00:00:00 2001 From: "D. Shah" Date: Fri, 29 Jan 2021 12:58:41 +0000 Subject: refactor: Replace getXName().c_str(ctx) with ctx->nameOfX This makes the ongoing migration to IdStringList easier. Signed-off-by: D. Shah --- ecp5/globals.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'ecp5/globals.cc') diff --git a/ecp5/globals.cc b/ecp5/globals.cc index ad99272e..478e5fac 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -238,8 +238,7 @@ class Ecp5GlobalRouter if (visit.empty() || visit.size() > 50000) { if (allow_fail) return false; - log_error("cannot route global from %s to %s.\n", ctx->getWireName(src).c_str(ctx), - ctx->getWireName(dst).c_str(ctx)); + log_error("cannot route global from %s to %s.\n", ctx->nameOfWire(src), ctx->nameOfWire(dst)); } cursor = visit.front(); visit.pop(); @@ -325,8 +324,8 @@ class Ecp5GlobalRouter } else { // Check for dedicated routing if (has_short_route(ctx->getBelPinWire(drv_bel, drv.port), ctx->getBelPinWire(dcc->bel, id_CLKI))) { - // log_info("dedicated route %s -> %s\n", ctx->getWireName(ctx->getBelPinWire(drv_bel, - // drv.port)).c_str(ctx), ctx->getBelName(dcc->bel).c_str(ctx)); + // log_info("dedicated route %s -> %s\n", ctx->nameOfWire(ctx->getBelPinWire(drv_bel, + // drv.port)), ctx->nameOfWire(dcc->bel)); dedicated_routing = true; return 0; } @@ -347,8 +346,8 @@ class Ecp5GlobalRouter while (true) { if (visit.empty() || visit.size() > 10000) { - // log_info ("dist %s -> %s = inf\n", ctx->getWireName(src).c_str(ctx), - // ctx->getWireName(dst).c_str(ctx)); + // log_info ("dist %s -> %s = inf\n", ctx->nameOfWire(src), + // ctx->nameOfWire(dst)); return false; } cursor = visit.front(); @@ -372,7 +371,7 @@ class Ecp5GlobalRouter cursor = ctx->getPipSrcWire(fnd->second); length++; } - // log_info ("dist %s -> %s = %d\n", ctx->getWireName(src).c_str(ctx), ctx->getWireName(dst).c_str(ctx), + // log_info ("dist %s -> %s = %d\n", ctx->nameOfWire(src), ctx->nameOfWire(dst), // length); return length < thresh; } -- cgit v1.2.3