aboutsummaryrefslogtreecommitdiffstats
path: root/common/rulecheck.cc
diff options
context:
space:
mode:
authorD. Shah <dave@ds0.me>2021-01-28 14:59:13 +0000
committerD. Shah <dave@ds0.me>2021-01-28 14:59:13 +0000
commit6ecf7f86c8356cc9b386e017ac0ff1ce4c9c19c9 (patch)
tree83bcc4a10a5da7d3b2ebd4c2660b931a45d293d5 /common/rulecheck.cc
parent0d9790421699a22fc6a5962b41910c3b7d089353 (diff)
downloadnextpnr-6ecf7f86c8356cc9b386e017ac0ff1ce4c9c19c9.tar.gz
nextpnr-6ecf7f86c8356cc9b386e017ac0ff1ce4c9c19c9.tar.bz2
nextpnr-6ecf7f86c8356cc9b386e017ac0ff1ce4c9c19c9.zip
cleanup: Remove dead/unused code
Note that some '#if 0' code that might still be useful for debugging in the future has been retained. Signed-off-by: D. Shah <dave@ds0.me>
Diffstat (limited to 'common/rulecheck.cc')
-rw-r--r--common/rulecheck.cc69
1 files changed, 0 insertions, 69 deletions
diff --git a/common/rulecheck.cc b/common/rulecheck.cc
deleted file mode 100644
index 1db9ae00..00000000
--- a/common/rulecheck.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-#include <assert.h>
-#include <string>
-#include "log.h"
-#include "nextpnr.h"
-
-NEXTPNR_NAMESPACE_BEGIN
-
-bool check_all_nets_driven(Context *ctx)
-{
- const bool debug = false;
-
- log_info("Rule checker, verifying imported design\n");
-
- for (auto &cell_entry : ctx->cells) {
- CellInfo *cell = cell_entry.second.get();
-
- if (debug)
- 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;
-
- if (debug)
- log_info(" Checking name of port \'%s\' "
- "against \'%s\'\n",
- port_entry.first.c_str(ctx), port.name.c_str(ctx));
- NPNR_ASSERT(port.name == port_entry.first);
- NPNR_ASSERT(!port.name.empty());
-
- 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));
- } else {
- NPNR_ASSERT(port.net);
- if (debug)
- log_info(" Checking for a net named \'%s\'\n", port.net->name.c_str(ctx));
- NPNR_ASSERT(ctx->nets.count(port.net->name) > 0);
- }
- }
- }
-
- for (auto &net_entry : ctx->nets) {
- NetInfo *net = net_entry.second.get();
-
- NPNR_ASSERT(net->name == net_entry.first);
- 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));
- NPNR_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 (debug)
- log_info(" Checking for a user cell named \'%s\'\n", user.cell->name.c_str(ctx));
- NPNR_ASSERT(ctx->cells.count(user.cell->name) > 0);
- }
- }
- }
-
- if (debug)
- log_info(" Verified!\n");
- return true;
-}
-
-NEXTPNR_NAMESPACE_END