aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/place_sa.cc9
-rw-r--r--common/rulecheck.cc23
2 files changed, 11 insertions, 21 deletions
diff --git a/common/place_sa.cc b/common/place_sa.cc
index a12e409b..55496f07 100644
--- a/common/place_sa.cc
+++ b/common/place_sa.cc
@@ -36,7 +36,6 @@
#include <stdlib.h>
#include <string.h>
#include <vector>
-#include "arch_place.h"
#include "log.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -48,7 +47,6 @@ class SAPlacer
public:
SAPlacer(Context *ctx, bool timing_driven) : ctx(ctx), timing_driven(timing_driven)
{
- checker = new PlaceValidityChecker(ctx);
int num_bel_types = 0;
for (auto bel : ctx->getBels()) {
int x, y;
@@ -222,7 +220,7 @@ class SAPlacer
// Final post-pacement validitiy check
for (auto bel : ctx->getBels()) {
IdString cell = ctx->getBoundBelCell(bel);
- if (!checker->isBelLocationValid(bel)) {
+ if (!ctx->isBelLocationValid(bel)) {
std::string cell_text = "no cell";
if (cell != IdString())
cell_text = std::string("cell '") + cell.str(ctx) + "'";
@@ -257,7 +255,7 @@ class SAPlacer
}
BelType targetType = ctx->belTypeFromId(cell->type);
for (auto bel : ctx->getBels()) {
- if (ctx->getBelType(bel) == targetType && checker->isValidBelForCell(cell, bel)) {
+ if (ctx->getBelType(bel) == targetType && ctx->isValidBelForCell(cell, bel)) {
if (ctx->checkBelAvail(bel)) {
uint64_t score = ctx->rng64();
if (score <= best_score) {
@@ -376,7 +374,7 @@ class SAPlacer
ctx->bindBel(oldBel, other_cell->name, STRENGTH_WEAK);
}
- if (!checker->isBelLocationValid(newBel) || ((other != IdString() && !checker->isBelLocationValid(oldBel)))) {
+ if (!ctx->isBelLocationValid(newBel) || ((other != IdString() && !ctx->isBelLocationValid(oldBel)))) {
ctx->unbindBel(newBel);
if (other != IdString())
ctx->unbindBel(oldBel);
@@ -457,7 +455,6 @@ class SAPlacer
std::unordered_map<BelType, int> bel_types;
std::vector<std::vector<std::vector<std::vector<BelId>>>> fast_bels;
std::unordered_set<BelId> locked_bels;
- PlaceValidityChecker *checker;
};
bool place_design_sa(Context *ctx, bool timing_driven)
diff --git a/common/rulecheck.cc b/common/rulecheck.cc
index 9b1ee7fe..c27d33ea 100644
--- a/common/rulecheck.cc
+++ b/common/rulecheck.cc
@@ -15,8 +15,7 @@ bool check_all_nets_driven(Context *ctx)
CellInfo *cell = cell_entry.second;
if (debug)
- log_info(" Examining cell \'%s\', of type \'%s\'\n",
- cell->name.c_str(ctx), cell->type.c_str(ctx));
+ log_info(" Examining cell \'%s\', of type \'%s\'\n", cell->name.c_str(ctx), cell->type.c_str(ctx));
for (auto port_entry : cell->ports) {
PortInfo &port = port_entry.second;
@@ -29,14 +28,12 @@ bool check_all_nets_driven(Context *ctx)
if (port.net == NULL) {
if (debug)
- log_warning(
- " Port \'%s\' in cell \'%s\' is unconnected\n",
- port.name.c_str(ctx), cell->name.c_str(ctx));
+ log_warning(" Port \'%s\' in cell \'%s\' is unconnected\n", port.name.c_str(ctx),
+ cell->name.c_str(ctx));
} else {
assert(port.net);
if (debug)
- log_info(" Checking for a net named \'%s\'\n",
- port.net->name.c_str(ctx));
+ log_info(" Checking for a net named \'%s\'\n", port.net->name.c_str(ctx));
assert(ctx->nets.count(port.net->name) > 0);
}
}
@@ -46,23 +43,19 @@ bool check_all_nets_driven(Context *ctx)
NetInfo *net = net_entry.second;
assert(net->name == net_entry.first);
- if ((net->driver.cell != NULL) &&
- (net->driver.cell->type != ctx->id("GND")) &&
+ if ((net->driver.cell != NULL) && (net->driver.cell->type != ctx->id("GND")) &&
(net->driver.cell->type != ctx->id("VCC"))) {
if (debug)
- log_info(" Checking for a driver cell named \'%s\'\n",
- net->driver.cell->name.c_str(ctx));
+ log_info(" Checking for a driver cell named \'%s\'\n", net->driver.cell->name.c_str(ctx));
assert(ctx->cells.count(net->driver.cell->name) > 0);
}
for (auto user : net->users) {
- if ((user.cell != NULL) && (user.cell->type != ctx->id("GND")) &&
- (user.cell->type != ctx->id("VCC"))) {
+ if ((user.cell != NULL) && (user.cell->type != ctx->id("GND")) && (user.cell->type != ctx->id("VCC"))) {
if (debug)
- log_info(" Checking for a user cell named \'%s\'\n",
- user.cell->name.c_str(ctx));
+ log_info(" Checking for a user cell named \'%s\'\n", user.cell->name.c_str(ctx));
assert(ctx->cells.count(user.cell->name) > 0);
}
}