aboutsummaryrefslogtreecommitdiffstats
path: root/common/place_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/place_common.h')
-rw-r--r--common/place_common.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/common/place_common.h b/common/place_common.h
index 67956072..32250604 100644
--- a/common/place_common.h
+++ b/common/place_common.h
@@ -26,14 +26,20 @@ NEXTPNR_NAMESPACE_BEGIN
typedef int64_t wirelen_t;
+enum class MetricType
+{
+ COST,
+ WIRELENGTH
+};
+
// Return the wirelength of a net
-wirelen_t get_net_wirelength(const Context *ctx, const NetInfo *net, float &tns);
+wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type, float &tns);
// Return the wirelength of all nets connected to a cell
-wirelen_t get_cell_wirelength(const Context *ctx, const CellInfo *cell);
+wirelen_t get_cell_metric(const Context *ctx, const CellInfo *cell, MetricType type);
// Return the wirelength of all nets connected to a cell, when the cell is at a given bel
-wirelen_t get_cell_wirelength_at_bel(const Context *ctx, CellInfo *cell, BelId bel);
+wirelen_t get_cell_metric_at_bel(const Context *ctx, CellInfo *cell, BelId bel, MetricType type);
// Place a single cell in the lowest wirelength Bel available, optionally requiring validity check
bool place_single_cell(Context *ctx, CellInfo *cell, bool require_legality);