diff options
author | David Shah <davey1576@gmail.com> | 2018-06-25 11:43:59 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-25 11:43:59 +0200 |
commit | bdd54a68471a68bb9e3f8125c1457cd039cc768b (patch) | |
tree | 7f96fc65d7714699b2b1ec2f707beeefedb76dd3 /dummy | |
parent | 1b7ed56f6ffd11d70d79cd96fb370f331e6d8df0 (diff) | |
download | nextpnr-bdd54a68471a68bb9e3f8125c1457cd039cc768b.tar.gz nextpnr-bdd54a68471a68bb9e3f8125c1457cd039cc768b.tar.bz2 nextpnr-bdd54a68471a68bb9e3f8125c1457cd039cc768b.zip |
Refactor: remove PlacementValidityChecker and move methods to Arch
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'dummy')
-rw-r--r-- | dummy/arch.cc | 3 | ||||
-rw-r--r-- | dummy/arch.h | 3 | ||||
-rw-r--r-- | dummy/arch_place.cc | 30 | ||||
-rw-r--r-- | dummy/arch_place.h | 45 | ||||
-rw-r--r-- | dummy/main.cc | 10 |
5 files changed, 12 insertions, 79 deletions
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 <clifford@symbioticeda.com> - * - * 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 <clifford@symbioticeda.com> - * - * 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; } |