From 2f61a9b98a621a35aa4763abaaf27ca12bfbbefa Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 12 Jun 2018 12:13:11 +0200 Subject: ice40: Start working on a packer, currently not tested Signed-off-by: David Shah --- common/design_utils.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common') 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 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 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 { -- cgit v1.2.3