From 84d542624213ab8639bac31ade79ce27097f4e06 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 20 Jan 2020 15:57:06 +0000 Subject: nexus: Working on validity checking Signed-off-by: David Shah --- common/design_utils.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/design_utils.h') 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 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); -- cgit v1.2.3 From 90608f2c898c179cb95fb469633867e7adc64fc4 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 13 Nov 2020 10:06:53 +0000 Subject: nexus: Add some infrastructure for DSP packing Signed-off-by: David Shah --- common/design_utils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common/design_utils.h') diff --git a/common/design_utils.h b/common/design_utils.h index 301547c6..3a2245a7 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -104,6 +104,12 @@ void rename_port(Context *ctx, CellInfo *cell, IdString old_name, IdString new_n // Rename a net without invalidating pointers to it void rename_net(Context *ctx, NetInfo *net, IdString new_name); +// Create a bus of nets +std::vector create_bus(Context *ctx, IdString base_name, const std::string &postfix, int width); + +// Connect a bus of nets to a bus of ports +void connect_bus(Context *ctx, CellInfo *cell, IdString port, std::vector &bus, PortType dir); + void print_utilisation(const Context *ctx); NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 094bf419d4b7aa62a606b8c7bdbcfc1fc63cacf7 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 13 Nov 2020 13:44:10 +0000 Subject: nexus: Miscellaneous DSP infrastructure Signed-off-by: David Shah --- common/design_utils.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'common/design_utils.h') diff --git a/common/design_utils.h b/common/design_utils.h index 3a2245a7..2014e7ad 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -104,14 +104,12 @@ void rename_port(Context *ctx, CellInfo *cell, IdString old_name, IdString new_n // Rename a net without invalidating pointers to it void rename_net(Context *ctx, NetInfo *net, IdString new_name); -// Create a bus of nets -std::vector create_bus(Context *ctx, IdString base_name, const std::string &postfix, int width); - -// Connect a bus of nets to a bus of ports -void connect_bus(Context *ctx, CellInfo *cell, IdString port, std::vector &bus, PortType dir); - 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, CellInfo *new_cell, + IdString new_name, int new_offset, int new_width, bool square_brackets = true); + NEXTPNR_NAMESPACE_END #endif -- cgit v1.2.3 From 92031816257dbf76e79bce4dc9c4963824932c4d Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 13 Nov 2020 15:25:57 +0000 Subject: nexus: Support for unclocked 9x9 multiplies Signed-off-by: David Shah --- common/design_utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/design_utils.h') diff --git a/common/design_utils.h b/common/design_utils.h index 2014e7ad..9d4b0550 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -107,8 +107,8 @@ 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, CellInfo *new_cell, - IdString new_name, int new_offset, int new_width, bool square_brackets = true); +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); NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 30c65931b2bb86b5dfd6140b35672f7db46c8d32 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 16 Nov 2020 09:07:25 +0000 Subject: nexus: Add support for clocked MULT9X9s Signed-off-by: David Shah --- common/design_utils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/design_utils.h') 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 -- cgit v1.2.3 From d8e748bc5864f7937cf087cf08d7497bff0d4f6d Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 16 Nov 2020 13:04:43 +0000 Subject: nexus: Refactor DSP macro splitting to make it more generic Signed-off-by: David Shah --- common/design_utils.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common/design_utils.h') diff --git a/common/design_utils.h b/common/design_utils.h index c93fe009..6f52eb0c 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -110,6 +110,10 @@ 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 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); -- cgit v1.2.3