aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-12 12:13:11 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-12 12:13:11 +0200
commit2f61a9b98a621a35aa4763abaaf27ca12bfbbefa (patch)
treee1d205548f38a14019d22b757b0bf11a58e7886b /common
parent5f813410aabdae3de84e11861248dcd0699b41c2 (diff)
downloadnextpnr-2f61a9b98a621a35aa4763abaaf27ca12bfbbefa.tar.gz
nextpnr-2f61a9b98a621a35aa4763abaaf27ca12bfbbefa.tar.bz2
nextpnr-2f61a9b98a621a35aa4763abaaf27ca12bfbbefa.zip
ice40: Start working on a packer, currently not tested
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/design_utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/design_utils.h b/common/design_utils.h
index 43ff180b..9d027d58 100644
--- a/common/design_utils.h
+++ b/common/design_utils.h
@@ -37,6 +37,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 {
@@ -54,6 +56,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 {