diff options
author | David Shah <dave@ds0.me> | 2020-11-16 09:07:25 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-11-30 08:45:28 +0000 |
commit | 30c65931b2bb86b5dfd6140b35672f7db46c8d32 (patch) | |
tree | c897c608db1814104c8d043d069492ab34b381f1 /common | |
parent | 92031816257dbf76e79bce4dc9c4963824932c4d (diff) | |
download | nextpnr-30c65931b2bb86b5dfd6140b35672f7db46c8d32.tar.gz nextpnr-30c65931b2bb86b5dfd6140b35672f7db46c8d32.tar.bz2 nextpnr-30c65931b2bb86b5dfd6140b35672f7db46c8d32.zip |
nexus: Add support for clocked MULT9X9s
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r-- | common/design_utils.cc | 9 | ||||
-rw-r--r-- | common/design_utils.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/common/design_utils.cc b/common/design_utils.cc index 6cd8f0f7..4d1c9e53 100644 --- a/common/design_utils.cc +++ b/common/design_utils.cc @@ -174,4 +174,13 @@ void replace_bus(Context *ctx, CellInfo *old_cell, IdString old_name, int old_of } } +void copy_port(Context *ctx, CellInfo *old_cell, IdString old_name, CellInfo *new_cell, IdString new_name) +{ + if (!old_cell->ports.count(old_name)) + return; + new_cell->ports[new_name].name = new_name; + new_cell->ports[new_name].type = old_cell->ports.at(old_name).type; + connect_port(ctx, old_cell->ports.at(old_name).net, new_cell, new_name); +} + NEXTPNR_NAMESPACE_END diff --git a/common/design_utils.h b/common/design_utils.h index 9d4b0550..c93fe009 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -110,6 +110,9 @@ void print_utilisation(const Context *ctx); 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 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 |