From bdd54a68471a68bb9e3f8125c1457cd039cc768b Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 25 Jun 2018 11:43:59 +0200 Subject: Refactor: remove PlacementValidityChecker and move methods to Arch Signed-off-by: David Shah --- dummy/arch.cc | 3 +++ dummy/arch.h | 3 +++ dummy/arch_place.cc | 30 ------------------------------ dummy/arch_place.h | 45 --------------------------------------------- dummy/main.cc | 10 ++++++---- 5 files changed, 12 insertions(+), 79 deletions(-) delete mode 100644 dummy/arch_place.cc delete mode 100644 dummy/arch_place.h (limited to 'dummy') diff --git a/dummy/arch.cc b/dummy/arch.cc index afd1d638..9d29921c 100644 --- a/dummy/arch.cc +++ b/dummy/arch.cc @@ -190,4 +190,7 @@ IdString Arch::getPortClock(const CellInfo *cell, IdString port) const { return bool Arch::isClockPort(const CellInfo *cell, IdString port) const { return false; } +bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const { return true; } +bool Arch::isBelLocationValid(BelId bel) const { return true; } + NEXTPNR_NAMESPACE_END diff --git a/dummy/arch.h b/dummy/arch.h index 58636ed9..f1fbcec8 100644 --- a/dummy/arch.h +++ b/dummy/arch.h @@ -150,6 +150,9 @@ struct Arch : BaseCtx bool getCellDelay(const CellInfo *cell, IdString fromPort, IdString toPort, delay_t &delay) const; IdString getPortClock(const CellInfo *cell, IdString port) const; bool isClockPort(const CellInfo *cell, IdString port) const; + + bool isValidBelForCell(CellInfo *cell, BelId bel) const; + bool isBelLocationValid(BelId bel) const; }; NEXTPNR_NAMESPACE_END diff --git a/dummy/arch_place.cc b/dummy/arch_place.cc deleted file mode 100644 index b57204bc..00000000 --- a/dummy/arch_place.cc +++ /dev/null @@ -1,30 +0,0 @@ -/* - * nextpnr -- Next Generation Place and Route - * - * Copyright (C) 2018 Clifford Wolf - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -#include "arch_place.h" - -NEXTPNR_NAMESPACE_BEGIN - -PlaceValidityChecker::PlaceValidityChecker(Context *ctx) {} - -bool PlaceValidityChecker::isValidBelForCell(CellInfo *cell, BelId bel) { return true; } - -bool PlaceValidityChecker::isBelLocationValid(BelId bel) { return true; } - -NEXTPNR_NAMESPACE_END diff --git a/dummy/arch_place.h b/dummy/arch_place.h deleted file mode 100644 index 213472d9..00000000 --- a/dummy/arch_place.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * nextpnr -- Next Generation Place and Route - * - * Copyright (C) 2018 Clifford Wolf - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifndef DUMMY_ARCH_PLACE_H -#define DUMMY_ARCH_PLACE_H - -#include "nextpnr.h" - -NEXTPNR_NAMESPACE_BEGIN - -// Architecure-specific placement functions - -class PlaceValidityChecker -{ - public: - PlaceValidityChecker(Context *ctx); - - // Whether or not a given cell can be placed at a given Bel - // This is not intended for Bel type checks, but finer-grained constraints - // such as conflicting set/reset signals, etc - bool isValidBelForCell(CellInfo *cell, BelId bel); - - // Return true whether all Bels at a given location are valid - bool isBelLocationValid(BelId bel); -}; - -NEXTPNR_NAMESPACE_END - -#endif diff --git a/dummy/main.cc b/dummy/main.cc index 5e0a9322..47402f82 100644 --- a/dummy/main.cc +++ b/dummy/main.cc @@ -75,16 +75,18 @@ int main(int argc, char *argv[]) } if (vm.count("help") || argc == 1) { - std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) + << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; std::cout << "\n"; std::cout << options << "\n"; return argc != 1; } if (vm.count("version")) { - std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) + << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; return 1; } -- cgit v1.2.3