diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2020-11-30 10:56:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 10:56:59 +0100 |
commit | 8b5c0dc1e49b692b0bb598a90034c27db653622d (patch) | |
tree | afd13c654df1faa0b5df9f11be74eede087fa564 /common/design_utils.h | |
parent | 1afa494e69e3c8af3dd5d1685b9cd2b1d3bea4d0 (diff) | |
parent | 2fe8bebc6ce464afadef2403a8331031e16c5a5d (diff) | |
download | nextpnr-8b5c0dc1e49b692b0bb598a90034c27db653622d.tar.gz nextpnr-8b5c0dc1e49b692b0bb598a90034c27db653622d.tar.bz2 nextpnr-8b5c0dc1e49b692b0bb598a90034c27db653622d.zip |
Merge pull request #524 from daveshah1/nextpnr-nexus
Upstreaming basic support for Nexus devices
Diffstat (limited to 'common/design_utils.h')
-rw-r--r-- | common/design_utils.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/design_utils.h b/common/design_utils.h index 1ae1d648..6f52eb0c 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); @@ -99,6 +106,17 @@ void rename_net(Context *ctx, NetInfo *net, IdString new_name); void print_utilisation(const Context *ctx); +// Disconnect a bus of nets (if connected) from old, and connect it to the new ports +void replace_bus(Context *ctx, CellInfo *old_cell, IdString old_name, int old_offset, bool old_brackets, + CellInfo *new_cell, IdString new_name, int new_offset, bool new_brackets, int width); + +// Copy a bus of nets (if connected) from old, and connect it to the new ports +void copy_bus(Context *ctx, CellInfo *old_cell, IdString old_name, int old_offset, bool old_brackets, + CellInfo *new_cell, IdString new_name, int new_offset, bool new_brackets, int width); + +// Copy a port from one cell to another +void copy_port(Context *ctx, CellInfo *old_cell, IdString old_name, CellInfo *new_cell, IdString new_name); + NEXTPNR_NAMESPACE_END #endif |