diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/util.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/common/util.h b/common/util.h index 81d7e47d..2ccfe5d2 100644 --- a/common/util.h +++ b/common/util.h @@ -119,7 +119,16 @@ inline const NetInfo *get_net_or_empty(const CellInfo *cell, const IdString port return found->second.net; else return nullptr; -}; +} + +inline NetInfo *get_net_or_empty(CellInfo *cell, const IdString port) +{ + auto found = cell->ports.find(port); + if (found != cell->ports.end()) + return found->second.net; + else + return nullptr; +} NEXTPNR_NAMESPACE_END |