From 3afce5ff5a6adfa1baccb4f4625005300b9a3862 Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 17 Jun 2018 11:45:41 +0200 Subject: Improving the placer output Signed-off-by: David Shah --- common/design_utils.cc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'common/design_utils.cc') diff --git a/common/design_utils.cc b/common/design_utils.cc index 85895a75..c6504fb9 100644 --- a/common/design_utils.cc +++ b/common/design_utils.cc @@ -18,7 +18,9 @@ */ #include "design_utils.h" - +#include +#include "log.h" +#include "util.h" NEXTPNR_NAMESPACE_BEGIN void replace_port(CellInfo *old_cell, IdString old_name, CellInfo *rep_cell, @@ -49,4 +51,23 @@ void replace_port(CellInfo *old_cell, IdString old_name, CellInfo *rep_cell, } } +// Print utilisation of a design +void print_utilisation(const Design *design) +{ + // Sort by Bel type + std::map used_types; + for (auto cell : design->cells) { + used_types[belTypeFromId(cell.second->type)]++; + } + std::map available_types; + for (auto bel : design->chip.getBels()) { + available_types[design->chip.getBelType(bel)]++; + } + log("\nDesign utilisation:\n"); + for (auto type : available_types) { + log("\t%20s: %5d/%5d\n", belTypeToId(type.first).c_str(), + get_or_default(used_types, type.first, 0), type.second); + } +} + NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 6a937e0b45ed9993d6cf4fd659693757c73b4f8f Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 17 Jun 2018 11:49:57 +0200 Subject: Updating copyrights Signed-off-by: David Shah --- common/design_utils.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'common/design_utils.cc') diff --git a/common/design_utils.cc b/common/design_utils.cc index c6504fb9..ae6e21ed 100644 --- a/common/design_utils.cc +++ b/common/design_utils.cc @@ -2,6 +2,7 @@ * nextpnr -- Next Generation Place and Route * * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above -- cgit v1.2.3