diff options
author | David Shah <dave@ds0.me> | 2020-01-20 15:57:06 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-11-30 08:45:27 +0000 |
commit | 84d542624213ab8639bac31ade79ce27097f4e06 (patch) | |
tree | 5c875473a6b57743ff0f3ac587f8511511e3bc13 /common | |
parent | 887d7c717b957a16e068d082a04d5da58d3eda84 (diff) | |
download | nextpnr-84d542624213ab8639bac31ade79ce27097f4e06.tar.gz nextpnr-84d542624213ab8639bac31ade79ce27097f4e06.tar.bz2 nextpnr-84d542624213ab8639bac31ade79ce27097f4e06.zip |
nexus: Working on validity checking
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r-- | common/design_utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/design_utils.h b/common/design_utils.h index 1ae1d648..301547c6 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -82,6 +82,13 @@ template <typename F1> CellInfo *net_driven_by(const Context *ctx, const NetInfo } } +// Check if a port is used +inline bool port_used(CellInfo *cell, IdString port_name) +{ + auto port_fnd = cell->ports.find(port_name); + return port_fnd != cell->ports.end() && port_fnd->second.net != nullptr; +} + // Connect a net to a port void connect_port(const Context *ctx, NetInfo *net, CellInfo *cell, IdString port_name); |