aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/design_utils.h4
-rw-r--r--common/place.cc4
2 files changed, 7 insertions, 1 deletions
diff --git a/common/design_utils.h b/common/design_utils.h
index b57c1cb6..2acc7d20 100644
--- a/common/design_utils.h
+++ b/common/design_utils.h
@@ -40,6 +40,8 @@ template <typename F1>
CellInfo *net_only_drives(NetInfo *net, F1 cell_pred, IdString port,
bool exclusive = false)
{
+ if (net == nullptr)
+ return nullptr;
if (exclusive && (net->users.size() != 1)) {
return nullptr;
} else {
@@ -57,6 +59,8 @@ CellInfo *net_only_drives(NetInfo *net, F1 cell_pred, IdString port,
template <typename F1>
CellInfo *net_driven_by(NetInfo *net, F1 cell_pred, IdString port)
{
+ if (net == nullptr)
+ return nullptr;
if (cell_pred(net->driver.cell) && net->driver.port == port) {
return net->driver.cell;
} else {
diff --git a/common/place.cc b/common/place.cc
index eba71a50..e8fadd16 100644
--- a/common/place.cc
+++ b/common/place.cc
@@ -28,6 +28,7 @@
#include <string.h>
#include <vector>
+#include "arch_place.h"
#include "log.h"
#include "place.h"
@@ -104,7 +105,8 @@ void place_design(Design *design)
while ((bi != blist.end()) &&
((design->chip.getBelType(*bi) != bel_type ||
- !design->chip.checkBelAvail(*bi))))
+ !design->chip.checkBelAvail(*bi)) ||
+ !isValidBelForCell(design, cell, *bi)))
bi++;
if (bi == blist.end())
log_error("Too many \'%s\' used in design\n",