aboutsummaryrefslogtreecommitdiffstats
path: root/common/placer1.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-08-08 19:36:05 +0200
committerGitHub <noreply@github.com>2018-08-08 19:36:05 +0200
commitb326b03a5261a824f428fe0811a5376c8758b929 (patch)
treea13673a636ddbea3b5fd5585e3bb109b56b69435 /common/placer1.cc
parentcd4e761bb799ca99f02d3aa177961af28a93f2d8 (diff)
parentf6189e4677c7bdaeaa5b9b796a67d750e6c7d49d (diff)
downloadnextpnr-b326b03a5261a824f428fe0811a5376c8758b929.tar.gz
nextpnr-b326b03a5261a824f428fe0811a5376c8758b929.tar.bz2
nextpnr-b326b03a5261a824f428fe0811a5376c8758b929.zip
Merge pull request #45 from YosysHQ/constids
Get rid of PortPin and BelType
Diffstat (limited to 'common/placer1.cc')
-rw-r--r--common/placer1.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index 51ef271a..91320240 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -51,7 +51,7 @@ class SAPlacer
int num_bel_types = 0;
for (auto bel : ctx->getBels()) {
Loc loc = ctx->getBelLocation(bel);
- BelType type = ctx->getBelType(bel);
+ IdString type = ctx->getBelType(bel);
int type_idx;
if (bel_types.find(type) == bel_types.end()) {
type_idx = num_bel_types++;
@@ -91,17 +91,17 @@ class SAPlacer
loc_name.c_str(), cell->name.c_str(ctx));
}
- BelType bel_type = ctx->getBelType(bel);
- if (bel_type != ctx->belTypeFromId(cell->type)) {
+ IdString bel_type = ctx->getBelType(bel);
+ if (bel_type != cell->type) {
log_error("Bel \'%s\' of type \'%s\' does not match cell "
"\'%s\' of type \'%s\'\n",
- loc_name.c_str(), ctx->belTypeToId(bel_type).c_str(ctx), cell->name.c_str(ctx),
+ loc_name.c_str(), bel_type.c_str(ctx), cell->name.c_str(ctx),
cell->type.c_str(ctx));
}
if (!ctx->isValidBelForCell(cell, bel)) {
log_error("Bel \'%s\' of type \'%s\' is not valid for cell "
"\'%s\' of type \'%s\'\n",
- loc_name.c_str(), ctx->belTypeToId(bel_type).c_str(ctx), cell->name.c_str(ctx),
+ loc_name.c_str(), bel_type.c_str(ctx), cell->name.c_str(ctx),
cell->type.c_str(ctx));
}
@@ -300,7 +300,7 @@ class SAPlacer
if (cell->bel != BelId()) {
ctx->unbindBel(cell->bel);
}
- BelType targetType = ctx->belTypeFromId(cell->type);
+ IdString targetType = cell->type;
for (auto bel : ctx->getBels()) {
if (ctx->getBelType(bel) == targetType && ctx->isValidBelForCell(cell, bel)) {
if (ctx->checkBelAvail(bel)) {
@@ -423,7 +423,7 @@ class SAPlacer
// diameter
BelId random_bel_for_cell(CellInfo *cell)
{
- BelType targetType = ctx->belTypeFromId(cell->type);
+ IdString targetType = cell->type;
Loc curr_loc = ctx->getBelLocation(cell->bel);
while (true) {
int nx = ctx->rng(2 * diameter + 1) + std::max(curr_loc.x - diameter, 0);
@@ -451,7 +451,7 @@ class SAPlacer
bool improved = false;
int n_move, n_accept;
int diameter = 35, max_x = 1, max_y = 1;
- std::unordered_map<BelType, int> bel_types;
+ std::unordered_map<IdString, int> bel_types;
std::vector<std::vector<std::vector<std::vector<BelId>>>> fast_bels;
std::unordered_set<BelId> locked_bels;
bool require_legal = false;