From a03adf0733472ca868666e6d202f790adc5af910 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Tue, 29 Oct 2024 13:18:22 +0000 Subject: [PATCH 1/2] mpl: RIP TritonMacroPlace (mpl) Replaced by Hierarchical RTL-MPL (mpl2; to be renamed mpl) Signed-off-by: Matt Liberty --- include/ord/Design.h | 5 - include/ord/OpenRoad.hh | 6 - src/CMakeLists.txt | 3 - src/Design.cc | 5 - src/Main.cc | 1 - src/OpenRoad.cc | 4 - src/OpenRoad.i | 7 - src/drt/test/stubs.cpp | 1 - src/dst/test/cpp/stubs.cpp | 1 - src/mpl/.gitignore | 4 - src/mpl/CMakeLists.txt | 91 - src/mpl/LICENSE | 29 - src/mpl/README.md | 87 - src/mpl/include/mpl/MacroPlacer.h | 240 -- src/mpl/include/mpl/MakeMacroPlacer.h | 50 - src/mpl/include/mpl/Partition.h | 116 - src/mpl/src/MacroPlacer-py.i | 48 - src/mpl/src/MacroPlacer.cpp | 1450 --------- src/mpl/src/MacroPlacer.i | 105 - src/mpl/src/MacroPlacer.tcl | 133 - src/mpl/src/MakeMacroPlacer.cpp | 71 - src/mpl/src/ParquetFP/.gitignore | 20 - src/mpl/src/ParquetFP/CMakeLists.txt | 77 - src/mpl/src/ParquetFP/src/AnalytSolve.cxx | 242 -- src/mpl/src/ParquetFP/src/AnalytSolve.h | 71 - src/mpl/src/ParquetFP/src/ClusterDB.cxx | 774 ----- src/mpl/src/ParquetFP/src/ClusterDB.h | 91 - src/mpl/src/ParquetFP/src/CommandLine.cxx | 114 - src/mpl/src/ParquetFP/src/CommandLine.h | 137 - src/mpl/src/ParquetFP/src/Ctainers/bitBoard.h | 115 - src/mpl/src/ParquetFP/src/DB.cxx | 2746 ----------------- src/mpl/src/ParquetFP/src/DB.h | 479 --- src/mpl/src/ParquetFP/src/FPcommon.cxx | 216 -- src/mpl/src/ParquetFP/src/FPcommon.h | 185 -- src/mpl/src/ParquetFP/src/Net.cxx | 70 - src/mpl/src/ParquetFP/src/Net.h | 140 - src/mpl/src/ParquetFP/src/Nets.cxx | 326 -- src/mpl/src/ParquetFP/src/Nets.h | 107 - src/mpl/src/ParquetFP/src/Node.cxx | 169 - src/mpl/src/ParquetFP/src/Node.h | 177 -- src/mpl/src/ParquetFP/src/Nodes.cxx | 716 ----- src/mpl/src/ParquetFP/src/Nodes.h | 123 - src/mpl/src/ParquetFP/src/PlToSP.cxx | 463 --- src/mpl/src/ParquetFP/src/PlToSP.h | 178 -- src/mpl/src/ParquetFP/src/SPeval.cxx | 608 ---- src/mpl/src/ParquetFP/src/SPeval.h | 181 -- src/mpl/src/ParquetFP/src/SeqPair.cxx | 61 - src/mpl/src/ParquetFP/src/SeqPair.h | 119 - src/mpl/src/ParquetFP/src/SolveMulti.cxx | 541 ---- src/mpl/src/ParquetFP/src/SolveMulti.h | 68 - src/mpl/src/ParquetFP/src/allparquet.h | 43 - src/mpl/src/ParquetFP/src/baseannealer.cxx | 199 -- src/mpl/src/ParquetFP/src/baseannealer.h | 165 - src/mpl/src/ParquetFP/src/basepacking.cxx | 286 -- src/mpl/src/ParquetFP/src/basepacking.h | 361 --- src/mpl/src/ParquetFP/src/btree.cxx | 998 ------ src/mpl/src/ParquetFP/src/btree.h | 445 --- src/mpl/src/ParquetFP/src/btreeanneal.cxx | 1616 ---------- src/mpl/src/ParquetFP/src/btreeanneal.h | 306 -- src/mpl/src/ParquetFP/src/btreecompact.cxx | 229 -- src/mpl/src/ParquetFP/src/btreecompact.h | 198 -- src/mpl/src/ParquetFP/src/btreeslackeval.cxx | 133 - src/mpl/src/ParquetFP/src/btreeslackeval.h | 131 - src/mpl/src/ParquetFP/src/debugflags.h | 39 - src/mpl/src/ParquetFP/src/mixedpacking.cxx | 320 -- src/mpl/src/ParquetFP/src/mixedpacking.h | 107 - .../src/ParquetFP/src/mixedpackingfromdb.cxx | 102 - .../src/ParquetFP/src/mixedpackingfromdb.h | 52 - src/mpl/src/ParquetFP/src/netlist.cxx | 308 -- src/mpl/src/ParquetFP/src/netlist.h | 245 -- src/mpl/src/ParquetFP/src/parsers.h | 101 - src/mpl/src/ParquetFP/src/plcompact.cxx | 433 --- src/mpl/src/ParquetFP/src/plcompact.h | 214 -- src/mpl/src/ParquetFP/src/plsptobtree.cxx | 185 -- src/mpl/src/ParquetFP/src/plsptobtree.h | 144 - src/mpl/src/ParquetFP/src/pltobtree.cxx | 447 --- src/mpl/src/ParquetFP/src/pltobtree.h | 281 -- src/mpl/src/ParquetFP/src/skyline.cxx | 439 --- src/mpl/src/ParquetFP/src/skyline.h | 122 - src/mpl/src/Partition.cpp | 409 --- src/mpl/src/graphics.cpp | 100 - src/mpl/src/graphics.h | 77 - src/mpl/test/CMakeLists.txt | 13 - src/mpl/test/Nangate45 | 1 - src/mpl/test/east_west.tcl | 48 - src/mpl/test/east_west1.def | 173 -- src/mpl/test/east_west1.defok | 173 -- src/mpl/test/east_west1.ok | 14 - src/mpl/test/east_west1.py | 20 - src/mpl/test/east_west1.tcl | 13 - src/mpl/test/east_west1.v | 14 - src/mpl/test/east_west2.def | 150 - src/mpl/test/east_west2.defok | 173 -- src/mpl/test/east_west2.ok | 14 - src/mpl/test/east_west2.py | 23 - src/mpl/test/east_west2.tcl | 12 - src/mpl/test/extract_utils.py | 1 - src/mpl/test/gcd.sdc | 1 - src/mpl/test/gpl_aux.py | 1 - src/mpl/test/helpers.py | 1 - src/mpl/test/helpers.tcl | 1 - src/mpl/test/level3.def | 670 ---- src/mpl/test/level3.tcl | 30 - src/mpl/test/level3.v | 160 - src/mpl/test/level3_01.defok | 670 ---- src/mpl/test/level3_01.ok | 36 - src/mpl/test/level3_01.py | 20 - src/mpl/test/level3_01.tcl | 8 - src/mpl/test/level3_02.defok | 670 ---- src/mpl/test/level3_02.ok | 87 - src/mpl/test/level3_02.py | 22 - src/mpl/test/level3_02.tcl | 9 - src/mpl/test/manpage.py | 1 - src/mpl/test/md_roff_compat.py | 1 - src/mpl/test/mpl_aux.py | 134 - src/mpl/test/mpl_man_tcl_check.ok | 5 - src/mpl/test/mpl_man_tcl_check.py | 77 - src/mpl/test/mpl_readme_msgs_check.ok | 4 - src/mpl/test/mpl_readme_msgs_check.py | 18 - src/mpl/test/regression | 1 - src/mpl/test/regression_tests.tcl | 9 - src/mpl/test/save_defok | 1 - src/mpl/test/save_ok | 1 - src/mpl/test/snap_layer1.defok | 173 -- src/mpl/test/snap_layer1.ok | 46 - src/mpl/test/snap_layer1.py | 19 - src/mpl/test/snap_layer1.tcl | 10 - test/regression | 1 - 128 files changed, 24735 deletions(-) delete mode 100644 src/mpl/.gitignore delete mode 100644 src/mpl/CMakeLists.txt delete mode 100644 src/mpl/LICENSE delete mode 100644 src/mpl/README.md delete mode 100644 src/mpl/include/mpl/MacroPlacer.h delete mode 100644 src/mpl/include/mpl/MakeMacroPlacer.h delete mode 100644 src/mpl/include/mpl/Partition.h delete mode 100644 src/mpl/src/MacroPlacer-py.i delete mode 100644 src/mpl/src/MacroPlacer.cpp delete mode 100644 src/mpl/src/MacroPlacer.i delete mode 100644 src/mpl/src/MacroPlacer.tcl delete mode 100644 src/mpl/src/MakeMacroPlacer.cpp delete mode 100644 src/mpl/src/ParquetFP/.gitignore delete mode 100644 src/mpl/src/ParquetFP/CMakeLists.txt delete mode 100644 src/mpl/src/ParquetFP/src/AnalytSolve.cxx delete mode 100644 src/mpl/src/ParquetFP/src/AnalytSolve.h delete mode 100644 src/mpl/src/ParquetFP/src/ClusterDB.cxx delete mode 100644 src/mpl/src/ParquetFP/src/ClusterDB.h delete mode 100644 src/mpl/src/ParquetFP/src/CommandLine.cxx delete mode 100644 src/mpl/src/ParquetFP/src/CommandLine.h delete mode 100644 src/mpl/src/ParquetFP/src/Ctainers/bitBoard.h delete mode 100644 src/mpl/src/ParquetFP/src/DB.cxx delete mode 100644 src/mpl/src/ParquetFP/src/DB.h delete mode 100644 src/mpl/src/ParquetFP/src/FPcommon.cxx delete mode 100644 src/mpl/src/ParquetFP/src/FPcommon.h delete mode 100644 src/mpl/src/ParquetFP/src/Net.cxx delete mode 100644 src/mpl/src/ParquetFP/src/Net.h delete mode 100644 src/mpl/src/ParquetFP/src/Nets.cxx delete mode 100644 src/mpl/src/ParquetFP/src/Nets.h delete mode 100644 src/mpl/src/ParquetFP/src/Node.cxx delete mode 100644 src/mpl/src/ParquetFP/src/Node.h delete mode 100644 src/mpl/src/ParquetFP/src/Nodes.cxx delete mode 100644 src/mpl/src/ParquetFP/src/Nodes.h delete mode 100644 src/mpl/src/ParquetFP/src/PlToSP.cxx delete mode 100644 src/mpl/src/ParquetFP/src/PlToSP.h delete mode 100644 src/mpl/src/ParquetFP/src/SPeval.cxx delete mode 100644 src/mpl/src/ParquetFP/src/SPeval.h delete mode 100644 src/mpl/src/ParquetFP/src/SeqPair.cxx delete mode 100644 src/mpl/src/ParquetFP/src/SeqPair.h delete mode 100644 src/mpl/src/ParquetFP/src/SolveMulti.cxx delete mode 100644 src/mpl/src/ParquetFP/src/SolveMulti.h delete mode 100644 src/mpl/src/ParquetFP/src/allparquet.h delete mode 100644 src/mpl/src/ParquetFP/src/baseannealer.cxx delete mode 100644 src/mpl/src/ParquetFP/src/baseannealer.h delete mode 100644 src/mpl/src/ParquetFP/src/basepacking.cxx delete mode 100644 src/mpl/src/ParquetFP/src/basepacking.h delete mode 100644 src/mpl/src/ParquetFP/src/btree.cxx delete mode 100644 src/mpl/src/ParquetFP/src/btree.h delete mode 100644 src/mpl/src/ParquetFP/src/btreeanneal.cxx delete mode 100644 src/mpl/src/ParquetFP/src/btreeanneal.h delete mode 100644 src/mpl/src/ParquetFP/src/btreecompact.cxx delete mode 100644 src/mpl/src/ParquetFP/src/btreecompact.h delete mode 100644 src/mpl/src/ParquetFP/src/btreeslackeval.cxx delete mode 100644 src/mpl/src/ParquetFP/src/btreeslackeval.h delete mode 100644 src/mpl/src/ParquetFP/src/debugflags.h delete mode 100644 src/mpl/src/ParquetFP/src/mixedpacking.cxx delete mode 100644 src/mpl/src/ParquetFP/src/mixedpacking.h delete mode 100644 src/mpl/src/ParquetFP/src/mixedpackingfromdb.cxx delete mode 100644 src/mpl/src/ParquetFP/src/mixedpackingfromdb.h delete mode 100644 src/mpl/src/ParquetFP/src/netlist.cxx delete mode 100644 src/mpl/src/ParquetFP/src/netlist.h delete mode 100644 src/mpl/src/ParquetFP/src/parsers.h delete mode 100644 src/mpl/src/ParquetFP/src/plcompact.cxx delete mode 100644 src/mpl/src/ParquetFP/src/plcompact.h delete mode 100644 src/mpl/src/ParquetFP/src/plsptobtree.cxx delete mode 100644 src/mpl/src/ParquetFP/src/plsptobtree.h delete mode 100644 src/mpl/src/ParquetFP/src/pltobtree.cxx delete mode 100644 src/mpl/src/ParquetFP/src/pltobtree.h delete mode 100644 src/mpl/src/ParquetFP/src/skyline.cxx delete mode 100644 src/mpl/src/ParquetFP/src/skyline.h delete mode 100644 src/mpl/src/Partition.cpp delete mode 100644 src/mpl/src/graphics.cpp delete mode 100644 src/mpl/src/graphics.h delete mode 100644 src/mpl/test/CMakeLists.txt delete mode 120000 src/mpl/test/Nangate45 delete mode 100644 src/mpl/test/east_west.tcl delete mode 100644 src/mpl/test/east_west1.def delete mode 100644 src/mpl/test/east_west1.defok delete mode 100644 src/mpl/test/east_west1.ok delete mode 100644 src/mpl/test/east_west1.py delete mode 100644 src/mpl/test/east_west1.tcl delete mode 100644 src/mpl/test/east_west1.v delete mode 100644 src/mpl/test/east_west2.def delete mode 100644 src/mpl/test/east_west2.defok delete mode 100644 src/mpl/test/east_west2.ok delete mode 100644 src/mpl/test/east_west2.py delete mode 100644 src/mpl/test/east_west2.tcl delete mode 120000 src/mpl/test/extract_utils.py delete mode 100644 src/mpl/test/gcd.sdc delete mode 120000 src/mpl/test/gpl_aux.py delete mode 120000 src/mpl/test/helpers.py delete mode 120000 src/mpl/test/helpers.tcl delete mode 100644 src/mpl/test/level3.def delete mode 100644 src/mpl/test/level3.tcl delete mode 100644 src/mpl/test/level3.v delete mode 100644 src/mpl/test/level3_01.defok delete mode 100644 src/mpl/test/level3_01.ok delete mode 100644 src/mpl/test/level3_01.py delete mode 100644 src/mpl/test/level3_01.tcl delete mode 100644 src/mpl/test/level3_02.defok delete mode 100644 src/mpl/test/level3_02.ok delete mode 100644 src/mpl/test/level3_02.py delete mode 100644 src/mpl/test/level3_02.tcl delete mode 120000 src/mpl/test/manpage.py delete mode 120000 src/mpl/test/md_roff_compat.py delete mode 100644 src/mpl/test/mpl_aux.py delete mode 100644 src/mpl/test/mpl_man_tcl_check.ok delete mode 100644 src/mpl/test/mpl_man_tcl_check.py delete mode 100644 src/mpl/test/mpl_readme_msgs_check.ok delete mode 100644 src/mpl/test/mpl_readme_msgs_check.py delete mode 120000 src/mpl/test/regression delete mode 100644 src/mpl/test/regression_tests.tcl delete mode 120000 src/mpl/test/save_defok delete mode 120000 src/mpl/test/save_ok delete mode 100644 src/mpl/test/snap_layer1.defok delete mode 100644 src/mpl/test/snap_layer1.ok delete mode 100644 src/mpl/test/snap_layer1.py delete mode 100644 src/mpl/test/snap_layer1.tcl diff --git a/include/ord/Design.h b/include/ord/Design.h index d10ff0c921d..f709fde8a5b 100644 --- a/include/ord/Design.h +++ b/include/ord/Design.h @@ -79,10 +79,6 @@ namespace dpl { class Opendp; } -namespace mpl { -class MacroPlacer; -} - namespace mpl2 { class MacroPlacer2; } @@ -202,7 +198,6 @@ class Design gpl::Replace* getReplace(); grt::GlobalRouter* getGlobalRouter(); ifp::InitFloorplan getFloorplan(); - mpl::MacroPlacer* getMacroPlacer(); mpl2::MacroPlacer2* getMacroPlacer2(); odb::dbDatabase* getDb(); pad::ICeWall* getICeWall(); diff --git a/include/ord/OpenRoad.hh b/include/ord/OpenRoad.hh index 8c707d23703..35539a0ddd5 100644 --- a/include/ord/OpenRoad.hh +++ b/include/ord/OpenRoad.hh @@ -95,10 +95,6 @@ namespace fin { class Finale; } -namespace mpl { -class MacroPlacer; -} - namespace mpl2 { class MacroPlacer2; } @@ -181,7 +177,6 @@ class OpenRoad dpo::Optdp* getOptdp() { return optdp_; } fin::Finale* getFinale() { return finale_; } tap::Tapcell* getTapcell() { return tapcell_; } - mpl::MacroPlacer* getMacroPlacer() { return macro_placer_; } mpl2::MacroPlacer2* getMacroPlacer2() { return macro_placer2_; } rcx::Ext* getOpenRCX() { return extractor_; } drt::TritonRoute* getTritonRoute() { return detailed_router_; } @@ -273,7 +268,6 @@ class OpenRoad dpl::Opendp* opendp_ = nullptr; dpo::Optdp* optdp_ = nullptr; fin::Finale* finale_ = nullptr; - mpl::MacroPlacer* macro_placer_ = nullptr; mpl2::MacroPlacer2* macro_placer2_ = nullptr; grt::GlobalRouter* global_router_ = nullptr; rmp::Restructure* restructure_ = nullptr; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab7f828106b..cc82c160add 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -295,7 +295,6 @@ add_subdirectory(rmp) add_subdirectory(cts) add_subdirectory(grt) add_subdirectory(tap) -add_subdirectory(mpl) add_subdirectory(rcx) add_subdirectory(psm) add_subdirectory(ant) @@ -362,7 +361,6 @@ target_link_libraries(openroad gui drt dst - mpl psm ant upf @@ -433,7 +431,6 @@ if (Python3_FOUND AND BUILD_PYTHON) grt_py gpl_py dpl_py - mpl_py ppl_py tap_py cts_py diff --git a/src/Design.cc b/src/Design.cc index b1d766eda22..4cac3271083 100644 --- a/src/Design.cc +++ b/src/Design.cc @@ -283,11 +283,6 @@ mpl2::MacroPlacer2* Design::getMacroPlacer2() return getOpenRoad()->getMacroPlacer2(); } -mpl::MacroPlacer* Design::getMacroPlacer() -{ - return getOpenRoad()->getMacroPlacer(); -} - ppl::IOPlacer* Design::getIOPlacer() { return getOpenRoad()->getIOPlacer(); diff --git a/src/Main.cc b/src/Main.cc index c629d2b333c..0ed5a8362ad 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -89,7 +89,6 @@ using std::string; X(grt) \ X(gpl) \ X(dpl) \ - X(mpl) \ X(ppl) \ X(tap) \ X(cts) \ diff --git a/src/OpenRoad.cc b/src/OpenRoad.cc index fc46d46587f..e1ed900f21c 100644 --- a/src/OpenRoad.cc +++ b/src/OpenRoad.cc @@ -60,7 +60,6 @@ #include "grt/MakeGlobalRouter.h" #include "gui/MakeGui.h" #include "ifp//MakeInitFloorplan.hh" -#include "mpl/MakeMacroPlacer.h" #include "mpl2/MakeMacroPlacer.h" #include "odb/cdl.h" #include "odb/db.h" @@ -136,7 +135,6 @@ OpenRoad::~OpenRoad() deleteRestructure(restructure_); deleteTritonCts(tritonCts_); deleteTapcell(tapcell_); - deleteMacroPlacer(macro_placer_); deleteMacroPlacer2(macro_placer2_); deleteOpenRCX(extractor_); deleteTritonRoute(detailed_router_); @@ -199,7 +197,6 @@ void OpenRoad::init(Tcl_Interp* tcl_interp) restructure_ = makeRestructure(); tritonCts_ = makeTritonCts(); tapcell_ = makeTapcell(); - macro_placer_ = makeMacroPlacer(); macro_placer2_ = makeMacroPlacer2(); extractor_ = makeOpenRCX(); detailed_router_ = makeTritonRoute(); @@ -235,7 +232,6 @@ void OpenRoad::init(Tcl_Interp* tcl_interp) initGlobalRouter(this); initTritonCts(this); initTapcell(this); - initMacroPlacer(this); initMacroPlacer2(this); initOpenRCX(this); initICeWall(this); diff --git a/src/OpenRoad.i b/src/OpenRoad.i index c26d329b42c..432a9385e0c 100644 --- a/src/OpenRoad.i +++ b/src/OpenRoad.i @@ -133,13 +133,6 @@ getTritonCts() return openroad->getTritonCts(); } -mpl::MacroPlacer * -getMacroPlacer() -{ - OpenRoad *openroad = getOpenRoad(); - return openroad->getMacroPlacer(); -} - mpl2::MacroPlacer2 * getMacroPlacer2() { diff --git a/src/drt/test/stubs.cpp b/src/drt/test/stubs.cpp index 21ed0dfcd59..037615f81f0 100644 --- a/src/drt/test/stubs.cpp +++ b/src/drt/test/stubs.cpp @@ -45,7 +45,6 @@ OpenRoad::OpenRoad() opendp_(nullptr), optdp_(nullptr), finale_(nullptr), - macro_placer_(nullptr), macro_placer2_(nullptr), global_router_(nullptr), restructure_(nullptr), diff --git a/src/dst/test/cpp/stubs.cpp b/src/dst/test/cpp/stubs.cpp index 536d498e699..b452bce09d6 100644 --- a/src/dst/test/cpp/stubs.cpp +++ b/src/dst/test/cpp/stubs.cpp @@ -44,7 +44,6 @@ OpenRoad::OpenRoad() opendp_(nullptr), optdp_(nullptr), finale_(nullptr), - macro_placer_(nullptr), macro_placer2_(nullptr), global_router_(nullptr), restructure_(nullptr), diff --git a/src/mpl/.gitignore b/src/mpl/.gitignore deleted file mode 100644 index 333998b5239..00000000000 --- a/src/mpl/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -build -TAGS -*~ -test/results diff --git a/src/mpl/CMakeLists.txt b/src/mpl/CMakeLists.txt deleted file mode 100644 index 8f042744ebc..00000000000 --- a/src/mpl/CMakeLists.txt +++ /dev/null @@ -1,91 +0,0 @@ -############################################################################# -## -## Copyright (c) 2019, The Regents of the University of California -## All rights reserved. -## -## BSD 3-Clause License -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are met: -## -## * Redistributions of source code must retain the above copyright notice, this -## list of conditions and the following disclaimer. -## -## * Redistributions in binary form must reproduce the above copyright notice, -## this list of conditions and the following disclaimer in the documentation -## and/or other materials provided with the distribution. -## -## * Neither the name of the copyright holder nor the names of its -## contributors may be used to endorse or promote products derived from -## this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -## POSSIBILITY OF SUCH DAMAGE. - -include("openroad") - -add_subdirectory(src/ParquetFP) - -swig_lib(NAME mpl - NAMESPACE mpl - I_FILE src/MacroPlacer.i - SCRIPTS src/MacroPlacer.tcl -) - -target_sources(mpl - PRIVATE - src/Partition.cpp - src/MacroPlacer.cpp - src/MakeMacroPlacer.cpp - src/graphics.cpp -) - -target_include_directories(mpl - PUBLIC - include -) - -target_link_libraries(mpl - PRIVATE - ParquetFP - dbSta - OpenSTA - odb - utl - gui -) - -messages( - TARGET mpl -) - -if (Python3_FOUND AND BUILD_PYTHON) - swig_lib(NAME mpl_py - NAMESPACE mpl - LANGUAGE python - I_FILE src/MacroPlacer-py.i - SWIG_INCLUDES ${PROJECT_SOURCE_DIR}/include/mpl - ${ODB_HOME}/src/swig/common - ${ODB_HOME}/src/swig/python - SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/mpl_py.py - ) - - target_link_libraries(mpl_py - PUBLIC - mpl - OpenSTA - odb - ) - -endif() - -add_subdirectory(test) diff --git a/src/mpl/LICENSE b/src/mpl/LICENSE deleted file mode 100644 index 846ec301b8f..00000000000 --- a/src/mpl/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2019-2021, The Regents of the University of California -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/mpl/README.md b/src/mpl/README.md deleted file mode 100644 index d718aa1cd12..00000000000 --- a/src/mpl/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# Macro Placement - -The macro placement module in OpenROAD (`mpl`) is based on -TritonMacroPlacer, an open-source ParquetFP-based macro cell placer. -The macro placer places macros/blocks honoring halos, channels -and cell row "snapping". -Run `global_placement` before macro placement. - -Approximately $\Bigl\lceil [{\frac{numMacros}{3}}]^{1.5} \Bigr\rceil$ quadrisections -of the initial placed mixed-size layout are explored and packed using -ParquetFP-based annealing. The best resulting floorplan according to a -heuristic evaluation function is kept. - -## Commands - -```{note} -- Parameters in square brackets `[-param param]` are optional. -- Parameters without square brackets `-param2 param2` are required. -``` - -### Macro Placement - -This command performs macro placement. -For placement style, `corner_max_wl` means that choosing the partitions that maximise the wirelength -of connections between the macros to force them to the corners. Vice versa for `corner_min_wl`. - -Macros will be placed with $max(halo * 2, channel)$ spacing between macros, and between -macros and the fence/die boundary. If no solutions are found, try reducing the -channel/halo. - -```tcl -macro_placement - [-halo {halo_x halo_y}] - [-channel {channel_x channel_y}] - [-fence_region {lx ly ux uy}] - [-snap_layer snap_layer_number] - [-style corner_wax_wl|corner_min_wl] -``` - -#### Options - -| Switch Name | Description | -| ----- | ----- | -| `-halo` | Horizontal and vertical halo around macros (microns). | -| `-channel` | Horizontal and vertical channel width between macros (microns). | -| `-fence_region` | Restrict macro placements to a region (microns). Defaults to the core area. | -| `-snap_layer` | Snap macro origins to this routing layer track. | -| `-style` | Placement style, to choose either `corner_max_wl` or `corner_min_wl`. The default value is `corner_max_wl`. | - - -## Useful Developer Commands - -If you are a developer, you might find these useful. More details can be found in the [source file](./src/MacroPlacer.cpp) or the [swig file](./src/MacroPlacer.i). - -| Command Name | Description | -| ----- | ----- | -| `macro_placement_debug` | Macro placement debugging. Note that GUI must be present for this command, otherwise a segfault will occur. | - -## Example scripts - -Example scripts demonstrating how to run TritonMacroPlace on a sample design of `east_west` as follows: - -``` -./test/east_west.tcl -./test/east_west1.tcl -./test/east_west2.tcl -``` - -## Regression tests - -There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests). - -Simply run the following script: - -```shell -./test/regression -``` - -## Limitations - -## FAQs - -Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+mpl) about this tool. - -## License - -BSD 3-Clause License. See [LICENSE](../../LICENSE) file. diff --git a/src/mpl/include/mpl/MacroPlacer.h b/src/mpl/include/mpl/MacroPlacer.h deleted file mode 100644 index 69f48c0c768..00000000000 --- a/src/mpl/include/mpl/MacroPlacer.h +++ /dev/null @@ -1,240 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2019-2020, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include -#include -#include - -#include "mpl/Partition.h" -#include "odb/db.h" -#include "sta/GraphClass.hh" -#include "sta/NetworkClass.hh" - -namespace sta { -class dbSta; -class BfsFwdIterator; -class dbNetwork; -class LibertyPort; -} // namespace sta - -namespace odb { -class dbDatabase; -class dbBTerm; -} // namespace odb - -namespace utl { -class Logger; -} - -namespace mpl { - -class Layout; - -using std::map; -using std::pair; -using std::set; -using std::string; -using std::unordered_map; -using std::vector; - -typedef set MacroSet; -// vertex -> fanin macro set -typedef map VertexFaninMap; -typedef pair MacroPair; -// from/to -> weight -// weight = from/pin -> to/pin count -typedef map AdjWeightMap; - -enum class CoreEdge -{ - West, - East, - North, - South, -}; - -constexpr int core_edge_count = 4; -const char* coreEdgeString(CoreEdge edge); -CoreEdge coreEdgeFromIndex(int edge_index); -int coreEdgeIndex(CoreEdge edge); - -class Macro -{ - public: - Macro(double _lx, double _ly, double _w, double _h, odb::dbInst* _dbInstPtr); - Macro(double _lx, double _ly, const Macro& copy_from); - string name(); - - double lx, ly; - double w, h; - odb::dbInst* dbInstPtr; -}; - -class MacroSpacings -{ - public: - MacroSpacings(); - MacroSpacings(double halo_x, - double halo_y, - double channel_x, - double channel_y); - void setHalo(double halo_x, double halo_y); - void setChannel(double channel_x, double channel_y); - void setChannelX(double channel_x); - void setChannelY(double channel_y); - double getHaloX() const { return halo_x_; } - double getHaloY() const { return halo_y_; } - double getChannelX() const { return channel_x_; } - double getChannelY() const { return channel_y_; } - double getSpacingX() const; - double getSpacingY() const; - - private: - double halo_x_, halo_y_, channel_x_, channel_y_; -}; - -class MacroPlacer -{ - public: - MacroPlacer(); - void init(odb::dbDatabase* db, sta::dbSta* sta, utl::Logger* log); - void setDebug(bool partitions); - - void setHalo(double halo_x, double halo_y); - void setChannel(double channel_x, double channel_y); - void setVerboseLevel(int verbose); - void setFenceRegion(double lx, double ly, double ux, double uy); - void setSnapLayer(odb::dbTechLayer* snap_layer); - - void placeMacrosCornerMinWL(); - void placeMacrosCornerMaxWl(); - int getSolutionCount(); - - // return weighted wire-length to get best solution - double getWeightedWL(); - int weight(int idx11, int idx12); - int macroIndex(odb::dbInst* inst); - MacroSpacings& getSpacings(const Macro& macro); - double paddedWidth(const Macro& macro); - double paddedHeight(const Macro& macro); - - Macro& macro(int idx) { return macros_[idx]; } - size_t macroCount() { return macros_.size(); } - - private: - bool findMacros(); - bool isMissingLiberty(); - - bool init(); - // Update Macro Location from Partition info - void updateMacroLocations(Partition& part); - void updateDbInstLocations(); - void makeMacroPartMap(const Partition& part, - MacroPartMap& macroPartMap) const; - vector> getPartitions(const Layout& layout, - const Partition& partition, - bool isHorizontal); - void cutRoundUp(const Layout& layout, double& cutLine, bool isHorizontal); - void setDbInstLocations(Partition& partition); - - // graph based adjacencies - void findAdjacencies(); - void seedFaninBfs(sta::BfsFwdIterator& bfs, VertexFaninMap& vertex_fanins); - void findFanins(sta::BfsFwdIterator& bfs, VertexFaninMap& vertex_fanins); - void copyFaninsAcrossRegisters(sta::BfsFwdIterator& bfs, - VertexFaninMap& vertex_fanins); - void findAdjWeights(VertexFaninMap& vertex_fanins, AdjWeightMap& adj_map); - sta::Pin* findSeqOutPin(sta::Instance* inst, sta::LibertyPort* out_port); - void fillMacroWeights(AdjWeightMap& adj_map); - CoreEdge findNearestEdge(odb::dbBTerm* bTerm); - string faninName(Macro* macro); - int macroIndex(Macro* macro); - bool macroIndexIsEdge(Macro* macro); - string macroIndexName(int index); - - void reportEdgePinCounts(); - - //////////////////////////////////////////////////////////////// - - odb::dbDatabase* db_; - sta::dbSta* sta_; - utl::Logger* logger_; - odb::dbTechLayer* snap_layer_; - - bool connection_driven_; - - // macro idx/idx pair -> give each - vector> macro_weights_; - // macro Information - vector macros_; - // dbInst* --> macros_'s index - unordered_map macro_inst_map_; - - MacroSpacings default_macro_spacings_; - unordered_map macro_spacings_; - - double lx_, ly_, ux_, uy_; - int verbose_; - int solution_count_; - - bool gui_debug_; - bool gui_debug_partitions_; - // Number of register levels to look through for macro adjacency. - static constexpr int reg_adjacency_depth_ = 3; -}; - -class Layout -{ - public: - Layout(); - Layout(double lx, double ly, double ux, double uy); - Layout(Layout& orig, Partition& part); - - double lx() const { return lx_; } - double ly() const { return ly_; } - double ux() const { return ux_; } - double uy() const { return uy_; } - - void setLx(double lx); - void setLy(double ly); - void setUx(double ux); - void setUy(double uy); - - private: - double lx_, ly_, ux_, uy_; -}; - -} // namespace mpl diff --git a/src/mpl/include/mpl/MakeMacroPlacer.h b/src/mpl/include/mpl/MakeMacroPlacer.h deleted file mode 100644 index 6c319ceba83..00000000000 --- a/src/mpl/include/mpl/MakeMacroPlacer.h +++ /dev/null @@ -1,50 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2019-2020, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -namespace mpl { -class MacroPlacer; -} - -namespace ord { - -class OpenRoad; - -mpl::MacroPlacer* makeMacroPlacer(); - -void initMacroPlacer(OpenRoad* openroad); - -void deleteMacroPlacer(mpl::MacroPlacer* macro_placer); - -} // namespace ord diff --git a/src/mpl/include/mpl/Partition.h b/src/mpl/include/mpl/Partition.h deleted file mode 100644 index f8f3f883d78..00000000000 --- a/src/mpl/include/mpl/Partition.h +++ /dev/null @@ -1,116 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2019-2020, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include -#include -#include - -namespace utl { -class Logger; -} - -namespace parquetfp { -class Nets; -} - -namespace mpl { - -using std::array; -using std::pair; -using std::string; -using std::vector; - -namespace pfp = parquetfp; - -class MacroPlacer; -class Macro; - -enum PartClass -{ - S, - N, - W, - E, - NW, - NE, - SW, - SE, - ALL, - None -}; - -constexpr int part_class_count = None + 1; - -// PartClass -> global macro indices -typedef array, part_class_count> MacroPartMap; - -class Partition -{ - public: - Partition(PartClass _partClass, - double _lx, - double _ly, - double _width, - double _height, - MacroPlacer* macro_placer, - utl::Logger* log); - Partition(const Partition& prev) = default; - - void fillNetlistTable(MacroPartMap& macroPartMap); - // Call Parquet to have annealing solution - bool anneal(); - - PartClass partClass; - vector macros_; - double lx, ly; - double width, height; - double solution_width, solution_height; - vector net_tbl_; - - private: - string getName(int macroIdx); - int globalIndex(int macro_idx); - void makePins(int macro_idx1, - int macro_idx2, - int cost, - int pnet_idx, - pfp::Nets* pfp_nets); - - utl::Logger* logger_; - MacroPlacer* macro_placer_; -}; - -} // namespace mpl diff --git a/src/mpl/src/MacroPlacer-py.i b/src/mpl/src/MacroPlacer-py.i deleted file mode 100644 index 7a22ed11347..00000000000 --- a/src/mpl/src/MacroPlacer-py.i +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2022, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -%{ -#include "ord/OpenRoad.hh" -#include "mpl/MacroPlacer.h" -using namespace mpl; -%} - -%include "../../Exception-py.i" - -%include -%include - -%import "odb.i" -%import "odb/dbTypes.h" - -%include "mpl/MacroPlacer.h" diff --git a/src/mpl/src/MacroPlacer.cpp b/src/mpl/src/MacroPlacer.cpp deleted file mode 100644 index 0aad1e3d771..00000000000 --- a/src/mpl/src/MacroPlacer.cpp +++ /dev/null @@ -1,1450 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2019-2020, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#include "mpl/MacroPlacer.h" - -#include - -#include "db_sta/dbNetwork.hh" -#include "db_sta/dbSta.hh" -#include "graphics.h" -#include "sta/Bfs.hh" -#include "sta/Corner.hh" -#include "sta/FuncExpr.hh" -#include "sta/Graph.hh" -#include "sta/Liberty.hh" -#include "sta/Network.hh" -#include "sta/PortDirection.hh" -#include "sta/Sdc.hh" -#include "sta/SearchPred.hh" -#include "sta/Sequential.hh" -#include "sta/Sta.hh" -#include "utl/Logger.h" - -namespace mpl { - -using std::max; -using std::min; -using std::round; - -using utl::MPL; - -using odb::dbBlock; -using odb::dbBPin; -using odb::dbBTerm; -using odb::dbInst; -using odb::dbITerm; -using odb::dbPlacementStatus; -using odb::dbRow; -using odb::dbSet; -using odb::dbSigType; -using odb::dbSite; -using odb::dbTech; -using odb::dbTechLayer; -using odb::Rect; - -typedef vector> TwoPartitions; - -static CoreEdge getCoreEdge(int cx, - int cy, - int dieLx, - int dieLy, - int dieUx, - int dieUy); - -//////////////////////////////////////////////////////////////// - -MacroPlacer::MacroPlacer() - : db_(nullptr), - sta_(nullptr), - logger_(nullptr), - snap_layer_(nullptr), - connection_driven_(false), - lx_(0), - ly_(0), - ux_(0), - uy_(0), - verbose_(1), - solution_count_(0), - gui_debug_(false), - gui_debug_partitions_(false) -{ -} - -void MacroPlacer::init(odb::dbDatabase* db, sta::dbSta* sta, utl::Logger* log) -{ - db_ = db; - sta_ = sta; - logger_ = log; -} - -void MacroPlacer::setDebug(bool partitions) -{ - gui_debug_ = true; - gui_debug_partitions_ = partitions; -} - -void MacroPlacer::setHalo(double halo_x, double halo_y) -{ - default_macro_spacings_.setHalo(halo_x, halo_y); -} - -void MacroPlacer::setChannel(double channel_x, double channel_y) -{ - default_macro_spacings_.setChannel(channel_x, channel_y); -} - -void MacroPlacer::setVerboseLevel(int verbose) -{ - verbose_ = verbose; -} - -void MacroPlacer::setFenceRegion(double lx, double ly, double ux, double uy) -{ - lx_ = lx; - ly_ = ly; - ux_ = ux; - uy_ = uy; -} - -void MacroPlacer::setSnapLayer(odb::dbTechLayer* snap_layer) -{ - snap_layer_ = snap_layer; -} - -int MacroPlacer::getSolutionCount() -{ - return solution_count_; -} - -bool MacroPlacer::init() -{ - if (!findMacros()) { - return false; - } - - // Connection driven will be disabled if some instances are missing liberty - // cells. - connection_driven_ = !isMissingLiberty(); - - if (connection_driven_) { - reportEdgePinCounts(); - findAdjacencies(); - } else { - logger_->warn(MPL, - 98, - "Some instances do not have Liberty models. TritonMP will " - "place macros without connection information."); - } - return true; -} - -bool MacroPlacer::isMissingLiberty() -{ - sta::Network* network = sta_->network(); - sta::LeafInstanceIterator* instIter = network->leafInstanceIterator(); - while (instIter->hasNext()) { - sta::Instance* inst = instIter->next(); - if (network->libertyCell(inst) == nullptr) { - delete instIter; - return true; - } - } - delete instIter; - return false; -} - -void MacroPlacer::reportEdgePinCounts() -{ - int counts[core_edge_count] = {0}; - for (dbBTerm* bterm : db_->getChip()->getBlock()->getBTerms()) { - CoreEdge edge = findNearestEdge(bterm); - counts[coreEdgeIndex(edge)]++; - } - for (int i = 0; i < core_edge_count; i++) { - CoreEdge edge = coreEdgeFromIndex(i); - logger_->info(MPL, 102, "{} pins {}.", coreEdgeString(edge), counts[i]); - } -} - -// Use parquefp on all the macros in the lower left corner. -void MacroPlacer::placeMacrosCornerMinWL() -{ - if (!init()) { - return; - } - - double wl = getWeightedWL(); - logger_->info(MPL, 67, "Initial weighted wire length {:g}.", wl); - - // All of this partitioning garbage is unnecessary but survives to support - // the multiple partition algorithm. - - Layout layout(lx_, ly_, ux_, uy_); - Partition partition( - PartClass::ALL, lx_, ly_, ux_ - lx_, uy_ - ly_, this, logger_); - partition.macros_ = macros_; - - MacroPartMap globalMacroPartMap; - makeMacroPartMap(partition, globalMacroPartMap); - - if (connection_driven_) { - partition.fillNetlistTable(globalMacroPartMap); - } - - // Annealing based on ParquetFP Engine - if (partition.anneal()) { - setDbInstLocations(partition); - - double curWwl = getWeightedWL(); - logger_->info(MPL, 68, "Placed weighted wire length {:g}.", curWwl); - } else - logger_->warn(MPL, 66, "Partitioning failed."); -} - -void MacroPlacer::setDbInstLocations(Partition& partition) -{ - odb::dbTech* tech = db_->getTech(); - const int dbu = tech->getDbUnitsPerMicron(); - const float pitch_x = static_cast(snap_layer_->getPitchX()) / dbu; - const float pitch_y = static_cast(snap_layer_->getPitchY()) / dbu; - - int macro_idx = 0; - for (Macro& pmacro : partition.macros_) { - // partition macros are 1:1 with macros_. - Macro& macro = macros_[macro_idx]; - - double x = pmacro.lx; - double y = pmacro.ly; - - // Snap to routing grid. - x = round(x / pitch_x) * pitch_x; - y = round(y / pitch_y) * pitch_y; - - // Snap macro location to grid. - macro.lx = x; - macro.ly = y; - - // Update db inst location. - dbInst* db_inst = macro.dbInstPtr; - db_inst->setLocation(round(x * dbu), round(y * dbu)); - db_inst->setPlacementStatus(odb::dbPlacementStatus::LOCKED); - macro_idx++; - } -} - -//////////////////////////////////////////////////////////////// - -// Use some undocumented method with cut lines to break the design -// into regions and try all combinations of something or other. -// Pick the one that maximizes (yes, really) -// wire lengths of connections between the macros to force them to the corners. -void MacroPlacer::placeMacrosCornerMaxWl() -{ - if (!init()) { - return; - } - - double wl = getWeightedWL(); - logger_->info(MPL, 69, "Initial weighted wire length {:g}.", wl); - - Layout layout(lx_, ly_, ux_, uy_); - bool horizontal = true; - Partition top_partition( - PartClass::ALL, lx_, ly_, ux_ - lx_, uy_ - ly_, this, logger_); - top_partition.macros_ = macros_; - - logger_->report("Begin one level partition."); - - TwoPartitions oneLevelPart = getPartitions(layout, top_partition, horizontal); - - logger_->report("End one level partition."); - TwoPartitions east_partitions, west_partitions; - - vector> allSets; - - MacroPartMap globalMacroPartMap; - makeMacroPartMap(top_partition, globalMacroPartMap); - - if (connection_driven_) { - top_partition.fillNetlistTable(globalMacroPartMap); - } - - // push to the outer vector - vector layoutSet; - layoutSet.push_back(top_partition); - - allSets.push_back(layoutSet); - for (auto& partition_set : oneLevelPart) { - if (horizontal) { - logger_->report("Begin horizontal partition."); - Layout eastInfo(layout, partition_set.first); - Layout westInfo(layout, partition_set.second); - - logger_->report("Begin east partition."); - TwoPartitions east_partitions - = getPartitions(eastInfo, partition_set.first, !horizontal); - logger_->report("End east partition."); - - logger_->report("Begin west partition."); - TwoPartitions west_partitions - = getPartitions(westInfo, partition_set.second, !horizontal); - logger_->report("End west partition."); - - // Zero case handling when east_partitions = 0 - if (east_partitions.empty() && !west_partitions.empty()) { - for (size_t i = 0; i < west_partitions.size(); i++) { - vector partition_set2; - - // one set is composed of two subblocks - partition_set2.push_back(west_partitions[i].first); - partition_set2.push_back(west_partitions[i].second); - - // Fill Macro Netlist - // update macroPartMap - MacroPartMap macroPartMap; - for (auto& partition : partition_set2) { - makeMacroPartMap(partition, macroPartMap); - } - - if (connection_driven_) { - for (auto& partition : partition_set2) { - partition.fillNetlistTable(macroPartMap); - } - } - - allSets.push_back(partition_set2); - } - } - // Zero case handling when west_partitions = 0 - else if (!east_partitions.empty() && west_partitions.empty()) { - for (size_t i = 0; i < east_partitions.size(); i++) { - vector partition_set2; - - // one set is composed of two subblocks - partition_set2.push_back(east_partitions[i].first); - partition_set2.push_back(east_partitions[i].second); - - // Fill Macro Netlist - // update macroPartMap - MacroPartMap macroPartMap; - for (auto& partition : partition_set2) { - makeMacroPartMap(partition, macroPartMap); - } - - if (connection_driven_) { - for (auto& partition : partition_set2) { - partition.fillNetlistTable(macroPartMap); - } - } - - allSets.push_back(partition_set2); - } - } else { - // for all possible partition combinations - for (size_t i = 0; i < east_partitions.size(); i++) { - for (size_t j = 0; j < west_partitions.size(); j++) { - vector partition_set2; - - // one set is composed of four subblocks - partition_set2.push_back(east_partitions[i].first); - partition_set2.push_back(east_partitions[i].second); - partition_set2.push_back(west_partitions[j].first); - partition_set2.push_back(west_partitions[j].second); - - MacroPartMap macroPartMap; - for (auto& partition : partition_set2) { - makeMacroPartMap(partition, macroPartMap); - } - - if (connection_driven_) { - for (auto& partition : partition_set2) { - partition.fillNetlistTable(macroPartMap); - } - } - allSets.push_back(partition_set2); - } - } - } - logger_->report("End horizontal partition."); - } else { - // Vertical partition support MIA - } - } - logger_->info(MPL, 70, "Using {} partition sets.", allSets.size() - 1); - - std::unique_ptr graphics; - if (gui_debug_ && Graphics::guiActive()) { - graphics = std::make_unique(db_); - } - - solution_count_ = 0; - bool found_best = false; - int best_setIdx = 0; - double bestWwl = std::numeric_limits::lowest(); - for (auto& partition_set : allSets) { - // skip for top partition - if (partition_set.size() == 1) { - continue; - } - - if (gui_debug_) { - graphics->status("Pre-anneal"); - graphics->set_partitions(partition_set, true); - } - - // For each of the 4 partitions - bool isFailed = false; - for (auto& curPart : partition_set) { - // Annealing based on ParquetFP Engine - bool success = curPart.anneal(); - if (!success) { - logger_->warn( - MPL, - 61, - "Parquet area {:g} x {:g} exceeds the partition area {:g} x {:g}.", - curPart.solution_width, - curPart.solution_height, - curPart.width, - curPart.height); - isFailed = true; - break; - } - // Update mckt frequently - updateMacroLocations(curPart); - } - - if (isFailed) { - continue; - } - - double curWwl = getWeightedWL(); - logger_->info(MPL, - 71, - "Solution {} weighted wire length {:g}.", - solution_count_ + 1, - curWwl); - bool is_best = false; - if (!found_best - // Note that this MAXIMIZES wirelength. - // That is they way mingyu wrote it. - // This is the only thing that keeps all the macros from ending - // up in one clump. -cherry - || curWwl > bestWwl) { - bestWwl = curWwl; - best_setIdx = &partition_set - &allSets[0]; - found_best = true; - is_best = true; - } - solution_count_++; - - if (gui_debug_) { - auto msg("Post-anneal WL: " + std::to_string(curWwl)); - if (is_best) { - msg += " [BEST]"; - } - graphics->status(msg); - graphics->set_partitions(partition_set, false); - } - } - - if (found_best) { - logger_->info(MPL, 73, "Best weighted wire length {:g}.", bestWwl); - std::vector best_set = allSets[best_setIdx]; - for (auto& best_partition : best_set) { - updateMacroLocations(best_partition); - } - updateDbInstLocations(); - } else - logger_->error(MPL, 72, "No partition solutions found."); -} - -int MacroPlacer::weight(int idx1, int idx2) -{ - return macro_weights_[idx1][idx2]; -} - -// Update opendb instance locations from macros. -void MacroPlacer::updateDbInstLocations() -{ - odb::dbTech* tech = db_->getTech(); - const int dbu = tech->getDbUnitsPerMicron(); - - for (auto& macro : macros_) { - macro.dbInstPtr->setLocation(round(macro.lx * dbu), round(macro.ly * dbu)); - macro.dbInstPtr->setPlacementStatus(odb::dbPlacementStatus::LOCKED); - } -} - -void MacroPlacer::cutRoundUp(const Layout& layout, - double& cutLine, - bool horizontal) -{ - dbBlock* block = db_->getChip()->getBlock(); - dbSite* site = nullptr; - for (auto* row : block->getRows()) { - if (row->getSite()->getClass() != odb::dbSiteClass::PAD) { - site = row->getSite(); - break; - } - } - if (site == nullptr) { - logger_->error(utl::MPL, 97, "Unable to find a site"); - } - const double dbu = db_->getTech()->getDbUnitsPerMicron(); - if (horizontal) { - double siteSizeX = site->getWidth() / dbu; - cutLine = round(cutLine / siteSizeX) * siteSizeX; - cutLine = min(cutLine, layout.ux()); - cutLine = max(cutLine, layout.lx()); - } else { - double siteSizeY = site->getHeight() / dbu; - cutLine = round(cutLine / siteSizeY) * siteSizeY; - cutLine = min(cutLine, layout.uy()); - cutLine = max(cutLine, layout.ly()); - } -} - -// using partition, -// fill in macroPartMap -// -// macroPartMap will contain -// -// first: macro partition class info -// second: macro candidates. -void MacroPlacer::makeMacroPartMap(const Partition& part, - MacroPartMap& macroPartMap) const -{ - // This does not look like it actually does anything -cherry - vector macros = macroPartMap[part.partClass]; - // convert macro Information into macroIdx - for (auto& macro : part.macros_) { - int macro_index = macro_inst_map_.at(macro.dbInstPtr); - macros.push_back(macro_index); - } - macroPartMap[part.partClass] = macros; -} - -// only considers lx or ly coordinates for sorting -static bool segLxLyLess(const std::pair& p1, - const std::pair& p2) -{ - return p1.second < p2.second; -} - -// Two partitioning functions: -// first : lower part -// second : upper part -// -// cutLine is sweeping from lower to upper coordinates in x / y -vector> MacroPlacer::getPartitions( - const Layout& layout, - const Partition& partition, - bool horizontal) -{ - logger_->info(MPL, 76, "Partition {} macros.", partition.macros_.size()); - - vector> partitions; - - double maxWidth = 0.0; - double maxHeight = 0.0; - - // segments - // In a sane implementation this would be a vector of Macro* - // and use a function to return the origin x/y. -cherry - vector> segments; - - // in parent partition, traverse macros - for (const Macro& macro : partition.macros_) { - segments.push_back(std::make_pair(¯o - &partition.macros_[0], - (horizontal) ? macro.lx : macro.ly)); - - maxWidth = std::max(maxWidth, paddedWidth(macro)); - maxHeight = std::max(maxHeight, paddedHeight(macro)); - } - - double cutLineLimit = (horizontal) ? maxWidth * 0.25 : maxHeight * 0.25; - vector cutlines; - - // less than 4 - if (partition.macros_.size() <= 4) { - sort(segments.begin(), segments.end(), segLxLyLess); - - double prevPushLimit = -1e30; - bool isFirst = true; - // first : macros_ index - // second : macro lower coordinates - for (auto& segPair : segments) { - if (isFirst) { - cutlines.push_back(segPair.second); - prevPushLimit = segPair.second; - isFirst = false; - } else if (std::abs(segPair.second - prevPushLimit) > cutLineLimit) { - cutlines.push_back(segPair.second); - prevPushLimit = segPair.second; - } - } - } - // more than 4 - else { - int hardLimit = round(std::sqrt(partition.macros_.size() / 3.0)); - for (int i = 0; i <= hardLimit; i++) { - cutlines.push_back( - (horizontal) - ? layout.lx() + (layout.ux() - layout.lx()) / hardLimit * i - : layout.ly() + (layout.uy() - layout.ly()) / hardLimit * i); - } - } - logger_->info(MPL, 77, "Using {} cut lines.", cutlines.size()); - - // Macro checker array - // 0 for uninitialize - // 1 for lower - // 2 for upper - // 3 for both - vector chkArr(partition.macros_.size()); - - for (auto& cutLine : cutlines) { - cutRoundUp(layout, cutLine, horizontal); - - logger_->info(MPL, 79, "Cut line {:.2f}.", cutLine); - - // chkArr initialize - for (size_t i = 0; i < partition.macros_.size(); i++) { - chkArr[i] = 0; - } - - bool isImpossible = false; - for (auto& macro : partition.macros_) { - int i = ¯o - &partition.macros_[0]; - if (horizontal) { - // lower is possible - if (paddedWidth(macro) <= cutLine) { - chkArr[i] += 1; - } - // upper is possible - if (paddedWidth(macro) <= partition.lx + partition.width - cutLine) { - chkArr[i] += 2; - } - // none of them - if (chkArr[i] == 0) { - isImpossible = true; - break; - } - } else { - // lower is possible - if (paddedHeight(macro) <= cutLine) { - chkArr[i] += 1; - } - // upper is possible - if (paddedHeight(macro) <= partition.ly + partition.height - cutLine) { - chkArr[i] += 2; - } - // none of - if (chkArr[i] == 0) { - isImpossible = true; - break; - } - } - } - // impossible cuts, then skip - if (isImpossible) { - continue; - } - - // Fill in the Partitioning information - PartClass lClass = None, uClass = None; - switch (partition.partClass) { - case PartClass::ALL: - lClass = (horizontal) ? W : S; - uClass = (horizontal) ? E : N; - break; - case PartClass::W: - lClass = SW; - uClass = NW; - break; - case PartClass::E: - lClass = SE; - uClass = NE; - break; - case PartClass::N: - lClass = NW; - uClass = NE; - break; - case PartClass::S: - lClass = SW; - uClass = SE; - break; - default: - logger_->error(MPL, 64, "Unhandled partition class."); - lClass = W; - uClass = E; - break; - } - - Partition lowerPart( - lClass, - partition.lx, - partition.ly, - (horizontal) ? cutLine - partition.lx : partition.width, - (horizontal) ? partition.height : cutLine - partition.ly, - this, - logger_); - - Partition upperPart(uClass, - (horizontal) ? cutLine : partition.lx, - (horizontal) ? partition.ly : cutLine, - (horizontal) ? partition.lx + partition.width - cutLine - : partition.width, - (horizontal) - ? partition.height - : partition.ly + partition.height - cutLine, - this, - logger_); - - // Fill in child partitons' macros_ - for (const Macro& macro : partition.macros_) { - int i = ¯o - &partition.macros_[0]; - if (chkArr[i] == 1) { - lowerPart.macros_.push_back(macro); - } else if (chkArr[i] == 2) { - upperPart.macros_.push_back( - Macro((horizontal) ? macro.lx - cutLine : macro.lx, - (horizontal) ? macro.ly : macro.ly - cutLine, - macro)); - } else if (chkArr[i] == 3) { - double centerPoint = (horizontal) ? macro.lx + macro.w / 2.0 - : macro.ly + macro.h / 2.0; - - if (centerPoint < cutLine) { - lowerPart.macros_.push_back(macro); - - } else { - upperPart.macros_.push_back( - Macro((horizontal) ? macro.lx - cutLine : macro.lx, - (horizontal) ? macro.ly : macro.ly - cutLine, - macro)); - } - } - } - - double lowerArea = lowerPart.width * lowerPart.height; - double upperArea = upperPart.width * upperPart.height; - - double upperMacroArea = 0.0f; - double lowerMacroArea = 0.0f; - - for (auto& macro : upperPart.macros_) { - upperMacroArea += macro.w * macro.h; - } - for (auto& macro : lowerPart.macros_) { - lowerMacroArea += macro.w * macro.h; - } - - // impossible partitioning - if (upperMacroArea > upperArea || lowerMacroArea > lowerArea) { - logger_->info(MPL, 80, "Impossible partition found."); - continue; - } - - pair curPart(lowerPart, upperPart); - partitions.push_back(curPart); - } - return partitions; -} - -double MacroPlacer::paddedWidth(const Macro& macro) -{ - MacroSpacings& spacings = getSpacings(macro); - return macro.w + spacings.getSpacingX() * 2; -} - -double MacroPlacer::paddedHeight(const Macro& macro) -{ - MacroSpacings& spacings = getSpacings(macro); - return macro.h + spacings.getSpacingY() * 2; -} - -bool MacroPlacer::findMacros() -{ - dbBlock* block = db_->getChip()->getBlock(); - const int dbu = db_->getTech()->getDbUnitsPerMicron(); - for (dbInst* inst : block->getInsts()) { - if (inst->getMaster()->getType().isBlock()) { - // for Macro cells - dbPlacementStatus dps = inst->getPlacementStatus(); - if (dps == dbPlacementStatus::NONE - || dps == dbPlacementStatus::UNPLACED) { - logger_->error(MPL, - 99, - "Macro {} is unplaced, use global_placement to get an " - "initial placement before macro placement.", - inst->getConstName()); - } - - int placeX, placeY; - inst->getLocation(placeX, placeY); - - macro_inst_map_[inst] = macros_.size(); - Macro macro(1.0 * placeX / dbu, - 1.0 * placeY / dbu, - 1.0 * inst->getBBox()->getDX() / dbu, - 1.0 * inst->getBBox()->getDY() / dbu, - inst); - macros_.push_back(macro); - } - } - - if (macros_.empty()) { - logger_->warn(MPL, 100, "No macros found."); - return false; - } - - logger_->info(MPL, 101, "Found {} macros.", macros_.size()); - logger_->metric("floorplan__design__instance__count__macros", macros_.size()); - return true; -} - -static bool isWithIn(int val, int min, int max) -{ - return ((min <= val) && (val <= max)); -} - -static float getRoundUpFloat(float x, float unit) -{ - return round(x / unit) * unit; -} - -void MacroPlacer::updateMacroLocations(Partition& part) -{ - dbTech* tech = db_->getTech(); - const float pitchX = static_cast(snap_layer_->getPitchX()) - / tech->getDbUnitsPerMicron(); - const float pitchY = static_cast(snap_layer_->getPitchY()) - / tech->getDbUnitsPerMicron(); - - for (auto& macro : part.macros_) { - // snap location to routing layer grid - float macroX = getRoundUpFloat(macro.lx, pitchX); - float macroY = getRoundUpFloat(macro.ly, pitchY); - macro.lx = macroX; - macro.ly = macroY; - // Update Macro Location - int macroIdx = macro_inst_map_.at(macro.dbInstPtr); - macros_[macroIdx].lx = macroX; - macros_[macroIdx].ly = macroY; - } -} - -#define EAST_IDX (macros_.size() + coreEdgeIndex(CoreEdge::East)) -#define WEST_IDX (macros_.size() + coreEdgeIndex(CoreEdge::West)) -#define NORTH_IDX (macros_.size() + coreEdgeIndex(CoreEdge::North)) -#define SOUTH_IDX (macros_.size() + coreEdgeIndex(CoreEdge::South)) - -double MacroPlacer::getWeightedWL() -{ - double wwl = 0.0f; - - double width = ux_ - lx_; - double height = uy_ - ly_; - - for (size_t i = 0; i < macros_.size() + core_edge_count; i++) { - for (size_t j = i + 1; j < macros_.size() + core_edge_count; j++) { - double pointX1 = 0, pointY1 = 0; - if (i == EAST_IDX) { - pointX1 = lx_ + width; - pointY1 = ly_ + height / 2.0; - } else if (i == WEST_IDX) { - pointX1 = lx_; - pointY1 = ly_ + height / 2.0; - } else if (i == NORTH_IDX) { - pointX1 = lx_ + width / 2.0; - pointY1 = ly_ + height; - } else if (i == SOUTH_IDX) { - pointX1 = lx_ + width / 2.0; - pointY1 = ly_; - } else { - pointX1 = macros_[i].lx + macros_[i].w / 2; - pointY1 = macros_[i].ly + macros_[i].h / 2; - } - - double pointX2 = 0, pointY2 = 0; - if (j == EAST_IDX) { - pointX2 = lx_ + width; - pointY2 = ly_ + height / 2.0; - } else if (j == WEST_IDX) { - pointX2 = lx_; - pointY2 = ly_ + height / 2.0; - } else if (j == NORTH_IDX) { - pointX2 = lx_ + width / 2.0; - pointY2 = ly_ + height; - } else if (j == SOUTH_IDX) { - pointX2 = lx_ + width / 2.0; - pointY2 = ly_; - } else { - pointX2 = macros_[j].lx + macros_[j].w / 2; - pointY2 = macros_[j].ly + macros_[j].h / 2; - } - - float edgeWeight = 0.0f; - if (connection_driven_) { - edgeWeight = macro_weights_[i][j]; - } else { - edgeWeight = 1; - } - double wl = std::sqrt((pointX1 - pointX2) * (pointX1 - pointX2) - + (pointY1 - pointY2) * (pointY1 - pointY2)); - double weighted_wl = edgeWeight * wl; - if (edgeWeight > 0) - debugPrint(logger_, - MPL, - "weighted_wl", - 1, - "{} -> {} wl {:.2f} * weight {:.2f} = {:.2f}", - macroIndexName(i), - macroIndexName(j), - wl, - edgeWeight, - weighted_wl); - wwl += weighted_wl; - } - } - - return wwl; -} - -Layout::Layout() : lx_(0), ly_(0), ux_(0), uy_(0) -{ -} - -Layout::Layout(double lx, double ly, double ux, double uy) - : lx_(lx), ly_(ly), ux_(ux), uy_(uy) -{ -} - -Layout::Layout(Layout& orig, Partition& part) - : lx_(part.lx), - ly_(part.ly), - ux_(part.lx + part.width), - uy_(part.ly + part.height) -{ -} - -void Layout::setLx(double lx) -{ - lx_ = lx; -} - -void Layout::setLy(double ly) -{ - ly_ = ly; -} - -void Layout::setUx(double ux) -{ - ux_ = ux; -} - -void Layout::setUy(double uy) -{ - uy_ = uy; -} - -static CoreEdge getCoreEdge(int cx, - int cy, - int dieLx, - int dieLy, - int dieUx, - int dieUy) -{ - int lxDx = abs(cx - dieLx); - int uxDx = abs(cx - dieUx); - - int lyDy = abs(cy - dieLy); - int uyDy = abs(cy - dieUy); - - int minDiff = std::min(lxDx, std::min(uxDx, std::min(lyDy, uyDy))); - if (minDiff == lxDx) { - return CoreEdge::West; - } else if (minDiff == uxDx) { - return CoreEdge::East; - } else if (minDiff == lyDy) { - return CoreEdge::South; - } else if (minDiff == uyDy) { - return CoreEdge::North; - } - return CoreEdge::West; -} - -//////////////////////////////////////////////////////////////// - -// Use OpenSTA graph to find macro adjacencies. -// No delay calculation or arrival search is required, -// just gate connectivity in the levelized graph. -void MacroPlacer::findAdjacencies() -{ - sta_->ensureLevelized(); - sta_->ensureClkNetwork(); - VertexFaninMap vertex_fanins; - sta::SearchPred2 srch_pred(sta_); - sta::BfsFwdIterator bfs(sta::BfsIndex::other, &srch_pred, sta_); - - seedFaninBfs(bfs, vertex_fanins); - findFanins(bfs, vertex_fanins); - - // Propagate fanins through 3 levels of register D->Q. - for (int i = 0; i < reg_adjacency_depth_; i++) { - copyFaninsAcrossRegisters(bfs, vertex_fanins); - findFanins(bfs, vertex_fanins); - } - - AdjWeightMap adj_map; - findAdjWeights(vertex_fanins, adj_map); - - fillMacroWeights(adj_map); -} - -void MacroPlacer::seedFaninBfs(sta::BfsFwdIterator& bfs, - VertexFaninMap& vertex_fanins) -{ - sta::dbNetwork* network = sta_->getDbNetwork(); - sta::Graph* graph = sta_->ensureGraph(); - // Seed the BFS with macro output pins. - for (Macro& macro : macros_) { - for (dbITerm* iterm : macro.dbInstPtr->getITerms()) { - sta::Pin* pin = network->dbToSta(iterm); - if (network->direction(pin)->isAnyOutput() && !sta_->isClock(pin)) { - sta::Vertex* vertex = graph->pinDrvrVertex(pin); - vertex_fanins[vertex].insert(¯o); - bfs.enqueueAdjacentVertices(vertex); - } - } - } - // Seed top level ports input ports. - for (dbBTerm* bterm : db_->getChip()->getBlock()->getBTerms()) { - sta::Pin* pin = network->dbToSta(bterm); - if (network->direction(pin)->isAnyInput() && !sta_->isClock(pin)) { - sta::Vertex* vertex = graph->pinDrvrVertex(pin); - CoreEdge edge = findNearestEdge(bterm); - vertex_fanins[vertex].insert(reinterpret_cast(edge)); - bfs.enqueueAdjacentVertices(vertex); - } - } -} - -// BFS search forward union-ing fanins. -// BFS stops at register inputs because there are no timing arcs -// from register D->Q. -void MacroPlacer::findFanins(sta::BfsFwdIterator& bfs, - VertexFaninMap& vertex_fanins) -{ - sta::dbNetwork* network = sta_->getDbNetwork(); - sta::Graph* graph = sta_->ensureGraph(); - while (bfs.hasNext()) { - sta::Vertex* vertex = bfs.next(); - MacroSet& fanins = vertex_fanins[vertex]; - sta::VertexInEdgeIterator fanin_iter(vertex, graph); - while (fanin_iter.hasNext()) { - sta::Edge* edge = fanin_iter.next(); - sta::Vertex* fanin = edge->from(graph); - // Union fanins sets of fanin vertices. - for (Macro* fanin : vertex_fanins[fanin]) { - fanins.insert(fanin); - debugPrint(logger_, - MPL, - "find_fanins", - 1, - "{} + {}", - vertex->name(network), - faninName(fanin)); - } - } - bfs.enqueueAdjacentVertices(vertex); - } -} - -void MacroPlacer::copyFaninsAcrossRegisters(sta::BfsFwdIterator& bfs, - VertexFaninMap& vertex_fanins) -{ - sta::dbNetwork* network = sta_->getDbNetwork(); - sta::Graph* graph = sta_->ensureGraph(); - sta::Instance* top_inst = network->topInstance(); - sta::LeafInstanceIterator* leaf_iter - = network->leafInstanceIterator(top_inst); - while (leaf_iter->hasNext()) { - sta::Instance* inst = leaf_iter->next(); - sta::LibertyCell* lib_cell = network->libertyCell(inst); - if (lib_cell->hasSequentials() && !lib_cell->isMacro()) { - for (sta::Sequential* seq : lib_cell->sequentials()) { - sta::FuncExpr* data_expr = seq->data(); - sta::FuncExprPortIterator data_port_iter(data_expr); - while (data_port_iter.hasNext()) { - sta::LibertyPort* data_port = data_port_iter.next(); - sta::Pin* data_pin = network->findPin(inst, data_port); - sta::LibertyPort* out_port = seq->output(); - sta::Pin* out_pin = findSeqOutPin(inst, out_port); - if (data_pin && out_pin) { - sta::Vertex* data_vertex = graph->pinLoadVertex(data_pin); - sta::Vertex* out_vertex = graph->pinDrvrVertex(out_pin); - // Copy fanins from D to Q on register. - vertex_fanins[out_vertex] = vertex_fanins[data_vertex]; - bfs.enqueueAdjacentVertices(out_vertex); - } - } - } - } - } - delete leaf_iter; -} - -// Sequential outputs are generally to internal pins that are not physically -// part of the instance. Find the output port with a function that uses -// the internal port. -sta::Pin* MacroPlacer::findSeqOutPin(sta::Instance* inst, - sta::LibertyPort* out_port) -{ - sta::dbNetwork* network = sta_->getDbNetwork(); - if (out_port->direction()->isInternal()) { - sta::InstancePinIterator* pin_iter = network->pinIterator(inst); - while (pin_iter->hasNext()) { - sta::Pin* pin = pin_iter->next(); - sta::LibertyPort* lib_port = network->libertyPort(pin); - if (lib_port->direction()->isAnyOutput()) { - sta::FuncExpr* func = lib_port->function(); - if (func->hasPort(out_port)) { - sta::Pin* out_pin = network->findPin(inst, lib_port); - if (out_pin) { - delete pin_iter; - return out_pin; - } - } - } - } - delete pin_iter; - return nullptr; - } else - return network->findPin(inst, out_port); -} - -void MacroPlacer::findAdjWeights(VertexFaninMap& vertex_fanins, - AdjWeightMap& adj_map) -{ - sta::dbNetwork* network = sta_->getDbNetwork(); - sta::Graph* graph = sta_->ensureGraph(); - // Find adjacencies from macro input pin fanins. - for (Macro& macro : macros_) { - for (dbITerm* iterm : macro.dbInstPtr->getITerms()) { - sta::Pin* pin = network->dbToSta(iterm); - if (network->direction(pin)->isAnyInput()) { - sta::Vertex* vertex = graph->pinLoadVertex(pin); - MacroSet& pin_fanins = vertex_fanins[vertex]; - for (Macro* pin_fanin : pin_fanins) { - // Adjacencies are symmetric so only fill in one side. - if (pin_fanin != ¯o) { - MacroPair from_to = (pin_fanin > ¯o) - ? MacroPair(pin_fanin, ¯o) - : MacroPair(¯o, pin_fanin); - adj_map[from_to]++; - } - } - } - } - } - // Find adjacencies from output pin fanins. - for (dbBTerm* bterm : db_->getChip()->getBlock()->getBTerms()) { - sta::Pin* pin = network->dbToSta(bterm); - if (network->direction(pin)->isAnyOutput() && !sta_->isClock(pin)) { - sta::Vertex* vertex = graph->pinDrvrVertex(pin); - CoreEdge edge = findNearestEdge(bterm); - debugPrint(logger_, - MPL, - "pin_edge", - 1, - "pin edge {} {}", - bterm->getConstName(), - coreEdgeString(edge)); - int edge_index = static_cast(edge); - Macro* macro = reinterpret_cast(edge_index); - MacroSet& edge_fanins = vertex_fanins[vertex]; - for (Macro* edge_fanin : edge_fanins) { - if (edge_fanin != macro) { - // Adjacencies are symmetric so only fill in one side. - MacroPair from_to = (edge_fanin > macro) - ? MacroPair(edge_fanin, macro) - : MacroPair(macro, edge_fanin); - adj_map[from_to]++; - } - } - } - } -} - -// Fill macro_weights_ array. -void MacroPlacer::fillMacroWeights(AdjWeightMap& adj_map) -{ - size_t weight_size = macros_.size() + core_edge_count; - macro_weights_.resize(weight_size); - for (size_t i = 0; i < weight_size; i++) { - macro_weights_[i].resize(weight_size); - } - - for (const auto& [from_to, weight] : adj_map) { - Macro* from = from_to.first; - Macro* to = from_to.second; - if (!(macroIndexIsEdge(from) && macroIndexIsEdge(to))) { - int idx1 = macroIndex(from); - int idx2 = macroIndex(to); - // Note macro_weights only has entries for idx1 < idx2. - macro_weights_[min(idx1, idx2)][max(idx1, idx2)] = weight; - if (weight > 0) - debugPrint(logger_, - MPL, - "weights", - 1, - "{} -> {} {}", - faninName(from), - faninName(to), - weight); - } - } -} - -std::string MacroPlacer::faninName(Macro* macro) -{ - intptr_t edge_index = reinterpret_cast(macro); - if (edge_index < core_edge_count) - return coreEdgeString(static_cast(edge_index)); - else - return macro->name(); -} - -// This has to be consistent with the accessors in EAST_IDX -int MacroPlacer::macroIndex(Macro* macro) -{ - intptr_t edge_index = reinterpret_cast(macro); - if (edge_index < core_edge_count) - return macros_.size() + edge_index; - else - return macro - ¯os_[0]; -} - -string MacroPlacer::macroIndexName(int index) -{ - if (index < macros_.size()) - return macros_[index].name(); - else - return coreEdgeString(static_cast(index - macros_.size())); -} - -int MacroPlacer::macroIndex(dbInst* inst) -{ - return macro_inst_map_.at(inst); -} - -bool MacroPlacer::macroIndexIsEdge(Macro* macro) -{ - intptr_t edge_index = reinterpret_cast(macro); - return edge_index < core_edge_count; -} - -// This assumes the pins straddle the die/fence boundary. -// It should look for the nearest edge to the pin center. -cherry -CoreEdge MacroPlacer::findNearestEdge(dbBTerm* bTerm) -{ - dbPlacementStatus status = bTerm->getFirstPinPlacementStatus(); - if (status == dbPlacementStatus::UNPLACED - || status == dbPlacementStatus::NONE) { - logger_->warn( - MPL, 65, "Pin {} is not placed, using west.", bTerm->getConstName()); - return CoreEdge::West; - } else { - const double dbu = db_->getTech()->getDbUnitsPerMicron(); - - int dbuCoreLx = round(lx_ * dbu); - int dbuCoreLy = round(ly_ * dbu); - int dbuCoreUx = round(ux_ * dbu); - int dbuCoreUy = round(uy_ * dbu); - - int placeX = 0, placeY = 0; - bool isAxisFound = false; - bTerm->getFirstPinLocation(placeX, placeY); - for (dbBPin* bPin : bTerm->getBPins()) { - Rect pin_bbox = bPin->getBBox(); - int boxLx = pin_bbox.xMin(); - int boxLy = pin_bbox.yMin(); - int boxUx = pin_bbox.xMax(); - int boxUy = pin_bbox.yMax(); - - if (isWithIn(dbuCoreLx, boxLx, boxUx)) { - return CoreEdge::West; - } else if (isWithIn(dbuCoreUx, boxLx, boxUx)) { - return CoreEdge::East; - } else if (isWithIn(dbuCoreLy, boxLy, boxUy)) { - return CoreEdge::South; - } else if (isWithIn(dbuCoreUy, boxLy, boxUy)) { - return CoreEdge::North; - } - } - if (!isAxisFound) { - dbBPin* bPin = *(bTerm->getBPins().begin()); - Rect pin_bbox = bPin->getBBox(); - int boxLx = pin_bbox.xMin(); - int boxLy = pin_bbox.yMin(); - int boxUx = pin_bbox.xMax(); - int boxUy = pin_bbox.yMax(); - return getCoreEdge((boxLx + boxUx) / 2, - (boxLy + boxUy) / 2, - dbuCoreLx, - dbuCoreLy, - dbuCoreUx, - dbuCoreUy); - } - } - return CoreEdge::West; -} - -//////////////////////////////////////////////////////////////// - -MacroSpacings& MacroPlacer::getSpacings(const Macro& macro) -{ - auto itr = macro_spacings_.find(macro.dbInstPtr); - if (itr == macro_spacings_.end()) - return default_macro_spacings_; - else - return itr->second; -} - -//////////////////////////////////////////////////////////////// - -const char* coreEdgeString(CoreEdge edge) -{ - switch (edge) { - case CoreEdge::West: - return "West"; - case CoreEdge::East: - return "East"; - case CoreEdge::North: - return "North"; - case CoreEdge::South: - return "South"; - default: - return "??"; - } -} - -int coreEdgeIndex(CoreEdge edge) -{ - return static_cast(edge); -} - -CoreEdge coreEdgeFromIndex(int edge_index) -{ - return static_cast(edge_index); -} - -//////////////////////////////////////////////////////////////// - -// Most of what is in this class is the dbInst and should be functions -// instead of class variables. -cherry -Macro::Macro(double _lx, - double _ly, - double _w, - double _h, - odb::dbInst* _dbInstPtr) - : lx(_lx), ly(_ly), w(_w), h(_h), dbInstPtr(_dbInstPtr) -{ -} - -Macro::Macro(double _lx, double _ly, const Macro& copy_from) - : lx(_lx), - ly(_ly), - w(copy_from.w), - h(copy_from.h), - dbInstPtr(copy_from.dbInstPtr) -{ -} - -std::string Macro::name() -{ - return dbInstPtr->getName(); -} - -MacroSpacings::MacroSpacings() - : halo_x_(0), halo_y_(0), channel_x_(0), channel_y_(0) -{ -} - -MacroSpacings::MacroSpacings(double halo_x, - double halo_y, - double channel_x, - double channel_y) - : halo_x_(halo_x), - halo_y_(halo_y), - channel_x_(channel_x), - channel_y_(channel_y) -{ -} - -void MacroSpacings::setHalo(double halo_x, double halo_y) -{ - halo_x_ = halo_x; - halo_y_ = halo_y; -} - -void MacroSpacings::setChannel(double channel_x, double channel_y) -{ - channel_x_ = channel_x; - channel_y_ = channel_y; -} - -void MacroSpacings::setChannelX(double channel_x) -{ - channel_x_ = channel_x; -} - -void MacroSpacings::setChannelY(double channel_y) -{ - channel_y_ = channel_y; -} - -double MacroSpacings::getSpacingX() const -{ - return max(halo_x_, channel_x_ / 2); -} - -double MacroSpacings::getSpacingY() const -{ - return max(halo_y_, channel_y_ / 2); -} - -} // namespace mpl diff --git a/src/mpl/src/MacroPlacer.i b/src/mpl/src/MacroPlacer.i deleted file mode 100644 index 815cb741f3b..00000000000 --- a/src/mpl/src/MacroPlacer.i +++ /dev/null @@ -1,105 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2019-2020, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -%{ - -#include "ord/OpenRoad.hh" -#include "mpl/MacroPlacer.h" - -namespace ord { -// Defined in OpenRoad.i -mpl::MacroPlacer* -getMacroPlacer(); -} - -using ord::getMacroPlacer; - -%} - -%include "../../Exception.i" - -%inline %{ - -namespace mpl { - -void -set_halo(double halo_v, double halo_h) -{ - MacroPlacer* macro_placer = getMacroPlacer(); - macro_placer->setHalo(halo_v, halo_h); -} - -void -set_channel(double channel_v, double channel_h) -{ - MacroPlacer* macro_placer = getMacroPlacer(); - macro_placer->setChannel(channel_v, channel_h); -} - -void -set_fence_region(double lx, double ly, double ux, double uy) -{ - MacroPlacer* macro_placer = getMacroPlacer(); - macro_placer->setFenceRegion(lx, ly, ux, uy); -} - -void -set_snap_layer(odb::dbTechLayer *snap_layer) -{ - MacroPlacer* macro_placer = getMacroPlacer(); - macro_placer->setSnapLayer(snap_layer); -} - -void -place_macros_corner_min_wl() -{ - MacroPlacer* macro_placer = getMacroPlacer(); - macro_placer->placeMacrosCornerMinWL(); -} - -void -place_macros_corner_max_wl() -{ - MacroPlacer* macro_placer = getMacroPlacer(); - macro_placer->placeMacrosCornerMaxWl(); -} - -void set_debug_cmd(bool partitions) -{ - MacroPlacer* macro_placer = getMacroPlacer(); - macro_placer->setDebug(partitions); -} - -} - -%} // inline diff --git a/src/mpl/src/MacroPlacer.tcl b/src/mpl/src/MacroPlacer.tcl deleted file mode 100644 index bca7ac16dbc..00000000000 --- a/src/mpl/src/MacroPlacer.tcl +++ /dev/null @@ -1,133 +0,0 @@ -############################################################################# -## -## Copyright (c) 2019, The Regents of the University of California -## All rights reserved. -## -## BSD 3-Clause License -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are met: -## -## * Redistributions of source code must retain the above copyright notice, this -## list of conditions and the following disclaimer. -## -## * Redistributions in binary form must reproduce the above copyright notice, -## this list of conditions and the following disclaimer in the documentation -## and/or other materials provided with the distribution. -## -## * Neither the name of the copyright holder nor the names of its -## contributors may be used to endorse or promote products derived from -## this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -## POSSIBILITY OF SUCH DAMAGE. -############################################################################# - -sta::define_cmd_args "macro_placement" { - [-halo {halo_x halo_y}] \ - [-channel {channel_x channel_y}]\ - [-fence_region {lx ly ux uy}]\ - [-snap_layer snap_layer_number]\ - [-style corner_max_wl|corner_min_wl]} - -proc macro_placement { args } { - sta::parse_key_args "macro_placement" args \ - keys {-channel -halo -fence_region -snap_layer -style} flags {} - - if { [info exists keys(-halo)] } { - set halo $keys(-halo) - if { [llength $halo] != 2 } { - utl::error "MPL" 92 "-halo receives a list with 2 values, [llength $halo] given." - } - lassign $halo halo_x halo_y - sta::check_positive_float "-halo x" $halo_x - sta::check_positive_float "-halo y" $halo_y - mpl::set_halo $halo_x $halo_y - } - - if { [info exists keys(-channel)] } { - set channel $keys(-channel) - if { [llength $channel] != 2 } { - utl::error "MPL" 93 "-channel receives a list with 2 values, [llength $channel] given." - } - lassign $channel channel_x channel_y - sta::check_positive_float "-channel x" $channel_x - sta::check_positive_float "-channel y" $channel_y - mpl::set_channel $channel_x $channel_y - } - - if { ![ord::db_has_rows] } { - utl::error "MPL" 89 "No rows found. Use initialize_floorplan to add rows." - } - set core [ord::get_db_core] - set core_lx [ord::dbu_to_microns [$core xMin]] - set core_ly [ord::dbu_to_microns [$core yMin]] - set core_ux [ord::dbu_to_microns [$core xMax]] - set core_uy [ord::dbu_to_microns [$core yMax]] - - if { [info exists keys(-fence_region)] } { - set fence_region $keys(-fence_region) - if { [llength $fence_region] != 4 } { - utl::error "MPL" 94 "-fence_region receives a list with 4 values,\ - [llength $fence_region] given." - } - lassign $fence_region lx ly ux uy - - if { $lx < $core_lx || $ly < $core_ly || $ux > $core_ux || $uy > $core_uy } { - utl::warn "MPL" 85 "fence_region outside of core area. Using core area." - mpl::set_fence_region $core_lx $core_ly $core_ux $core_uy - } else { - mpl::set_fence_region $lx $ly $ux $uy - } - } else { - mpl::set_fence_region $core_lx $core_ly $core_ux $core_uy - } - - set snap_layer 4 - if { [info exists keys(-snap_layer)] } { - set snap_layer $keys(-snap_layer) - sta::check_positive_integer "-snap_layer" $snap_layer - } - set tech [ord::get_db_tech] - set layer [$tech findRoutingLayer $snap_layer] - if { $layer == "NULL" } { - utl::error "MPL" 95 "Snap layer $snap_layer is not a routing layer." - } - mpl::set_snap_layer $layer - - set style "corner_max_wl" - if { [info exists keys(-style)] } { - set style $keys(-style) - } - if { $style == "corner_max_wl" } { - mpl::place_macros_corner_max_wl - } elseif { $style == "corner_min_wl" } { - mpl::place_macros_corner_min_wl - } else { - utl::error MPL 96 "Unknown placement style. Use one of corner_max_wl or corner_min_wl." - } -} - -sta::define_cmd_args "macro_placement_debug" { - [-partitions] -} ;# checker off - -proc macro_placement_debug { args } { - # This seg faults if the gui is not present -cherry - sta::parse_key_args "macro_placement_debug" args \ - keys {} \ - flags {-partitions} ;# checker off - - set partitions [info exists flags(-partitions)] - - mpl::set_debug_cmd $partitions -} diff --git a/src/mpl/src/MakeMacroPlacer.cpp b/src/mpl/src/MakeMacroPlacer.cpp deleted file mode 100644 index d074bf30012..00000000000 --- a/src/mpl/src/MakeMacroPlacer.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2019-2020, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#include "mpl/MakeMacroPlacer.h" - -#include - -#include "mpl/MacroPlacer.h" -#include "ord/OpenRoad.hh" -#include "sta/StaMain.hh" - -namespace sta { -extern const char* mpl_tcl_inits[]; -} - -extern "C" { -extern int Mpl_Init(Tcl_Interp* interp); -} - -namespace ord { - -mpl::MacroPlacer* makeMacroPlacer() -{ - return new mpl::MacroPlacer; -} - -void initMacroPlacer(OpenRoad* openroad) -{ - Tcl_Interp* tcl_interp = openroad->tclInterp(); - Mpl_Init(tcl_interp); - sta::evalTclInit(tcl_interp, sta::mpl_tcl_inits); - openroad->getMacroPlacer()->init( - openroad->getDb(), openroad->getSta(), openroad->getLogger()); -} - -void deleteMacroPlacer(mpl::MacroPlacer* macro_placer) -{ - delete macro_placer; -} - -} // namespace ord diff --git a/src/mpl/src/ParquetFP/.gitignore b/src/mpl/src/ParquetFP/.gitignore deleted file mode 100644 index 21130807c94..00000000000 --- a/src/mpl/src/ParquetFP/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -*.a -**/*.a -*.out -*.log -*.o -*.exe -*.so -*.dot - -src/bench -src/output -src/runtest - -build - -Makefile -CMakeCache.txt -*.cmake -CMakeFiles -install_manifest.txt diff --git a/src/mpl/src/ParquetFP/CMakeLists.txt b/src/mpl/src/ParquetFP/CMakeLists.txt deleted file mode 100644 index 3f2448eda4a..00000000000 --- a/src/mpl/src/ParquetFP/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################ -## -## BSD 3-Clause License -## -## Copyright (c) 2021, The Regents of the University of California -## All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are met: -## -## * Redistributions of source code must retain the above copyright notice, this -## list of conditions and the following disclaimer. -## -## * Redistributions in binary form must reproduce the above copyright notice, -## this list of conditions and the following disclaimer in the documentation -## and/or other materials provided with the distribution. -## -## * Neither the name of the copyright holder nor the names of its -## contributors may be used to endorse or promote products derived from -## this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -## POSSIBILITY OF SUCH DAMAGE. -## - -project(ParquetFP - LANGUAGES CXX -) - -add_library(ParquetFP - src/AnalytSolve.cxx - src/baseannealer.cxx - src/basepacking.cxx - src/btreeanneal.cxx - src/btreecompact.cxx - src/btree.cxx - src/btreeslackeval.cxx - src/ClusterDB.cxx - src/CommandLine.cxx - src/DB.cxx - src/FPcommon.cxx - src/mixedpacking.cxx - src/mixedpackingfromdb.cxx - src/Net.cxx - src/netlist.cxx - src/Nets.cxx - src/Node.cxx - src/Nodes.cxx - src/plcompact.cxx - src/plsptobtree.cxx - src/pltobtree.cxx - src/PlToSP.cxx - src/SeqPair.cxx - src/skyline.cxx - src/SolveMulti.cxx - src/SPeval.cxx -) - -target_include_directories(ParquetFP - PUBLIC - ${PARQUET_HOME} - ) - -target_include_directories(ParquetFP - PUBLIC - src -) - diff --git a/src/mpl/src/ParquetFP/src/AnalytSolve.cxx b/src/mpl/src/ParquetFP/src/AnalytSolve.cxx deleted file mode 100644 index 79bb8b84f05..00000000000 --- a/src/mpl/src/ParquetFP/src/AnalytSolve.cxx +++ /dev/null @@ -1,242 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "AnalytSolve.h" - -#include - -#include "CommandLine.h" -#include "DB.h" -#include "FPcommon.h" - -using namespace parquetfp; -using std::vector; - -AnalytSolve::AnalytSolve(DB* db) : _db(db) -{ -} - -parquetfp::Point AnalytSolve::getDesignOptLoc() -{ - Point finalLoc; - Nodes* nodes = _db->getNodes(); - Nets* nets = _db->getNets(); - itNode node; - itNodePin nodePin; - itPin netPin; - vector netsSeen(nets->getNumNets(), 0); - - float xSum = 0; - float ySum = 0; - float netXSum = 0; - float netYSum = 0; - unsigned netDegree = 0; - unsigned nodeDegree = 0; - bool pinType = 0; - float xOffset; - float yOffset; - - for (node = nodes->terminalsBegin(); node != nodes->terminalsEnd(); ++node) { - for (nodePin = node->pinsBegin(); nodePin != node->pinsEnd(); ++nodePin) { - unsigned netIndex = nodePin->netIndex; - if (!netsSeen[netIndex]) { - ++nodeDegree; - netsSeen[netIndex] = 1; - Net& net = nets->getNet(netIndex); - - netDegree = 0; - netXSum = 0; - netYSum = 0; - - for (netPin = net.pinsBegin(); netPin != net.pinsEnd(); ++netPin) { - pinType = netPin->getType(); - int currNodeIndex = netPin->getNodeIndex(); - - if (!pinType) // if not terminal - { - Node& currNode = nodes->getNode(currNodeIndex); - float width = currNode.getWidth(); - float height = currNode.getHeight(); - xOffset = netPin->getXOffset() * width + width / 2; - yOffset = netPin->getYOffset() * height + height / 2; - netXSum -= (currNode.getX() + xOffset); - netYSum -= (currNode.getY() + yOffset); - } else { - ++netDegree; - Node& terminal = nodes->getTerminal(currNodeIndex); - netXSum += terminal.getX(); - netYSum += terminal.getY(); - } - } - if (netDegree > 0) { - netXSum = netXSum / netDegree; - netYSum = netYSum / netDegree; - xSum += netXSum; - ySum += netYSum; - } - } - } - } - if (nodeDegree != 0) { - xSum /= nodeDegree; - ySum /= nodeDegree; - finalLoc.x = xSum; - finalLoc.y = ySum; - } else { - finalLoc.x = 0; - finalLoc.y = 0; - } - /* - if(finalLoc.x < 0) - finalLoc.x = 0; - if(finalLoc.y < 0) - finalLoc.y = 0; - */ - return finalLoc; -} - -parquetfp::Point AnalytSolve::getOptLoc(int index, - vector& xloc, - vector& yloc) -{ - Point finalLoc; - Nodes* nodes = _db->getNodes(); - Nets* nets = _db->getNets(); - Node& node = nodes->getNode(index); - itNodePin nodePin; - itPin netPin; - float xSum = 0; - float ySum = 0; - float netXSum = 0; - float netYSum = 0; - unsigned netDegree = 0; - unsigned nodeDegree = node.getDegree(); - bool pinType = 0; - float xOffset; - float yOffset; - - float nodeXOffset; - float nodeYOffset; - float nodeWidth = node.getWidth(); - float nodeHeight = node.getHeight(); - - for (nodePin = node.pinsBegin(); nodePin != node.pinsEnd(); ++nodePin) { - unsigned netIndex = nodePin->netIndex; - Net& net = nets->getNet(netIndex); - unsigned pinIndex = nodePin->pinOffset; - pin& thisPin = net.getPin(pinIndex); - nodeXOffset = thisPin.getXOffset() * nodeWidth + nodeWidth / 2; - nodeYOffset = thisPin.getYOffset() * nodeHeight + nodeHeight / 2; - - netDegree = net.getDegree(); - netXSum = 0; - netYSum = 0; - - for (netPin = net.pinsBegin(); netPin != net.pinsEnd(); ++netPin) { - pinType = netPin->getType(); - int currNodeIndex = netPin->getNodeIndex(); - - if (!pinType && currNodeIndex == index) { - --netDegree; - // cout<<"currNodeIndex "<getNode(currNodeIndex); - float width = currNode.getWidth(); - float height = currNode.getHeight(); - xOffset = netPin->getXOffset() * width + width / 2; - yOffset = netPin->getYOffset() * height + height / 2; - netXSum += (xloc[currNodeIndex] + xOffset - nodeXOffset); - netYSum += (yloc[currNodeIndex] + yOffset - nodeYOffset); - } else { - Node& terminal = nodes->getTerminal(currNodeIndex); - netXSum += terminal.getX(); - netYSum += terminal.getY(); - } - } - } - if (netDegree > 0) { - netXSum = netXSum / netDegree; - netYSum = netYSum / netDegree; - xSum += netXSum; - ySum += netYSum; - } - } - - if (nodeDegree != 0) { - xSum /= nodeDegree; - ySum /= nodeDegree; - finalLoc.x = xSum; - finalLoc.y = ySum; - } else { - finalLoc.x = 0; - finalLoc.y = 0; - } - return finalLoc; -} - -void AnalytSolve::solveSOR() -{ - _xloc = _db->getXLocs(); - _yloc = _db->getYLocs(); - - float epsilon = sqrt(_db->getNodesArea()); - Point newLoc; - float change = std::numeric_limits::max(); - float indChange = 0.0f; - unsigned numIter = 0; - float xchange; - float ychange; - float overshoot; - - while (change > epsilon && numIter < 1000000) { - numIter++; - change = 0.0f; - for (unsigned i = 0; i < _xloc.size(); ++i) { - newLoc = getOptLoc(i, _xloc, _yloc); - xchange = newLoc.x - _xloc[i]; - ychange = newLoc.y - _yloc[i]; - overshoot = xchange * 1.7f; - _xloc[i] += overshoot; - - overshoot = ychange * 1.7f; - _yloc[i] += overshoot; - - indChange = std::abs(xchange) + std::abs(ychange); - - change += indChange; - } - // cout< -#include - -namespace parquetfp { -class Command_Line; -class DB; -class Point; - -class AnalytSolve -{ - private: - DB* _db; - - std::vector _xloc; - std::vector _yloc; - - public: - AnalytSolve() {} - AnalytSolve(DB* db); - ~AnalytSolve() {} - - Point getOptLoc(int index, - std::vector& xloc, - std::vector& yloc); - // location of cells passed - Point getDesignOptLoc(); // get the optimum location of the entire placement - - std::vector& getXLocs() { return _xloc; } - - std::vector& getYLocs() { return _yloc; } - - void solveSOR(); // uses the DB placements as initial solution -}; -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/ClusterDB.cxx b/src/mpl/src/ParquetFP/src/ClusterDB.cxx deleted file mode 100644 index 5caac950aba..00000000000 --- a/src/mpl/src/ParquetFP/src/ClusterDB.cxx +++ /dev/null @@ -1,774 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "ClusterDB.h" - -#include "CommandLine.h" -#include "DB.h" -#include "FPcommon.h" - -using namespace parquetfp; -using std::cout; -using std::endl; -using std::map; -using std::vector; - -ClusterDB::ClusterDB(DB* db, Command_Line* params) - : _params(params), - _db(db), - _newDB(0), - _oldDB(0), - _nodesSeenBB(0), - _numConnections(0, 0) -{ - //_params = params; - //_db = db; - //_oldDB = new DB(_params->minWL); - //*(_oldDB) = *(_db); -} - -void ClusterDB::clusterMulti(DB*& newDB) -{ - unsigned numNewNodes; - unsigned numOldNodes; - unsigned layerNum = 1; - - bool noCompress = false; - _oldDB = new DB(*_db, noCompress); - if (_params->dontClusterMacros) { - float avgNodeHeight = 5 * _oldDB->getAvgHeight(); - _oldDB->markTallNodesAsMacros(avgNodeHeight); - } - - unsigned maxTopLevelNodes; - if (_params->maxTopLevelNodes == -9999) // # top-level nodes - { - maxTopLevelNodes = unsigned(2 * sqrt(float(_db->getNumNodes()))); - if (maxTopLevelNodes < 50) - maxTopLevelNodes = 50; - } else { - maxTopLevelNodes = _params->maxTopLevelNodes; - if (maxTopLevelNodes <= 0) { - cout << "maxTopLevelNodes has to be > 0" << endl; - exit(0); - } - } - - if (_params->lookAheadFP) { - // cluster hard - maxTopLevelNodes = std::min(maxTopLevelNodes, 20u); - } - - if (_db->getNumNodes() > maxTopLevelNodes) { - unsigned maxConnId = 1; // ??? - do { - _newDB = new DB(); - - // don't forget your obstacles when clustering (icky code flow) - float obstacleFrame[2]; - obstacleFrame[0] = _db->getObstacleFrame()[0]; - obstacleFrame[1] = _db->getObstacleFrame()[1]; - _newDB->addObstacles(_db->getObstacles(), obstacleFrame); - - numOldNodes = _oldDB->getNodes()->getNumNodes(); - cluster1Layer(layerNum, maxConnId, maxTopLevelNodes); - - numNewNodes = _newDB->getNodes()->getNumNodes(); - - delete _oldDB; - _oldDB = _newDB; - - ++layerNum; - if (numOldNodes != numNewNodes && maxConnId > 1) { - if (maxConnId > 10) - maxConnId -= 4; - else - --maxConnId; - } - if (numOldNodes == numNewNodes) - ++maxConnId; - if (maxConnId >= unsigned(numOldNodes / 4) || maxConnId > 100) - break; - } while (numNewNodes - > maxTopLevelNodes /* && numOldNodes != numNewNodes */); - } - - _newDB = _oldDB; // next function expects to change _newDB - addWSPerNode(); // add WS per node - - // compress the created DB now - bool compressDB = true; - _newDB = new DB(*_oldDB, compressDB); - - // Transfer ownership of the compressed DB to the caller - newDB = _newDB; - _newDB = 0; -} - -ClusterDB::~ClusterDB() -{ - if (_oldDB) - delete _oldDB; -} - -static bool haveMoreNodesToCluster(bool direction, itNode& nodeIt, Nodes* nodes) -{ - if (direction) { - if (nodeIt == nodes->nodesEnd()) - return false; - } else { - if (nodeIt == nodes->nodesBegin()) - return false; - } - - return true; -} - -static void advanceClusterIt(bool direction, itNode& nodeIt) -{ - if (direction) - ++nodeIt; - else - --nodeIt; -} - -void ClusterDB::cluster1Layer(unsigned layerNum, - unsigned maxConnId, - unsigned maxTopLevelNodes) -{ - map mapping; // actual index -> top-level index - - char blockName[1024]; - unsigned blkCtr; - - Nodes* nodes = _oldDB->getNodes(); - Nets* nets = _oldDB->getNets(); - Nodes* newNodes = _newDB->getNodes(); - Nets* newNets = _newDB->getNets(); - - float totalArea = _oldDB->getNodesArea(); - float threshold = 0.2 * totalArea; // upper bd in area for a cluster - unsigned numNodes = nodes->getNumNodes(); - unsigned newNumNodes - = numNodes; // the # of nodes in the new (clustered) DB - unsigned currNodeIdx, nextNodeIdx; - - itNode node, nodeBegin; - static bool direction = false; - - blkCtr = 0; - vector seenNodes; - seenNodes.resize(numNodes); - fill(seenNodes.begin(), seenNodes.end(), false); - - _nodesSeenBB.reset(numNodes); - _numConnections.resize(numNodes, 0); - fill(_numConnections.begin(), _numConnections.end(), false); - - // set up the nodes (top-level nodes) - if (direction || numNodes == 1) - nodeBegin = nodes->nodesBegin(); - else - nodeBegin = nodes->nodesEnd() - 1; - - for (node = nodeBegin; - newNumNodes - > maxTopLevelNodes // don't cluster more than we need to - && haveMoreNodesToCluster(direction, node, nodes); - advanceClusterIt(direction, node)) { - bool clusterEverything = !_params->dontClusterMacros; - - Node& currNode = *node; - currNodeIdx = currNode.getIndex(); - - // if the node hasn't been seen, create it - // otherwise, update existing info - // if(!seenNodes[currNode.getIndex()] && !currNode.isMacro()) - if (!seenNodes[currNodeIdx] && (clusterEverything || !currNode.isMacro()) - && (!currNode.isMacro() || !currNode.needsFP())) { - float currNodeArea = currNode.getArea(); - - Node& nextNode = getClosestNode( - currNode, nodes, nets, seenNodes, maxConnId, direction); - // both "currNode" and "nextNode" haven't been seen - if (!seenNodes[nextNode.getIndex()] - && (currNodeIdx != (unsigned) nextNode.getIndex())) { - float nextNodeArea = nextNode.getArea(); - float newNodeArea = currNodeArea + nextNodeArea; - nextNodeIdx = nextNode.getIndex(); - - // if(newNodeArea < threshold && !currNode.isMacro() && - // !nextNode.isMacro()) // cluster these nodes - if (newNodeArea < threshold - && (clusterEverything || !nextNode.isMacro()) - && (!nextNode.isMacro() - || !nextNode.needsFP())) // cluster these nodes - { - seenNodes[nextNodeIdx] = true; - seenNodes[currNodeIdx] = true; - - float largeNodeArea = nextNodeArea; - float largeNodeMinAR = nextNode.getminAR(); - float largeNodeMaxAR = nextNode.getmaxAR(); - float smallNodeArea = currNodeArea; - if (currNodeArea > nextNodeArea) { - largeNodeArea = currNodeArea; - largeNodeMinAR = currNode.getminAR(); - largeNodeMaxAR = currNode.getmaxAR(); - smallNodeArea = nextNodeArea; - } - - // float newNodeMinAR = 0.75; - // float newNodeMaxAR = 1.5; - float newNodeMinAR = 0.25f; - float newNodeMaxAR = 4.0f; - - // temporary AR calculations until we figure out something smarter - if (currNode.isMacro() && !nextNode.isMacro()) { - newNodeMinAR = currNode.getminAR(); - newNodeMaxAR = currNode.getmaxAR(); - } else if (!currNode.isMacro() && nextNode.isMacro()) { - newNodeMinAR = nextNode.getminAR(); - newNodeMaxAR = nextNode.getmaxAR(); - } else if (largeNodeArea > smallNodeArea * 36) { - // clustering something large with something small - assume AR of - // large - newNodeMinAR = largeNodeMinAR; - newNodeMaxAR = largeNodeMaxAR; - } else { // if (largeNodeArea < smallNodeArea * 1.2) { - // make it squarish - newNodeMinAR = 0.67f; - newNodeMaxAR = 1.5f; - } - // else { - // // get weighted average of ARs - // newNodeMinAR = ((largeNodeArea*largeNodeMinAR) + - //(smallNodeArea*smallNodeMinAR)) / (largeNodeArea + - // smallNodeArea); newNodeMaxAR = ((largeNodeArea*largeNodeMaxAR) + - //(largeNodeArea*smallNodeMaxAR)) / (largeNodeArea + - // smallNodeArea); - // } - - sprintf(blockName, "Block_%d_%d", layerNum, blkCtr); - Node tempNode(blockName, - newNodeArea, - newNodeMinAR, - newNodeMaxAR, - blkCtr, - false); - - // add both the sub-blocks of "currNode" and "nextNode" - for (vector::iterator i = currNode.subBlocksBegin(); - i != currNode.subBlocksEnd(); - ++i) - tempNode.addSubBlockIndex(*i); - - // tempNode.putNeedsFP(false); // don't have to propagate 'needFP' - // flag coz only nodes that don't needFP will be - // clustered, and 'needFP' is false by default - - for (vector::iterator i = nextNode.subBlocksBegin(); - i != nextNode.subBlocksEnd(); - ++i) - tempNode.addSubBlockIndex(*i); - - newNumNodes--; // clustering each pair reduces numNodes by - // 1 - } else { - seenNodes[currNodeIdx] = true; - Node tempNode(currNode.getName(), - currNode.getArea(), - currNode.getminAR(), - currNode.getmaxAR(), - blkCtr, - false); - if (currNode.isMacro()) - tempNode.updateMacroInfo(true); - if (currNode.isOrientFixed()) - tempNode.putIsOrientFixed(true); - tempNode.putNeedsFP(currNode.needsFP()); // propagate 'needFP' - - for (vector::iterator i = currNode.subBlocksBegin(); - i != currNode.subBlocksEnd(); - ++i) - tempNode.addSubBlockIndex(*i); - - mapping[currNodeIdx] = blkCtr; - newNodes->putNewNode(tempNode); - ++blkCtr; - } - } - } else if ((!clusterEverything && currNode.isMacro()) - || (currNode.isMacro() && currNode.needsFP())) { - seenNodes[currNodeIdx] = true; - Node tempNode(currNode.getName(), - currNode.getArea(), - currNode.getminAR(), - currNode.getmaxAR(), - blkCtr, - false); - if (currNode.isMacro()) - tempNode.updateMacroInfo(true); - if (currNode.isOrientFixed()) - tempNode.putIsOrientFixed(true); - tempNode.putNeedsFP(currNode.needsFP()); // propagate 'needFP' - - for (vector::iterator i = currNode.subBlocksBegin(); - i != currNode.subBlocksEnd(); - ++i) - tempNode.addSubBlockIndex(*i); - - mapping[currNodeIdx] = blkCtr; - newNodes->putNewNode(tempNode); - ++blkCtr; - } - } - - direction = !direction; - - // put any remaining nodes in new DB - for (node = nodes->nodesBegin(); node != nodes->nodesEnd(); ++node) { - Node& currNode = *node; - currNodeIdx = currNode.getIndex(); - if (!seenNodes[currNodeIdx]) { - seenNodes[currNodeIdx] = true; - Node tempNode(currNode.getName(), - currNode.getArea(), - currNode.getminAR(), - currNode.getmaxAR(), - blkCtr, - false); - if (currNode.isMacro()) - tempNode.updateMacroInfo(true); - if (currNode.isOrientFixed()) - tempNode.putIsOrientFixed(true); - tempNode.putNeedsFP(currNode.needsFP()); // propagate 'needFP' - - for (vector::iterator i = currNode.subBlocksBegin(); - i != currNode.subBlocksEnd(); - ++i) - tempNode.addSubBlockIndex(*i); - mapping[currNodeIdx] = blkCtr; - newNodes->putNewNode(tempNode); - ++blkCtr; - } - } - - for (node = nodes->terminalsBegin(); node != nodes->terminalsEnd(); ++node) - newNodes->putNewTerm(*node); - - // set up the nets now - addNetsToNewDB(nets, newNets, nodes, newNodes, mapping); -} - -Node& ClusterDB::getClosestNode(Node& currNode, - Nodes* nodes, - Nets* nets, - vector& seenNodes, - unsigned maxConnId, - bool direction) -{ - unsigned numNodes = nodes->getNumNodes(); - Point tempPoint; - tempPoint.x = 0; // x: node index - tempPoint.y = 0; // y: incidence w/ "currNode" - vector numConnections; - bool iamDesperate = false; - - unsigned currNodeIdx = currNode.getIndex(); - itNodePin nodePin; - - for (nodePin = currNode.pinsBegin(); nodePin != currNode.pinsEnd(); - ++nodePin) { - Net& net = nets->getNet(nodePin->netIndex); - // if(net.getDegree() < 50) - { - itPin netPin; - for (netPin = net.pinsBegin(); netPin != net.pinsEnd(); ++netPin) { - if (!netPin->getType()) // not terminal - { - if (unsigned(netPin->getNodeIndex()) != currNodeIdx) { - unsigned nodeId = netPin->getNodeIndex(); - _numConnections[nodeId] += 1.0 / net.getDegree(); - _nodesSeenBB.setBit(nodeId); - } - } - } - } - } - - if (maxConnId < 11) { - const vector& bitsSet = _nodesSeenBB.getIndicesOfSetBits(); - for (unsigned i = 0; i < bitsSet.size(); ++i) { - tempPoint.x = float(bitsSet[i]); - tempPoint.y = _numConnections[bitsSet[i]]; - numConnections.push_back(tempPoint); - - _numConnections[bitsSet[i]] = 0; - } - _nodesSeenBB.clear(); - } else { - for (unsigned i = 0; i < _numConnections.size(); ++i) { - tempPoint.x = float(i); - tempPoint.y = _numConnections[i]; - numConnections.push_back(tempPoint); - } - _nodesSeenBB.clear(); - fill(_numConnections.begin(), _numConnections.end(), 0); - } - - // sort - std::sort(numConnections.begin(), numConnections.end(), sortNumConnections()); - - unsigned maxConnectionsIdx = 0; - unsigned maxConnectedNodes = numConnections.size(); - int startingId = 0; - if (maxConnId > maxConnectedNodes) - startingId = 0; - else - startingId = maxConnectedNodes - maxConnId; - - if (maxConnectedNodes > 0) { - for (int i = startingId; i >= 0; --i) { - maxConnectionsIdx = unsigned(numConnections[i].x); - if (seenNodes[maxConnectionsIdx] != 1) { - numConnections.clear(); // why need to clear() - return nodes->getNode(maxConnectionsIdx); - } - } - - if (maxConnId <= maxConnectedNodes) - maxConnectionsIdx - = unsigned(numConnections[maxConnectedNodes - maxConnId].x); - else if (maxConnectedNodes > 0) - maxConnectionsIdx = unsigned(numConnections[maxConnectedNodes - 1].x); - else // desperate attempt. return something - { - iamDesperate = true; - if (direction) - maxConnectionsIdx = 0; - else - maxConnectionsIdx = numNodes - 1; - } - } else { - // desperate attempt. return something - iamDesperate = true; - if (direction) - maxConnectionsIdx = 0; - else - maxConnectionsIdx = numNodes - 1; - } - if (iamDesperate && maxConnId > 15) { - /* - Node& nextClosestNode = getClosestNodeBFS(currNode, nodes, nets, - seenNodes, maxConnId, direction); - */ - maxConnectionsIdx = rand() % numNodes; - } - numConnections.clear(); - return nodes->getNode(maxConnectionsIdx); -} - -/* -Node& ClusterDB getClosestNodeBFS(Node& currNode, - Nodes* nodes, Nets* nets, - vector& seenNodes, unsigned maxConnId, - bool direction) -{ - - -} -*/ - -void ClusterDB::addWSPerNode(void) -{ - float multFactor = 1 + _params->maxWSHier / 100; - if (!_params->dontClusterMacros) - multFactor - = 0.80f; // let's make them squishy, but not too squishy - if (_params->lookAheadFP) - multFactor = 0.01f; // squish them hard - float currArea, newArea, newHeight, newWidth; - - Nodes* newNodes = _newDB->getNodes(); - for (itNode node = newNodes->nodesBegin(); node != newNodes->nodesEnd(); - ++node) { - if (node->numSubBlocks() > 1) { - currArea = node->getArea(); - newArea = currArea * multFactor; // add WS - newWidth = sqrt(newArea * node->getminAR()); - newHeight = newWidth / node->getminAR(); - node->putArea(newArea); - node->putWidth(newWidth); - node->putHeight(newHeight); - } - } -} - -void ClusterDB::addNetsToNewDB(Nets* nets, - Nets* newNets, - Nodes* nodes, - Nodes* newNodes, - map& mapping) -{ - int netCtr = 0; - itNet net; - - vector seenNodes(newNodes->getNumNodes()); - for (net = nets->netsBegin(); net != nets->netsEnd(); ++net) { - Net tempEdge; - fill(seenNodes.begin(), seenNodes.end(), false); - tempEdge.putName(net->getName()); - tempEdge.putIndex(netCtr); - tempEdge.putWeight(net->getWeight()); - for (itPin netPin = net->pinsBegin(); netPin != net->pinsEnd(); ++netPin) { - unsigned currNodeIdx = netPin->getNodeIndex(); - - if (!netPin->getType()) { - unsigned newNodeIdx = mapping[currNodeIdx]; - Node& newNode = newNodes->getNode(newNodeIdx); - float poffsetX = 0, poffsetY = 0; - if (newNode.numSubBlocks() == 1) { - poffsetX = netPin->getXOffset(); - poffsetY = netPin->getYOffset(); - } else if (_params->clusterPhysical) // get pinoffsets of subcells - { - float xMin = newNode.getX(); - float yMin = newNode.getY(); - float xMax = xMin + sqrt(newNode.getArea()); // assume AR 1 - float yMax = yMin + sqrt(newNode.getArea()); // assume AR 1 - Node& oldNode = nodes->getNode(currNodeIdx); - float xloc = oldNode.getX(); - float yloc = oldNode.getY(); - if (xloc >= xMax) - poffsetX = 0.5; - else if (xloc <= xMin) - poffsetX = -0.5; - else - poffsetX = ((xloc - xMin) / (xMax - xMin)) - 0.5; - - if (yloc >= yMax) - poffsetY = 0.5; - else if (yloc <= yMin) - poffsetY = -0.5; - else - poffsetY = ((yloc - yMin) / (yMax - yMin)) - 0.5; - } - - pin tempPin(newNode.getName(), false, poffsetX, poffsetY, netCtr); - tempPin.putNodeIndex(newNodeIdx); - - if (!seenNodes[newNodeIdx]) { - tempEdge.addNode(tempPin); - seenNodes[newNodeIdx] = 1; - } - } else { - Node& newTerm = newNodes->getTerminal(currNodeIdx); - float poffsetX = 0, poffsetY = 0; - - pin tempPin(newTerm.getName(), true, poffsetX, poffsetY, netCtr); - tempPin.putNodeIndex(currNodeIdx); - - tempEdge.addNode(tempPin); - } - } - - bool needNet = false; - int firstNodeIdx = tempEdge.pinsBegin()->getNodeIndex(); - for (itPin netPin = tempEdge.pinsBegin(); netPin != tempEdge.pinsEnd(); - netPin++) { - if (netPin->getType()) { - needNet = true; - break; - } else if (netPin->getNodeIndex() != firstNodeIdx) // atleast 1 different - { - needNet = true; - break; - } - } - if (needNet) { - newNets->putNewNet(tempEdge); - ++netCtr; - } - } - - // cout<<"Num Nets: "<getNumNets()<<" Num Pins: " - //<getNumPins()<updatePinsInfo(*newNets); -} - -void ClusterDB::clusterMultiPhysical(DB*& newDB) -{ - const unsigned numNew = 6; - unsigned numOldNodes = _db->getNumNodes(); - - unsigned blkCtr = 0; - if (numOldNodes <= 50) { - //*newDB = *_oldDB; - // Dont change the DB, create a copy of the original - // and transfer ownership - bool noCompress = false; - newDB = new DB(*_db, noCompress); - return; - } - - bool noCompress = false; - _oldDB = new DB(*_db, noCompress); - if (_params->dontClusterMacros) { - float avgNodeHeight = _oldDB->getAvgHeight(); - _oldDB->markTallNodesAsMacros(avgNodeHeight); - } - - map mapping; - - _newDB = new DB(*_oldDB, noCompress); - - Nodes* nodes = _oldDB->getNodes(); - Nets* nets = _oldDB->getNets(); - Nodes* newNodes = _newDB->getNodes(); - Nets* newNets = _newDB->getNets(); - - itNode node; - - float layOutXSize = _oldDB->getXMax(); - float layOutYSize = _oldDB->getYMax(); - - // put nodes outside layout region into layout region - for (node = nodes->nodesBegin(); node != nodes->nodesEnd(); ++node) { - Node& currNode = *node; - if (currNode.getX() > layOutXSize) - currNode.putX(layOutXSize); - if (currNode.getX() < 0.0) - currNode.putX(0.0); - if (currNode.getY() > layOutYSize) - currNode.putY(layOutYSize); - if (currNode.getY() < 0.0) - currNode.putY(0.0); - } - - float xStep = layOutXSize / numNew; - float yStep = layOutYSize / numNew; - float xMax, yMax, xMin, yMin; - - vector seenNodes(numOldNodes, false); - - char blockName[1024]; - - for (unsigned i = 0; i < numNew; ++i) { - yMin = i * yStep; - yMax = (i + 1) * yStep; - for (unsigned j = 0; j < numNew; ++j) { - xMin = j * xStep; - xMax = (j + 1) * xStep; - - sprintf(blockName, "Block_%d_%d", i, j); - float newNodeArea = 0; - vector newNodesIdxs; - - for (node = nodes->nodesBegin(); node != nodes->nodesEnd(); ++node) { - Node& currNode = *node; - unsigned currNodeIdx = currNode.getIndex(); - if (!seenNodes[currNodeIdx]) { - if (currNode.getX() >= xMin && currNode.getX() <= xMax - && currNode.getY() >= yMin && currNode.getY() <= yMax) { - if (!currNode.isMacro()) { - newNodeArea += currNode.getArea(); - newNodesIdxs.push_back(currNode.getIndex()); - seenNodes[currNode.getIndex()] = 1; - } else // macro needs to stored alone - { - Node tempNode(currNode.getName(), - currNode.getArea(), - currNode.getminAR(), - currNode.getmaxAR(), - blkCtr, - false); - mapping[currNode.getIndex()] = blkCtr; - tempNode.addSubBlockIndex(currNode.getIndex()); - tempNode.putX(currNode.getX()); - tempNode.putY(currNode.getY()); - tempNode.putOrient(currNode.getOrient()); - newNodes->putNewNode(tempNode); - ++blkCtr; - seenNodes[currNode.getIndex()] = 1; - } - } - } - } - if (newNodesIdxs.size() != 0) { - Node tempNode(blockName, newNodeArea, 0.5, 2.0, blkCtr, false); - for (unsigned k = 0; k < newNodesIdxs.size(); ++k) { - tempNode.addSubBlockIndex(newNodesIdxs[k]); - mapping[newNodesIdxs[k]] = blkCtr; - } - tempNode.putX(xMin); - tempNode.putY(yMin); - newNodes->putNewNode(tempNode); - ++blkCtr; - } - } - } - for (unsigned i = 0; i < seenNodes.size(); ++i) - if (seenNodes[i] == 0) { - Node& temp = nodes->getNode(i); - Node tempNode(temp.getName(), - temp.getArea(), - temp.getminAR(), - temp.getmaxAR(), - blkCtr, - false); - - tempNode.addSubBlockIndex(temp.getIndex()); - float xLoc = temp.getX() > 0 ? temp.getX() : 0; - float yLoc = temp.getY() > 0 ? temp.getY() : 0; - tempNode.putX(xLoc); - tempNode.putY(yLoc); - tempNode.putOrient(temp.getOrient()); - newNodes->putNewNode(tempNode); - ++blkCtr; - cout << "Warning in ClusterDB.cxx " << temp.getName() << "(" - << temp.getX() << ", " << temp.getY() << ") out of layout region " - << endl; - } - - for (node = nodes->terminalsBegin(); node != nodes->terminalsEnd(); ++node) - newNodes->putNewTerm(*node); - - addWSPerNode(); // add WS per node needs to be before addNetsToNewDB - - addNetsToNewDB(nets, newNets, nodes, newNodes, mapping); - - // Transfer ownership of the new DB - newDB = _newDB; - _newDB = 0; -} diff --git a/src/mpl/src/ParquetFP/src/ClusterDB.h b/src/mpl/src/ParquetFP/src/ClusterDB.h deleted file mode 100644 index 40e9ea1ec88..00000000000 --- a/src/mpl/src/ParquetFP/src/ClusterDB.h +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef CLUSTERDB_H -#define CLUSTERDB_H - -#include -#include -#include -#include - -#include "Ctainers/bitBoard.h" -#include "DB.h" - -namespace parquetfp { -class DB; -class Command_Line; - -class ClusterDB -{ - private: - Command_Line* _params; // parameters - DB* _db; // just a pointer to base DB - DB* _newDB; // used in cluster - DB* _oldDB; // used in cluster - - BitBoard _nodesSeenBB; - std::vector _numConnections; - - public: - ClusterDB(DB* db, Command_Line* params); - ~ClusterDB(); - - void clusterMulti(DB*& newDB); - - void cluster1Layer(unsigned layerNum, - unsigned maxConnId = 1, - unsigned maxTopLevelNodes = 0); - void addNetsToNewDB(Nets* nets, - Nets* newNets, - Nodes* nodes, - Nodes* newNodes, - std::map& mapping); - - Node& getClosestNode(Node& currNode, - Nodes* nodes, - Nets* nets, - std::vector& seenNodes, - unsigned maxConnId = 1, - bool direction = true); - void addWSPerNode(void); - - void clusterMultiPhysical(DB*& newDB); // cluster with physical constraints -}; - -struct sortNumConnections // sort connectivities -{ - bool operator()(Point pt1, Point pt2) { return (pt1.y < pt2.y); } -}; -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/CommandLine.cxx b/src/mpl/src/ParquetFP/src/CommandLine.cxx deleted file mode 100644 index 7ea6348d7a0..00000000000 --- a/src/mpl/src/ParquetFP/src/CommandLine.cxx +++ /dev/null @@ -1,114 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2007 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -// 040608 hhchan param printout up to v2.1 are placed in the "classic" fcn - -#include "CommandLine.h" - -#include -#include -#include - -#include "baseannealer.h" - -using namespace parquetfp; -using std::cerr; -using std::cout; -using std::endl; - -#ifdef _MSC_VER -#ifndef srand48 -#define srand48 srand -#endif -#endif - -Command_Line::Command_Line() - : getSeed(false), - budgetTime(0), - softBlocks(0), - initQP(0), - inFileName(""), - outPlFile(""), - capoPlFile(""), - capoBaseFile(""), - baseFile(""), - FPrep("Best"), - seed(0), - iterations(1), - maxIterHier(10), - seconds(0.0f), - plot(0), - plotNoNets(false), - plotNoSlacks(false), - plotNoNames(false), - savePl(0), - saveCapoPl(0), - saveCapo(0), - save(0), - takePl(0), - solveMulti(0), - clusterPhysical(0), - solveTop(0), - maxWSHier(15), - usePhyLocHier(0), - dontClusterMacros(0), - maxTopLevelNodes(-9999), - timeInit(30000.0f), - timeCool(0.01f), - startTime(30000.0f), - reqdAR(-9999.0f), - maxWS(15.0f), - minWL(0), -#ifdef USEFLUTE - useSteiner(false), - printSteiner(false), -#endif - areaWeight(0.4f), - wireWeight(0.4f), - useFastSP(false), - lookAheadFP(false), - initCompact(0), - compact(0), - verb(0), - packleft(true), - packbot(true), - scaleTerms(true), - shrinkToSize(-1.f), - noRotation(false) -{ - setSeed(); -} - -void Command_Line::setSeed() -{ - std::srand(seed); // seed for rand function -} diff --git a/src/mpl/src/ParquetFP/src/CommandLine.h b/src/mpl/src/ParquetFP/src/CommandLine.h deleted file mode 100644 index caa80ec17ed..00000000000 --- a/src/mpl/src/ParquetFP/src/CommandLine.h +++ /dev/null @@ -1,137 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2007 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef COMMAND_LINE_H -#define COMMAND_LINE_H - -// 040608 hhchan added StringParam "FPrep" ("SeqPair" or "BTree") - -#include - -#include "FPcommon.h" - -namespace parquetfp { -class Command_Line -{ - public: - Command_Line(); - - // -----public member variables to store params----- - bool getSeed, budgetTime; - bool softBlocks; - bool initQP; // initialize a QP soln - std::string inFileName; - std::string outPlFile; - std::string capoPlFile; - std::string capoBaseFile; - std::string baseFile; - - std::string FPrep; - - unsigned seed; // fixed seed - int iterations; // number of runs - int maxIterHier; // max # iterations during hierarchical flow - - float seconds; - bool plot; // plot to out.plt - bool plotNoNets; // do not plot nets - bool plotNoSlacks; // do not plot slacks - bool plotNoNames; // do not plot names - bool savePl; // save .pl file as output - bool saveCapoPl; // save .pl file in Capo format - bool saveCapo; // save files in Capo format - bool save; // save files in bookshelf format - - bool takePl; // takes a Placement and converts it - // to sequence pair for initial soln - - // -----Parameters for 2-level hierarchy----- - bool solveMulti; // use multilevel heirarchy - bool clusterPhysical; // use physical hierarchy instead of - // closest node - bool solveTop; // solve only top level of heirarchy - float maxWSHier; // maximum WS for heirarchical blocks - // default: 15% - bool usePhyLocHier; // use physical locs which updating - // locs of sub-blocks of clustered blocks, if using physical - // clustering. usefull for eco purposes - bool dontClusterMacros; // keep macros out of clustering - // default: false - int maxTopLevelNodes; // number of top-level nodes required during - // clustering. if -9999 then use sqrt(#nodes) - - // -----Annealer performance parameters next----- - float timeInit; // initial temperature default 30000 - float timeCool; // cooling temperature default 0.01 - float startTime; // default to timeInit - // (this is the time the area & WL are normalized to) - float reqdAR; // required Aspect Ratio of fixed outline - // default -9999(means no fixed outline - // desired) - float maxWS; // if fixed-outline then maximum whitespace - // acceptable - bool minWL; // whether HPWL minimization desired -#ifdef USEFLUTE - bool useSteiner; // use Steiner WL instead of HPWL - bool printSteiner; -#endif - float areaWeight; // weight for area minimization - float wireWeight; // weight for WL minimization - - bool useFastSP; // whether to use fast SP(O(nlog n)) algo - // for SPEval - - bool lookAheadFP; // run FP in lookahead mode (fast) - - // -----pre/post-processing----- - bool initCompact; // whether to use compaction to generate - // initial SP (default: false) - bool compact; // compact final soln (default: false) - - int verb; // by royj to control the verbosity of Parquet - - bool packleft; // directions the SPannealer should use - bool packbot; - - bool scaleTerms; - - BBox nonTrivialOutline; - - float shrinkToSize; - - bool noRotation; - - void setSeed(); -}; -} // namespace parquetfp -// using namespace parquetfp; -#endif // COMMAND_LINE_H diff --git a/src/mpl/src/ParquetFP/src/Ctainers/bitBoard.h b/src/mpl/src/ParquetFP/src/Ctainers/bitBoard.h deleted file mode 100644 index b4c79fc8f67..00000000000 --- a/src/mpl/src/ParquetFP/src/Ctainers/bitBoard.h +++ /dev/null @@ -1,115 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 1995-2000 Regents of the University of California, -*** Andrew E. Caldwell, Andrew B. Kahng and Igor L. Markov -*** Copyright (c) 2000-2010 Regents of the University of Michigan, -*** Saurabh N. Adya, Jarrod A. Roy, David A. Papa and -*** Igor L. Markov -*** -*** Contact author(s): abk@cs.ucsd.edu, imarkov@umich.edu -*** Original Affiliation: UCLA, Computer Science Department, -*** Los Angeles, CA 90095-1596 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -//! author="Igor Markov Nov 11, 1997" -// 020811 ilm ported to g++ 3.0 - -#ifndef _BITBOARD_H_ -#define _BITBOARD_H_ - -#include -#include - -//: bits can be set, and then all set bits can be erased in O(#bits) -// time bits can not be unset one by one in O(1) time each (search required) -// SAMPLE USAGE: mark visited nodes in graph traversals when -// multiple traversals are performed - -class BitBoard -{ - std::vector _bitIndicesSet; - std::vector _boardSpace; - - public: - BitBoard(unsigned size) : _boardSpace(size, false) {} - const std::vector& getIndicesOfSetBits() const - { - return _bitIndicesSet; - } - // To get the Indices of Bits which have been set to 1; - const std::vector& getBoardSpace() const { return _boardSpace; } - // To get the bit sequence; - unsigned getSize() const { return _boardSpace.size(); } - // To get the size of the bitBoard; - unsigned getNumBitsSet() const { return _bitIndicesSet.size(); } - // To get the number of bits which have been set to 1; - bool isBitSet(unsigned idx) const - // To tell whether the given bit is set to 1; - { - /* abkassert(idx::iterator it = _bitIndicesSet.begin(); - it != _bitIndicesSet.end(); - it++) - _boardSpace[*it] = false; - _bitIndicesSet.clear(); - } - - void reset(unsigned newSize) - { - signed sizeDif = newSize - _boardSpace.size(); - if (sizeDif <= 0) - clear(); - else { - _bitIndicesSet.clear(); - _boardSpace.clear(); - _boardSpace.insert(_boardSpace.end(), newSize, false); - } - } - - friend std::ostream& operator<<(std::ostream& os, const BitBoard& bb); -}; - -#endif diff --git a/src/mpl/src/ParquetFP/src/DB.cxx b/src/mpl/src/ParquetFP/src/DB.cxx deleted file mode 100644 index 78910d73216..00000000000 --- a/src/mpl/src/ParquetFP/src/DB.cxx +++ /dev/null @@ -1,2746 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2007 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -// 040608 hhchan modified how it plots: -// plot terminals only when plotNets, "set size ratio -1" - -#include "DB.h" - -#include -#include -#include -#include -#include -#include - -#include "FPcommon.h" -#include "PlToSP.h" -#include "SPeval.h" - -#ifdef USEFLUTE -#include "Flute/flute.h" -#endif - -using std::cout; -using std::endl; -using std::map; -using std::max; -using std::min; -using std::numeric_limits; -using std::ofstream; -using std::string; -using std::stringstream; -using std::vector; - -namespace parquetfp { - -void DB::buildTermBBox(void) -{ - termBBox.clear(); - if (_nodes) { - Point temp(0.f, 0.f); - termBBox.put(temp); - for (itNode n = _nodes->terminalsBegin(); n != _nodes->terminalsEnd(); - ++n) { - temp.x = n->getX(); - temp.y = n->getY(); - termBBox.put(temp); - temp.x += n->getWidth(); - temp.y += n->getHeight(); - termBBox.put(temp); - } - } -} - -void DB::scaleTerminals(void) -{ - if (_nodes) { - _scaledLocs.resize(_nodes->getNumTerminals()); - - float xScale = getXMax() / termBBox.getXSize(); - float yScale = getYMax() / termBBox.getYSize(); - - for (itNode n = _nodes->terminalsBegin(); n != _nodes->terminalsEnd(); - ++n) { - _scaledLocs[n->getIndex()].x = xScale * n->getX(); - _scaledLocs[n->getIndex()].y = yScale * n->getY(); - } - } -} - -// ctor -DB::DB(const std::string& baseName) -{ - cout << "Reading Nodes (files " << baseName << ".blocks and " << baseName - << ".pl)" << endl; - _nodes = new Nodes(baseName); - - cout << "Reading Nets (file " << baseName << ".nets)" << endl; - _nets = new Nets(baseName); - - _nets->updateNodeInfo(*_nodes); - _nodes->updatePinsInfo(*_nets); - _nodes->initNodesFastPOAccess(*_nets, false); - - cout << "Done creating DB " << endl; - - _nodesBestCopy = new Nodes(); - _obstacles = new Nodes(); - //_nodesBestCopy = new Nodes(baseName); - //_nodesBestCopy->updatePinsInfo(*_nets); - - _area = 0; - _initArea = 0; - successAR = 0; - _rowHeight = 0; - _siteSpacing = 0; - - buildTermBBox(); -} - -DB::DB(void) -{ - _nodes = new Nodes(); - _nets = new Nets(); - _nodesBestCopy = new Nodes(); - _obstacles = new Nodes(); - - _area = 0; - _initArea = 0; - successAR = 0; - _rowHeight = 0; - _siteSpacing = 0; - - buildTermBBox(); -} - -DB::DB(DB* db, - vector& subBlocksIndices, - parquetfp::Point& dbLoc, - float reqdAR) -{ - _nodes = new Nodes(); - _nets = new Nets(); - _nodesBestCopy = new Nodes(); - _obstacles = new Nodes(); - _area = 0; - _initArea = 0; - successAR = 0; - _rowHeight = 0; - _siteSpacing = 0; - - Nodes* origNodes = db->getNodes(); - Nets* origNets = db->getNets(); - - map mapping; - unsigned numOrigNodes = origNodes->getNumNodes(); - vector seenNodes(numOrigNodes, false); - - float nodesArea = 0; - for (unsigned i = 0; i < subBlocksIndices.size(); ++i) { - Node& origNode = origNodes->getNode(subBlocksIndices[i]); - nodesArea += origNode.getArea(); - Node tempNode(origNode.getName(), - origNode.getArea(), - origNode.getminAR(), - origNode.getmaxAR(), - i, - false); - tempNode.addSubBlockIndex(subBlocksIndices[i]); - tempNode.putX(origNode.getX()); - tempNode.putY(origNode.getY()); - _nodes->putNewNode(tempNode); - seenNodes[subBlocksIndices[i]] = true; - mapping[subBlocksIndices[i]] = i; - } - - float reqdHeight = sqrt(nodesArea / reqdAR); - float reqdWidth = reqdHeight * reqdAR; - float termXLoc, termYLoc; - float minXLoc = dbLoc.x; - float maxXLoc = minXLoc + reqdWidth; - float minYLoc = dbLoc.y; - float maxYLoc = minYLoc + reqdHeight; - - unsigned numOrigNets = origNets->getNumNets(); - vector seenNets(numOrigNets, false); - - unsigned newNetCtr = 0; - unsigned newTermCtr = 0; - - itNodePin origNodePin; - Net tempEdge; - - for (unsigned i = 0; i < subBlocksIndices.size(); ++i) { - Node& origNode = origNodes->getNode(subBlocksIndices[i]); - for (origNodePin = origNode.pinsBegin(); origNodePin != origNode.pinsEnd(); - ++origNodePin) { - Net& origNet = origNets->getNet(origNodePin->netIndex); - if (!seenNets[origNet.getIndex()]) { - seenNets[origNet.getIndex()] = true; - tempEdge.putName(origNet.getName()); - tempEdge.putIndex(newNetCtr); - for (itPin netPin = origNet.pinsBegin(); netPin != origNet.pinsEnd(); - ++netPin) { - float poffsetX, poffsetY; - unsigned origNodeIdx = netPin->getNodeIndex(); - if (!netPin->getType()) // not a terminal - { - if (seenNodes[origNodeIdx]) { - unsigned newNodeIdx = mapping[origNodeIdx]; - poffsetX = netPin->getXOffset(); - poffsetY = netPin->getYOffset(); - - Node& newNode = _nodes->getNode(newNodeIdx); - pin tempPin( - newNode.getName(), false, poffsetX, poffsetY, newNetCtr); - tempPin.putNodeIndex(newNodeIdx); - tempEdge.addNode(tempPin); - } else // need terminal propagation - { - Node& origTerm = origNodes->getNode(netPin->getNodeIndex()); - - Node tempTerm(origTerm.getName(), 0, 1, 1, newTermCtr, true); - tempTerm.addSubBlockIndex(origTerm.getIndex()); - - // terminal propagation - if (origTerm.getX() < minXLoc) - termXLoc = 0; - else if (origTerm.getX() > maxXLoc) - termXLoc = reqdWidth; - else - termXLoc = origTerm.getX() - minXLoc; - - if (origTerm.getY() < minYLoc) - termYLoc = 0; - else if (origTerm.getY() > maxYLoc) - termYLoc = reqdHeight; - else - termYLoc = origTerm.getY() - minYLoc; - - tempTerm.putX(termXLoc); - tempTerm.putY(termYLoc); - - _nodes->putNewTerm(tempTerm); - - pin tempPin(origTerm.getName(), true, 0, 0, newNetCtr); - tempPin.putNodeIndex(newTermCtr); - tempEdge.addNode(tempPin); - newTermCtr++; - } - } else // actual terminal - { - Node& origTerm = origNodes->getTerminal(netPin->getNodeIndex()); - - Node tempTerm(origTerm.getName(), 0, 1, 1, newTermCtr, true); - tempTerm.addSubBlockIndex(origTerm.getIndex()); - - // terminal propagation - if (origTerm.getX() < minXLoc) - termXLoc = 0; - else if (origTerm.getX() > maxXLoc) - termXLoc = reqdWidth; - else - termXLoc = origTerm.getX() - minXLoc; - - if (origTerm.getY() < minYLoc) - termYLoc = 0; - else if (origTerm.getY() > maxYLoc) - termYLoc = reqdHeight; - else - termYLoc = origTerm.getY() - minYLoc; - - tempTerm.putX(termXLoc); - tempTerm.putY(termYLoc); - - _nodes->putNewTerm(tempTerm); - - pin tempPin(origTerm.getName(), true, 0, 0, newNetCtr); - tempPin.putNodeIndex(newTermCtr); - tempEdge.addNode(tempPin); - newTermCtr++; - } - } - _nets->putNewNet(tempEdge); - ++newNetCtr; - tempEdge.clean(); - } - } - } - _nodes->updatePinsInfo(*_nets); - _nodes->initNodesFastPOAccess(*_nets, false); - *_nodesBestCopy = *_nodes; - *_obstacles = *(db->_obstacles); - _obstacleFrame[0] = db->_obstacleFrame[0]; - _obstacleFrame[1] = db->_obstacleFrame[1]; - - buildTermBBox(); -} - -DB::~DB() -{ - if (_nodes) - delete _nodes; - if (_nets) - delete _nets; - if (_nodesBestCopy) - delete _nodesBestCopy; - if (_obstacles) - delete _obstacles; -} - -DB& DB::operator=(DB& db2) -{ - if (this != &db2) { - if (_nodes) - delete _nodes; - if (_nets) - delete _nets; - if (_nodesBestCopy) - delete _nodesBestCopy; - if (_obstacles) - delete _obstacles; - - _nodes = new Nodes(); - _nets = new Nets(); - _nodesBestCopy = new Nodes(); - _obstacles = new Nodes(); - - *(_nodes) = *(db2.getNodes()); - *(_nets) = *(db2.getNets()); - *(_nodesBestCopy) = *(db2._nodesBestCopy); - *(_obstacles) = *(db2._obstacles); - _obstacleFrame[0] = db2._obstacleFrame[0]; - _obstacleFrame[1] = db2._obstacleFrame[1]; - - _area = db2._area; - _initArea = db2._initArea; - _rowHeight = db2._rowHeight; - _siteSpacing = db2._siteSpacing; - - termBBox = db2.termBBox; - } - return *this; -} - -struct sortFnPairFirst -{ - bool operator()(const std::pair& elem1, - const std::pair& elem2) - { - return (elem1.first < elem2.first); - } -}; - -DB::DB(DB& db2, bool compressDB) -{ - if (this != &db2) { - /* - if(_nodes) delete _nodes; - if(_nets) delete _nets; - if(_nodesBestCopy) delete _nodesBestCopy; - */ - successAR = db2.successAR; - _nodes = new Nodes(); - _nets = new Nets(); - _nodesBestCopy = new Nodes(); - _obstacles = new Nodes(); - - *(_nodes) = *(db2.getNodes()); - *(_nodesBestCopy) = *(db2._nodesBestCopy); - *(_obstacles) = *(db2._obstacles); - _obstacleFrame[0] = db2._obstacleFrame[0]; - _obstacleFrame[1] = db2._obstacleFrame[1]; - - _area = db2._area; - _initArea = db2._initArea; - _rowHeight = db2._rowHeight; - _siteSpacing = db2._siteSpacing; - - if (!compressDB) { - *(_nets) = *(db2.getNets()); - } else { - // any net connected to a macro or terminal is added as is - // only nets between normal blocks are compressed - int netCtr = 0; - Nets* oldNets = db2.getNets(); - Nodes* oldNodes = db2.getNodes(); - vector seenNets(oldNets->getNumNets(), false); - for (itNode term = oldNodes->terminalsBegin(); - term != oldNodes->terminalsEnd(); - ++term) { - for (itNodePin pin = term->pinsBegin(); pin != term->pinsEnd(); ++pin) { - unsigned netId = pin->netIndex; - if (!seenNets[netId]) { - Net& origNet = oldNets->getNet(netId); - Net tempEdge; - tempEdge.putName(origNet.getName()); - tempEdge.putIndex(netCtr); - tempEdge.putWeight(origNet.getWeight()); - for (itPin netPin = origNet.pinsBegin(); - netPin != origNet.pinsEnd(); - ++netPin) { - unsigned currNodeIdx = netPin->getNodeIndex(); - float poffsetX = 0, poffsetY = 0; - poffsetX = netPin->getXOffset(); - poffsetY = netPin->getYOffset(); - if (!netPin->getType()) { - Node& oldNode = oldNodes->getNode(currNodeIdx); - parquetfp::pin tempPin( - oldNode.getName(), false, poffsetX, poffsetY, netCtr); - tempPin.putNodeIndex(currNodeIdx); - tempEdge.addNode(tempPin); - } else { - Node& oldTerm = oldNodes->getTerminal(currNodeIdx); - parquetfp::pin tempPin( - oldTerm.getName(), true, poffsetX, poffsetY, netCtr); - tempPin.putNodeIndex(currNodeIdx); - tempEdge.addNode(tempPin); - } - } - seenNets[netId] = true; - _nets->putNewNet(tempEdge); - ++netCtr; - } - } - } - - for (itNode node = oldNodes->nodesBegin(); node != oldNodes->nodesEnd(); - ++node) { - for (itNodePin pin = node->pinsBegin(); pin != node->pinsEnd(); ++pin) { - unsigned netId = pin->netIndex; - Net& origNet = oldNets->getNet(netId); - if (!seenNets[netId] - /*&& ( node->isMacro() || origNet.getDegree() > 2)*/) { - Net tempEdge; - bool atleast1PinOffsetNotZero = false; - tempEdge.putName(origNet.getName()); - tempEdge.putIndex(netCtr); - tempEdge.putWeight(origNet.getWeight()); - for (itPin netPin = origNet.pinsBegin(); - netPin != origNet.pinsEnd(); - ++netPin) { - unsigned currNodeIdx = netPin->getNodeIndex(); - float poffsetX = 0, poffsetY = 0; - poffsetX = netPin->getXOffset(); - poffsetY = netPin->getYOffset(); - if (!(std::abs(poffsetX - 0) < 1e-5 - && std::abs(poffsetY - 0) < 1e-5)) - atleast1PinOffsetNotZero = true; - - if (!netPin->getType()) { - Node& oldNode = oldNodes->getNode(currNodeIdx); - parquetfp::pin tempPin( - oldNode.getName(), false, poffsetX, poffsetY, netCtr); - tempPin.putNodeIndex(currNodeIdx); - tempEdge.addNode(tempPin); - } else { - Node& oldTerm = oldNodes->getTerminal(currNodeIdx); - parquetfp::pin tempPin( - oldTerm.getName(), true, poffsetX, poffsetY, netCtr); - tempPin.putNodeIndex(currNodeIdx); - tempEdge.addNode(tempPin); - } - } - if (atleast1PinOffsetNotZero || origNet.getDegree() > 2) { - seenNets[netId] = true; - _nets->putNewNet(tempEdge); - ++netCtr; - } - } - } - } - - // now add the compressing code - vector>> nodeConnections( - oldNodes->getNumNodes()); - - for (itNode node = oldNodes->nodesBegin(); node != oldNodes->nodesEnd(); - ++node) { - // if(!node->isMacro()) - { - unsigned currNodeIdx = node->getIndex(); - - for (itNodePin pin = node->pinsBegin(); pin != node->pinsEnd(); - ++pin) { - unsigned netId = pin->netIndex; - Net& origNet = oldNets->getNet(netId); - if (!seenNets[netId] && origNet.getDegree() == 2) { - for (itPin netPin = origNet.pinsBegin(); - netPin != origNet.pinsEnd(); - ++netPin) { - unsigned nextNodeIdx = netPin->getNodeIndex(); - // following cond ensures that we go over each - // net only once - if (nextNodeIdx > currNodeIdx) { - std::pair elem(nextNodeIdx, - origNet.getWeight()); - nodeConnections[currNodeIdx].push_back(elem); - } - } - } - } - } - } - - for (unsigned i = 0; i < nodeConnections.size(); ++i) - std::sort(nodeConnections[i].begin(), - nodeConnections[i].end(), - sortFnPairFirst()); - - char netName[100]; - for (int i = 0; i < int(nodeConnections.size()); ++i) { - int j = 0; - while (j < int(nodeConnections[i].size())) { - unsigned numConn = 1; - float sumOfWts = nodeConnections[i][j].second; - if (j != (int(nodeConnections[i].size()) - 1)) { - while (j < (int(nodeConnections[i].size()) - 1) - && nodeConnections[i][j].first - == nodeConnections[i][j + 1].first) { - ++numConn; - ++j; - sumOfWts += nodeConnections[i][j].second; - } - } - - Net tempEdge; - sprintf(netName, "clusteredNet_%d", netCtr); - tempEdge.putName(netName); - tempEdge.putIndex(netCtr); - float poffsetX = 0, poffsetY = 0; - Node& node1 = _nodes->getNode(i); - Node& node2 = _nodes->getNode(nodeConnections[i][j].first); - - pin tempPin1(node1.getName(), false, poffsetX, poffsetY, netCtr); - tempPin1.putNodeIndex(i); - tempEdge.addNode(tempPin1); - - pin tempPin2(node2.getName(), false, poffsetX, poffsetY, netCtr); - tempPin2.putNodeIndex(nodeConnections[i][j].first); - tempEdge.addNode(tempPin2); - - // tempEdge.putWeight(numConn); - tempEdge.putWeight(sumOfWts); - _nets->putNewNet(tempEdge); - - ++netCtr; - ++j; - } - } - //_nets->updateNodeInfo(*_nodes); - _nodes->updatePinsInfo(*_nets); - _nodes->initNodesFastPOAccess(*_nets, false); - - /* - cout<<"Initial #Nets "<getNumNets()<<" Initial #Pins " - <getNumPins()<<" Compressed #Nets "<<_nets->getNumNets() - <<" Compressed #Pins "<<_nets->getNumPins()<clean(); - if (_nets) - _nets->clean(); - if (_nodesBestCopy) - _nodesBestCopy->clean(); - if (_obstacles) - _obstacles->clean(); -} - -Nodes* DB::getNodes(void) -{ - return _nodes; -} - -Nets* DB::getNets(void) -{ - return _nets; -} - -Nodes* DB::getObstacles(void) -{ - return _obstacles; -} - -void DB::addObstacles(Nodes* obstacles, float obstacleFrame[2]) -{ - if (_obstacles) - delete _obstacles; - _obstacles = new Nodes(); - *(_obstacles) = *obstacles; - _obstacleFrame[0] = obstacleFrame[0]; - _obstacleFrame[1] = obstacleFrame[1]; -} - -unsigned DB::getNumObstacles(void) const -{ - return _obstacles->getNumNodes(); -} - -unsigned DB::getNumNodes(void) const -{ - return _nodes->getNumNodes(); -} - -vector DB::getNodeWidths(void) const -{ - return _nodes->getNodeWidths(); -} - -vector DB::getNodeHeights(void) const -{ - return _nodes->getNodeHeights(); -} - -vector DB::getXLocs(void) const -{ - return _nodes->getXLocs(); -} - -vector DB::getYLocs(void) const -{ - return _nodes->getYLocs(); -} - -parquetfp::Point DB::getBottomLeftCorner() const -{ - const vector& nodesXLocs = _nodes->getXLocs(); - const vector& nodesYLocs = _nodes->getYLocs(); - - vector::const_iterator xMin - = min_element(nodesXLocs.begin(), nodesXLocs.end()); - vector::const_iterator yMin - = min_element(nodesYLocs.begin(), nodesYLocs.end()); - - Point bottomLeft; - bottomLeft.x = *xMin; - bottomLeft.y = *yMin; - return bottomLeft; -} - -parquetfp::Point DB::getTopRightCorner() const -{ - vector nodesXLocs(_nodes->getXLocs()); - vector nodesYLocs(_nodes->getYLocs()); - for (unsigned int i = 0; i < _nodes->getNumNodes(); i++) { - nodesXLocs[i] += _nodes->getNodeWidth(i); - nodesYLocs[i] += _nodes->getNodeHeight(i); - } - - vector::iterator xMax - = max_element(nodesXLocs.begin(), nodesXLocs.end()); - vector::iterator yMax - = max_element(nodesYLocs.begin(), nodesYLocs.end()); - - Point topRight; - topRight.x = *xMax; - topRight.y = *yMax; - return topRight; -} - -void DB::packToCorner(vector>& xlocsAt, - vector>& ylocsAt) const -{ - const Point topRightCorner(getTopRightCorner()); - const Point bottomLeftCorner(getBottomLeftCorner()); - - const vector xlocs(getXLocs()); - const vector ylocs(getYLocs()); - const vector widths(getNodeWidths()); - const vector heights(getNodeHeights()); - - // naive FP representation independent way of determining slacks - vector yBottomSlacks(getNumNodes()); - vector yTopSlacks(getNumNodes()); - vector xLeftSlacks(getNumNodes()); - vector xRightSlacks(getNumNodes()); - - // calculate the bottom, top, left, and right slacks for the current positions - for (unsigned i = 0; i < getNumNodes(); i++) { - xRightSlacks[i] = max(0.f, topRightCorner.x - xlocs[i] - widths[i]); - xLeftSlacks[i] = max(0.f, xlocs[i] - bottomLeftCorner.x); - - yTopSlacks[i] = max(0.f, topRightCorner.y - ylocs[i] - heights[i]); - yBottomSlacks[i] = max(0.f, ylocs[i] - bottomLeftCorner.y); - - for (unsigned j = 0; j < getNumNodes(); j++) { - if (i != j) { - // have x-overlap - if (lessThanFloat(xlocs[i], xlocs[j] + widths[j]) - && lessThanFloat(xlocs[j], xlocs[i] + widths[i])) { - if (ylocs[j] > ylocs[i]) { - // [j] is above [i] - yTopSlacks[i] = min(yTopSlacks[i], - max(0.f, ylocs[j] - (ylocs[i] + heights[i]))); - } else { - // [j] is below [i] - yBottomSlacks[i] = min( - yBottomSlacks[i], max(0.f, ylocs[i] - (ylocs[j] + heights[j]))); - } - } - - // have y-overlap - if (lessThanFloat(ylocs[i], ylocs[j] + heights[j]) - && lessThanFloat(ylocs[j], ylocs[i] + heights[i])) { - if (xlocs[j] > xlocs[i]) { - // [j] is right of [i] - xRightSlacks[i] = min(xRightSlacks[i], - max(0.f, xlocs[j] - (xlocs[i] + widths[i]))); - } else { - // [j] is left of [i] - xLeftSlacks[i] = min(xLeftSlacks[i], - max(0.f, xlocs[i] - (xlocs[j] + widths[j]))); - } - } - } - } - } - - // set the locations for the easy directions - for (unsigned i = 0; i < getNumNodes(); i++) { - xlocsAt[BOTTOM][i] = xlocs[i]; - ylocsAt[BOTTOM][i] = ylocs[i] - yBottomSlacks[i]; - - xlocsAt[TOP][i] = xlocs[i]; - ylocsAt[TOP][i] = ylocs[i] + yTopSlacks[i]; - - xlocsAt[LEFT][i] = xlocs[i] - xLeftSlacks[i]; - ylocsAt[LEFT][i] = ylocs[i]; - - xlocsAt[RIGHT][i] = xlocs[i] + xRightSlacks[i]; - ylocsAt[RIGHT][i] = ylocs[i]; - } - - // now assuming we packed to the bottom, find the x slacks - // and assuming we packed to the left, find the y slacks - - for (unsigned i = 0; i < getNumNodes(); i++) { - xRightSlacks[i] = topRightCorner.x - xlocsAt[BOTTOM][i] - widths[i]; - xLeftSlacks[i] = xlocsAt[BOTTOM][i] - bottomLeftCorner.x; - - yTopSlacks[i] = topRightCorner.y - ylocsAt[LEFT][i] - heights[i]; - yBottomSlacks[i] = ylocsAt[LEFT][i] - bottomLeftCorner.y; - - for (unsigned j = 0; j < getNumNodes(); j++) { - if (i != j) { - // have x-overlap - if (lessThanFloat(xlocsAt[LEFT][i], xlocsAt[LEFT][j] + widths[j]) - && lessThanFloat(xlocsAt[LEFT][j], xlocsAt[LEFT][i] + widths[i])) { - if (ylocsAt[LEFT][j] > ylocsAt[LEFT][i]) { - // [j] is above [i] - yTopSlacks[i] = min( - yTopSlacks[i], - max(0.f, ylocsAt[LEFT][j] - (ylocsAt[LEFT][i] + heights[i]))); - } else { - // [j] is below [i] - yBottomSlacks[i] = min( - yBottomSlacks[i], - max(0.f, ylocsAt[LEFT][i] - (ylocsAt[LEFT][j] + heights[j]))); - } - } - - // have y-overlap - if (lessThanFloat(ylocsAt[BOTTOM][i], ylocsAt[BOTTOM][j] + heights[j]) - && lessThanFloat(ylocsAt[BOTTOM][j], - ylocsAt[BOTTOM][i] + heights[i])) { - if (xlocsAt[BOTTOM][j] > xlocsAt[BOTTOM][i]) { - // [j] is right of [i] - xRightSlacks[i] = min( - xRightSlacks[i], - max(0.f, - xlocsAt[BOTTOM][j] - (xlocsAt[BOTTOM][i] + widths[i]))); - } else { - // [j] is left of [i] - xLeftSlacks[i] = min( - xLeftSlacks[i], - max(0.f, - xlocsAt[BOTTOM][i] - (xlocsAt[BOTTOM][j] + widths[j]))); - } - } - } - } - } - - // set the locations for those compound directions - for (unsigned i = 0; i < getNumNodes(); i++) { - xlocsAt[BOTTOM_LEFT][i] = xlocsAt[BOTTOM][i] - xLeftSlacks[i]; - ylocsAt[BOTTOM_LEFT][i] = ylocsAt[BOTTOM][i]; - - xlocsAt[BOTTOM_RIGHT][i] = xlocsAt[BOTTOM][i] + xRightSlacks[i]; - ylocsAt[BOTTOM_RIGHT][i] = ylocsAt[BOTTOM][i]; - - xlocsAt[LEFT_BOTTOM][i] = xlocsAt[LEFT][i]; - ylocsAt[LEFT_BOTTOM][i] = ylocsAt[LEFT][i] - yBottomSlacks[i]; - - xlocsAt[LEFT_TOP][i] = xlocsAt[LEFT][i]; - ylocsAt[LEFT_TOP][i] = ylocsAt[LEFT][i] + yTopSlacks[i]; - } - - // now assuming we packed to the top, find the x slacks - // and assuming we packed to the right, find the y slacks - - for (unsigned i = 0; i < getNumNodes(); i++) { - xRightSlacks[i] = topRightCorner.x - xlocsAt[TOP][i] - widths[i]; - xLeftSlacks[i] = xlocsAt[TOP][i] - bottomLeftCorner.x; - - yTopSlacks[i] = topRightCorner.y - ylocsAt[RIGHT][i] - heights[i]; - yBottomSlacks[i] = ylocsAt[RIGHT][i] - bottomLeftCorner.y; - - for (unsigned j = 0; j < getNumNodes(); j++) { - if (i != j) { - // have x-overlap - if (lessThanFloat(xlocsAt[RIGHT][i], xlocsAt[RIGHT][j] + widths[j]) - && lessThanFloat(xlocsAt[RIGHT][j], - xlocsAt[RIGHT][i] + widths[i])) { - if (ylocsAt[RIGHT][j] > ylocsAt[RIGHT][i]) { - // [j] is above [i] - yTopSlacks[i] = min( - yTopSlacks[i], - max(0.f, ylocsAt[RIGHT][j] - (ylocsAt[RIGHT][i] + heights[i]))); - } else { - // [j] is below [i] - yBottomSlacks[i] = min( - yBottomSlacks[i], - max(0.f, ylocsAt[RIGHT][i] - (ylocsAt[RIGHT][j] + heights[j]))); - } - } - - // have y-overlap - if (lessThanFloat(ylocsAt[TOP][i], ylocsAt[TOP][j] + heights[j]) - && lessThanFloat(ylocsAt[TOP][j], ylocsAt[TOP][i] + heights[i])) { - if (xlocsAt[TOP][j] > xlocsAt[TOP][i]) { - // [j] is right of [i] - xRightSlacks[i] = min( - xRightSlacks[i], - max(0.f, xlocsAt[TOP][j] - (xlocsAt[TOP][i] + widths[i]))); - } else { - // [j] is left of [i] - xLeftSlacks[i] = min( - xLeftSlacks[i], - max(0.f, xlocsAt[TOP][i] - (xlocsAt[TOP][j] + widths[j]))); - } - } - } - } - } - - // set the locations for those compound directions - for (unsigned i = 0; i < getNumNodes(); i++) { - xlocsAt[TOP_LEFT][i] = xlocsAt[TOP][i] - xLeftSlacks[i]; - ylocsAt[TOP_LEFT][i] = ylocsAt[TOP][i]; - - xlocsAt[TOP_RIGHT][i] = xlocsAt[TOP][i] + xRightSlacks[i]; - ylocsAt[TOP_RIGHT][i] = ylocsAt[TOP][i]; - - xlocsAt[RIGHT_BOTTOM][i] = xlocsAt[RIGHT][i]; - ylocsAt[RIGHT_BOTTOM][i] = ylocsAt[RIGHT][i] - yBottomSlacks[i]; - - xlocsAt[RIGHT_TOP][i] = xlocsAt[RIGHT][i]; - ylocsAt[RIGHT_TOP][i] = ylocsAt[RIGHT][i] + yTopSlacks[i]; - } -} - -#ifdef USEFLUTE -void DB::cornerOptimizeDesign(bool scaleTerms, bool minWL, bool useSteiner) -#else -void DB::cornerOptimizeDesign(bool scaleTerms, bool minWL) -#endif -{ - vector origXLocs; - vector origYLocs; - - vector> xlocsAt(NUM_CORNERS, vector(getNumNodes())); - vector> ylocsAt(NUM_CORNERS, vector(getNumNodes())); - - int ORIGINAL = -1; - int minCorner = ORIGINAL; - bool useWts = true; - - float minObjective = numeric_limits::max(); - - if (minWL) { -#ifdef USEFLUTE - minObjective = evalHPWL(useWts, scaleTerms, useSteiner); -#else - minObjective = evalHPWL(useWts, scaleTerms); -#endif - cout << "Original HPWL: " << minObjective << endl; - } else { - minObjective = evalArea(); - cout << "Original Area: " << minObjective << endl; - } - - do { - origXLocs = getXLocs(); - origYLocs = getYLocs(); - - minCorner = ORIGINAL; - - packToCorner(xlocsAt, ylocsAt); - - for (unsigned i = 0; i < NUM_CORNERS; i++) { - updatePlacement(xlocsAt[i], ylocsAt[i]); - - float currObjective = numeric_limits::max(); - if (minWL) { -#ifdef USEFLUTE - currObjective = evalHPWL(useWts, scaleTerms, useSteiner); -#else - currObjective = evalHPWL(useWts, scaleTerms); -#endif - cout << toString(Corner(i)) << " HPWL: " << currObjective << endl; - } else { - currObjective = evalArea(); - cout << toString(Corner(i)) << " Area: " << currObjective << endl; - } - - if (lessThanFloat(currObjective, minObjective)) { - minObjective = currObjective; - minCorner = i; - } - } - if (minWL) { - cout << "minimum HPWL: " << minObjective; - } else { - cout << "minimum Area: " << minObjective; - } - - if (minCorner == ORIGINAL) - cout << " in the original position." << endl; - else - cout << " at " << toString(Corner(minCorner)) << endl; - - cout << "packing design towards " - << ((minCorner == ORIGINAL) ? string("the original position") - : toString(Corner(minCorner))) - << endl; - - if (minCorner == ORIGINAL) - updatePlacement(origXLocs, origYLocs); - else - updatePlacement(xlocsAt[minCorner], ylocsAt[minCorner]); - - } while (minCorner != ORIGINAL); - - if (minWL) { -#ifdef USEFLUTE - cout << "final HPWL: " << evalHPWL(useWts, scaleTerms, useSteiner) << endl; -#else - cout << "final HPWL: " << evalHPWL(useWts, scaleTerms) << endl; -#endif - } else { - cout << "final Area: " << evalArea() << endl; - } -} - -float DB::getNodesArea(void) const -{ - if (_initArea) - return _area; - else { - _area = _nodes->getNodesArea(); - _initArea = 1; - return _area; - } -} - -float DB::getRowHeight(void) const -{ - return _rowHeight; -} - -float DB::getSiteSpacing(void) const -{ - return _siteSpacing; -} - -void DB::setRowHeight(float rowHeight) -{ - _rowHeight = rowHeight; -} - -void DB::setSiteSpacing(float siteSpacing) -{ - _siteSpacing = siteSpacing; -} - -float DB::getAvgHeight(void) const -{ - itNode node; - float avgHeight = 0; - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) - avgHeight += node->getHeight(); - avgHeight /= getNumNodes(); - return (avgHeight); -} - -void DB::updatePlacement(const vector& xloc, const vector& yloc) -{ - unsigned int numNodes = _nodes->getNumNodes(); - unsigned int size = min(unsigned(xloc.size()), numNodes); - - for (unsigned i = 0; i < size; i++) { - _nodes->getNode(i).putX(xloc[i]); - _nodes->getNode(i).putY(yloc[i]); - } -} - -void DB::initPlacement(const parquetfp::Point& loc) -{ - itNode node; - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - node->putX(loc.x); - node->putY(loc.y); - } -} - -void DB::updateSlacks(const vector& xSlack, const vector& ySlack) -{ - for (unsigned i = 0; i < xSlack.size(); ++i) { - _nodes->getNode(i).putslackX(xSlack[i]); - _nodes->getNode(i).putslackY(ySlack[i]); - } -} - -#ifdef USEFLUTE -float DB::evalHPWL(bool useWts, bool scaleTerms, bool useSteiner) -{ - exit(1); - if (useSteiner) - return evalSteiner(useWts, scaleTerms); -#else -float DB::evalHPWL(bool useWts, bool scaleTerms) -{ -#endif - - // this function has a lot of code repetition - // because things have been manually inlined for speed concerns - // this function accounts for the greatest portion of runtime - // used by Parquet within Capo (it is the bottleneck) - float HPWL = 0.0f; - float width = 0.0f; - float height = 0.0f; - - if (scaleTerms) { - scaleTerminals(); - } - - for (itNet net = _nets->netsBegin(); net != _nets->netsEnd(); ++net) { - unsigned nDegree = net->getDegree(); - if (nDegree <= 1) { - continue; // one pin has 0 WL - } - if (nDegree == 2) { // fast special case for 2 pin nets - Net& currNet = (*net); - float nodeLocx = 0.0f; - float nodeLocy = 0.0f; - float pinOffsetx = 0.0f; - float pinOffsety = 0.0f; - - // Begin Compute location of pin 0 - pin& pin0 = currNet.getPin(0); - unsigned nodeIndex0 = pin0.getNodeIndex(); - Node* node0; - if (pin0.getType()) { - node0 = &_nodes->getTerminal(nodeIndex0); - if (scaleTerms) { - nodeLocx = getScaledX(*node0); - nodeLocy = getScaledY(*node0); - } else { - nodeLocx = node0->getX(); - nodeLocy = node0->getY(); - } - } else { - node0 = &_nodes->getNode(nodeIndex0); - nodeLocx = node0->getX(); - nodeLocy = node0->getY(); - } - // Begin Compute pin offsets - width = node0->getWidth(); - height = node0->getHeight(); - if (node0->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin0.getXOffset()) * width; - pinOffsety = (0.5f + pin0.getYOffset()) * height; - } - // End Compute pin offsets - float pin0Locx = nodeLocx + pinOffsetx; - float pin0Locy = nodeLocy + pinOffsety; - // End Compute location of pin 0 - - // Begin Compute location of pin 1 - pin& pin1 = currNet.getPin(1); - unsigned nodeIndex1 = pin1.getNodeIndex(); - Node* node1; - if (pin1.getType()) { - node1 = &_nodes->getTerminal(nodeIndex1); - if (scaleTerms) { - nodeLocx = getScaledX(*node1); - nodeLocy = getScaledY(*node1); - } else { - nodeLocx = node1->getX(); - nodeLocy = node1->getY(); - } - } else { - node1 = &_nodes->getNode(nodeIndex1); - nodeLocx = node1->getX(); - nodeLocy = node1->getY(); - } - // Begin Compute pin offsets - width = node1->getWidth(); - height = node1->getHeight(); - if (node1->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin1.getXOffset()) * width; - pinOffsety = (0.5f + pin1.getYOffset()) * height; - } - // End Compute pin offsets - float pin1Locx = nodeLocx + pinOffsetx; - float pin1Locy = nodeLocy + pinOffsety; - // End Compute location of pin 1 - - if (useWts) { - HPWL += net->getWeight() - * (std::abs(pin1Locx - pin0Locx) - + std::abs(pin1Locy - pin0Locy)); - } else { - HPWL += std::abs(pin1Locx - pin0Locx) + std::abs(pin1Locy - pin0Locy); - } - - // if(HPWL == numeric_limits::infinity()) - // { - // const vector& nodexlocs = _nodes->getXLocs(); - // const vector& nodeylocs = _nodes->getYLocs(); - - // abkfatal(nodexlocs.size() == nodeylocs.size(), "What the - // hell am i doing?"); - - // cerr<<"There is a problem with HPWL, dumping node - // locs"<::infinity(), - // "Returning inf HPWL! "); - // } - } else if (nDegree == 3) { - Net& currNet = (*net); - float nodeLocx = 0.0f; - float nodeLocy = 0.0f; - float pinOffsetx = 0.0f; - float pinOffsety = 0.0f; - - // Begin Compute location of pin 0 - pin& pin0 = currNet.getPin(0); - unsigned nodeIndex0 = pin0.getNodeIndex(); - Node* node0; - if (pin0.getType()) { - node0 = &_nodes->getTerminal(nodeIndex0); - if (scaleTerms) { - nodeLocx = getScaledX(*node0); - nodeLocy = getScaledY(*node0); - } else { - nodeLocx = node0->getX(); - nodeLocy = node0->getY(); - } - } else { - node0 = &_nodes->getNode(nodeIndex0); - nodeLocx = node0->getX(); - nodeLocy = node0->getY(); - } - // Begin Compute pin offsets - width = node0->getWidth(); - height = node0->getHeight(); - if (node0->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin0.getXOffset()) * width; - pinOffsety = (0.5f + pin0.getYOffset()) * height; - } - // End Compute pin offsets - float pin0Locx = nodeLocx + pinOffsetx; - float pin0Locy = nodeLocy + pinOffsety; - // End Compute location of pin 0 - - // Begin Compute location of pin 1 - pin& pin1 = currNet.getPin(1); - unsigned nodeIndex1 = pin1.getNodeIndex(); - Node* node1; - if (pin1.getType()) { - node1 = &_nodes->getTerminal(nodeIndex1); - if (scaleTerms) { - nodeLocx = getScaledX(*node1); - nodeLocy = getScaledY(*node1); - } else { - nodeLocx = node1->getX(); - nodeLocy = node1->getY(); - } - } else { - node1 = &_nodes->getNode(nodeIndex1); - nodeLocx = node1->getX(); - nodeLocy = node1->getY(); - } - // Begin Compute pin offsets - width = node1->getWidth(); - height = node1->getHeight(); - if (node1->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin1.getXOffset()) * width; - pinOffsety = (0.5f + pin1.getYOffset()) * height; - } - // End Compute pin offsets - float pin1Locx = nodeLocx + pinOffsetx; - float pin1Locy = nodeLocy + pinOffsety; - // End Compute location of pin 1 - - // Begin Compute location of pin 2 - pin& pin2 = currNet.getPin(2); - unsigned nodeIndex2 = pin2.getNodeIndex(); - Node* node2; - if (pin2.getType()) { - node2 = &_nodes->getTerminal(nodeIndex2); - if (scaleTerms) { - nodeLocx = getScaledX(*node2); - nodeLocy = getScaledY(*node2); - } else { - nodeLocx = node2->getX(); - nodeLocy = node2->getY(); - } - } else { - node2 = &_nodes->getNode(nodeIndex2); - nodeLocx = node2->getX(); - nodeLocy = node2->getY(); - } - // Begin Compute pin offsets - width = node2->getWidth(); - height = node2->getHeight(); - if (node2->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin2.getXOffset()) * width; - pinOffsety = (0.5f + pin2.getYOffset()) * height; - } - // End Compute pin offsets - float pin2Locx = nodeLocx + pinOffsetx; - float pin2Locy = nodeLocy + pinOffsety; - // End Compute location of pin 2 - - float maxy = 0.0f; - float miny = 0.0f; - float maxx = 0.0f; - float minx = 0.0f; - if (pin1Locx > pin0Locx) { - if (pin2Locx > pin1Locx) { - maxx = pin2Locx; - minx = pin0Locx; - } else { - maxx = pin1Locx; - if (pin0Locx < pin2Locx) - minx = pin0Locx; - else - minx = pin2Locx; - } - } else { - if (pin2Locx > pin0Locx) { - maxx = pin2Locx; - minx = pin1Locx; - } else { - maxx = pin0Locx; - if (pin1Locx < pin2Locx) - minx = pin1Locx; - else - minx = pin2Locx; - } - } - - if (pin1Locy > pin0Locy) { - if (pin2Locy > pin1Locy) { - maxy = pin2Locy; - miny = pin0Locy; - } else { - maxy = pin1Locy; - if (pin0Locy < pin2Locy) - miny = pin0Locy; - else - miny = pin2Locy; - } - } else { - if (pin2Locy > pin0Locy) { - maxy = pin2Locy; - miny = pin1Locy; - } else { - maxy = pin0Locy; - if (pin1Locy < pin2Locy) - miny = pin1Locy; - else - miny = pin2Locy; - } - } - - if (useWts) { - HPWL += net->getWeight() * (maxx - minx + maxy - miny); - } else { - HPWL += maxx - minx + maxy - miny; - } - - // if(HPWL == numeric_limits::infinity()) - // { - // const vector& nodexlocs = _nodes->getXLocs(); - // const vector& nodeylocs = _nodes->getYLocs(); - - // abkfatal(nodexlocs.size() == nodeylocs.size(), "What the - // hell am i doing?"); - - // cerr<<"There is a problem with HPWL, dumping node - // locs"<::infinity(), - // "Returning inf HPWL! "); - // } - } else // degree >= 4 - { - float maxx = 0.0f; - float maxy = 0.0f; - float minx = 0.0f; - float miny = 0.0f; - float nodeLocx = 0.0f; - float nodeLocy = 0.0f; - float pinOffsetx = 0.0f; - float pinOffsety = 0.0f; - float halfPerim = 0.0f; - - // Begin by initializing the locations to the first four pins - // faster because it saves some comparing - Net& currNet = (*net); - // Begin Compute location of pin 0 - pin& pin0 = currNet.getPin(0); - unsigned nodeIndex0 = pin0.getNodeIndex(); - Node* node0; - if (pin0.getType()) { - node0 = &_nodes->getTerminal(nodeIndex0); - if (scaleTerms) { - nodeLocx = getScaledX(*node0); - nodeLocy = getScaledY(*node0); - } else { - nodeLocx = node0->getX(); - nodeLocy = node0->getY(); - } - } else { - node0 = &_nodes->getNode(nodeIndex0); - nodeLocx = node0->getX(); - nodeLocy = node0->getY(); - } - // Begin Compute pin offsets - width = node0->getWidth(); - height = node0->getHeight(); - if (node0->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin0.getXOffset()) * width; - pinOffsety = (0.5f + pin0.getYOffset()) * height; - } - // End Compute pin offsets - float pin0Locx = nodeLocx + pinOffsetx; - float pin0Locy = nodeLocy + pinOffsety; - // End Compute location of pin 0 - - // Begin Compute location of pin 1 - pin& pin1 = currNet.getPin(1); - unsigned nodeIndex1 = pin1.getNodeIndex(); - Node* node1; - if (pin1.getType()) { - node1 = &_nodes->getTerminal(nodeIndex1); - if (scaleTerms) { - nodeLocx = getScaledX(*node1); - nodeLocy = getScaledY(*node1); - } else { - nodeLocx = node1->getX(); - nodeLocy = node1->getY(); - } - } else { - node1 = &_nodes->getNode(nodeIndex1); - nodeLocx = node1->getX(); - nodeLocy = node1->getY(); - } - // Begin Compute pin offsets - width = node1->getWidth(); - height = node1->getHeight(); - if (node1->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin1.getXOffset()) * width; - pinOffsety = (0.5f + pin1.getYOffset()) * height; - } - // End Compute pin offsets - float pin1Locx = nodeLocx + pinOffsetx; - float pin1Locy = nodeLocy + pinOffsety; - // End Compute location of pin 1 - - // Begin Compute location of pin 2 - pin& pin2 = currNet.getPin(2); - unsigned nodeIndex2 = pin2.getNodeIndex(); - Node* node2; - if (pin2.getType()) { - node2 = &_nodes->getTerminal(nodeIndex2); - if (scaleTerms) { - nodeLocx = getScaledX(*node2); - nodeLocy = getScaledY(*node2); - } else { - nodeLocx = node2->getX(); - nodeLocy = node2->getY(); - } - } else { - node2 = &_nodes->getNode(nodeIndex2); - nodeLocx = node2->getX(); - nodeLocy = node2->getY(); - } - // Begin Compute pin offsets - width = node2->getWidth(); - height = node2->getHeight(); - if (node2->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin2.getXOffset()) * width; - pinOffsety = (0.5f + pin2.getYOffset()) * height; - } - // End Compute pin offsets - float pin2Locx = nodeLocx + pinOffsetx; - float pin2Locy = nodeLocy + pinOffsety; - // End Compute location of pin 2 - - // Begin Compute location of pin 3 - pin& pin3 = currNet.getPin(3); - unsigned nodeIndex3 = pin3.getNodeIndex(); - Node* node3; - if (pin3.getType()) { - node3 = &_nodes->getTerminal(nodeIndex3); - if (scaleTerms) { - nodeLocx = getScaledX(*node3); - nodeLocy = getScaledY(*node3); - } else { - nodeLocx = node3->getX(); - nodeLocy = node3->getY(); - } - } else { - node3 = &_nodes->getNode(nodeIndex3); - nodeLocx = node3->getX(); - nodeLocy = node3->getY(); - } - // Begin Compute pin offsets - width = node3->getWidth(); - height = node3->getHeight(); - if (node3->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pin3.getXOffset()) * width; - pinOffsety = (0.5f + pin3.getYOffset()) * height; - } - // End Compute pin offsets - float pin3Locx = nodeLocx + pinOffsetx; - float pin3Locy = nodeLocy + pinOffsety; - // End Compute location of pin 3 - - if (pin1Locx > pin0Locx) { - if (pin3Locx > pin2Locx) { - if (pin3Locx > pin1Locx) - maxx = pin3Locx; - else - maxx = pin1Locx; - - if (pin2Locx > pin0Locx) - minx = pin0Locx; - else - minx = pin2Locx; - } else { - if (pin2Locx > pin1Locx) - maxx = pin2Locx; - else - maxx = pin1Locx; - - if (pin3Locx > pin0Locx) - minx = pin0Locx; - else - minx = pin3Locx; - } - } else { - if (pin3Locx > pin2Locx) { - if (pin3Locx > pin0Locx) - maxx = pin3Locx; - else - maxx = pin0Locx; - - if (pin2Locx > pin1Locx) - minx = pin1Locx; - else - minx = pin2Locx; - } else { - if (pin2Locx > pin0Locx) - maxx = pin2Locx; - else - maxx = pin0Locx; - - if (pin3Locx > pin1Locx) - minx = pin1Locx; - else - minx = pin3Locx; - } - } - - if (pin1Locy > pin0Locy) { - if (pin3Locy > pin2Locy) { - if (pin3Locy > pin1Locy) - maxy = pin3Locy; - else - maxy = pin1Locy; - - if (pin2Locy > pin0Locy) - miny = pin0Locy; - else - miny = pin2Locy; - } else { - if (pin2Locy > pin1Locy) - maxy = pin2Locy; - else - maxy = pin1Locy; - - if (pin3Locy > pin0Locy) - miny = pin0Locy; - else - miny = pin3Locy; - } - } else { - if (pin3Locy > pin2Locy) { - if (pin3Locy > pin0Locy) - maxy = pin3Locy; - else - maxy = pin0Locy; - - if (pin2Locy > pin1Locy) - miny = pin1Locy; - else - miny = pin2Locy; - } else { - if (pin2Locy > pin0Locy) - maxy = pin2Locy; - else - maxy = pin0Locy; - - if (pin3Locy > pin1Locy) - miny = pin1Locy; - else - miny = pin3Locy; - } - } - // end initialize - - // Loop over the rest of the pins in pairs (A,B) starting at the fifth - // and sixth pin compare nodes A and B, compare the greater to the max, - // and the lesser to the min The loop will execute 0 times if there are - // exactly 5 pins - unsigned A = 0, nodeIndexA = 0; - unsigned B = 0, nodeIndexB = 0; - unsigned numLoopIterations - = (nDegree - 4) / 2; // integer division floor((nDegree-4)/2.0); - - for (unsigned loopCt = 0; loopCt < numLoopIterations; ++loopCt) { - A = loopCt * 2 + 0 + 4; - B = loopCt * 2 + 1 + 4; - - // Begin Compute location of pin A - pin& pinA = currNet.getPin(A); - nodeIndexA = pinA.getNodeIndex(); - Node* nodeA; - if (pinA.getType()) { - nodeA = &_nodes->getTerminal(nodeIndexA); - if (scaleTerms) { - nodeLocx = getScaledX(*nodeA); - nodeLocy = getScaledY(*nodeA); - } else { - nodeLocx = nodeA->getX(); - nodeLocy = nodeA->getY(); - } - } else { - nodeA = &_nodes->getNode(nodeIndexA); - nodeLocx = nodeA->getX(); - nodeLocy = nodeA->getY(); - } - // Begin Compute pin offsets - width = nodeA->getWidth(); - height = nodeA->getHeight(); - if (nodeA->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pinA.getXOffset()) * width; - pinOffsety = (0.5f + pinA.getYOffset()) * height; - } - // End Compute pin offsets - float pinALocx = nodeLocx + pinOffsetx; - float pinALocy = nodeLocy + pinOffsety; - // End Compute location of pin A - - // Begin Compute location of pin B - pin& pinB = currNet.getPin(B); - nodeIndexB = pinB.getNodeIndex(); - Node* nodeB; - if (pinB.getType()) { - nodeB = &_nodes->getTerminal(nodeIndexB); - if (scaleTerms) { - nodeLocx = getScaledX(*nodeB); - nodeLocy = getScaledY(*nodeB); - } else { - nodeLocx = nodeB->getX(); - nodeLocy = nodeB->getY(); - } - } else { - nodeB = &_nodes->getNode(nodeIndexB); - nodeLocx = nodeB->getX(); - nodeLocy = nodeB->getY(); - } - // Begin Compute pin offsets - width = nodeB->getWidth(); - height = nodeB->getHeight(); - if (nodeB->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pinB.getXOffset()) * width; - pinOffsety = (0.5f + pinB.getYOffset()) * height; - } - // End Compute pin offsets - float pinBLocx = nodeLocx + pinOffsetx; - float pinBLocy = nodeLocy + pinOffsety; - // End Compute location of pin B - - if (pinBLocx > pinALocx) { - if (pinBLocx > maxx) - maxx = pinBLocx; - if (pinALocx < minx) - minx = pinALocx; - } else { - if (pinALocx > maxx) - maxx = pinALocx; - if (pinBLocx < minx) - minx = pinBLocx; - } - - if (pinBLocy > pinALocy) { - if (pinBLocy > maxy) - maxy = pinBLocy; - if (pinALocy < miny) - miny = pinALocy; - } else { - if (pinALocy > maxy) - maxy = pinALocy; - if (pinBLocy < miny) - miny = pinBLocy; - } - } - - // finally, if nDegree is odd, pick up the last compare - if (nDegree % 2 == 1) { - // Begin Compute location of pin N - unsigned N = nDegree - 1; - pin& pinN = currNet.getPin(N); - unsigned nodeIndexN = pinN.getNodeIndex(); - Node* nodeN; - if (pinN.getType()) { - nodeN = &_nodes->getTerminal(nodeIndexN); - if (scaleTerms) { - nodeLocx = getScaledX(*nodeN); - nodeLocy = getScaledY(*nodeN); - } else { - nodeLocx = nodeN->getX(); - nodeLocy = nodeN->getY(); - } - } else { - nodeN = &_nodes->getNode(nodeIndexN); - nodeLocx = nodeN->getX(); - nodeLocy = nodeN->getY(); - } - // Begin Compute pin offsets - width = nodeN->getWidth(); - height = nodeN->getHeight(); - if (nodeN->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + pinN.getXOffset()) * width; - pinOffsety = (0.5f + pinN.getYOffset()) * height; - } - // End Compute pin offsets - float pinNLocx = nodeLocx + pinOffsetx; - float pinNLocy = nodeLocy + pinOffsety; - // End Compute location of pin N - - if (pinNLocx > maxx) - maxx = pinNLocx; - else if (pinNLocx < minx) - minx = pinNLocx; - if (pinNLocy > maxy) - maxy = pinNLocy; - else if (pinNLocy < miny) - miny = pinNLocy; - } - - halfPerim = maxx - minx + maxy - miny; - if (useWts) - HPWL += net->getWeight() * halfPerim; - else - HPWL += halfPerim; - - // if(HPWL == numeric_limits::infinity()) - // { - // const vector& nodexlocs = _nodes->getXLocs(); - // const vector& nodeylocs = _nodes->getYLocs(); - - // abkfatal(nodexlocs.size() == nodeylocs.size(), "What the - // hell am i doing?"); - - // cerr<<"There is a problem with HPWL, dumping node - // locs"<::infinity(), - // "Returning inf HPWL! "); - // } - } - } - - // if(HPWL == numeric_limits::infinity()) - // { - // const vector& nodexlocs = _nodes->getXLocs(); - // const vector& nodeylocs = _nodes->getYLocs(); - - // abkfatal(nodexlocs.size() == nodeylocs.size(), "What the hell am i - // doing?"); - - // cerr<<"There is a problem with HPWL, dumping node locs"<::infinity(), "Returning inf - // HPWL! "); - // } - - return HPWL; -} - -#ifdef USEFLUTE -double flute_x[MAXD], flute_y[MAXD]; - -float DB::evalSteiner(bool useWts, bool scaleTerms) -{ - if (scaleTerms) { - scaleTerminals(); - } - - float total = 0.f; - vector pointsOnNet; - - for (itNet net = _nets->netsBegin(); net != _nets->netsEnd(); ++net) { - pointsOnNet.clear(); - - for (unsigned i = 0; i < net->getDegree(); ++i) { - const pin& Pin = net->getPin(i); - unsigned nodeIndex = Pin.getNodeIndex(); - Node* node; - float nodeLocx, nodeLocy; - if (Pin.getType()) { - node = &_nodes->getTerminal(nodeIndex); - if (scaleTerms) { - nodeLocx = getScaledX(*node); - nodeLocy = getScaledY(*node); - } else { - nodeLocx = node->getX(); - nodeLocy = node->getY(); - } - } else { - node = &_nodes->getNode(nodeIndex); - nodeLocx = node->getX(); - nodeLocy = node->getY(); - } - // Begin Compute pin offsets - float width = node->getWidth(); - float height = node->getHeight(); - float pinOffsetx, pinOffsety; - if (node->allPinsAtCenter) { - pinOffsetx = 0.5f * width; - pinOffsety = 0.5f * height; - } else { - pinOffsetx = (0.5f + Pin.getXOffset()) * width; - pinOffsety = (0.5f + Pin.getYOffset()) * height; - } - // End Compute pin offsets - float pinLocx = nodeLocx + pinOffsetx; - float pinLocy = nodeLocy + pinOffsety; - - pointsOnNet.push_back(Point(pinLocx, pinLocy)); - } - - sort(pointsOnNet.begin(), pointsOnNet.end()); - vector::iterator new_end - = unique(pointsOnNet.begin(), pointsOnNet.end()); - pointsOnNet.erase(new_end, pointsOnNet.end()); - - if (pointsOnNet.size() <= 1) { /* do nothing */ - } else if (pointsOnNet.size() == 2) { - if (useWts) { - total += net->getWeight() - * (std::abs(pointsOnNet[0].x - pointsOnNet[1].x) - + std::abs(pointsOnNet[0].y - pointsOnNet[1].y)); - } else { - total += std::abs(pointsOnNet[0].x - pointsOnNet[1].x) - + std::abs(pointsOnNet[0].y - pointsOnNet[1].y); - } - } else if (pointsOnNet.size() == 3) { - float minx, maxx, miny, maxy; - - if (pointsOnNet[0].x < pointsOnNet[1].x) { - minx = pointsOnNet[0].x; - maxx = pointsOnNet[1].x; - } else { - minx = pointsOnNet[1].x; - maxx = pointsOnNet[0].x; - } - if (pointsOnNet[2].x < minx) { - minx = pointsOnNet[2].x; - } else if (pointsOnNet[2].x > maxx) { - maxx = pointsOnNet[2].x; - } - - if (pointsOnNet[0].y < pointsOnNet[1].y) { - miny = pointsOnNet[0].y; - maxy = pointsOnNet[1].y; - } else { - miny = pointsOnNet[1].y; - maxy = pointsOnNet[0].y; - } - if (pointsOnNet[2].y < miny) { - miny = pointsOnNet[2].y; - } else if (pointsOnNet[2].y > maxy) { - maxy = pointsOnNet[2].y; - } - - if (useWts) { - total += net->getWeight() * ((maxx - minx) + (maxy - miny)); - } else { - total += (maxx - minx) + (maxy - miny); - } - } else if (pointsOnNet.size() <= MAXD) { - for (unsigned i = 0; i < pointsOnNet.size(); ++i) { - flute_x[i] = static_cast(pointsOnNet[i].x); - flute_y[i] = static_cast(pointsOnNet[i].y); - } - Tree flutetree = flute(pointsOnNet.size(), flute_x, flute_y, ACCURACY); - if (useWts) { - total += net->getWeight() * static_cast(flutetree.length); - } else { - total += static_cast(flutetree.length); - } - free(flutetree.branch); - } else { - abkfatal(0, "Net too large to use Flute"); - } - } - - return total; -} -#endif - -float DB::evalArea(void) const -{ - BBox area; - itNode node; - Point P; - for (node = const_cast(this)->getNodes()->nodesBegin(); - node != const_cast(this)->getNodes()->nodesEnd(); - ++node) { - P.x = node->getX(); - P.y = node->getY(); - area.put(P); - P.x = node->getX() + node->getWidth(); - P.y = node->getY() + node->getHeight(); - area.put(P); - } - return (area.getXSize() * area.getYSize()); -} - -float DB::getXSize(void) const -{ - BBox xSize; - itNode node; - Point P; - for (node = const_cast(this)->getNodes()->nodesBegin(); - node != const_cast(this)->getNodes()->nodesEnd(); - ++node) { - P.x = node->getX(); - P.y = 0; - xSize.put(P); - P.x = node->getX() + node->getWidth(); - P.y = 0; - xSize.put(P); - } - return (xSize.getXSize()); -} - -float DB::getYSize(void) const -{ - BBox ySize; - itNode node; - Point P; - for (node = const_cast(this)->getNodes()->nodesBegin(); - node != const_cast(this)->getNodes()->nodesEnd(); - ++node) { - P.y = node->getY(); - P.x = 0; - ySize.put(P); - P.y = node->getY() + node->getHeight(); - P.x = 0; - ySize.put(P); - } - return (ySize.getYSize()); -} - -void DB::plot(const char* fileName, - float area, - float whitespace, - float aspectRatio, - float time, - float HPWL, - bool plotSlacks, - bool plotNets, - bool plotNames, - bool fixedOutline, - float ll, - float ly, - float ux, - float uy) const -{ - float x = 0; - float y = 0; - float w = 0; - float h = 0; - float nodesArea = getNodesArea(); - float starDelta = sqrt(nodesArea) / 200; - itNode it; - - cout << "OutPut Plot file is " << fileName << endl; - ofstream gpOut(fileName); - if (!gpOut.good()) { - cout << "Warning: output file " << fileName << " can't be opened" << endl; - } - // gpOut <<"set terminal png size 1024,768" << endl; - - gpOut << "#Use this file as a script for gnuplot" << endl; - gpOut << "#(See http://www.gnuplot.info/ for details)" << endl; - gpOut << "set nokey" << endl; - - gpOut << "set size ratio -1" << endl; - gpOut << "set title ' " << fileName << " area= " << area - << " WS= " << whitespace << "%" - << " AR= " << aspectRatio << " time= " << time << "s" - << " HPWL= " << HPWL << endl - << endl; - - gpOut << "# Uncomment these two lines starting with \"set\"" << endl; - gpOut << "# to save an EPS file for inclusion into a latex document" - << endl; - gpOut << "# set terminal postscript eps color solid 10" << endl; - gpOut << "# set output \"out.eps\"" << endl << endl << endl; - - gpOut << "# Uncomment these two lines starting with \"set\"" << endl; - gpOut << "# to save a PS file for printing" << endl; - gpOut << "# set terminal postscript portrait color solid 8" << endl; - gpOut << "# set output \"out.ps\"" << endl << endl << endl; - - if (fixedOutline) { - gpOut << "set xrange[" << ll << ":" << ux << "]" << endl; - gpOut << "set yrange[" << ly << ":" << uy << "]" << endl; - } - - if (plotNames) { - for (it = _nodes->nodesBegin(); it != _nodes->nodesEnd(); ++it) { - gpOut << "set label '" << it->getName() << "(" - << (it - _nodes->nodesBegin()) << ")" - << "'noenhanced at " << it->getX() + it->getWidth() / 5 << " , " - << it->getY() + it->getHeight() / 4 << endl; - } - - // plot terminals only when Net is plotted - if (plotNets) { - for (it = _nodes->terminalsBegin(); it != _nodes->terminalsEnd(); ++it) { - gpOut << "set label \"" << it->getName() << "\" at " - << it->getX() + it->getWidth() / 4 << " , " - << it->getY() + it->getHeight() / 4 << endl; - } - } - } - - if (plotSlacks) { - for (it = _nodes->nodesBegin(); it != _nodes->nodesEnd(); ++it) { - float xSlack = it->getslackX(); - float ySlack = it->getslackY(); - if (xSlack < 1e-5) - xSlack = 0; - if (ySlack < 1e-5) - ySlack = 0; - - gpOut.precision(4); - gpOut << "set label \"x " << xSlack << "\" at " - << it->getX() + it->getWidth() / 6 << " , " - << it->getY() + it->getHeight() / 2 << endl; - gpOut << "set label \"y " << ySlack << "\" at " - << it->getX() + it->getWidth() / 6 << " , " - << it->getY() + it->getHeight() * 3 / 4 << endl; - } - } - - int objCnt = 0; - // Blockage drawing - for (it = _obstacles->nodesBegin(); it != _obstacles->nodesEnd(); ++it) { - x = it->getX(); - y = it->getY(); - w = it->getWidth(); - h = it->getHeight(); - - gpOut << "set object " << ++objCnt << " rect from " << x << "," << y - << " to " << x + w << "," << y + h << " fc rgb \"gold\"" << endl; - } - - gpOut.precision(6); - - // HALO drawing - for (it = _nodes->nodesBegin(); it != _nodes->nodesEnd(); ++it) { - x = it->getX(); - y = it->getY(); - - x = (x - it->getHaloX() >= 0) ? x - it->getHaloX() : 0; - y = (y - it->getHaloY() >= 0) ? y - it->getHaloY() : 0; - - float ux = it->getWidth() + it->getX() + it->getHaloX(); - float uy = it->getHeight() + it->getY() + it->getHaloY(); - - // gpOut<nodesBegin(); it != _nodes->nodesEnd(); ++it) { - x = it->getX(); - y = it->getY(); - w = it->getWidth(); - h = it->getHeight(); - - // gpOut<netsBegin(); net != _nets->netsEnd(); ++net) { - Point starPoint; - starPoint.x = 0; - starPoint.y = 0; - unsigned netDegree = 0; - for (netPin = net->pinsBegin(); netPin != net->pinsEnd(); netPin++) { - Node* nodep; - if (!netPin->getType()) // if not terminal - nodep = &_nodes->getNode(netPin->getNodeIndex()); - else - nodep = &_nodes->getTerminal(netPin->getNodeIndex()); - Node node = *nodep; - - width = node.getWidth(); - height = node.getHeight(); - absOffsetX = width / 2 + (netPin->getXOffset() * width); - absOffsetY = height / 2 + (netPin->getYOffset() * height); - starPoint.x += node.getX() + absOffsetX; - starPoint.y += node.getY() + absOffsetY; - ++netDegree; - } - - if (netDegree != 0) { - starPoint.x /= netDegree; - starPoint.y /= netDegree; - for (netPin = net->pinsBegin(); netPin != net->pinsEnd(); netPin++) { - Node* nodep; - if (!netPin->getType()) - nodep = &_nodes->getNode(netPin->getNodeIndex()); - else - nodep = &_nodes->getTerminal(netPin->getNodeIndex()); - Node node = *nodep; - - width = node.getWidth(); - height = node.getHeight(); - absOffsetX = width / 2 + (netPin->getXOffset() * width); - absOffsetY = height / 2 + (netPin->getYOffset() * height); - gpOut << starPoint.x << " " << starPoint.y << endl; - gpOut << node.getX() + absOffsetX << " " << node.getY() + absOffsetY - << endl; - gpOut << starPoint.x << " " << starPoint.y << endl << endl; - - gpOut << starPoint.x - starDelta << " " << starPoint.y << endl; - gpOut << starPoint.x << " " << starPoint.y + starDelta << endl; - gpOut << starPoint.x + starDelta << " " << starPoint.y << endl; - gpOut << starPoint.x << " " << starPoint.y - starDelta << endl; - gpOut << starPoint.x - starDelta << " " << starPoint.y << endl - << endl; - } - } else { - cout << "Warning: net with zero degree detected." << endl; - } - } - } - gpOut << "EOF" << endl << endl; - gpOut << "pause -1 'Press any key' " << endl; - gpOut.close(); -} - -void DB::saveCapo(const char* baseFileName, - const BBox& nonTrivialBBox, - float reqdAR, - float reqdWS) const -{ - cout << "Saving in Capo Format " << baseFileName << endl; - _nodes->saveCapoNodes(baseFileName); - _nodes->saveCapoPl(baseFileName); - saveCapoNets(baseFileName); - _nodes->saveCapoScl(baseFileName, reqdAR, reqdWS, nonTrivialBBox); - - // check for soft blocks - bool anySoft = false; - for (unsigned i = 0; i < getNumNodes(); ++i) { - if (isNodeSoft(i)) { - anySoft = true; - break; - } - } - - if (anySoft) { - _nodes->saveNodes(baseFileName); - } - - // save the aux file now - ofstream aux(string(baseFileName) + ".aux"); - aux << "RowBasedPlacement : " << baseFileName << ".nodes " << baseFileName - << ".nets "; - if (anySoft) { - aux << baseFileName << ".blocks "; - } - aux << baseFileName << ".pl " << baseFileName << ".scl "; - aux << endl; - aux.close(); -} - -void DB::save(const char* baseFileName) const -{ - cout << "Saving in Floorplan Format " << baseFileName << endl; - _nodes->saveNodes(baseFileName); - _nodes->savePl(baseFileName); - saveNets(baseFileName); - saveWts(baseFileName); -} - -void DB::saveCapoNets(const char* baseFileName) const -{ - Nets* nets; - nets = const_cast(this)->getNets(); - float absOffsetX; - float absOffsetY; - float width; - float height; - float temp; - int nodeIndex; - - ofstream file(string(baseFileName) + ".nets"); - - file << "UCLA nets 1.0" << endl << endl << endl; - file << "NumNets : " << nets->getNumNets() << endl; - file << "NumPins : " << nets->getNumPins() << endl << endl; - - itNet net; - itPin pin; - for (net = nets->netsBegin(); net != nets->netsEnd(); ++net) { - file << "NetDegree : " << net->_pins.size() << "\t" << net->getName() - << endl; - for (pin = net->pinsBegin(); pin != net->pinsEnd(); ++pin) { - nodeIndex = pin->getNodeIndex(); - if (!pin->getType()) // if not terminal - { - Node& node = _nodes->getNode(nodeIndex); - width = node.getWidth(); - height = node.getHeight(); - } else { - Node& node = _nodes->getTerminal(nodeIndex); - width = node.getWidth(); - height = node.getHeight(); - } - if (int(pin->getOrient()) % 2 == 1) { - temp = width; - width = height; - height = temp; - } - absOffsetX = (pin->getOrigXOffset() * width); - absOffsetY = (pin->getOrigYOffset() * height); - - file << "\t" << pin->getName() << " B : \t" << absOffsetX << "\t " - << absOffsetY << endl; - } - } - file.close(); -} - -void DB::saveNets(const char* baseFileName) const -{ - Nets* nets; - nets = const_cast(this)->getNets(); - - ofstream file(string(baseFileName) + ".nets"); - - file << "UCLA nets 1.0" << endl << endl << endl; - file << "NumNets : " << nets->getNumNets() << endl; - file << "NumPins : " << nets->getNumPins() << endl << endl; - - itNet net; - itPin pin; - for (net = nets->netsBegin(); net != nets->netsEnd(); ++net) { - file << "NetDegree : " << net->_pins.size() << " " << net->getName() - << endl; - for (pin = net->pinsBegin(); pin != net->pinsEnd(); ++pin) { - file << pin->getName() << " B : \t%" << pin->getOrigXOffset() * 100 - << "\t %" << pin->getOrigYOffset() * 100 << endl; - } - } - file.close(); -} - -void DB::saveWts(const char* baseFileName) const -{ - Nets* nets; - nets = const_cast(this)->getNets(); - - ofstream file(string(baseFileName) + ".wts"); - - file << "UCLA wts 1.0" << endl << endl << endl; - - itNet net; - // itPin pin; - for (net = nets->netsBegin(); net != nets->netsEnd(); ++net) { - file << net->getName() << "\t" << net->getWeight() << endl; - } - file.close(); -} - -void DB::shiftDesign(const parquetfp::Point& offset) -{ - itNode node; - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - node->putX(node->getX() + offset.x); - node->putY(node->getY() + offset.y); - } -} - -void DB::shiftTerminals(const parquetfp::Point& offset) -{ - for (itNode term = _nodes->terminalsBegin(); term != _nodes->terminalsEnd(); - ++term) { - term->putX(term->getX() + offset.x); - term->putY(term->getY() + offset.y); - } -} - -void DB::expandDesign(float maxWidth, float maxHeight) -{ - float currWidth = getXMax(); - float currHeight = getYMax(); - if (currWidth > maxWidth && currHeight > maxHeight) - return; - - float xExpRatio = 1; - float yExpRatio = 1; - - if (currWidth < maxWidth) - xExpRatio = maxWidth / currWidth; - if (currHeight < maxHeight) - yExpRatio = maxHeight / currHeight; - - itNode node; - float newLoc; - for (node = getNodes()->nodesBegin(); node != getNodes()->nodesEnd(); - ++node) { - newLoc = node->getX() * xExpRatio; - node->putX(newLoc); - newLoc = node->getY() * yExpRatio; - node->putY(newLoc); - } -} - -void DB::saveInBestCopy(void) -{ - successAR = 1; - itNode node; - itNode nodeBest; - nodeBest = _nodesBestCopy->nodesBegin(); - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); node++) { - nodeBest->putX(node->getX()); - nodeBest->putY(node->getY()); - nodeBest->putWidth(node->getWidth()); - nodeBest->putHeight(node->getHeight()); - nodeBest->putOrient(node->getOrient()); - nodeBest++; - } -} - -void DB::saveBestCopyPl(char* fileName) const -{ - _nodesBestCopy->savePl(fileName); -} - -void DB::markTallNodesAsMacros(float maxHeight) -{ - itNode node; - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - if (node->getHeight() > maxHeight) - node->updateMacroInfo(true); - } -} - -void DB::reduceCoreCellsArea(float layoutArea, float maxWS) -{ - float currNodesArea = getNodesArea(); - float currWS = (layoutArea - currNodesArea) / currNodesArea; - - if (currWS > maxWS) - return; - - float macroArea = 0; - itNode node; - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - if (node->isMacro()) - macroArea += node->getHeight() * node->getWidth(); - } - - float newCtoOldCRatio - = ((layoutArea - (1 + maxWS) * macroArea) * (1 + currWS)) - / ((layoutArea - (1 + currWS) * macroArea) * (1 + maxWS)); - - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - if (!node->isMacro()) { - float nodeWidth = node->getWidth(); - float newNodeWidth = nodeWidth * newCtoOldCRatio; - node->putWidth(newNodeWidth); - } - } - - _initArea = false; - float newNodesArea = getNodesArea(); - - currWS = (layoutArea - newNodesArea) / newNodesArea; -} - -float DB::getXMax(void) -{ - float xMax = -numeric_limits::max(); - for (itNode node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - xMax = max(xMax, node->getX() + node->getWidth()); - } - - return xMax; -} - -float DB::getXMaxWMacroOnly(void) -{ - float xMax = -numeric_limits::max(); - for (itNode node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - if (node->isMacro() && node->needsFP()) { - xMax = max(xMax, node->getX() + node->getWidth()); - } - } - - return xMax; -} - -float DB::getXSizeWMacroOnly(void) -{ - BBox xSize; - itNode node; - Point P; - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - if (node->isMacro() && node->needsFP()) { - P.x = node->getX(); - P.y = 0; - xSize.put(P); - P.x = node->getX() + node->getWidth(); - P.y = 0; - xSize.put(P); - } - } - if (xSize.isValid()) - return (xSize.getXSize()); - else - return 0; -} - -float DB::getYMax(void) -{ - float yMax = -numeric_limits::max(); - for (itNode node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - yMax = max(yMax, node->getY() + node->getHeight()); - } - - return yMax; -} - -float DB::getYMaxWMacroOnly(void) -{ - float yMax = -numeric_limits::max(); - for (itNode node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - if (node->isMacro() && node->needsFP()) { - yMax = max(yMax, node->getY() + node->getHeight()); - } - } - - return yMax; -} - -float DB::getYSizeWMacroOnly(void) -{ - BBox ySize; - itNode node; - Point P; - for (node = _nodes->nodesBegin(); node != _nodes->nodesEnd(); ++node) { - if (node->isMacro() && node->needsFP()) { - P.y = node->getY(); - P.x = 0; - ySize.put(P); - P.y = node->getY() + node->getHeight(); - P.x = 0; - ySize.put(P); - } - } - if (ySize.isValid()) - return (ySize.getYSize()); - else - return 0; -} - -// -------------------------------------------------------- -#ifdef USEFLUTE -void DB::shiftOptimizeDesign(float outlineWidth, - float outlineHeight, - bool scaleTerms, - bool useSteiner, - int verb) -#else -void DB::shiftOptimizeDesign(float outlineWidth, - float outlineHeight, - bool scaleTerms, - int verb) -#endif -{ - if (_nodes->getNumTerminals() == 0) - return; - - // original bottomLeft corner of the floorplan - Point outlineBottomLeft(getBottomLeftCorner()); - Point outlineTopRight; - outlineTopRight.x = outlineBottomLeft.x + outlineWidth; - outlineTopRight.y = outlineBottomLeft.y + outlineHeight; - -#ifdef USEFLUTE - shiftOptimizeDesign( - outlineBottomLeft, outlineTopRight, scaleTerms, useSteiner, verb); -#else - shiftOptimizeDesign(outlineBottomLeft, outlineTopRight, scaleTerms, verb); -#endif -} -// -------------------------------------------------------- -#ifdef USEFLUTE -void DB::shiftOptimizeDesign(const parquetfp::Point& outlineBottomLeft, - const parquetfp::Point& outlineTopRight, - bool scaleTerms, - bool useSteiner, - Verbosity verb) -#else -void DB::shiftOptimizeDesign(const parquetfp::Point& outlineBottomLeft, - const parquetfp::Point& outlineTopRight, - bool scaleTerms, - int verb) -#endif - -{ - float designWidth = getXMax(); - float designHeight = getYMax(); - - float outlineWidth = outlineTopRight.x - outlineBottomLeft.x; - float outlineHeight = outlineTopRight.y - outlineBottomLeft.y; - - if (designWidth < outlineWidth && designHeight < outlineHeight) { - Point currBottomLeft(getBottomLeftCorner()); - Point minOffset; - minOffset.x = outlineBottomLeft.x - currBottomLeft.x; - minOffset.y = outlineBottomLeft.y - currBottomLeft.y; - - Point currTopRight(getTopRightCorner()); - Point maxOffset; - maxOffset.x = outlineTopRight.x - currTopRight.x; - maxOffset.y = outlineTopRight.y - currTopRight.y; - - float xRangeStart = getOptimalRangeStart(true); - xRangeStart = max(xRangeStart, minOffset.x); - xRangeStart = min(xRangeStart, maxOffset.x); - - float yRangeStart = getOptimalRangeStart(false); - yRangeStart = max(yRangeStart, minOffset.y); - yRangeStart = min(yRangeStart, maxOffset.y); - - // the magnitude of shifting (not the final pos) - Point offset; - offset.x = xRangeStart; - offset.y = yRangeStart; - - if (verb > 0) { - printf("currBBox: %.2f %.2f %.2f %.2f\n", - currBottomLeft.x, - currBottomLeft.y, - currTopRight.x, - currTopRight.y); - printf("outBBox: %.2f %.2f %.2f %.2f\n", - outlineBottomLeft.x, - outlineBottomLeft.y, - outlineTopRight.x, - outlineTopRight.y); - cout << "offset.x: " << offset.x << " offset.y: " << offset.y << endl; - } - - bool useWts = true; -#ifdef USEFLUTE - float origHPWL = evalHPWL(useWts, scaleTerms, useSteiner); -#else - float origHPWL = evalHPWL(useWts, scaleTerms); -#endif - if (verb > 0) - cout << "HPWL before shifting: " << origHPWL << endl; - - shiftDesign(offset); - -#ifdef USEFLUTE - float newHPWL = evalHPWL(useWts, scaleTerms, useSteiner); -#else - float newHPWL = evalHPWL(useWts, scaleTerms); -#endif - if (verb > 0) - cout << "HPWL after shifting: " << newHPWL << endl; - - if (origHPWL < newHPWL) { - if (verb > 0) - cout << "Undo-ing the shift..." << endl; - offset.x = -offset.x; - offset.y = -offset.y; - shiftDesign(offset); - } - -#ifdef USEFLUTE - float finalHPWL = evalHPWL(useWts, scaleTerms, useSteiner); -#else - float finalHPWL = evalHPWL(useWts, scaleTerms); -#endif - if (verb > 0) - cout << "Final HPWL: " << finalHPWL << endl; - } else { - /* Saurabh: The below code is not general enough. only valid - when relevant nodes are marked as macros. So I am connenting - it out. only used for printing out a message anyway */ - /* - float tempXSize = getXMaxWMacroOnly(); - float tempYSize = getYMaxWMacroOnly(); - if(tempXSize > 1e-5 && tempYSize > 1e-5) - { - designHeight = tempYSize; - designWidth = tempXSize; - } - if (!(designWidth <= outlineWidth && - designHeight <= outlineHeight)) - */ - if (verb > 0) - cout << "No shifting for HPWL minimization is performed. " << endl; - } -} -// -------------------------------------------------------- -float DB::getOptimalRangeStart(bool horizontal) -{ - float center = (horizontal) ? getXMax() * 0.5f : getYMax() * 0.5f; - - vector endPoints; - for (itNode currBlk = _nodes->nodesBegin(); currBlk != _nodes->nodesEnd(); - currBlk++) { - float currNodeLength - = (horizontal) ? currBlk->getWidth() : currBlk->getHeight(); - - float currNodeLocAbs = (horizontal) ? currBlk->getX() : currBlk->getY(); - - for (itNodePin currNodePin = currBlk->pinsBegin(); - currNodePin != currBlk->pinsEnd(); - currNodePin++) { - // find the net in which this pin lies - unsigned currNetIndex = currNodePin->netIndex; - Net& currNet = _nets->getNet(currNetIndex); - - // index number for the pin in its net - unsigned currPinOffset = currNodePin->pinOffset; - - // pins offset from the center - float pinOffset = (horizontal) - ? currNet.getPin(currPinOffset).getXOffset() - : currNet.getPin(currPinOffset).getYOffset(); - - // absolute location of the pin - float pinLocationAbs - = currNodeLocAbs + currNodeLength / 2 + (currNodeLength * pinOffset); - - // relative location wrt center of the FLOORPLAN - float pinLocationWrtCenter = pinLocationAbs - center; - - // span of the net in this direction wrt this pin - float spanStart = numeric_limits::max(); - float spanEnd = -numeric_limits::max(); - - for (itPin currPad = currNet.pinsBegin(); currPad != currNet.pinsEnd(); - currPad++) { - if (currPad->getType()) // true: pad/terminal - { - int padIndex = currPad->getNodeIndex(); - const Node& currTerm = _nodes->getTerminal(padIndex); - - float padLoc = (horizontal) ? currTerm.getX() : currTerm.getY(); - - float padAdjusted = padLoc - pinLocationWrtCenter; - - spanStart = min(spanStart, padAdjusted); - spanEnd = max(spanEnd, padAdjusted); - } - } // end for each pin in currNet - - if (spanStart <= spanEnd) { - endPoints.push_back(spanStart); - endPoints.push_back(spanEnd); - } - } // end for each pin in currNode - } // end for each node - - sort(endPoints.begin(), endPoints.end()); - - // return the median, assuming endPoints[] has even size - int endPointNum = endPoints.size(); - if (endPointNum < 2) { - fpwarn(0, "Could not find optimal ranges."); - return 0; - } - fpwarn(endPointNum % 2 == 0, "size of endPoints is not even."); - return (endPoints[(endPointNum / 2) - 1] + endPoints[endPointNum / 2]) / 2; -} - -void DB::resizeHardBlocks(float ratio) -{ - float factor = sqrt(ratio); - - for (itNode currBlk = _nodes->nodesBegin(); currBlk != _nodes->nodesEnd(); - ++currBlk) { - if (!currBlk->getType() - && currBlk->isHard()) // examine only hard blocks that are not pads - { - currBlk->putArea(ratio * currBlk->getArea()); - currBlk->putHeight(factor * currBlk->getHeight()); - currBlk->putWidth(factor * currBlk->getWidth()); - } - } - - _area = _nodes->getNodesArea(); -} - -// -------------------------------------------------------- - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/DB.h b/src/mpl/src/ParquetFP/src/DB.h deleted file mode 100644 index 7b58457d962..00000000000 --- a/src/mpl/src/ParquetFP/src/DB.h +++ /dev/null @@ -1,479 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2007 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef DB_H -#define DB_H - -#include -#include -#include -#include - -#include "FPcommon.h" -#include "Nets.h" -#include "Nodes.h" - -namespace parquetfp { -class DB -{ - protected: - Nodes* _nodes; - Nets* _nets; - - Nodes* _nodesBestCopy; - - Nodes* _obstacles; // - float _obstacleFrame[2]; // width, height - - // cached copies of sum(area of all nodes) - mutable float _area; - mutable bool _initArea; - - float _rowHeight; // rowHeight to snap the soln to - float _siteSpacing; // site spacing to snap the soln to - - BBox termBBox; - void buildTermBBox(void); - - std::vector _scaledLocs; - void scaleTerminals(void); - - inline float getScaledX(const Node& node) const - { - return _scaledLocs[node.getIndex()].x; - } - - inline float getScaledY(const Node& node) const - { - return _scaledLocs[node.getIndex()].y; - } - - public: - bool successAR; - DB(const std::string& baseName); - DB(DB* db, std::vector& subBlocksIndices, Point& dbLoc, float reqdAR); - DB(); - - // makes a copy of db2. compresses multiple 2-pin nets - // between modules regardless of pin-offset. use only when pin-offsets - // are inconsequential - DB(DB& db2, bool compressDB = false); - - virtual ~DB(); - - DB& operator=(DB& db2); - void clean(void); - - unsigned getNumNodes(void) const; - Nodes* getNodes(void); - Nets* getNets(void); - - Nodes* getObstacles(void); - float* getObstacleFrame() { return _obstacleFrame; } - unsigned getNumObstacles(void) const; - void addObstacles(Nodes* obstacles, float obstacleFrame[2]); - - std::vector getNodeWidths() const; - std::vector getNodeHeights() const; - std::vector getXLocs() const; - std::vector getYLocs() const; - - // hhchan: more efficient (safer) getters - inline float getNodeArea(unsigned index) const; - inline float getNodeWidth(unsigned index) const; - inline float getNodeHeight(unsigned index) const; - inline float getXLoc(unsigned index) const; - inline float getYLoc(unsigned index) const; - inline ORIENT getOrient(unsigned index) const; - - inline float getNodeMaxAR(unsigned index) const; - inline float getNodeMinAR(unsigned index) const; - inline float getNodeAR(unsigned index) const; - - inline bool isMacro(unsigned index) const; - inline bool isOrientFixed(unsigned index) const; - inline bool isNodeSoft(unsigned index) const; - inline bool isNodeHard(unsigned index) const; - - // hhchan: safer setters - inline void setNodeWidth(unsigned index, float width); - inline void setNodeHeight(unsigned index, float height); - inline void setNodeAR(unsigned index, float ar); - - inline void setXLoc(unsigned index, float newX); - inline void setYLoc(unsigned index, float newY); - inline void setOrient(unsigned index, - ORIENT newOrient, - bool ignoreNets = false); - inline void setOrient(unsigned index, - const char* newOrient, - bool ignoreNets = false); - - Point getBottomLeftCorner() const; - Point getTopRightCorner() const; - - // pack to one of the corners - // - use only interface fcns of SPeval, hence not efficient at all - // - not meant to used in the critical loop - // WARNING: assume the vectors of of size [NUM_CORNERS][getNumNodes()] - enum Corner - { - BOTTOM, - TOP, - LEFT, - RIGHT, - BOTTOM_LEFT, - BOTTOM_RIGHT, - TOP_LEFT, - TOP_RIGHT, - LEFT_BOTTOM, - RIGHT_BOTTOM, - LEFT_TOP, - RIGHT_TOP, - NUM_CORNERS - }; - inline static std::string toString(Corner corner); - void packToCorner(std::vector>& xlocsAt, - std::vector>& ylocsAt) const; - - // optimize HPWL by the corner -#ifdef USEFLUTE - void cornerOptimizeDesign(bool scaleTerms, bool minWL, bool useSteiner); -#else - void cornerOptimizeDesign(bool scaleTerms, bool minWL); -#endif - - // get total area of ALL nodes - float getNodesArea(void) const; - float getRowHeight(void) const; - float getSiteSpacing(void) const; - void setRowHeight(float rowHeight); - void setSiteSpacing(float siteSpacing); - - // slim: xloc, yloc, orient, width, height (but not the orig's) - // location: xloc, yloc - // dimensions: width, height (but not the orig's) - // TRUE ~ succeed in updating, FALSE otherwise - inline bool updateNodeSlim(int index, const Node& newNode); - inline bool updateNodeLocation(int index, float xloc, float yloc); - inline bool updateNodeDimensions(int index, float width, float height); - - void updatePlacement(const std::vector& xloc, - const std::vector& yloc); - void initPlacement(const Point& loc); - void updateSlacks(const std::vector& xSlack, - const std::vector& ySlack); - - // plot in gnuplot format - void plot(const char* fileName, - float area, - float whitespace, - float aspectRatio, - float time, - float HPWL, - bool plotSlacks, - bool plotNets, - bool plotNames, - bool fixedOutline = false, - float lx = FLT_MAX, - float ly = FLT_MAX, - float ux = FLT_MIN, - float uy = FLT_MIN) const; - - // save the data in Capo format - void saveCapo(const char* baseFileName, - const BBox&, - float reqdAR = 1, - float reqdWS = 30) const; - void saveCapoNets(const char* baseFileName) const; - - // save data in floorplan format - void save(const char* baseFileName) const; - void saveNets(const char* baseFileName) const; - void saveWts(const char* baseFileName) const; - - void saveBestCopyPl(char* baseFileName) const; - void saveInBestCopy(void); // non-const since it modifies "successAR" - -#ifdef USEFLUTE - float evalHPWL(bool useWts, - bool scaleTerms, - bool useSteiner); // assumes that placement is updated - float evalSteiner(bool useWts, bool scaleTerms); -#else - float evalHPWL(bool useWts, - bool scaleTerms); // assumes that placement is updated -#endif - float evalArea(void) const; // assumes that placement is updated - float getXSize(void) const; - float getYSize(void) const; - float getAvgHeight(void) const; - - // optimize the BL-corner of the design -#ifdef USEFLUTE - void shiftOptimizeDesign(float outlineWidth, - float outlineHeight, - bool scaleTerms, - bool useSteiner, - Verbosity verb); // deduce BL-corner from DB - void shiftOptimizeDesign(const Point& bottomLeft, - const Point& topRight, - bool scaleTerms, - bool useSteiner, - Verbosity verb); -#else - void shiftOptimizeDesign(float outlineWidth, - float outlineHeight, - bool scaleTerms, - int verb); // deduce BL-corner from DB - void shiftOptimizeDesign(const Point& bottomLeft, - const Point& topRight, - bool scaleTerms, - int verb); -#endif - - void shiftDesign( - const Point& offset); // shift the entire placement by an offset - void shiftTerminals(const Point& offset); - - void expandDesign(float maxWidth, float maxHeight); - // expand entire design to occupy the new dimensions. only locations of blocks - // are altered - - // marks all nodes with height > avgHeight as macros - void markTallNodesAsMacros(float maxHeight); - - // reduce the core cells area of design excluding macros to maxWS whitespace - // assumes macros are marked using DB::markTallNodesAsMacros() - void reduceCoreCellsArea(float layoutArea, float maxWS); - - // this function gets the dimension of the FP only considering the macros - float getXSizeWMacroOnly(); - float getYSizeWMacroOnly(); - - float getXMax(); - float getYMax(); - - float getXMaxWMacroOnly(); - float getYMaxWMacroOnly(); - - void resizeHardBlocks(float ratio); - - private: - // help function of shiftOptimizeDesign() - float getOptimalRangeStart(bool isHorizontal); - void _setUpPinOffsets(void) const; -}; - -// --------------- -// IMPLEMENTATIONS -// --------------- -float DB::getNodeArea(unsigned index) const -{ - return getNodeWidth(index) * getNodeHeight(index); -} - -float DB::getNodeWidth(unsigned index) const -{ - return _nodes->getNodeWidth(index); -} - -float DB::getNodeHeight(unsigned index) const -{ - return _nodes->getNodeHeight(index); -} - -float DB::getXLoc(unsigned index) const -{ - return (_nodes->getNode(index)).getX(); -} - -float DB::getYLoc(unsigned index) const -{ - return (_nodes->getNode(index)).getY(); -} - -ORIENT DB::getOrient(unsigned index) const -{ - return (_nodes->getNode(index)).getOrient(); -} - -float DB::getNodeMinAR(unsigned index) const -{ - return (_nodes->getNode(index)).getminAR(); -} - -float DB::getNodeMaxAR(unsigned index) const -{ - return (_nodes->getNode(index)).getmaxAR(); -} - -float DB::getNodeAR(unsigned index) const -{ - return getNodeWidth(index) / getNodeHeight(index); -} - -bool DB::isMacro(unsigned index) const -{ - return (_nodes->getNode(index)).isMacro(); -} - -bool DB::isOrientFixed(unsigned index) const -{ - return (_nodes->getNode(index)).isOrientFixed(); -} - -bool DB::isNodeSoft(unsigned index) const -{ - return getNodeMaxAR(index) - getNodeMinAR(index) > 1e-6; -} - -bool DB::isNodeHard(unsigned index) const -{ - return !isNodeSoft(index); -} -// ----------------------------------------------------- -void DB::setNodeWidth(unsigned index, float width) -{ - (_nodes->getNode(index)).putWidth(width); -} - -void DB::setNodeHeight(unsigned index, float height) -{ - (_nodes->getNode(index)).putHeight(height); -} - -void DB::setNodeAR(unsigned index, float ar) -{ - const float area = getNodeArea(index); - setNodeWidth(index, sqrt(area * ar)); - setNodeHeight(index, sqrt(area / ar)); -} - -void DB::setXLoc(unsigned index, float newX) -{ - (_nodes->getNode(index)).putX(newX); -} - -void DB::setYLoc(unsigned index, float newY) -{ - (_nodes->getNode(index)).putY(newY); -} - -void DB::setOrient(unsigned index, ORIENT newOrient, bool ignoreNets) -{ - if (ignoreNets) - (_nodes->getNode(index)).putOrient(newOrient); - else - _nodes->changeOrient(index, newOrient, *_nets); -} - -void DB::setOrient(unsigned index, const char* newOrient, bool ignoreNets) -{ - setOrient(index, toOrient(const_cast(newOrient)), ignoreNets); -} -// ----------------------------------------------------- -bool DB::updateNodeSlim(int index, const Node& newNode) -{ - if (index < int(_nodes->getNumNodes())) { - Node& oldNode = _nodes->getNode(index); - - oldNode.putX(newNode.getX()); - oldNode.putY(newNode.getY()); - oldNode.changeOrient(newNode.getOrient(), *_nets); - oldNode.putWidth(newNode.getWidth()); - oldNode.putHeight(newNode.getHeight()); - return true; - } else - return false; -} -// ----------------------------------------------------- -bool DB::updateNodeLocation(int index, float xloc, float yloc) -{ - if (index < int(_nodes->getNumNodes())) { - Node& oldNode = _nodes->getNode(index); - oldNode.putX(xloc); - oldNode.putY(yloc); - return true; - } else - return false; -} -// ----------------------------------------------------- -bool DB::updateNodeDimensions(int index, float width, float height) -{ - if (index < int(_nodes->getNumNodes())) { - Node& oldNode = _nodes->getNode(index); - - oldNode.putWidth(width); - oldNode.putHeight(height); - return true; - } else - return false; -} -// ----------------------------------------------------- -std::string DB::toString(DB::Corner corner) -{ - switch (corner) { - case BOTTOM: - return "bottom"; - case TOP: - return "top"; - case LEFT: - return "left"; - case RIGHT: - return "right"; - case BOTTOM_LEFT: - return "bottom-left"; - case BOTTOM_RIGHT: - return "bottom-right"; - case TOP_LEFT: - return "top-left"; - case TOP_RIGHT: - return "top-right"; - case LEFT_BOTTOM: - return "left-bottom"; - case RIGHT_BOTTOM: - return "right-bottom"; - case LEFT_TOP: - return "left-top"; - case RIGHT_TOP: - return "right-top"; - default: - return "INVALID CORNER"; - } -} -// ----------------------------------------------------- - -} // namespace parquetfp -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/FPcommon.cxx b/src/mpl/src/ParquetFP/src/FPcommon.cxx deleted file mode 100644 index 6fbb7574da7..00000000000 --- a/src/mpl/src/ParquetFP/src/FPcommon.cxx +++ /dev/null @@ -1,216 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2007 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "FPcommon.h" -using std::cout; -using std::endl; -using std::ostream; - -ostream& parquetfp::operator<<(ostream& out, const ORIENT& orient) -{ - if (orient == N) - out << "N"; - else if (orient == E) - out << "E"; - else if (orient == S) - out << "S"; - else if (orient == W) - out << "W"; - else if (orient == FN) - out << "FN"; - else if (orient == FE) - out << "FE"; - else if (orient == FS) - out << "FS"; - else if (orient == FW) - out << "FW"; - else - cout << "ERROR in outputting orientations" << endl; - return out; -} - -bool parquetfp::operator<(const parquetfp::Point& a, const parquetfp::Point& b) -{ - if (a.x < b.x) - return true; - if (a.x > b.x) - return false; - return (a.y < b.y); -} - -bool parquetfp::operator==(const parquetfp::Point& a, const parquetfp::Point& b) -{ - return (a.x == b.x) && (a.y == b.y); -} - -parquetfp::BBox::BBox() -{ - _minX = (std::numeric_limits::max()); - _maxX = (-std::numeric_limits::max()); - _minY = (std::numeric_limits::max()); - _maxY = (-std::numeric_limits::max()); - _valid = 0; -} - -void parquetfp::BBox::clear(void) -{ - _minX = (std::numeric_limits::max()); - _maxX = (-std::numeric_limits::max()); - _minY = (std::numeric_limits::max()); - _maxY = (-std::numeric_limits::max()); - _valid = 0; -} - -void parquetfp::BBox::put(const Point& point) -{ - if (point.x < _minX) - _minX = point.x; - if (point.x > _maxX) - _maxX = point.x; - if (point.y < _minY) - _minY = point.y; - if (point.y > _maxY) - _maxY = point.y; - _valid = 1; -} - -float parquetfp::BBox::getHPWL(void) const -{ - return ((_maxX - _minX) + (_maxY - _minY)); -} - -float parquetfp::BBox::getXSize(void) const -{ - return (_maxX - _minX); -} - -float parquetfp::BBox::getYSize(void) const -{ - return (_maxY - _minY); -} - -float parquetfp::BBox::getMinX(void) const -{ - return _minX; -} - -float parquetfp::BBox::getMinY(void) const -{ - return _minY; -} - -bool parquetfp::BBox::isValid(void) const -{ - return _valid; -} - -std::istream& parquetfp::eatblank(std::istream& i) -{ - while (i.peek() == ' ' || i.peek() == '\t') - i.get(); - return i; -} - -std::istream& parquetfp::skiptoeol(std::istream& i) -{ - while (!i.eof() && i.peek() != '\n' && i.peek() != '\r') - i.get(); - i.get(); - return i; -} - -bool parquetfp::needCaseChar(std::istream& i, char character) -{ - while (!i.eof() && i.peek() != character) - i.get(); - if (i.eof()) - return 0; - else - return 1; -} -std::istream& parquetfp::eathash(std::istream& i) -{ - return skiptoeol(i); -} - -parquetfp::ORIENT parquetfp::toOrient(char* orient) -{ - if (!strcmp(orient, "N")) - return N; - if (!strcmp(orient, "E")) - return E; - if (!strcmp(orient, "S")) - return S; - if (!strcmp(orient, "W")) - return W; - if (!strcmp(orient, "FN")) - return FN; - if (!strcmp(orient, "FE")) - return FE; - if (!strcmp(orient, "FS")) - return FS; - if (!strcmp(orient, "FW")) - return FW; - - cout << "ERROR: in converting char* to ORIENT" << endl; - return N; -} - -const char* parquetfp::toChar(ORIENT orient) -{ - if (orient == N) { - return ("N"); - } - if (orient == E) { - return ("E"); - } - if (orient == S) { - return ("S"); - } - if (orient == W) { - return ("W"); - } - if (orient == FN) { - return ("FN"); - } - if (orient == FE) { - return ("FE"); - } - if (orient == FS) { - return ("FS"); - } - if (orient == FW) { - return ("FW"); - } - cout << "ERROR: in converting ORIENT to char* " << endl; - return "N"; -} diff --git a/src/mpl/src/ParquetFP/src/FPcommon.h b/src/mpl/src/ParquetFP/src/FPcommon.h deleted file mode 100644 index 22ead42edca..00000000000 --- a/src/mpl/src/ParquetFP/src/FPcommon.h +++ /dev/null @@ -1,185 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2007 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef FPCOMMON -#define FPCOMMON - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace parquetfp { -enum ORIENT -{ - N, - E, - S, - W, - FN, - FE, - FS, - FW -}; - -std::ostream& operator<<(std::ostream&, const ORIENT&); - -struct ltstr -{ - bool operator()(const char* s1, const char* s2) const - { - return strcmp(s1, s2) < 0; - } -}; - -class Point -{ - public: - float x, y; - Point() : x(0.f), y(0.f) {} - Point(float x_, float y_) : x(x_), y(y_) {} - Point(const Point& orig) : x(orig.x), y(orig.y) {} -}; - -bool operator<(const Point& a, const Point& b); -bool operator==(const Point& a, const Point& b); - -class IntPoint -{ - public: - int x, y; - IntPoint() : x(0), y(0) {} - IntPoint(int x_, int y_) : x(x_), y(y_) {} - IntPoint(const IntPoint& orig) : x(orig.x), y(orig.y) {} -}; - -class BBox -{ - private: - float _minX; - float _maxX; - float _minY; - float _maxY; - - bool _valid; - - public: - // ctor - BBox(); - BBox(float minX, float minY, float maxX, float maxY) - : _minX(minX), - _maxX(maxX), - _minY(minY), - _maxY(maxY), - _valid(maxX >= minX && maxY >= minY) - { - } - - void put(const Point& point); - void clear(void); - float getHPWL(void) const; - float getXSize(void) const; - float getYSize(void) const; - float getMinX(void) const; - float getMinY(void) const; - bool isValid(void) const; -}; - -// global parsing functions -std::istream& eatblank(std::istream& i); - -std::istream& skiptoeol(std::istream& i); - -std::istream& eathash(std::istream& i); - -bool needCaseChar(std::istream& i, char character); - -// functions to manage the orientations -ORIENT toOrient(char* orient); -const char* toChar(ORIENT orient); - -// Lifted from ABKcommon - -inline bool equalFloat(const float a, const float b) -{ - // standard def of equality - if (a == b) - return true; - - float absdiff = std::abs(a - b); - const float fraction = 1.e-6f; - - // special case for a = 0 or b = 0 - if (((a == 0.) || (b == 0.)) && (absdiff < fraction)) - return true; - - float absa = std::abs(a); - float absb = std::abs(b); - - // difference insignificant compared to a and b - return ((absdiff < fraction * absa) && (absdiff < fraction * absb)); -} - -inline bool lessOrEqualFloat(const float a, const float b) -{ - return (a <= b) || equalFloat(a, b); -} - -inline bool lessThanFloat(const float a, const float b) -{ - return (a < b) && !equalFloat(a, b); -} - -#define fpwarn(CONDITION, ERRMESSAGE) \ - { \ - if (!(CONDITION)) { \ - std::cerr << std::endl << (ERRMESSAGE); \ - } \ - } - -#define fpfatal(CONDITION, ERRMESSAGE) \ - { \ - if (!(CONDITION)) { \ - std::cerr << std::endl << (ERRMESSAGE); \ - abort(); \ - } \ - } - -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/Net.cxx b/src/mpl/src/ParquetFP/src/Net.cxx deleted file mode 100644 index c9ee0dd3ac0..00000000000 --- a/src/mpl/src/ParquetFP/src/Net.cxx +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "Net.h" - -#include "FPcommon.h" -using namespace parquetfp; -using std::cout; -using std::endl; - -void pin::changeOrient(ORIENT newOrient) -{ - _orient = newOrient; - if (newOrient == N) { - _offset.x = _origOffset.x; - _offset.y = _origOffset.y; - } else if (newOrient == E) { - _offset.x = _origOffset.y; - _offset.y = -1 * _origOffset.x; - } else if (newOrient == S) { - _offset.x = -1 * _origOffset.x; - _offset.y = -1 * _origOffset.y; - } else if (newOrient == W) { - _offset.x = -1 * _origOffset.y; - _offset.y = _origOffset.x; - } else if (newOrient == FN) { - _offset.x = -1 * _origOffset.x; - _offset.y = _origOffset.y; - } else if (newOrient == FE) { - _offset.x = _origOffset.y; - _offset.y = _origOffset.x; - } else if (newOrient == FS) { - _offset.x = _origOffset.x; - _offset.y = -1 * _origOffset.y; - } else if (newOrient == FW) { - _offset.x = -1 * _origOffset.y; - _offset.y = -1 * _origOffset.x; - } else { - cout << "ERROR in changeOrient " << endl; - } -} diff --git a/src/mpl/src/ParquetFP/src/Net.h b/src/mpl/src/ParquetFP/src/Net.h deleted file mode 100644 index 16b8be7abcb..00000000000 --- a/src/mpl/src/ParquetFP/src/Net.h +++ /dev/null @@ -1,140 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef NET_H -#define NET_H - -#include -#include -#include - -#include "FPcommon.h" - -namespace parquetfp { - -class pin; -typedef std::vector::iterator itPin; -typedef std::vector::const_iterator itPinConst; - -// this class holds the pin offsets and pinindex on a particular node -class pin -{ - private: - Point _origOffset; // original offset wrt center. In relative terms - Point _offset; // offsets during iteration. to account for orientation - // changes - ORIENT _orient; // keeps track of orientation of the node - std::string _name; - bool _type; - int _nodeIndex; // index of the node in which the pin is located - int _netIndex; // index of net to which pin is attached - - public: - pin(const std::string name, - bool type, - float xoffset, - float yoffset, - int netIndex) - : _type(type), _nodeIndex(0) - { - // strncpy(_name,name,199); - //_name[199] = '\0'; - _name = name; - _origOffset.x = xoffset; - _origOffset.y = yoffset; - _offset.x = xoffset; - _offset.y = yoffset; - _orient = N; - _netIndex = netIndex; - } - pin() {} - - bool getType() const { return _type; } - const std::string getName(void) const { return _name; } - int getNodeIndex() const { return _nodeIndex; } - int getNetIndex() const { return _netIndex; } - void putNodeIndex(int nodeIndex) { _nodeIndex = nodeIndex; } - void putNetIndex(int netIndex) { _netIndex = netIndex; } - void putType(bool type) { _type = type; } - - float getXOffset(void) const { return _offset.x; } - float getYOffset(void) const { return _offset.y; } - float getOrigXOffset(void) const { return _origOffset.x; } - float getOrigYOffset(void) const { return _origOffset.y; } - - ORIENT getOrient(void) const { return _orient; } - - void changeOrient(ORIENT newOrient); -}; - -class Net -{ - public: - std::vector _pins; - - private: - int _index; - std::string _name; - float _weight; - - public: - Net() - { - _index = 0; - _weight = 1.0; - } - - void putName(const std::string name) { _name = name; } - - void addNode(const pin& node) { _pins.push_back(node); } - void clean(void) { _pins.clear(); } - itPin pinsBegin() { return _pins.begin(); } - itPin pinsEnd() { return _pins.end(); } - - pin& getPin(unsigned pinOffset) { return _pins[pinOffset]; } - - const pin& getPin(unsigned pinOffset) const { return _pins[pinOffset]; } - - int getIndex() const { return _index; } - void putIndex(int netIndex) { _index = netIndex; } - float getWeight() const { return _weight; } - void putWeight(float netWeight) { _weight = netWeight; } - const std::string getName(void) const { return _name; } - - unsigned getDegree(void) const { return _pins.size(); } -}; - -} // namespace parquetfp - -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/Nets.cxx b/src/mpl/src/ParquetFP/src/Nets.cxx deleted file mode 100644 index 25154e6a329..00000000000 --- a/src/mpl/src/ParquetFP/src/Nets.cxx +++ /dev/null @@ -1,326 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "Nets.h" - -#include - -#include "FPcommon.h" -#include "Nodes.h" - -using namespace parquetfp; -using std::cout; -using std::endl; -using std::ifstream; -using std::map; -using std::string; -using std::vector; - -Nets::Nets(const string& baseName) //://_numPins(0) -{ - string fname = baseName + string(".nets"); - parseNets(fname); - initName2IdxMap(); - fname = baseName + string(".wts"); - parseWts(fname); -} - -void Nets::parseNets(const string& fnameNets) -{ - char block_name[1024]; - ifstream nets(fnameNets.c_str()); - char tempWord1[1024]; - char netName[1024]; - float poffsetX; - float poffsetY; - int netIndex = 0; - int numNets = 0; - int numPins = 0; - unsigned netDegree = 0; - unsigned netCtr = 0; - Net tempEdge; - - if (!nets) { - cout << "ERROR: .nets file could not be opened successfully" << endl; - return; - } - skiptoeol(nets); - while (!nets.eof()) { - nets >> tempWord1; - if (!(strcmp(tempWord1, "NumNets"))) - break; - } - nets >> tempWord1; - nets >> numNets; - while (!nets.eof()) { - nets >> tempWord1; - if (!(strcmp(tempWord1, "NumPins"))) - break; - } - nets >> tempWord1; - nets >> numPins; - - if (numNets > 0) { - while (!nets.eof()) { - nets >> tempWord1; - if (!(strcmp(tempWord1, "NetDegree"))) - break; - } - nets >> tempWord1; - nets >> netDegree; - - eatblank(nets); - if (nets.peek() == '\n' || nets.peek() == '\r') { - sprintf(netName, "N%d", netIndex); - } else // netName present - { - nets >> netName; - } - skiptoeol(nets); - tempEdge.putName(netName); - } - - eatblank(nets); - if (nets.peek() == EOF) - nets.get(); - - while (!nets.eof()) { - eatblank(nets); - if (nets.eof()) - break; - if (nets.peek() == '#') - eathash(nets); - else { - eatblank(nets); - if (nets.peek() == '\n' || nets.peek() == '\r' || nets.peek() == EOF) { - nets.get(); - continue; - } - - nets >> block_name; - nets >> tempWord1; - - if (!strcmp(tempWord1, "B") || !strcmp(tempWord1, "O") - || !strcmp(tempWord1, "I")) { - eatblank(nets); - - if (nets.peek() == '\n' || nets.peek() == '\r' || nets.eof()) { - nets.get(); - // put terminal info in vector - pin tempPin(block_name, true, 0, 0, netIndex); - tempEdge.addNode(tempPin); - // cout<> tempWord1; - if (!strcmp(tempWord1, ":")) { - eatblank(nets); - } else - cout << "error in parsing" << endl; - - if (nets.peek() != '%') { - cout << "expecting %" << endl; - } else { - nets.get(); - nets >> poffsetX; - eatblank(nets); - nets.get(); - nets >> poffsetY; - nets.get(); - // convert from % - poffsetX /= 100; - poffsetY /= 100; - // put block info here - pin tempPin(block_name, false, poffsetX, poffsetY, netIndex); - tempEdge.addNode(tempPin); - // cout<> netDegree; - eatblank(nets); - if (nets.peek() == '\n' || nets.peek() == '\r') { - sprintf(netName, "N%d", netIndex); - } else // netName present - { - nets >> netName; - } - skiptoeol(nets); - tempEdge.putName(netName); - } - } - } - nets.close(); - - if (numNets > 0) { - // put the last net info inside - tempEdge.putIndex(netIndex); - _nets.push_back(tempEdge); - ++netIndex; - //_numPins+=netCtr; - } - - if (netIndex != numNets) - cout << "Error in parsing .nets file. Number of nets do not tally " - << netIndex << " vs " << numNets << endl; - - int actNumPins = getNumPins(); - if (numPins != actNumPins) { - cout << "Error in parsing .nets file. Number of pins do not tally " - << actNumPins << " vs " << numPins << endl; - } -} - -void Nets::parseWts(const string& fnameWts) -{ - ifstream wts(fnameWts.c_str()); - // char tempWord1[1024]; - char netName[1024]; - float netWeight = 1; - - if (!wts) { - cout << "WARNING: .wts file could not be opened successfully" << endl; - return; - } - - skiptoeol(wts); - - while (!wts.eof()) { - eatblank(wts); - if (wts.eof()) - break; - if (wts.peek() == '#') - eathash(wts); - else { - eatblank(wts); - if (wts.peek() == '\n' || wts.peek() == '\r' || wts.peek() == EOF) { - wts.get(); - continue; - } - wts >> netName; - wts >> netWeight; - if (_name2IdxMap.find(netName) != _name2IdxMap.end()) { - unsigned idx = getIdxFrmName(netName); - Net& net = getNet(idx); - net.putWeight(netWeight); - } else { - cout << "ERROR in parsing .wts file. Net " << netName - << " has weight, but is not defined in .nets file" << endl; - } - } - } - wts.close(); -} - -void Nets::updateNodeInfo(Nodes& nodes) -{ - itNet net; - itPin pin; - itNode node; - - map index; - map type; - - for (node = nodes.nodesBegin(); node != nodes.nodesEnd(); node++) { - index[node->getName()] = node->getIndex(); - type[node->getName()] = 0; - } - for (node = nodes.terminalsBegin(); node != nodes.terminalsEnd(); node++) { - index[node->getName()] = node->getIndex(); - type[node->getName()] = 1; - } - - for (net = _nets.begin(); net != _nets.end(); net++) { - for (pin = net->pinsBegin(); pin != net->pinsEnd(); pin++) { - int thisIndex = index[pin->getName()]; - bool thisType = type[pin->getName()]; - pin->putNodeIndex(thisIndex); - pin->putType(thisType); - - // cout<<"ERROR: Node "<getName()<<" not found in - // updateNodeInfo"<_pins.size(); - } - // if(numPins != _numPins) - //{ - // cout<<" Long computation: "<getName(), netCtr); - ++netCtr; - } -} diff --git a/src/mpl/src/ParquetFP/src/Nets.h b/src/mpl/src/ParquetFP/src/Nets.h deleted file mode 100644 index 6d4dcc5c81f..00000000000 --- a/src/mpl/src/ParquetFP/src/Nets.h +++ /dev/null @@ -1,107 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef NETS_H -#define NETS_H - -#include -#include -#include -#include -#include - -#include "Net.h" - -namespace parquetfp { - -class Nodes; -typedef std::vector::iterator itNet; -typedef std::vector::const_iterator itNetConst; - -struct eqstr -{ - bool operator()(const char* s1, const char* s2) const - { - return strcmp(s1, s2) == 0; - } -}; - -class Nets -{ - private: - std::vector _nets; - std::unordered_map _name2IdxMap; - - public: - Nets(const std::string& baseName); - Nets() {} - - void clean(void) { _nets.clear(); } - - void parseNets(const std::string& fnameNets); - - void parseWts(const std::string& fnameWts); - - void updateNodeInfo(Nodes& nodes); - - itNet netsBegin(void) { return _nets.begin(); } - - itNet netsEnd(void) { return _nets.end(); } - - itNetConst netsBegin(void) const { return _nets.begin(); } - - itNetConst netsEnd(void) const { return _nets.end(); } - - Net& getNet(unsigned index) { return _nets[index]; } - - const Net& getNet(unsigned index) const { return _nets[index]; } - - void putNewNet(Net& net) - { - _nets.push_back(net); /*_numPins+=net.getDegree();*/ - } - - int getNumPins(void) const; - // unsigned getNumPins(void) - // { return _numPins; } - - unsigned getNumNets(void) const { return _nets.size(); } - - void initName2IdxMap(void); - void putName2IdxEntry(std::string netName, int idx); - int getIdxFrmName(std::string netName); -}; -} // namespace parquetfp - -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/Node.cxx b/src/mpl/src/ParquetFP/src/Node.cxx deleted file mode 100644 index 7a4f1a4338e..00000000000 --- a/src/mpl/src/ParquetFP/src/Node.cxx +++ /dev/null @@ -1,169 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "Node.h" - -#include "FPcommon.h" -#include "Nets.h" - -using std::string; -using std::vector; - -namespace parquetfp { - -Node::Node(const string block_name, - float block_area, - float minAr, - float maxAr, - int index, - bool type) - : _area(block_area), - _minAr(minAr), - _maxAr(maxAr), - _width(sqrt(_area * minAr)), - _height(_width / minAr), - _snapX(0), - _snapY(0), - _haloX(0), - _haloY(0), - _channelX(0), - _channelY(0), - _orient(N), - _isOrientFixed(false), - _slackX(0), - _slackY(0), - _index(index), - _type(type), - _isMacro(false), - _needsFP(false), - _placement(0.f, 0.f), - _name(block_name), - _origWidth(_width), - _origHeight(_height), - allPinsAtCenter(false), - needSyncOrient(true) -{ - // by default orientation is N -} - -Node::Node(const Node& orig) - : _area(orig._area), - _minAr(orig._minAr), - _maxAr(orig._maxAr), - _width(orig._width), - _height(orig._height), - _snapX(orig._snapX), - _snapY(orig._snapY), - _haloX(orig._haloX), - _haloY(orig._haloY), - _channelX(orig._channelX), - _channelY(orig._channelY), - _orient(orig._orient), - _isOrientFixed(orig._isOrientFixed), - _slackX(orig._slackX), - _slackY(orig._slackY), - _index(orig._index), - _type(orig._type), - _isMacro(orig._isMacro), - _needsFP(orig._needsFP), - _placement(orig._placement), - _pins(orig._pins), - _subBlockIndices(orig._subBlockIndices), - _name(orig._name), - _origWidth(orig._origWidth), - _origHeight(orig._origHeight), - allPinsAtCenter(orig.allPinsAtCenter), - needSyncOrient(orig.needSyncOrient) -{ -} - -void Node::changeOrient(ORIENT newOrient, Nets& nets) -{ - if (_orient == newOrient) - return; - - if (_orient % 2 != newOrient % 2) { - float tempHeight = _height; - _height = _width; - _width = tempHeight; - } - - // update the pinoffsets of the netlist now - for (vector::const_iterator itP = _pins.begin(); itP != _pins.end(); - ++itP) { - Net& net = nets.getNet(itP->netIndex); - pin& netPin = net.getPin(itP->pinOffset); - netPin.changeOrient(newOrient); - } - _orient = newOrient; -} - -void Node::syncOrient(Nets& nets) -{ - // update the heights and widths only if not updated earlier in parsePl - if (needSyncOrient) { - if (int(_orient) % 2 == 1) // needs swap of height and width - { - float tempHeight = _height; - _height = _width; - _width = tempHeight; - } - } - - // update the pinoffsets of the netlist now - // itNodePin itP; - // for(itP = _pins.begin(); itP != _pins.end(); ++itP) - // { - // pin& netPin = nets.getNet(itP->netIndex).getPin(itP->pinOffset); - // netPin.changeOrient(_orient); - // } - for (itNodePin itP = _pins.begin(); itP != _pins.end(); ++itP) { - Net& net = nets.getNet(itP->netIndex); - pin& netPin = net.getPin(itP->pinOffset); - netPin.changeOrient(_orient); - } -} - -bool Node::calcAllPinsAtCenter(Nets& nets) -{ - itNodePin itP; - bool localAllPinsAtCenter = true; - for (itP = _pins.begin(); itP != _pins.end(); ++itP) { - pin& netPin = nets.getNet(itP->netIndex).getPin(itP->pinOffset); - if (netPin.getXOffset() != 0 || netPin.getYOffset() != 0) { - localAllPinsAtCenter = false; - break; - } - } - return (localAllPinsAtCenter); -} -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/Node.h b/src/mpl/src/ParquetFP/src/Node.h deleted file mode 100644 index aac7da827b5..00000000000 --- a/src/mpl/src/ParquetFP/src/Node.h +++ /dev/null @@ -1,177 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef NODE_H -#define NODE_H - -#include -#include -#include - -#include "FPcommon.h" - -namespace parquetfp { -class Nets; - -struct NodePin -{ - unsigned netIndex; - unsigned pinOffset; -}; - -typedef std::vector::iterator itNodePin; - -class Node -{ - private: - float _area; - float _minAr; - float _maxAr; - float _width; - float _height; - - float _snapX; - float _snapY; - float _haloX; - float _haloY; - float _channelX; - float _channelY; - - ORIENT _orient; // N,E,S,W,FN.FE,FS or FW. N on initialization - bool _isOrientFixed; - float _slackX; - float _slackY; - int _index; - bool _type; // 0 normal node,1 pad - bool _isMacro; // is Node Macro(used only during clustering) - bool _needsFP; // if node needs FP (e.g., if this node triggered FP) - Point _placement; - std::vector _pins; // all the pins of this node - std::vector _subBlockIndices; // indices of subBlocks - - std::string _name; - float _origWidth; - float _origHeight; - - public: - bool allPinsAtCenter; // helps for HPWL evaluation. made public member for - // speed. be carefull in modifying this. - bool calcAllPinsAtCenter( - Nets& nets); // use this only for initialization. else use above variable - - // ctors - Node(const std::string block_name, - float block_area, - float minAr, - float maxAr, - int index, - bool type); - Node(const Node& orig); - - bool getType() const { return _type; } - int getIndex(void) const { return _index; } - ORIENT getOrient(void) const { return _orient; } - bool isOrientFixed(void) const { return _isOrientFixed; } - float getHeight(void) const { return _height; } - float getWidth(void) const { return _width; } - float getOrigHeight(void) const { return _origHeight; } - float getOrigWidth(void) const { return _origWidth; } - std::string getName(void) const { return _name; } - float getX(void) const { return _placement.x; } - float getY(void) const { return _placement.y; } - float getslackX(void) const { return _slackX; } - float getslackY(void) const { return _slackY; } - float getminAR(void) const { return _minAr; } - float getmaxAR(void) const { return _maxAr; } - float getArea(void) const { return _area; } - - float getSnapX(void) const { return _snapX; } - float getSnapY(void) const { return _snapY; } - float getHaloX(void) const { return _haloX; } - float getHaloY(void) const { return _haloY; } - float getChannelX(void) const { return _channelX; } - float getChannelY(void) const { return _channelY; } - - bool isMacro(void) const { return _isMacro; } - bool needsFP(void) const { return _needsFP; } // - bool isHard(void) const { return equalFloat(_maxAr, _minAr); } - void updateMacroInfo(bool isMacro) { _isMacro = isMacro; } - - itNodePin pinsBegin() { return _pins.begin(); } - itNodePin pinsEnd() { return _pins.end(); } - unsigned getDegree() const { return _pins.size(); } - void clearPins() { _pins.clear(); } - std::vector::iterator subBlocksBegin() - { - return _subBlockIndices.begin(); - } - std::vector::iterator subBlocksEnd() { return _subBlockIndices.end(); } - unsigned numSubBlocks() { return _subBlockIndices.size(); } - std::vector& getSubBlocks() { return _subBlockIndices; } - - void putArea(float area) { _area = area; } - - void putWidth(float w) { _width = w; } - void putHeight(float h) { _height = h; } - void putHaloX(float hx) { _haloX = hx; } - void putHaloY(float hy) { _haloY = hy; } - void putSnapX(float sx) { _snapX = sx; } - void putSnapY(float sy) { _snapY = sy; } - void putChannelX(float cx) { _channelX = cx; } - void putChannelY(float cy) { _channelY = cy; } - - void putX(float x) { _placement.x = x; } - void putY(float y) { _placement.y = y; } - void putslackX(float x) { _slackX = x; } - void putslackY(float y) { _slackY = y; } - void putNeedsFP(bool needFP) { _needsFP = needFP; } // - void addPin(NodePin& pinTemp) { _pins.push_back(pinTemp); } - - // to be used only during initialization else use changeOrient - void putOrient(ORIENT newOrient) { _orient = newOrient; } - void putmaxAR(float newMaxAR) { _maxAr = newMaxAR; } - void putminAR(float newMinAR) { _minAr = newMinAR; } - - void putIsOrientFixed(bool value) { _isOrientFixed = value; } - void addSubBlockIndex(int index) { _subBlockIndices.push_back(index); } - - void changeOrient(ORIENT newOrient, Nets& nets); - void syncOrient(Nets& nets); - bool needSyncOrient; // during parsing if DIMS found then no need to change - // H & W. If orient found and no DIMS then need change - // in H & W -}; - -} // namespace parquetfp -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/Nodes.cxx b/src/mpl/src/ParquetFP/src/Nodes.cxx deleted file mode 100644 index 8848055e7c7..00000000000 --- a/src/mpl/src/ParquetFP/src/Nodes.cxx +++ /dev/null @@ -1,716 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ -#include "Nodes.h" - -#include - -#include "FPcommon.h" -#include "Nets.h" - -using namespace parquetfp; -using std::cout; -using std::endl; -using std::ifstream; -using std::map; -using std::numeric_limits; -using std::ofstream; -using std::string; -using std::vector; - -// ctor - -Nodes::Nodes(const string& baseName) -{ - // string fname = baseName + string(".blocks"); - // parseNodes(fname); - - string fname = baseName + string(".txt"); - parseTxt(fname); - - fname = baseName + string(".pl"); - parsePl(fname); -} - -Nodes::Nodes(const Nodes& orig) -{ - (*this) = orig; -} - -Nodes& Nodes::operator=(const Nodes& rhs) -{ - _nodes.clear(); - _nodes.insert(_nodes.end(), rhs._nodes.begin(), rhs._nodes.end()); - _terminals.clear(); - _terminals.insert( - _terminals.end(), rhs._terminals.begin(), rhs._terminals.end()); - return *this; -} - -// *.blocks parsing -void Nodes::parseNodes(const string& fnameBl) -{ - char block_name[1024]; - char block_type[1024]; - char tempWord1[1024]; - - vector vertices; - int numVertices; - bool success; - float width, height; - - float area, minAr, maxAr; - int numSoftBl = 0; - int numHardBl = 0; - int numTerm = 0; - - int indexBlock = 0; - int indexTerm = 0; - - ifstream input(fnameBl.c_str()); - if (!input) { - cout << "ERROR: .blocks file could not be opened successfully" << endl; - exit(0); - } - skiptoeol(input); - while (!input.eof()) { - input >> tempWord1; - if (!(strcmp(tempWord1, "NumSoftRectangularBlocks"))) - break; - } - input >> tempWord1; - input >> numSoftBl; - while (!input.eof()) { - input >> tempWord1; - if (!(strcmp(tempWord1, "NumHardRectilinearBlocks"))) - break; - } - input >> tempWord1; - input >> numHardBl; - - while (!input.eof()) { - input >> tempWord1; - if (!(strcmp(tempWord1, "NumTerminals"))) - break; - } - input >> tempWord1; - input >> numTerm; - - while (!input.eof()) { - block_type[0] = '\0'; - eatblank(input); - if (input.eof()) - break; - if (input.peek() == '#') - eathash(input); - else { - eatblank(input); - if (input.peek() == '\n' || input.peek() == '\r' || input.peek() == EOF) { - input.get(); - continue; - } - - input >> block_name; - input >> block_type; - - if (!strcmp(block_type, "softrectangular")) { - input >> area; - input >> minAr; - input >> maxAr; - Node temp(block_name, area, minAr, maxAr, indexBlock, false); - temp.addSubBlockIndex(indexBlock); - _nodes.push_back(temp); - - ++indexBlock; - // cout<> numVertices; - Point tempPoint; - success = 1; - if (numVertices > 4) - cout << "ERROR in parsing .blocks file. rectilinear blocks can be " - "only rectangles for now\n"; - for (int i = 0; i < numVertices; ++i) { - success &= needCaseChar(input, '('); - input.get(); - input >> tempPoint.x; - success &= needCaseChar(input, ','); - input.get(); - input >> tempPoint.y; - success &= needCaseChar(input, ')'); - input.get(); - vertices.push_back(tempPoint); - } - if (!success) - cout << "ERROR in parsing .blocks file while processing " - "hardrectilinear blocks" - << endl; - - width = vertices[2].x - vertices[0].x; - height = vertices[2].y - vertices[0].y; - cout << width << " " << height << endl; - area = width * height; - minAr = width / height; - maxAr = minAr; - Node temp(block_name, area, minAr, maxAr, indexBlock, false); - temp.addSubBlockIndex(indexBlock); - _nodes.push_back(temp); - ++indexBlock; - vertices.clear(); - // cout << block_name << " " << width << " " << height << endl; - } else if (!strcmp(block_type, "terminal")) { - Node temp(block_name, 0, 1, 1, indexTerm, true); - temp.addSubBlockIndex(indexTerm); - _terminals.push_back(temp); - ++indexTerm; - // cout< vertices; - float width, height; - - int numHardBl = 0; - int numTerm = 0; - - int indexBlock = 0; - int indexTerm = 0; - - ifstream input(fnameTxt.c_str()); - if (!input) { - cout << "ERROR: .blocks file could not be opened successfully" << endl; - exit(0); - } - - float area, minAr, maxAr; - float snapX, snapY, haloX, haloY, channelX, channelY; - input >> numHardBl; - for (int i = 0; i < numHardBl; i++) { - input >> block_name; - input >> width >> height; - input >> snapX >> snapY; - input >> haloX >> haloY; - input >> channelX >> channelY; - - area = width * height; - minAr = width / height; - maxAr = minAr; - - Node temp(block_name, area, minAr, maxAr, indexBlock, false); - temp.addSubBlockIndex(indexBlock); - - temp.putSnapX(snapX); - temp.putSnapY(snapY); - temp.putHaloX(haloX); - temp.putHaloY(haloY); - temp.putChannelX(channelX); - temp.putChannelY(channelY); - - _nodes.push_back(temp); - ++indexBlock; - } - - input >> numTerm; - for (int i = 0; i < numTerm; i++) { - input >> block_name; - Node temp(block_name, 0, 1, 1, indexTerm, true); - temp.addSubBlockIndex(indexTerm); - _terminals.push_back(temp); - ++indexTerm; - } - input.close(); -} - -void Nodes::parsePl(const string& fnamePl) -{ - char block_name[1024]; - char tempWord[1024]; - char tempWord1[1024]; - float xloc; - float yloc; - float width; - float height; - bool success; - ORIENT newOrient; - itNode node; - - map index; - map type; - for (node = nodesBegin(); node != nodesEnd(); node++) { - index[node->getName()] = node->getIndex(); - type[node->getName()] = 0; - } - for (node = terminalsBegin(); node != terminalsEnd(); node++) { - index[node->getName()] = node->getIndex(); - type[node->getName()] = 1; - } - - ifstream input(fnamePl.c_str()); - if (!input) { - cout << "ERROR: .pl file could not be opened successfully" << endl; - return; - } - - skiptoeol(input); - while (!input.eof()) { - eatblank(input); - if (input.eof()) - break; - if (input.peek() == '#') - eathash(input); - else { - eatblank(input); - if (input.peek() == '\n' || input.peek() == '\r' || input.peek() == EOF) { - input.get(); - continue; - } - input >> block_name; - input >> xloc; - input >> yloc; - int thisIndex = index[block_name]; - int thisType = type[block_name]; - - updatePlacement(thisIndex, thisType, xloc, yloc); - - // cout << block_name << ", xloc: " << xloc << ", yloc: " << yloc << - // endl; - // exit(1); - - eatblank(input); - success = 1; - if (input.peek() == 'D') // block with width and height - { - input >> tempWord; - success &= needCaseChar(input, '('); - input.get(); - input >> width; - success &= needCaseChar(input, ','); - input.get(); - input >> height; - success &= needCaseChar(input, ')'); - input.get(); - - if (!success || strcmp(tempWord, "DIMS")) - cout << "ERROR in parsing .pl file while reading in DIMS\n"; - updateHW(thisIndex, thisType, width, height); - getNode(thisIndex).needSyncOrient = false; - } - - success = 1; - eatblank(input); - if (input.peek() == ':') // initial orientation given - { - input.get(); - input >> tempWord1; // the orientation in words; - newOrient = toOrient(tempWord1); - updateOrient(thisIndex, thisType, newOrient); - } - // cout< Nodes::getNodeWidths(void) -{ - vector widths; - for (itNode iNodes = nodesBegin(); iNodes != nodesEnd(); iNodes++) - widths.push_back(iNodes->getWidth()); - return widths; -} - -vector Nodes::getNodeHeights(void) -{ - vector heights; - for (itNode iNodes = nodesBegin(); iNodes != nodesEnd(); iNodes++) - heights.push_back(iNodes->getHeight()); - return heights; -} - -vector Nodes::getXLocs(void) -{ - vector xloc; - for (itNode iNodes = nodesBegin(); iNodes != nodesEnd(); iNodes++) - xloc.push_back(iNodes->getX()); - return xloc; -} - -vector Nodes::getYLocs(void) -{ - vector yloc; - for (itNode iNodes = nodesBegin(); iNodes != nodesEnd(); iNodes++) - yloc.push_back(iNodes->getY()); - return yloc; -} - -float Nodes::getNodesArea() -{ - itNode iNode; - float area = 0; - for (iNode = nodesBegin(); iNode != nodesEnd(); ++iNode) { - area += iNode->getHeight() * iNode->getWidth(); - } - return area; -} - -void Nodes::changeOrient(unsigned index, ORIENT newOrient, Nets& nets) -{ - Node& node = _nodes[index]; - node.changeOrient(newOrient, nets); -} - -/*following function assumes that pin info about node index is correct.*/ -void Nodes::updatePinsInfo(Nets& nets) -{ - itNet net; - itNode node; - NodePin tempNodePin; - unsigned pinOffset; - - for (node = nodesBegin(); node != nodesEnd(); ++node) - node->clearPins(); - for (node = terminalsBegin(); node != terminalsEnd(); ++node) - node->clearPins(); - - for (net = nets.netsBegin(); net != nets.netsEnd(); net++) { - pinOffset = 0; - // for(pin = net->pinsBegin(); pin != net->pinsEnd(); pin++) - for (pinOffset = 0; pinOffset < net->getDegree(); ++pinOffset) { - pin& currPin = net->getPin(pinOffset); - tempNodePin.netIndex = net->getIndex(); - tempNodePin.pinOffset = pinOffset; - unsigned nodeIndex = currPin.getNodeIndex(); - if (!currPin.getType()) // if not pad - { - Node& node = getNode(nodeIndex); - node.addPin(tempNodePin); - } else { - Node& node = getTerminal(nodeIndex); - node.addPin(tempNodePin); - } - // tempNodePin.netIndex = net->getIndex(); - // tempNodePin.pinOffset = pinOffset; - // unsigned nodeIndex = pin->getNodeIndex(); - // if(!pin->getType()) //if not pad - //{ - // Node& node = getNode(nodeIndex); - // node.addPin(tempNodePin); - // } - // else - //{ - // Node& node = getTerminal(nodeIndex); - // node.addPin(tempNodePin); - // } - // pinOffset++; - } - } - - // now sync the orientations of the pins with that of the nodes - for (node = nodesBegin(); node != nodesEnd(); ++node) { - if (node->getOrient() != N) // synchronize orientation only if not N - node->syncOrient(nets); - } -} - -void Nodes::savePl(const char* baseFileName) -{ - ofstream outPl(string(baseFileName) + ".pl"); - if (!outPl) { - cout << "ERROR in saving .pl file" << endl; - return; - } - outPl << "UMICH blocks 1.0" << endl << endl << endl << endl; - - itNode node; - - for (node = nodesBegin(); node != nodesEnd(); node++) { - outPl << node->getName() << "\t" << node->getX() << "\t" << node->getY(); - outPl << "\tDIMS = (" << node->getWidth() << ", " << node->getHeight() - << ")"; - outPl << "\t: " << toChar(node->getOrient()) << endl; - } - outPl << endl; - - for (node = terminalsBegin(); node != terminalsEnd(); node++) { - outPl << node->getName() << "\t" << node->getX() << "\t" << node->getY() - << "\t: " << toChar(node->getOrient()) << endl; - } - outPl << endl; - outPl.close(); -} - -void Nodes::saveCapoNodes(const char* baseFileName) -{ - ofstream file(string(baseFileName) + ".nodes"); - file << "UCLA nodes 1.0" << endl << endl << endl; - - file << "NumNodes : \t" << _nodes.size() + _terminals.size() << endl; - file << "NumTerminals : \t" << _terminals.size() << endl; - - itNode node; - - float width, height, temp; - for (node = nodesBegin(); node != nodesEnd(); ++node) { - width = node->getWidth(); - height = node->getHeight(); - if (int(node->getOrient()) % 2 == 1) { - temp = width; - width = height; - height = temp; - } - file << "\t" << node->getName() << "\t" << width << "\t" << height << endl; - } - - for (node = terminalsBegin(); node != terminalsEnd(); ++node) { - width = node->getWidth(); - height = node->getHeight(); - if (int(node->getOrient()) % 2 == 1) { - temp = width; - width = height; - height = temp; - } - file << "\t" << node->getName() << "\t" << width << "\t" << height - << "\tterminal " << endl; - } - file.close(); -} - -void Nodes::saveNodes(const char* baseFileName) -{ - ofstream file(string(baseFileName) + ".blocks"); - file << "UCSC blocks 1.0" << endl << endl << endl; - - file << "NumSoftRectangularBlocks : \t" << _nodes.size() << endl; - file << "NumHardRectilinearBlocks : \t0" << endl; - file << "NumTerminals : \t" << _terminals.size() << endl << endl; - - itNode node; - - for (node = nodesBegin(); node != nodesEnd(); ++node) { - file << node->getName() << " softrectangular " << node->getArea() << "\t" - << node->getminAR() << "\t" << node->getmaxAR() << endl; - } - file << endl; - for (node = terminalsBegin(); node != terminalsEnd(); ++node) - file << node->getName() << " terminal" << endl; - - file.close(); -} - -void Nodes::saveCapoPl(const char* baseFileName) -{ - ofstream file(string(baseFileName) + ".pl"); - - file << "UCLA pl 1.0" << endl << endl << endl; - - itNode node; - - for (node = nodesBegin(); node != nodesEnd(); ++node) { - file << "\t" << node->getName() << "\t" << node->getX() << "\t" - << node->getY() << " : \t" << toChar(node->getOrient()) << endl; - } - - for (node = terminalsBegin(); node != terminalsEnd(); ++node) { - file << "\t" << node->getName() << "\t" << node->getX() << "\t" - << node->getY() << " : \t" << toChar(node->getOrient()) << endl; - } - - file.close(); -} - -void Nodes::saveCapoScl(const char* baseFileName, - float reqdAR, - float reqdWS, - const BBox& nonTrivialBBox) -{ - // default required aspect ratio of 1 - float AR; - if (reqdAR == -9999) - AR = 1; - else - AR = reqdAR; - - float area = (1 + reqdWS / 100.0) * getNodesArea(); // add WS - float height = sqrt(area / AR); - float width = AR * height; - - float siteWidth = 1.; - unsigned numSites = static_cast(width / siteWidth) + 1; - - float minHeight = getMinHeight(); - float minWidth = getMinWidth(); - - float rowHeight = std::max(ceil(0.1 * std::min(minHeight, minWidth)), 1.); - - unsigned numRows = static_cast(height / rowHeight) + 1; - - float rowCoord = nonTrivialBBox.isValid() ? nonTrivialBBox.getMinY() : 0.f; - float colCoord = nonTrivialBBox.isValid() ? nonTrivialBBox.getMinX() : 0.f; - - string fileName = string(baseFileName) + string(".scl"); - ofstream file(fileName.c_str()); - - file << "UCLA scl 1.0" << endl << endl << endl; - file << "Numrows : " << numRows << endl; - - for (unsigned i = 0; i < numRows; ++i) { - file << "CoreRow Horizontal" << endl; - file << " Coordinate\t: " << rowCoord << endl; - file << " Height\t: " << rowHeight << endl; - file << " Sitewidth\t: " << siteWidth << endl; - file << " Sitespacing\t: " << siteWidth << endl; - file << " Siteorient\t: N" << endl; - file << " Sitesymmetry\t: Y" << endl; - file << " SubrowOrigin\t: " << colCoord << " Numsites\t: " << numSites - << endl; - file << "End" << endl; - - rowCoord += rowHeight; - } - - file.close(); -} - -float Nodes::getMinHeight() -{ - itNode node; - float minHeight = std::numeric_limits::max(); - for (node = nodesBegin(); node != nodesEnd(); ++node) { - if (minHeight > node->getHeight()) - minHeight = node->getHeight(); - } - return minHeight; -} - -float Nodes::getMinWidth() -{ - itNode node; - float minWidth = numeric_limits::max(); - for (node = nodesBegin(); node != nodesEnd(); ++node) { - if (minWidth > node->getWidth()) - minWidth = node->getWidth(); - } - return minWidth; -} - -void Nodes::initNodesFastPOAccess(Nets& nets, bool reset) -{ - itNode node; - if (reset) - for (node = nodesBegin(); node != nodesEnd(); ++node) - node->allPinsAtCenter = false; - else { - for (node = nodesBegin(); node != nodesEnd(); ++node) - node->allPinsAtCenter = node->calcAllPinsAtCenter(nets); - } -} diff --git a/src/mpl/src/ParquetFP/src/Nodes.h b/src/mpl/src/ParquetFP/src/Nodes.h deleted file mode 100644 index c0cdb763b0f..00000000000 --- a/src/mpl/src/ParquetFP/src/Nodes.h +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef NODES_H -#define NODES_H - -#include -#include -#include - -#include "Node.h" - -namespace parquetfp { -class Nets; -typedef std::vector::iterator itNode; - -class Nodes -{ - private: - std::vector _nodes; - std::vector _terminals; - - public: - Nodes(const std::string& baseName); - Nodes(void) {} - Nodes(const Nodes& orig); - Nodes& operator=(const Nodes& rhs); - - void parseNodes(const std::string& fnameBl); - void parseTxt(const std::string& fnameTxt); - void parsePl(const std::string& fnamePl); - - unsigned getNumNodes(void) const { return _nodes.size(); } - itNode nodesBegin(void) { return _nodes.begin(); } - itNode nodesEnd(void) { return _nodes.end(); } - void putNewNode(Node& node) { _nodes.push_back(node); } - Node& getNode(unsigned index) { return _nodes[index]; } - const Node& getNode(unsigned index) const { return _nodes[index]; } - void clearNodes(void) { _nodes.clear(); } - - unsigned getNumTerminals(void) const { return _terminals.size(); } - itNode terminalsBegin(void) { return _terminals.begin(); } - itNode terminalsEnd(void) { return _terminals.end(); } - void putNewTerm(Node& term) { _terminals.push_back(term); } - Node& getTerminal(unsigned index) { return _terminals[index]; } - const Node& getTerminal(unsigned index) const { return _terminals[index]; } - void clearTerm(void) { _terminals.clear(); } - - void clean(void) - { - _nodes.clear(); - _terminals.clear(); - } - - std::vector getNodeWidths(); - std::vector getNodeHeights(); - std::vector getXLocs(); - std::vector getYLocs(); - float getNodeWidth(unsigned index); - float getNodeHeight(unsigned index); - float getNodesArea(); - float getMinHeight(); - float getMinWidth(); - - void putNodeWidth(unsigned index, float width); - void putNodeHeight(unsigned index, float height); - - void changeOrient(unsigned index, ORIENT newOrient, Nets& nets); - void updatePinsInfo(Nets& nets); - - void updatePlacement(int index, bool type, float xloc, float yloc); - void updateOrient(int index, bool type, ORIENT newOrient); - void updateHW(int index, bool type, float width, float height); - - // initialize info for fast pin offset access. - // if reset is true then all pin-offsets are assumed to be non-trivial - // useful for fast HPWL calc. - void initNodesFastPOAccess(Nets& nets, bool reset = false); - - void savePl(const char* baseFileName); - void saveNodes(const char* baseFileName); - - // following functions save in Capo format - void saveCapoNodes(const char* baseFileName); - void saveCapoPl(const char* baseFileName); - void saveCapoScl(const char* baseFileName, - float reqdAR, - float reqdWS, - const BBox&); -}; -} // namespace parquetfp -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/PlToSP.cxx b/src/mpl/src/ParquetFP/src/PlToSP.cxx deleted file mode 100644 index b4bb470343f..00000000000 --- a/src/mpl/src/ParquetFP/src/PlToSP.cxx +++ /dev/null @@ -1,463 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "PlToSP.h" - -#include "FPcommon.h" - -using namespace parquetfp; -using std::cout; -using std::endl; -using std::vector; - -Pl2SP::Pl2SP(vector& xloc, - vector& yloc, - vector& widths, - vector& heights, - PL2SP_ALGO whichAlgo) - : _xloc(xloc), _yloc(yloc), _widths(widths), _heights(heights), _cnt(0) -{ - unsigned size = _xloc.size(); - if (_yloc.size() != size || _widths.size() != size || _heights.size() != size) - cout << "ERROR: in Pl2SP. Sizes do not match" << endl; - - switch (whichAlgo) { - case NAIVE_ALGO: - naiveAlgo(); - break; - case TCG_ALGO: - TCGAlgo(); - break; - } -} - -void Pl2SP::naiveAlgo(void) -{ - unsigned size = _xloc.size(); - float rowHeight = std::numeric_limits::max(); - float maxYLoc = -std::numeric_limits::max(); - - for (unsigned i = 0; i < size; ++i) { - if (rowHeight > _heights[i]) - rowHeight = _heights[i]; - - if (maxYLoc < _yloc[i]) - maxYLoc = _yloc[i]; - } - - unsigned numRows = unsigned(ceil(maxYLoc / rowHeight) + 1); - - // snap to y grid here - for (unsigned i = 0; i < size; ++i) { - unsigned reqdRow = static_cast((_yloc[i] / rowHeight) + 0.5); - // unsigned reqdRow = unsigned(rint(_yloc[i]/rowHeight)); - _yloc[i] = reqdRow * rowHeight; - } - - vector> rows; - vector singleRow; - RowElem tempRE; - - float currHeight = 0; - - for (unsigned i = 0; i < numRows; ++i) { - for (unsigned j = 0; j < size; ++j) { - if (std::abs(_yloc[j] - currHeight) < 0.0001) { - tempRE.index = j; - tempRE.xloc = _xloc[j]; - singleRow.push_back(tempRE); - } - } - - currHeight += rowHeight; - - std::stable_sort(singleRow.begin(), singleRow.end(), less_mag()); - rows.push_back(singleRow); - singleRow.clear(); - } - - // form the X and Y sequence pairs now - for (unsigned i = 0; i < rows.size(); ++i) { - for (unsigned j = 0; j < rows[i].size(); ++j) { - _YY.push_back(rows[i][j].index); - } - } - for (int i = rows.size() - 1; i >= 0; --i) { - for (unsigned j = 0; j < rows[i].size(); ++j) { - _XX.push_back(rows[i][j].index); - } - } - - if (_XX.size() != _xloc.size() || _YY.size() != _xloc.size()) { - cout << "ERROR: generated sequence pair of not correct sizes " << _XX.size() - << " & " << _YY.size() << " vs " << size << endl; - print(); - } -} - -void Pl2SP::TCGAlgo(void) -{ - unsigned size = _xloc.size(); - - vector> TCGMatrixVert; - vector> TCGMatrixHoriz; - - TCGMatrixVert.resize(size); - TCGMatrixHoriz.resize(size); - - for (unsigned i = 0; i < size; ++i) { - TCGMatrixVert[i].resize(size, false); - TCGMatrixHoriz[i].resize(size, false); - } - - float ebsilon = std::numeric_limits::max(); - for (unsigned i = 0; i < size; ++i) // pick min dimension - { - if (ebsilon > _widths[i]) - ebsilon = _widths[i]; - if (ebsilon > _heights[i]) - ebsilon = _heights[i]; - } - ebsilon /= 1000; - - // set up the immediate constraints - for (unsigned i = 0; i < size; ++i) { - for (unsigned j = 0; j <= i; ++j) { - float iXStart, iXEnd, jXStart, jXEnd; - float iYStart, iYEnd, jYStart, jYEnd; - - float horizOverlap = 0.0f; - float vertOverlap = 0.0f; - unsigned vertOverlapDir = 0; - unsigned horizOverlapDir = 0; - - if (i == j) { - TCGMatrixHoriz[i][j] = 1; - TCGMatrixVert[i][j] = 1; - continue; - } - - TCGMatrixHoriz[i][j] = 0; - TCGMatrixVert[i][j] = 0; - TCGMatrixHoriz[j][i] = 0; - TCGMatrixVert[j][i] = 0; - - iXStart = _xloc[i]; - iXEnd = _xloc[i] + _widths[i]; - jXStart = _xloc[j]; - jXEnd = _xloc[j] + _widths[j]; - - iYStart = _yloc[i]; - iYEnd = _yloc[i] + _heights[i]; - jYStart = _yloc[j]; - jYEnd = _yloc[j] + _heights[j]; - - // horizontal constraint - if (jYStart < iYStart + ebsilon && jYEnd < iYEnd + ebsilon - && jYEnd > iYStart + ebsilon) { - vertOverlap = jYEnd - iYStart; // lower overlap - vertOverlapDir = 0; - } else if (jYStart > iYStart + ebsilon && jYEnd < iYEnd + ebsilon) { - vertOverlap = jYEnd - jYStart; // inner overlap - if (iYEnd - jYEnd > jYStart - iYStart) - vertOverlapDir = 0; - else - vertOverlapDir = 1; - } else if (jYStart > iYStart + ebsilon && jYStart < iYEnd + ebsilon - && jYEnd > iYEnd + ebsilon) { - vertOverlap = iYEnd - jYStart; // upper overlap - vertOverlapDir = 1; - } else if (jYStart < iYStart + ebsilon && jYEnd > iYEnd + ebsilon) { - vertOverlap = iYEnd - iYStart; // outer overlap - if (jYEnd - iYEnd > iYStart - jYStart) - vertOverlapDir = 1; - else - vertOverlapDir = 0; - } else - TCGMatrixHoriz[i][j] = 0; - - // vertical constraint - if (jXStart < iXStart + ebsilon && jXEnd < iXEnd + ebsilon - && jXEnd > iXStart + ebsilon) { - horizOverlap = jXEnd - iXStart; // right overlap - horizOverlapDir = 0; - } else if (jXStart > iXStart + ebsilon && jXEnd < iXEnd + ebsilon) { - horizOverlap = jXEnd - jXStart; // inner overlap - if (iXEnd - jXEnd > jXStart - iXStart) - horizOverlapDir = 0; - else - horizOverlapDir = 1; - } else if (jXStart > iXStart + ebsilon && jXStart < iXEnd + ebsilon - && jXEnd > iXEnd + ebsilon) { - horizOverlap = iXEnd - jXStart; // left overlap - horizOverlapDir = 1; - } else if (jXStart < iXStart + ebsilon && jXEnd > iXEnd + ebsilon) { - horizOverlap = iXEnd - iXStart; // outer overlap - if (jXEnd - iXEnd > iXStart - jXStart) - horizOverlapDir = 1; - else - horizOverlapDir = 0; - } else - TCGMatrixVert[i][j] = 0; - - if (vertOverlap > ebsilon && horizOverlap <= ebsilon) { - if (iXStart <= jXStart) - TCGMatrixHoriz[i][j] = 1; - else - TCGMatrixHoriz[j][i] = 1; - } else if (horizOverlap > ebsilon && vertOverlap <= ebsilon) { - if (iYStart <= jYStart) - TCGMatrixVert[i][j] = 1; - else - TCGMatrixVert[j][i] = 1; - } - // overlapping - else if (horizOverlap > ebsilon && vertOverlap > ebsilon) { - if (vertOverlap >= horizOverlap) { - if (horizOverlapDir == 1) - TCGMatrixHoriz[i][j] = 1; - else - TCGMatrixHoriz[j][i] = 1; - } else { - if (vertOverlapDir == 1) - TCGMatrixVert[i][j] = 1; - else - TCGMatrixVert[j][i] = 1; - } - } - } - } - - // floyd marshal to find transitive closure - // TCG_FM(TCGMatrixHoriz, TCGMatrixVert); - - // dynamic programming DFS algo to find transitive closure - TCG_DP(TCGMatrixHoriz, TCGMatrixVert); - - // find ties and break them - for (unsigned i = 0; i < size; ++i) { - for (unsigned j = 0; j < i; ++j) { - if (i == j) - continue; - if (TCGMatrixHoriz[i][j] == 1 && TCGMatrixHoriz[j][i] == 1) { - cout << "ERROR in TCG 1 " << i << "\t" << j << endl; - } - if (TCGMatrixVert[i][j] == 1 && TCGMatrixVert[j][i] == 1) { - cout << "ERROR in TCG 2 " << i << "\t" << j << endl; - } - unsigned ctr = 0; - if (TCGMatrixHoriz[i][j] == 1) - ++ctr; - if (TCGMatrixHoriz[j][i] == 1) - ++ctr; - if (TCGMatrixVert[i][j] == 1) - ++ctr; - if (TCGMatrixVert[j][i] == 1) - ++ctr; - - if (ctr > 1) { - unsigned dir = rand() % 2; - if (dir == 0) // H constraint - { - TCGMatrixVert[i][j] = 0; - TCGMatrixVert[j][i] = 0; - } else // V constraint - { - TCGMatrixHoriz[i][j] = 0; - TCGMatrixHoriz[j][i] = 0; - } - /* - cout<<"ERROR in TCG 3 "<>& TCGMatrixHoriz, - vector>& TCGMatrixVert) -{ - unsigned size = TCGMatrixHoriz[0].size(); - for (unsigned k = 0; k < size; ++k) { - for (unsigned i = 0; i < size; ++i) { - for (unsigned j = 0; j < size; ++j) { - TCGMatrixHoriz[i][j] = TCGMatrixHoriz[i][j] - | (TCGMatrixHoriz[i][k] & TCGMatrixHoriz[k][j]); - TCGMatrixVert[i][j] - = TCGMatrixVert[i][j] | (TCGMatrixVert[i][k] & TCGMatrixVert[k][j]); - } - } - } -} - -void Pl2SP::TCG_DP(vector>& TCGMatrixHoriz, - vector>& TCGMatrixVert) -{ - int size = TCGMatrixHoriz[0].size(); - vector> adjMatrixHoriz = TCGMatrixHoriz; - vector> adjMatrixVert = TCGMatrixVert; - vector pre(size, -1); - - int i; - for (i = 0; i < size; ++i) { - fill(TCGMatrixHoriz[i].begin(), TCGMatrixHoriz[i].end(), false); - fill(TCGMatrixVert[i].begin(), TCGMatrixVert[i].end(), false); - } - - _cnt = 0; - for (i = 0; i < size; ++i) - if (pre[i] == -1) - TCGDfs(TCGMatrixHoriz, adjMatrixHoriz, i, pre); - - _cnt = 0; - fill(pre.begin(), pre.end(), -1); - for (i = 0; i < size; ++i) - if (pre[i] == -1) - TCGDfs(TCGMatrixVert, adjMatrixVert, i, pre); -} - -void Pl2SP::TCGDfs(vector>& TCGMatrix, - vector>& adjMatrix, - int v, - vector& pre) -{ - int u, i; - pre[v] = _cnt++; - int size = adjMatrix[0].size(); - - for (u = 0; u < size; ++u) { - if (adjMatrix[v][u]) { - TCGMatrix[v][u] = true; - if (pre[u] > pre[v]) - continue; - - if (pre[u] == -1) - TCGDfs(TCGMatrix, adjMatrix, u, pre); - - for (i = 0; i < size; ++i) - if (TCGMatrix[u][i] == 1) - TCGMatrix[v][i] = 1; - } - } -} diff --git a/src/mpl/src/ParquetFP/src/PlToSP.h b/src/mpl/src/ParquetFP/src/PlToSP.h deleted file mode 100644 index 80966597f31..00000000000 --- a/src/mpl/src/ParquetFP/src/PlToSP.h +++ /dev/null @@ -1,178 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef PLTOSP_H -#define PLTOSP_H - -#include -#include -#include -#include -#include - -namespace parquetfp { -enum PL2SP_ALGO -{ - NAIVE_ALGO, - TCG_ALGO -}; - -class Pl2SP -{ - private: - std::vector _xloc; - std::vector _yloc; - std::vector _widths; - std::vector _heights; - - std::vector _XX; - std::vector _YY; - - int _cnt; - - public: - Pl2SP(std::vector& xloc, - std::vector& yloc, - std::vector& widths, - std::vector& heights, - PL2SP_ALGO whichAlgo); - - ~Pl2SP() {} - - void naiveAlgo(void); - void TCGAlgo(void); - - // Floyd Marshal to find TCG - void TCG_FM(std::vector>& TCGMatrixHoriz, - std::vector>& TCGMatrixVert); - - // DP to find TCG - void TCG_DP(std::vector>& TCGMatrixHoriz, - std::vector>& TCGMatrixVert); - void TCGDfs(std::vector>& TCGMatrix, - std::vector>& adjMatrix, - int v, - std::vector& pre); - - const std::vector& getXSP(void) const { return _XX; } - - const std::vector& getYSP(void) const { return _YY; } - - void print(void) const; -}; - -struct RowElem -{ - unsigned index; - float xloc; -}; - -struct less_mag -{ - bool operator()(const RowElem& elem1, const RowElem& elem2) - { - return (elem1.xloc < elem2.xloc); - } -}; - -class SPXRelation -{ - const std::vector>& TCGMatrixHoriz; - const std::vector>& TCGMatrixVert; - - public: - SPXRelation(const std::vector>& TCGMatrixHorizIP, - const std::vector>& TCGMatrixVertIP) - : TCGMatrixHoriz(TCGMatrixHorizIP), TCGMatrixVert(TCGMatrixVertIP) - { - } - - bool operator()(const unsigned i, const unsigned j) const - { - if (i == j) { - return false; - } else if (TCGMatrixHoriz[i][j]) { - return true; - } else if (TCGMatrixHoriz[j][i]) { - return false; - } else if (TCGMatrixVert[j][i]) { - return true; - } else if (TCGMatrixVert[i][j]) { - return false; - } else { - // cout<<"ERROR IN PL2SP SPX "<>& TCGMatrixHoriz; - const std::vector>& TCGMatrixVert; - - public: - SPYRelation(const std::vector>& TCGMatrixHorizIP, - const std::vector>& TCGMatrixVertIP) - : TCGMatrixHoriz(TCGMatrixHorizIP), TCGMatrixVert(TCGMatrixVertIP) - { - } - bool operator()(const unsigned i, const unsigned j) const - { - if (i == j) { - return false; - } - if (TCGMatrixHoriz[i][j]) - return true; - else if (TCGMatrixHoriz[j][i]) - return false; - else if (TCGMatrixVert[j][i]) - return false; - else if (TCGMatrixVert[i][j]) - return true; - else { - // cout<<"ERROR IN PL2SP SPY "< - -#include "PlToSP.h" - -using std::cout; -using std::endl; -using std::map; -using std::vector; - -using namespace parquetfp; - -SPeval::SPeval(const vector& heights, - const vector& widths, - bool paramUseFastSP) -{ - _heights = heights; - _widths = widths; - xSize = 0; - ySize = 0; - - unsigned size = heights.size(); - _match.resize(size); - _LL.resize(size); - _reverseXX.resize(size); - _reverseYY.resize(size); - xloc.resize(size); - yloc.resize(size); - xlocRev.resize(size); - ylocRev.resize(size); - xSlacks.resize(size); - ySlacks.resize(size); - xlocRev.resize(size); - ylocRev.resize(size); - _TCGMatrixInitialized = false; - _paramUseFastSP = paramUseFastSP; -} - -void SPeval::_initializeTCGMatrix(unsigned size) -{ - _TCGMatrixVert.resize(size); - _TCGMatrixHoriz.resize(size); - for (unsigned i = 0; i < size; ++i) { - _TCGMatrixVert[i].resize(size); - _TCGMatrixHoriz[i].resize(size); - } - _TCGMatrixInitialized = true; -} - -float SPeval::_lcsCompute(const vector& X, - const vector& Y, - const vector& weights, - vector& match, - vector& P, - vector& L) -{ - unsigned size = X.size(); - for (unsigned i = 0; i < size; ++i) { - match[Y[i]] = i; - L[i] = 0; - } - - float t; - unsigned j; - for (unsigned i = 0; i < size; ++i) { - unsigned p = match[X[i]]; - P[X[i]] = L[p]; - t = P[X[i]] + weights[X[i]]; - - for (j = p; j < size; ++j) { - if (t > L[j]) - L[j] = t; - else - break; - } - } - return L[size - 1]; -} - -float SPeval::xEval(const vector& XX, - const vector& YY, - bool leftpack, - vector& xcoords) -{ - fill(_match.begin(), _match.end(), 0); - if (leftpack) { - return _lcsCompute(XX, YY, _widths, _match, xcoords, _LL); - } else { - float xspan = _lcsReverseCompute(XX, YY, _widths, _match, xcoords, _LL); - for (unsigned i = 0; i < XX.size(); ++i) { - xcoords[i] = xspan - xcoords[i] - _widths[i]; - } - return xspan; - } -} - -float SPeval::xEvalCompact(const vector& XX, - const vector& YY, - bool leftpack, - vector& xcoords, - vector& ycoords) -{ - fill(_match.begin(), _match.end(), 0); - if (leftpack) { - return _lcsComputeCompact( - XX, YY, _widths, _match, xcoords, _LL, ycoords, _heights); - } else { - float xspan = _lcsComputeCompact(_reverseXX, - _reverseYY, - _widths, - _match, - xcoords, - _LL, - ycoords, - _heights); - for (unsigned i = 0; i < XX.size(); ++i) { - xcoords[i] = xspan - xcoords[i] - _widths[i]; - } - return xspan; - } -} - -float SPeval::xEvalFast(const vector& XX, - const vector& YY, - bool leftpack, - vector& xcoords) -{ - fill(_match.begin(), _match.end(), 0); - if (leftpack) { - return _lcsComputeFast(XX, YY, _widths, _match, xcoords, _LL); - } else { - float xspan = _lcsComputeFast( - _reverseXX, _reverseYY, _widths, _match, xcoords, _LL); - for (unsigned i = 0; i < XX.size(); ++i) { - xcoords[i] = xspan - xcoords[i] - _widths[i]; - } - return xspan; - } -} - -float SPeval::yEval(const vector& XX, - const vector& YY, - bool botpack, - vector& ycoords) -{ - fill(_match.begin(), _match.end(), 0); - if (botpack) { - return _lcsCompute(_reverseXX, YY, _heights, _match, ycoords, _LL); - } else { - float yspan - = _lcsReverseCompute(_reverseXX, YY, _heights, _match, ycoords, _LL); - for (unsigned i = 0; i < XX.size(); ++i) { - ycoords[i] = yspan - ycoords[i] - _heights[i]; - } - return yspan; - } -} - -float SPeval::yEvalCompact(const vector& XX, - const vector& YY, - bool botpack, - vector& xcoords, - vector& ycoords) -{ - fill(_match.begin(), _match.end(), 0); - if (botpack) { - return _lcsComputeCompact( - _reverseXX, YY, _heights, _match, ycoords, _LL, xcoords, _widths); - } else { - float yspan = _lcsComputeCompact( - XX, _reverseYY, _heights, _match, ycoords, _LL, xcoords, _widths); - for (unsigned i = 0; i < YY.size(); ++i) { - ycoords[i] = yspan - ycoords[i] - _heights[i]; - } - return yspan; - } -} - -float SPeval::yEvalFast(const vector& XX, - const vector& YY, - bool botpack, - vector& ycoords) -{ - fill(_match.begin(), _match.end(), 0); - if (botpack) { - return _lcsComputeFast(_reverseXX, YY, _heights, _match, ycoords, _LL); - } else { - float yspan - = _lcsComputeFast(XX, _reverseYY, _heights, _match, ycoords, _LL); - for (unsigned i = 0; i < YY.size(); ++i) { - ycoords[i] = yspan - ycoords[i] - _heights[i]; - } - return yspan; - } -} - -void SPeval::evaluate(const vector& X, - const vector& Y, - bool leftpack, - bool botpack) -{ - if (_paramUseFastSP) { - evaluateFast(X, Y, leftpack, botpack); - return; - } - - reverse_copy(X.begin(), X.end(), _reverseXX.begin()); - xSize = xEval(X, Y, leftpack, xloc); - ySize = yEval(X, Y, botpack, yloc); -} - -void SPeval::evaluateFast(const vector& X, - const vector& Y, - bool leftpack, - bool botpack) -{ - if (!leftpack || botpack) { - reverse_copy(X.begin(), X.end(), _reverseXX.begin()); - } - if (!leftpack || !botpack) { - reverse_copy(Y.begin(), Y.end(), _reverseYY.begin()); - } - xSize = xEvalFast(X, Y, leftpack, xloc); - ySize = yEvalFast(X, Y, botpack, yloc); -} - -void SPeval::evaluateCompact(const vector& X, - const vector& Y, - bool whichDir, - bool leftpack, - bool botpack) -{ - if (whichDir) // evaluate xloc first and then compact - { - if (!leftpack || botpack) { - reverse_copy(X.begin(), X.end(), _reverseXX.begin()); - } - if (!leftpack || !botpack) { - reverse_copy(Y.begin(), Y.end(), _reverseYY.begin()); - } - xEval(X, Y, leftpack, xloc); - ySize = yEvalCompact(X, Y, botpack, xloc, yloc); - xSize = xEvalCompact(X, Y, leftpack, xloc, yloc); - } else // evaluate yloc first and then compact - { - reverse_copy(X.begin(), X.end(), _reverseXX.begin()); - if (!leftpack || !botpack) { - reverse_copy(Y.begin(), Y.end(), _reverseYY.begin()); - } - yEval(X, Y, botpack, yloc); - xSize = xEvalCompact(X, Y, leftpack, xloc, yloc); - ySize = yEvalCompact(X, Y, botpack, xloc, yloc); - } -} - -void SPeval::evalSlacks(const vector& X, const vector& Y) -{ - if (_paramUseFastSP) { - evalSlacksFast(X, Y); - return; - } - - reverse_copy(X.begin(), X.end(), _reverseXX.begin()); - - bool leftpack = true; - xSize = xEval(X, Y, leftpack, xloc); - xEval(X, Y, !leftpack, xlocRev); - - bool botpack = true; - ySize = yEval(X, Y, botpack, yloc); - yEval(X, Y, !botpack, ylocRev); - - for (unsigned i = 0; i < X.size(); ++i) { - xSlacks[i] = (xlocRev[i] - xloc[i]) * 100. / xSize; - ySlacks[i] = (ylocRev[i] - yloc[i]) * 100. / ySize; - } -} - -void SPeval::evalSlacksFast(const vector& X, - const vector& Y) -{ - reverse_copy(X.begin(), X.end(), _reverseXX.begin()); - reverse_copy(Y.begin(), Y.end(), _reverseYY.begin()); - - bool leftpack = true; - xSize = xEvalFast(X, Y, leftpack, xloc); - xEvalFast(X, Y, !leftpack, xlocRev); - - bool botpack = true; - ySize = yEvalFast(X, Y, botpack, yloc); - yEvalFast(X, Y, !botpack, ylocRev); - - for (unsigned i = 0; i < X.size(); ++i) { - xSlacks[i] = (xlocRev[i] - xloc[i]) * 100. / xSize; - ySlacks[i] = (ylocRev[i] - yloc[i]) * 100. / ySize; - } -} - -float SPeval::_lcsComputeCompact(const vector& X, - const vector& Y, - const vector& weights, - vector& match, - vector& P, - vector& L, - vector& oppLocs, - vector& oppWeights) -{ - float finalSize = -std::numeric_limits::max(); - unsigned size = X.size(); - for (unsigned i = 0; i < size; ++i) { - match[Y[i]] = i; - L[i] = 0; - } - - float t; - unsigned j; - for (unsigned i = 0; i < size; ++i) { - unsigned p = match[X[i]]; - P[X[i]] = L[p]; - t = P[X[i]] + weights[X[i]]; - - float iStart = oppLocs[X[i]]; - float iEnd = oppLocs[X[i]] + oppWeights[X[i]]; - - for (j = p; j < size; ++j) { - float jStart = oppLocs[Y[j]]; - float jEnd = oppLocs[Y[j]] + oppWeights[Y[j]]; - - if (iStart >= jEnd || iEnd <= jStart) // no constraint - continue; - - if (t > L[j]) { - L[j] = t; - if (t > finalSize) - finalSize = t; - } - } - } - return finalSize; -} - -void SPeval::computeConstraintGraphs(const vector& X, - const vector& Y) -{ - unsigned size = X.size(); - if (!_TCGMatrixInitialized) - _initializeTCGMatrix(size); - - vector matchX; - vector matchY; - matchX.resize(size); - matchY.resize(size); - - for (unsigned i = 0; i < size; ++i) { - matchX[X[i]] = i; - matchY[Y[i]] = i; - } - - for (unsigned i = 0; i < size; ++i) { - for (unsigned j = 0; j < size; ++j) { - if (i == j) { - _TCGMatrixHoriz[i][j] = 1; - _TCGMatrixVert[i][j] = 1; - continue; - } - - _TCGMatrixHoriz[i][j] = 0; - _TCGMatrixVert[i][j] = 0; - _TCGMatrixHoriz[j][i] = 0; - _TCGMatrixVert[j][i] = 0; - - if (matchX[i] < matchX[j] && matchY[i] < matchY[j]) - _TCGMatrixHoriz[i][j] = 1; - else if (matchX[i] > matchX[j] && matchY[i] > matchY[j]) - _TCGMatrixHoriz[j][i] = 1; - else if (matchX[i] < matchX[j] && matchY[i] > matchY[j]) - _TCGMatrixVert[j][i] = 1; - else if (matchX[i] > matchX[j] && matchY[i] < matchY[j]) - _TCGMatrixVert[i][j] = 1; - else - cout << "ERROR: in computeConstraintGraph \n"; - } - } -} - -void SPeval::removeRedundantConstraints(const vector& X, - const vector& Y, - bool knownDir) -{ - unsigned size = X.size(); - float iStart, iEnd, jStart, jEnd; - for (unsigned i = 0; i < size; ++i) { - if (knownDir == 0) // horizontal - { - iStart = xloc[i]; - iEnd = iStart + _widths[i]; - } else // vertical - { - iStart = yloc[i]; - iEnd = iStart + _heights[i]; - } - for (unsigned j = 0; j < size; ++j) { - if (i == j) - continue; - - if (knownDir == 0) { - jStart = xloc[j]; - jEnd = jStart + _widths[j]; - } else { - jStart = yloc[j]; - jEnd = jStart + _heights[j]; - } - - if (knownDir == 0) { - if (_TCGMatrixVert[i][j] == 1) { - if (iStart >= jEnd || iEnd <= jStart) // no constraint - { - _TCGMatrixVert[i][j] = 0; - if (iStart < jStart) - _TCGMatrixHoriz[i][j] = 1; - else - _TCGMatrixHoriz[j][i] = 1; - } - } - } else { - if (_TCGMatrixHoriz[i][j] == 1) { - if (iStart >= jEnd || iEnd <= jStart) // no constraint - { - cout << i << "\t" << j << "\t" << iStart << "\t" << iEnd << "\t" - << jStart << "\t" << jEnd << endl; - _TCGMatrixHoriz[i][j] = 0; - if (iStart < jStart) - _TCGMatrixVert[i][j] = 1; - else - _TCGMatrixVert[j][i] = 1; - } - } - } - } - } -} - -void SPeval::computeSPFromCG(vector& X, vector& Y) -{ - unsigned size = X.size(); - for (unsigned i = 0; i < size; ++i) { - X[i] = i; - Y[i] = i; - } - - SPXRelation SPX(_TCGMatrixHoriz, _TCGMatrixVert); - SPYRelation SPY(_TCGMatrixHoriz, _TCGMatrixVert); - - std::sort(X.begin(), X.end(), SPX); - std::sort(Y.begin(), Y.end(), SPY); -} - -void SPeval::changeWidths(const vector& widths) -{ - _widths = widths; -} - -void SPeval::changeHeights(const vector& heights) -{ - _heights = heights; -} - -void SPeval::changeNodeWidth(unsigned index, float width) -{ - _widths[index] = width; -} - -void SPeval::changeNodeHeight(unsigned index, float height) -{ - _heights[index] = height; -} - -void SPeval::changeOrient(unsigned index) -{ - float tempWidth = _heights[index]; - _heights[index] = _widths[index]; - _widths[index] = tempWidth; -} - -float SPeval::_lcsReverseCompute(const vector& X, - const vector& Y, - const vector& weights, - vector& match, - vector& P, - vector& L) -{ - unsigned size = X.size(); - for (unsigned i = 0; i < size; ++i) { - match[Y[i]] = i; - L[i] = 0; - } - - float t; - int j; - for (int i = size - 1; i >= 0; --i) { - unsigned p = match[X[i]]; - P[X[i]] = L[p]; - t = P[X[i]] + weights[X[i]]; - - for (j = p; j >= 0; --j) { - if (t > L[j]) - L[j] = t; - else - break; - } - } - return L[0]; -} - -void SPeval::_discardNodesBST(unsigned index, float length) -{ - map::iterator iter; - map::iterator nextIter; - map::iterator endIter; - endIter = _BST.end(); - iter = _BST.find(index); - nextIter = iter; - ++nextIter; - if (nextIter != _BST.end()) { - ++iter; - while (true) { - ++nextIter; - if ((*iter).second < length) - _BST.erase(iter); - if (nextIter == endIter) - break; - iter = nextIter; - } - } -} - -float SPeval::_findBST(unsigned index) -{ - map::iterator iter; - float loc; - iter = _BST.lower_bound(index); - if (iter != _BST.begin()) { - iter--; - loc = (*iter).second; - } else - loc = 0; - return loc; -} - -float SPeval::_lcsComputeFast(const vector& X, - const vector& Y, - const vector& weights, - vector& match, - vector& P, - vector& L) -{ - _BST.clear(); - _BST[0] = 0; - unsigned size = X.size(); - for (unsigned i = 0; i < size; ++i) { - match[Y[i]] = i; - } - - float t; - // unsigned j; - for (unsigned i = 0; i < size; ++i) { - unsigned p = match[X[i]]; - P[X[i]] = _findBST(p); - t = P[X[i]] + weights[X[i]]; - _BST[p] = t; - _discardNodesBST(p, t); - } - float length = _findBST(size); - return length; -} diff --git a/src/mpl/src/ParquetFP/src/SPeval.h b/src/mpl/src/ParquetFP/src/SPeval.h deleted file mode 100644 index 6fa52fd7b3c..00000000000 --- a/src/mpl/src/ParquetFP/src/SPeval.h +++ /dev/null @@ -1,181 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef SPEVAL_H -#define SPEVAL_H - -#include -#include -#include -#include -#include -#include -#include - -namespace parquetfp { -class SPeval -{ - private: - // buffers go in here - std::vector _match; - std::vector _reverseXX; - std::vector _reverseYY; - std::vector _LL; - std::vector _heights; - std::vector _widths; - std::vector _xlocRev; - std::vector _ylocRev; - std::map _BST; // for the O(nlogn) algo - - std::vector> _TCGMatrixHoriz; - std::vector> _TCGMatrixVert; - - float _lcsCompute(const std::vector& X, - const std::vector& Y, - const std::vector& weights, - std::vector& match, - std::vector& P, - std::vector& L); - - float _lcsReverseCompute(const std::vector& X, - const std::vector& Y, - const std::vector& weights, - std::vector& match, - std::vector& P, - std::vector& L); - - float _lcsComputeCompact(const std::vector& X, - const std::vector& Y, - const std::vector& weights, - std::vector& match, - std::vector& P, - std::vector& L, - std::vector& oppLocs, - std::vector& oppWeights); - - // fast are for the O(nlog n) algo - float _findBST(unsigned index); // see the paper for definitions - void _discardNodesBST(unsigned index, float length); - - float _lcsComputeFast(const std::vector& X, - const std::vector& Y, - const std::vector& weights, - std::vector& match, - std::vector& P, - std::vector& L); - - bool _TCGMatrixInitialized; - void _initializeTCGMatrix(unsigned size); - bool _paramUseFastSP; - - public: - std::vector xloc; - std::vector yloc; - std::vector xlocRev; - std::vector ylocRev; - float xSize; - float ySize; - std::vector xSlacks; - std::vector ySlacks; - - SPeval(const std::vector& heights, - const std::vector& widths, - bool paramUseFastSP); - - void evaluate(const std::vector& X, - const std::vector& Y, - bool leftpack, - bool botpack); - void evalSlacks(const std::vector& X, - const std::vector& Y); - void evaluateCompact(const std::vector& X, - const std::vector& Y, - bool whichDir, - bool leftpack, - bool botpack); - - // following are for evaluating with the O(nlog n) scheme - void evaluateFast(const std::vector& X, - const std::vector& Y, - bool leftpack, - bool botpack); - void evalSlacksFast(const std::vector& X, - const std::vector& Y); - - private: - float xEval(const std::vector& X, - const std::vector& Y, - bool leftpack, - std::vector& xcoords); - float yEval(const std::vector& X, - const std::vector& Y, - bool botpack, - std::vector& ycoords); - float xEvalCompact(const std::vector& X, - const std::vector& Y, - bool leftpack, - std::vector& xcoords, - std::vector& ycoords); - float yEvalCompact(const std::vector& X, - const std::vector& Y, - bool botpack, - std::vector& xcoords, - std::vector& ycoords); - void computeConstraintGraphs(const std::vector& X, - const std::vector& Y); - void removeRedundantConstraints(const std::vector& X, - const std::vector& Y, - bool knownDir); - void computeSPFromCG(std::vector& X, std::vector& Y); - - // following are for evaluating with the O(nlog n) scheme - float xEvalFast(const std::vector& X, - const std::vector& Y, - bool leftpack, - std::vector& xcoords); - float yEvalFast(const std::vector& X, - const std::vector& Y, - bool botpack, - std::vector& ycoords); - - public: - // miscelleneous functions - void changeWidths(const std::vector& widths); - void changeHeights(const std::vector& heights); - void changeNodeWidth(const unsigned index, float width); - void changeNodeHeight(const unsigned index, float height); - void changeOrient(unsigned index); -}; -} // namespace parquetfp -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/SeqPair.cxx b/src/mpl/src/ParquetFP/src/SeqPair.cxx deleted file mode 100644 index 91f05a89662..00000000000 --- a/src/mpl/src/ParquetFP/src/SeqPair.cxx +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "SeqPair.h" - -#include "FPcommon.h" - -using namespace parquetfp; -using std::cout; -using std::endl; -using std::vector; - -// ctor randomly generates the seqPair -SeqPair::SeqPair(unsigned size, std::mt19937& random_gen) -{ - _XX.resize(size); - _YY.resize(size); - for (unsigned i = 0; i < size; ++i) { - _XX[i] = i; - _YY[i] = i; - } - - std::shuffle(_XX.begin(), _XX.end(), random_gen); - std::shuffle(_YY.begin(), _YY.end(), random_gen); -} - -SeqPair::SeqPair(const vector& X, const vector& Y) - : _XX(X), _YY(Y) -{ - if (X.size() != Y.size()) - cout << "ERROR: Input Sequence Pairs of different sizes" << endl; -} diff --git a/src/mpl/src/ParquetFP/src/SeqPair.h b/src/mpl/src/ParquetFP/src/SeqPair.h deleted file mode 100644 index 3b4c3a2f575..00000000000 --- a/src/mpl/src/ParquetFP/src/SeqPair.h +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef SEQPAIR_H -#define SEQPAIR_H - -#include -#include -#include -#include -#include -#include -#include - -namespace parquetfp { -class SeqPair -{ - private: - std::vector _XX; // seqPair in the X direction - std::vector _YY; // seqPair in the Y direction - - public: - // empty sequence-pair - SeqPair() {} - - // random sequence-pair of length "size" - SeqPair(unsigned size, std::mt19937& random_gen); - - // sequence-pair (X, Y) - SeqPair(const std::vector& X, const std::vector& Y); - - inline const std::vector& getX() const; - inline const std::vector& getY() const; - - inline void putX(const std::vector& X); - inline void putY(const std::vector& Y); - - inline void printX(void) const; - inline void printY(void) const; - - inline unsigned getSize(void) const; -}; - -// -----IMPLEMENTATIONS----- -const std::vector& SeqPair::getX(void) const -{ - return _XX; -} - -const std::vector& SeqPair::getY(void) const -{ - return _YY; -} - -void SeqPair::putX(const std::vector& X) -{ - _XX = X; -} - -void SeqPair::putY(const std::vector& Y) -{ - _YY = Y; -} - -unsigned SeqPair::getSize(void) const -{ - return _XX.size(); -} - -void SeqPair::printX(void) const -{ - std::cout << "X Seq Pair" << std::endl; - for (unsigned i = 0; i < _XX.size(); ++i) { - std::cout << _XX[i] << " "; - } - std::cout << std::endl; -} - -void SeqPair::printY(void) const -{ - std::cout << "Y Seq Pair" << std::endl; - for (unsigned i = 0; i < _XX.size(); ++i) { - std::cout << _YY[i] << " "; - } - std::cout << std::endl; -} -} // namespace parquetfp -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/SolveMulti.cxx b/src/mpl/src/ParquetFP/src/SolveMulti.cxx deleted file mode 100644 index 9b2a31f4dad..00000000000 --- a/src/mpl/src/ParquetFP/src/SolveMulti.cxx +++ /dev/null @@ -1,541 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "SolveMulti.h" - -#include - -#include "ClusterDB.h" -#include "CommandLine.h" -#include "FPcommon.h" -#include "baseannealer.h" -#include "btreeanneal.h" -#include "mixedpacking.h" - -using namespace parquetfp; -using std::cout; -using std::endl; -using std::numeric_limits; -using std::vector; - -SolveMulti::SolveMulti(DB* db, Command_Line* params) : _newDB(0) -{ - _db = db; - _params = params; - //_newDB = new DB(_params->minWL); - clusterTime = 0.0; - annealTime = 0.0; -} - -SolveMulti::~SolveMulti() -{ - if (_newDB) - delete _newDB; -} - -DB* SolveMulti::clusterOnly() const -{ - ClusterDB multiCluster(_db, _params); - - DB* clusteredDB = 0; - - if (_params->clusterPhysical) - multiCluster.clusterMultiPhysical(clusteredDB); - else - multiCluster.clusterMulti(clusteredDB); - - return clusteredDB; // Transfer ownership of the DB -} - -void SolveMulti::go(void) -{ - ClusterDB multiCluster(_db, _params); - - if (_params->clusterPhysical) - multiCluster.clusterMultiPhysical(_newDB); - else - multiCluster.clusterMulti(_newDB); - - if (_params->verb > 0) - cout << "Num Nodes: " << _newDB->getNumNodes() - << " Num Nets: " << _newDB->getNets()->getNumNets() - << " Num Pins: " << _newDB->getNets()->getNumPins() - << " Num Obstacles: " << _newDB->getNumObstacles() << endl; - - /* _newDB->plot("cluster.plt", _newDB->evalArea(), - 100*(_newDB->evalArea()-_newDB->getNodesArea())/_newDB->getNodesArea(), - _newDB->getXMax()/_newDB->getYMax(), 0, _newDB->evalHPWL(), 0, 1, 0); - */ - float reqdWidth = numeric_limits::max(); - float reqdHeight = numeric_limits::max(); - float oldDBArea = _db->getNodesArea(); - float newDBArea = _newDB->getNodesArea(); - float maxArea = (1.f + _params->maxWS / 100) * oldDBArea; - float newMaxWS = (maxArea / newDBArea - 1.f) * 100.f; - float oldMaxWS = _params->maxWS; - float inverseRatio = 1.f; - - if (lessThanFloat(newMaxWS, 100.f * _params->shrinkToSize)) { - // we don't have enough whitespace, so lets shrink the - // hard movable objects to make more room - - float targetDBArea = maxArea / (1.f + _params->shrinkToSize); - float ratio = targetDBArea / newDBArea; - inverseRatio = newDBArea / targetDBArea; - - _newDB->resizeHardBlocks(ratio); - - newDBArea = _newDB->getNodesArea(); - newMaxWS = (maxArea / newDBArea - 1.f) * 100.f; - } else { - _params->shrinkToSize = -1.f; - } - - _params->maxWS = newMaxWS; - bool fixedOutline = _params->reqdAR != -9999; - if (fixedOutline && _params->verb > 0) - cout << "newMaxWS is " << _params->maxWS << endl; - - if (fixedOutline) { - reqdHeight = sqrt(maxArea / _params->reqdAR); - reqdWidth = maxArea / reqdHeight; - } - float currXSize, currYSize; - int maxIter = 0; - - if (_db->getNumObstacles() > 0 && _params->FPrep != "BTree") { - if (_params->verb > 0) - cout << "Obstacles detected. Changing annealer to B*Tree" << endl; - _params->FPrep = "BTree"; - } - - BaseAnnealer* annealer = NULL; - if (_params->FPrep == "BTree") { - annealer = new BTreeAreaWireAnnealer(_params, _newDB); - } else if (_params->FPrep == "SeqPair") { - annealer = new BTreeAreaWireAnnealer(_params, _newDB); - } else if (_params->FPrep == "Best") { - if (_newDB->getNumNodes() < 100 && _params->maxWS > 10.) { - _params->FPrep = "SeqPair"; - annealer = new BTreeAreaWireAnnealer(_params, _newDB); - } else { - _params->FPrep = "BTree"; - annealer = new BTreeAreaWireAnnealer(_params, _newDB); - } - } else { - fpfatal(false, "Invalid floorplan representation specified"); - exit(1); - } - - if (_params->takePl) { - // convert placement to sequence pair - annealer->takePlfromDB(); - } - - if (_params->initQP) { - annealer->solveQP(); - annealer->takePlfromDB(); - } - - if (_params->initCompact) { - bool minimizeWL = false; - annealer->compactSoln(minimizeWL, fixedOutline, reqdHeight, reqdWidth); - //_newDB->plot("out.plt", currArea, 0, 0, 0, 0, 0, 0, 0); - } - - // annealer->eval(); - float startArea = _newDB->getXMax() * _newDB->getYMax(); - if (_params->verb > 0) - cout << "Starting whitespace " << 100 * (startArea - newDBArea) / newDBArea - << "%. Starting AR " << _newDB->getXMax() / _newDB->getYMax() << endl; - - //_newDB->save("temp"); - - unsigned numNodes = _newDB->getNumNodes(); - Point dummy(0, 0); - vector bestSolnPl(numNodes, dummy); - vector bestSolnOrient(numNodes, N); - vector bestSolnWidth(numNodes, 0); - vector bestSolnHeight(numNodes, 0); - Nodes* newNodes = _newDB->getNodes(); - - float minViol = std::numeric_limits::max(); - bool satisfied = true; - do { - annealer->go(); - - // do the shifting HPWL optimization at the very end - // if (_params->minWL) - // annealer->postHPWLOpt(); - - currXSize = _newDB->getXMax(); - currYSize = _newDB->getYMax(); - - if (_params->solveTop && _params->dontClusterMacros) { - float tempXSize = _newDB->getXMaxWMacroOnly(); - float tempYSize = _newDB->getYMaxWMacroOnly(); - if (tempXSize > 1e-5 && tempYSize > 1e-5) { - currXSize = tempXSize; - currYSize = tempYSize; - } - } - - bool legal = lessOrEqualFloat(currXSize, reqdWidth) - && lessOrEqualFloat(currYSize, reqdHeight); - - if (_params->compact || !legal) { - annealer->compactSoln( - _params->minWL, fixedOutline, reqdHeight, reqdWidth); - - currXSize = _newDB->getXMax(); - currYSize = _newDB->getYMax(); - - if (_params->solveTop && _params->dontClusterMacros) { - cout << "checking size with macros only" << endl; - - float tempXSize = _newDB->getXMaxWMacroOnly(); - float tempYSize = _newDB->getYMaxWMacroOnly(); - if (tempXSize > 1e-5 && tempYSize > 1e-5) { - currXSize = tempXSize; - currYSize = tempYSize; - } - } - - legal = lessOrEqualFloat(currXSize, reqdWidth) - && lessOrEqualFloat(currYSize, reqdHeight); - } - - if (fixedOutline && legal && _params->verb > 0) { - cout << "Fixed-outline FPing SUCCESS" << endl; - } - - if (fixedOutline && !legal && _params->verb > 0) { - cout << "Fixed-outline FPing FAILURE" << endl; - } - - if (legal) - break; - - // if not satisfied. then save best solution - float viol = 0; - if (currXSize > reqdWidth) - viol += (currXSize - reqdWidth); - if (currYSize > reqdHeight) - viol += (currYSize - reqdHeight); - - if (minViol > viol) { - minViol = viol; - itNode node; - unsigned nodeId = 0; - for (node = newNodes->nodesBegin(); node != newNodes->nodesEnd(); - ++node) { - bestSolnPl[nodeId].x = node->getX(); - bestSolnPl[nodeId].y = node->getY(); - bestSolnOrient[nodeId] = node->getOrient(); - bestSolnWidth[nodeId] = node->getWidth(); - bestSolnHeight[nodeId] = node->getHeight(); - ++nodeId; - } - } - - maxIter++; - if (maxIter == _params->maxIterHier) { - if (_params->verb > 0) - cout << "FAILED to satisfy fixed outline constraints" - << " for clustered hypergraph" << endl; - satisfied = false; - break; - } - - // change the annealer to BTree if 1'st 2 iterations fail - if (maxIter == 2 && _params->FPrep == "SeqPair") { - if (_params->verb > 0) - cout << "Failed 1st iteration. Changing annealer to B*Tree" << endl; - - annealTime += annealer->annealTime; - delete annealer; - - _params->FPrep = "BTree"; - annealer = new BTreeAreaWireAnnealer(_params, _newDB); - } - } while (1); - - annealTime += annealer->annealTime; - delete annealer; - - if (!satisfied) // failed to satisfy constraints. save best soln - { - itNode node; - unsigned nodeId = 0; - for (node = newNodes->nodesBegin(); node != newNodes->nodesEnd(); ++node) { - node->putX(bestSolnPl[nodeId].x); - node->putY(bestSolnPl[nodeId].y); - node->changeOrient(bestSolnOrient[nodeId], *(_newDB->getNets())); - node->putWidth(bestSolnWidth[nodeId]); - node->putHeight(bestSolnHeight[nodeId]); - ++nodeId; - } - } - - if (!equalFloat(inverseRatio, 1.f)) { - _newDB->resizeHardBlocks(inverseRatio); - } - - updatePlaceUnCluster(_newDB); - - if (!_params->solveTop) - placeSubBlocks(); - - _params->maxWS = oldMaxWS; - - /* - _newDB->plot("main.plt", _newDB->evalArea(), - 100*(_newDB->evalArea()-_newDB->getNodesArea())/_newDB->getNodesArea(), - _newDB->getXMax()/_newDB->getYMax(), 0, _newDB->evalHPWL(), - 0, 0, 1); - - _db->plot("final.plt", _db->evalArea(), - 100*(_db->evalArea()-_db->getNodesArea())/_db->getNodesArea(), - _db->getXMax()/_db->getYMax(), 0, _db->evalHPWL(), - 0, 0, 0); - */ -} - -void SolveMulti::placeSubBlocks(void) -{ - Nodes* nodes = _newDB->getNodes(); - Nodes* origNodes = _db->getNodes(); - - // itNode node; - - Command_Line* params = new Command_Line(*_params); - params->budgetTime = 0; // (false) - - // for each node at top-level - for (itNode node = nodes->nodesBegin(); node != nodes->nodesEnd(); ++node) { - Point dbLoc; // location of a top-level block - dbLoc.x = node->getX(); - dbLoc.y = node->getY(); - params->reqdAR = node->getWidth() / node->getHeight(); - - DB* tempDB = new DB(_db, node->getSubBlocks(), dbLoc, params->reqdAR); - - if (_params->verb > 0) - cout << node->getName() << " numSubBlks : " << node->numSubBlocks() - << "reqdAR " << params->reqdAR << endl; - - std::unique_ptr annealer; - if (params->FPrep == "BTree") { - annealer.reset(new BTreeAreaWireAnnealer(params, tempDB)); - } else if (params->FPrep == "SeqPair") { - annealer.reset(new BTreeAreaWireAnnealer(params, tempDB)); - } else if (_params->FPrep == "Best") { - if (tempDB->getNumNodes() < 100 && _params->maxWS > 10.) { - annealer.reset(new BTreeAreaWireAnnealer(_params, tempDB)); - } else { - annealer.reset(new BTreeAreaWireAnnealer(_params, tempDB)); - } - } else { - fpfatal(false, "Invalid floorplan representation specified"); - } - - float currXSize, currYSize; - float reqdWidth = node->getWidth(); - float reqdHeight = node->getHeight(); - - int maxIter = 0; - if (node->numSubBlocks() > 1) { - unsigned numNodes = tempDB->getNumNodes(); - Point dummy; - dummy.x = 0; - dummy.y = 0; - - vector bestSolnPl(numNodes, dummy); - vector bestSolnOrient(numNodes, N); - vector bestSolnWidth(numNodes, 0); - vector bestSolnHeight(numNodes, 0); - Nodes* tempNodes = tempDB->getNodes(); - - float minViol = std::numeric_limits::max(); - bool satisfied = true; - do { - annealer->go(); - - // do the shifting HPWL optimization after packing - // if (_params->minWL) - // annealer->postHPWLOpt(); - - currXSize = tempDB->getXMax(); - currYSize = tempDB->getYMax(); - if (currXSize <= reqdWidth && currYSize <= reqdHeight) - break; - - // if not satisfied. then save best solution - float viol = 0; - if (currXSize > reqdWidth) - viol += (currXSize - reqdWidth); - if (currYSize > reqdHeight) - viol += (currYSize - reqdHeight); - - if (minViol > viol) { - minViol = viol; - unsigned nodeId = 0; - - for (itNode tempNode = tempNodes->nodesBegin(); - tempNode != tempNodes->nodesEnd(); - ++tempNode) { - bestSolnPl[nodeId].x = tempNode->getX(); - bestSolnPl[nodeId].y = tempNode->getY(); - bestSolnOrient[nodeId] = tempNode->getOrient(); - bestSolnWidth[nodeId] = tempNode->getWidth(); - bestSolnHeight[nodeId] = tempNode->getHeight(); - ++nodeId; - } - } - - maxIter++; - if (maxIter == _params->maxIterHier) { - if (_params->verb > 0) - cout << "FAILED to satisfy fixed outline constraints for " - << node->getName() << endl; - satisfied = false; - break; - } - } while (1); - - if (!satisfied) // failed to satisfy constraints. save best soln - { - unsigned nodeId = 0; - for (itNode tempNode = tempNodes->nodesBegin(); - tempNode != tempNodes->nodesEnd(); - ++tempNode) { - tempNode->putX(bestSolnPl[nodeId].x); - tempNode->putY(bestSolnPl[nodeId].y); - tempNode->changeOrient(bestSolnOrient[nodeId], *(tempDB->getNets())); - // *(_newDB->getNets())); - tempNode->putWidth(bestSolnWidth[nodeId]); - tempNode->putHeight(bestSolnHeight[nodeId]); - ++nodeId; - } - } - } else { - Point loc; - loc.x = 0.0; - loc.y = 0.0; - tempDB->initPlacement(loc); - } - - Point offset; - offset.x = node->getX(); - offset.y = node->getY(); - - tempDB->shiftDesign(offset); - - Nodes* tempNodes = tempDB->getNodes(); - - if (node->numSubBlocks() > 1) { - for (itNode tempNode = tempNodes->nodesBegin(); - tempNode != tempNodes->nodesEnd(); - ++tempNode) { - for (vector::iterator tempIdx = tempNode->subBlocksBegin(); - tempIdx != tempNode->subBlocksEnd(); - ++tempIdx) { - Node& origNode = origNodes->getNode(*tempIdx); - origNode.putX(tempNode->getX()); - origNode.putY(tempNode->getY()); - origNode.changeOrient(tempNode->getOrient(), *(_db->getNets())); - origNode.putHeight(tempNode->getHeight()); - origNode.putWidth(tempNode->getWidth()); - } - } - } else if (node->numSubBlocks() == 1) { - vector::iterator tempIdx = node->subBlocksBegin(); - Node& origNode = origNodes->getNode(*tempIdx); - origNode.putX(node->getX()); - origNode.putY(node->getY()); - origNode.changeOrient(node->getOrient(), *(_db->getNets())); - origNode.putHeight(node->getHeight()); - origNode.putWidth(node->getWidth()); - } - delete tempDB; - } // end for each node - delete params; -} - -void SolveMulti::updatePlaceUnCluster(DB* clusterDB) -{ - Nodes* nodes = _db->getNodes(); - Nodes* newNodes = clusterDB->getNodes(); - - itNode node; - - const unsigned numNew = 6; - float layOutXSize = _db->getXMax(); - float layOutYSize = _db->getYMax(); - float xStep = layOutXSize / numNew; - float yStep = layOutYSize / numNew; - - for (node = newNodes->nodesBegin(); node != newNodes->nodesEnd(); ++node) { - if (node->numSubBlocks() > 1) { - for (vector::iterator subBlockIdx = node->subBlocksBegin(); - subBlockIdx != node->subBlocksEnd(); - ++subBlockIdx) { - Node& tempNode = nodes->getNode(*subBlockIdx); - if (!_params->usePhyLocHier || node->numSubBlocks() == 1) { - tempNode.putX(node->getX()); - tempNode.putY(node->getY()); - tempNode.changeOrient(node->getOrient(), *(_db->getNets())); - } else { - float xloc = tempNode.getX(); - float yloc = tempNode.getY(); - unsigned xIdx = unsigned(floor(xloc / xStep)); - unsigned yIdx = unsigned(floor(yloc / yStep)); - xloc -= xIdx * xStep; - yloc -= yIdx * yStep; - - tempNode.putX(xloc + node->getX()); - tempNode.putY(yloc + node->getY()); - } - // tempNode.changeOrient(node->getOrient(), *(_db->getNets())); - } - } else if (node->numSubBlocks() == 1) // the only block - { - vector::iterator subBlockIdx = node->subBlocksBegin(); - Node& tempNode = nodes->getNode(*subBlockIdx); - tempNode.putX(node->getX()); - tempNode.putY(node->getY()); - tempNode.changeOrient(node->getOrient(), *(_db->getNets())); - tempNode.putHeight(node->getHeight()); - tempNode.putWidth(node->getWidth()); - } - } -} diff --git a/src/mpl/src/ParquetFP/src/SolveMulti.h b/src/mpl/src/ParquetFP/src/SolveMulti.h deleted file mode 100644 index 8cd101753cc..00000000000 --- a/src/mpl/src/ParquetFP/src/SolveMulti.h +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef SOLVEMULTI_H -#define SOLVEMULTI_H - -#include -#include - -#include -#include - -namespace parquetfp { -class DB; -class Command_Line; - -class SolveMulti -{ - private: - DB* _db; - Command_Line* _params; - DB* _newDB; - - public: - SolveMulti(DB* db, Command_Line* params); - ~SolveMulti(); - void go(void); - DB* clusterOnly() const; - - void placeSubBlocks(void); - void updatePlaceUnCluster(DB* clusterDB); - - mutable float clusterTime; - mutable float annealTime; -}; -} // namespace parquetfp -// using namespace parquetfp; - -#endif diff --git a/src/mpl/src/ParquetFP/src/allparquet.h b/src/mpl/src/ParquetFP/src/allparquet.h deleted file mode 100644 index c3a486436ad..00000000000 --- a/src/mpl/src/ParquetFP/src/allparquet.h +++ /dev/null @@ -1,43 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef ALLPARQUET_H -#define ALLPARQUET_H - -#include "AnalytSolve.h" -#include "CommandLine.h" -#include "DB.h" -#include "FPcommon.h" -#include "PlToSP.h" -#include "SPeval.h" - -#endif diff --git a/src/mpl/src/ParquetFP/src/baseannealer.cxx b/src/mpl/src/ParquetFP/src/baseannealer.cxx deleted file mode 100644 index be99b347df2..00000000000 --- a/src/mpl/src/ParquetFP/src/baseannealer.cxx +++ /dev/null @@ -1,199 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "baseannealer.h" - -#include "AnalytSolve.h" -#include "CommandLine.h" -#include "DB.h" -#include "basepacking.h" - -#ifdef _MSC_VER -#ifndef srand48 -#define srand48 srand -#endif -#endif - -#ifdef WIN32 -#define _X86_ -#include -#include -#else -#include -#endif - -using std::cout; -using std::endl; - -const int BaseAnnealer::UNINITIALIZED = -1; -const unsigned int BaseAnnealer::UNSIGNED_UNINITIALIZED = 0; -const int BaseAnnealer::FREE_OUTLINE = -9999; -const int BaseAnnealer::NOT_FOUND = -1; - -// -------------------------------------------------------- -BaseAnnealer::BaseAnnealer(const parquetfp::Command_Line* const params, - parquetfp::DB* const db) - : _db(db), - _params(params), - _analSolve(new parquetfp::AnalytSolve(const_cast(db))), - - _isFixedOutline(_params->reqdAR != FREE_OUTLINE), - _outlineDeadspaceRatio((_isFixedOutline) - ? (1 + (_params->maxWS / 100.0)) - : basepacking_h::Dimension::Infty), - - _outlineArea((_isFixedOutline) - ? (_db->getNodesArea() * _outlineDeadspaceRatio) - : basepacking_h::Dimension::Infty), - - _outlineWidth((_isFixedOutline) ? sqrt(_outlineArea * _params->reqdAR) - : basepacking_h::Dimension::Infty), - - _outlineHeight((_isFixedOutline) ? sqrt(_outlineArea / _params->reqdAR) - : basepacking_h::Dimension::Infty), - _random_gen(_rd()) -{ - // compilerCheck(); - - // set the random seed for each invokation of the Annealer - unsigned seed = _params->seed; - - srand(seed); // seed for rand function - _random_gen.seed(seed); // seed for shuffle - - _baseFileName = _params->inFileName; - annealTime = 0.0; -} -// -------------------------------------------------------- -BaseAnnealer::~BaseAnnealer() -{ - if (_analSolve != NULL) - delete _analSolve; -} -// -------------------------------------------------------- -void BaseAnnealer::solveQP() -{ - _analSolve->solveSOR(); - _db->updatePlacement(_analSolve->getXLocs(), _analSolve->getYLocs()); -} -// -------------------------------------------------------- -void BaseAnnealer::postHPWLOpt() -{ - // parquetfp::Point offset = _analSolve->getDesignOptLoc(); - // cout << "offset.x " << offset.x - // << " offset.y " << offset.y << endl; - - // float initHPWL = _db->evalHPWL(); - // cout << "initHPWL: " << initHPWL << endl; - // _db->shiftDesign(offset); - - // float afterHPWL = _db->evalHPWL(); - // cout << "afterHPWL: " << afterHPWL << endl; - // if(afterHPWL > initHPWL) - // { - // cout << "shifting not done." << endl; - // offset.x *= -1; - // offset.y *= -1; - // _db->shiftDesign(offset); - // } - // else - // cout << "shifting is done." << endl; - - // only shift in "fixed-outline" mode - if (_params->reqdAR != FREE_OUTLINE) { - float blocksArea = _db->getNodesArea(); - float reqdAR = _params->reqdAR; - float reqdArea = blocksArea * (1 + _params->maxWS / 100.0); - float reqdWidth = sqrt(reqdArea * reqdAR); - float reqdHeight = sqrt(reqdArea / reqdAR); - -// printf("blocksArea: %.2f reqdWidth: %.2f reqdHeight: %.2f\n", -// blocksArea, reqdWidth, reqdHeight); -#ifdef USEFLUTE - _db->shiftOptimizeDesign(reqdWidth, - reqdHeight, - _params->scaleTerms, - _params->useSteiner, - _params->verb); -#else - _db->shiftOptimizeDesign( - reqdWidth, reqdHeight, _params->scaleTerms, _params->verb); -#endif - } -} -// -------------------------------------------------------- -void BaseAnnealer::printResults(const SolutionInfo& curr) const -{ - float blocksArea = _db->getNodesArea(); - float currArea = curr.area; - float currWidth = curr.width; - float currHeight = curr.height; - float currAR = currWidth / currHeight; - float whiteSpace = 100 * (currArea - blocksArea) / blocksArea; - float HPWL = curr.HPWL; - float reqdAR = _params->reqdAR; - float reqdArea = blocksArea * (1 + _params->maxWS / 100.0); - float reqdWidth = sqrt(reqdArea * reqdAR); - float reqdHeight = sqrt(reqdArea / reqdAR); - - cout.precision(6); - - if (_params->verb > 0) - cout << "Final Area: " << currArea << " WhiteSpace " << whiteSpace << "%" - << " AR " << currAR << " HPWL " << HPWL << endl; - - if (_params->verb > 0) { - if (_params->dontClusterMacros && _params->solveTop) - cout << "width w/ macros only: " << _db->getXMaxWMacroOnly() << " "; - else - cout << "width: " << currWidth << " "; - - if (_params->reqdAR != FREE_OUTLINE) - cout << "(outline width: " << reqdWidth << ") "; - cout << endl; - - if (_params->dontClusterMacros && _params->solveTop) - cout << "height w/ macros only: " << _db->getYMaxWMacroOnly() << " "; - else - cout << "height: " << currHeight << " "; - - if (_params->reqdAR != FREE_OUTLINE) - cout << "(outline height: " << reqdHeight << ") "; - cout << endl; - - cout << "area utilization (wrt. total current area): " - << (blocksArea / currArea) * 100 << "%" << endl; - cout << "whitespace (wrt. total current area): " - << (1 - (blocksArea / currArea)) * 100 << "%" << endl; - } -} -// -------------------------------------------------------- diff --git a/src/mpl/src/ParquetFP/src/baseannealer.h b/src/mpl/src/ParquetFP/src/baseannealer.h deleted file mode 100644 index 0ec2c88c068..00000000000 --- a/src/mpl/src/ParquetFP/src/baseannealer.h +++ /dev/null @@ -1,165 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef BASEANNEALER_H -#define BASEANNEALER_H - -#include -#include - -#include "AnalytSolve.h" -#include "CommandLine.h" -#include "DB.h" -#include "basepacking.h" - -// -------------------------------------------------------- -class BaseAnnealer -{ - public: - BaseAnnealer(const parquetfp::Command_Line* const params, - parquetfp::DB* const db); - virtual ~BaseAnnealer(); - - virtual bool go() = 0; // go() == entire annealing process - virtual bool packOneBlock() = 0; // floorplan only one block - - virtual void takePlfromDB() = 0; // get init soln from *db - virtual void solveQP(); // get a quad-minimum soln and update *db - virtual void compactSoln(bool minWL, - bool fixedOutline, - float reqdH, - float reqdW) - = 0; - void postHPWLOpt(); - - inline float isFixedOutline() const; - inline float outlineDeadspaceRatio() const; - inline float outlineArea() const; - inline float outlineWidth() const; - inline float outlineHeight() const; - - // basic constants for readability - static const int UNINITIALIZED; - static const unsigned int UNSIGNED_UNINITIALIZED; - static const int FREE_OUTLINE; - static const int NOT_FOUND; - - enum MOVE_TYPES - { - MISC = -1, - NOOP = 0, - REP_SPEC_MIN = 1, // representation-specific - REP_SPEC_ORIENT = 2, - REP_SPEC_MAX = 5, - SLACKS_MOVE = 6, - AR_MOVE = 7, - ORIENT = 10, - SOFT_BL = 11, - HPWL = 12, - ARWL = 13 - }; - - class SolutionInfo - { - public: - SolutionInfo() - : area(UNINITIALIZED), - width(UNINITIALIZED), - height(UNINITIALIZED), - HPWL(UNINITIALIZED) - { - } - - float area; - float width; - float height; - float HPWL; - }; - void printResults(const SolutionInfo& curr) const; - float annealTime; - - protected: - parquetfp::DB* const _db; // _db, _params behaves like - const parquetfp::Command_Line* const _params; // references, use ptrs for - parquetfp::AnalytSolve* const _analSolve; // code backwd compatibility - std::string _baseFileName; - - const bool _isFixedOutline; - const float _outlineDeadspaceRatio; - const float _outlineArea; - const float _outlineWidth; - const float _outlineHeight; - std::random_device _rd; - std::mt19937 _random_gen; - - BaseAnnealer() - : annealTime(0), - _db(NULL), - _params(NULL), - _analSolve(NULL), - _isFixedOutline(false), - _outlineDeadspaceRatio(basepacking_h::Dimension::Infty), - _outlineArea(basepacking_h::Dimension::Infty), - _outlineWidth(basepacking_h::Dimension::Infty), - _outlineHeight(basepacking_h::Dimension::Infty) - { /* compilerCheck(); */ - } -}; -// -------------------------------------------------------- - -inline float BaseAnnealer::isFixedOutline() const -{ - return _isFixedOutline; -} -// -------------------------------------------------------- -inline float BaseAnnealer::outlineDeadspaceRatio() const -{ - return _outlineDeadspaceRatio; -} -// -------------------------------------------------------- -inline float BaseAnnealer::outlineArea() const -{ - return _outlineArea; -} -// -------------------------------------------------------- -inline float BaseAnnealer::outlineWidth() const -{ - return _outlineWidth; -} -// -------------------------------------------------------- -inline float BaseAnnealer::outlineHeight() const -{ - return _outlineHeight; -} -// -------------------------------------------------------- - -#endif diff --git a/src/mpl/src/ParquetFP/src/basepacking.cxx b/src/mpl/src/ParquetFP/src/basepacking.cxx deleted file mode 100644 index 8169ccebef2..00000000000 --- a/src/mpl/src/ParquetFP/src/basepacking.cxx +++ /dev/null @@ -1,286 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "basepacking.h" - -#include -#include - -#include "parsers.h" -using namespace parse_utils; -using namespace basepacking_h; -using std::cout; -using std::endl; -using std::ifstream; -using std::string; -using std::vector; - -// ======================================================== -void HardBlockInfoType::set_dimensions(int i, - float w, - float h, - float snapX, - float snapY, - float haloX, - float haloY, - float channelX, - float channelY) -{ - in_blocks[i].width.resize(Orient_Num); - in_blocks[i].height.resize(Orient_Num); - in_blocks[i].snapX.resize(Orient_Num); - in_blocks[i].snapY.resize(Orient_Num); - in_blocks[i].haloX.resize(Orient_Num); - in_blocks[i].haloY.resize(Orient_Num); - in_blocks[i].channelX.resize(Orient_Num); - in_blocks[i].channelY.resize(Orient_Num); - for (int j = 0; j < Orient_Num; j++) { - if (j % 2 == 0) { - in_blocks[i].width[j] = w; - in_blocks[i].height[j] = h; - in_blocks[i].snapX[j] = snapX; - in_blocks[i].snapY[j] = snapY; - in_blocks[i].haloX[j] = haloX; - in_blocks[i].haloY[j] = haloY; - in_blocks[i].channelX[j] = channelX; - in_blocks[i].channelY[j] = channelY; - } else { - in_blocks[i].width[j] = h; - in_blocks[i].height[j] = w; - in_blocks[i].snapX[j] = snapY; - in_blocks[i].snapY[j] = snapX; - in_blocks[i].haloX[j] = haloY; - in_blocks[i].haloY[j] = haloX; - in_blocks[i].channelX[j] = channelY; - in_blocks[i].channelY[j] = channelX; - } - } -} -// -------------------------------------------------------- -HardBlockInfoType::HardBlockInfoType(ifstream& ins, const string& format) - : blocks(in_blocks), block_names(in_block_names) -{ - if (format == "txt") - ParseTxt(ins); - else if (format == "blocks") - ParseBlocks(ins); - else { - cout << "ERROR: invalid format: " << format << endl; - exit(1); - } -} -// -------------------------------------------------------- -void HardBlockInfoType::ParseTxt(ifstream& ins) -{ - int blocknum = -1; - ins >> blocknum; - - if (!ins.good()) { - cout << "ERROR: cannot read the block count." << endl; - exit(1); - } - - if (blocknum < 0) { - cout << "ERROR: invalid blocknum" << blocknum << endl; - exit(1); - } - - in_blocks.resize(blocknum + 2); - in_block_names.resize(blocknum + 2); - for (int i = 0; i < blocknum; i++) { - float w, h; - ins >> w >> h; - - if (!ins.good()) { - cout << "ERROR: cannot read block no." << i << endl; - exit(1); - } - - set_dimensions(i, w, h); - - char temp[100]; - temp[0] = '\0'; - sprintf(temp, "%d", i); - in_block_names[i] = temp; - } - set_dimensions(blocknum, 0, Dimension::Infty); - in_block_names[blocknum] = "LEFT"; - - set_dimensions(blocknum + 1, Dimension::Infty, 0); - in_block_names[blocknum + 1] = "BOTTOM"; -} -// -------------------------------------------------------- -// taken from Nodes.cxx of Parquet using FPcommon.h/cxx -// -------------------------------------------------------- -void HardBlockInfoType::ParseBlocks(ifstream& ins) -{ - char block_name[100]; - char block_type[100]; - char tempWord[100]; - - int numSoftBl = 0; - int numHardBl = 0; - int numTerm = 0; - - int indexBlock = 0; - - if (!ins) { - cout << "ERROR: .blocks file could not be opened successfully" << endl; - exit(1); - } - - skiptoeol(ins); - while (!ins.eof()) { - ins >> tempWord; - if (!(strcmp(tempWord, "NumSoftRectangularBlocks"))) - break; - } - - if (!ins.good()) { - cout << "ERROR in parsing .blocks file." << endl; - exit(1); - } - - ins >> tempWord; - ins >> numSoftBl; - if (numSoftBl != 0) { - cout << "ERROR: soft block packing is not supported for now." << endl; - exit(0); - } - - while (!ins.eof()) { - ins >> tempWord; - if (!(strcmp(tempWord, "NumHardRectilinearBlocks"))) - break; - } - ins >> tempWord; - ins >> numHardBl; - - while (!ins.eof()) { - ins >> tempWord; - if (!(strcmp(tempWord, "NumTerminals"))) - break; - } - ins >> tempWord; - ins >> numTerm; - - in_blocks.resize(numHardBl + 2); - in_block_names.resize(numHardBl + 2); - while (ins.good()) { - block_type[0] = '\0'; - eatblank(ins); - - if (ins.eof()) - break; - if (ins.peek() == '#') - eathash(ins); - else { - eatblank(ins); - if (ins.peek() == '\n' || ins.peek() == '\r') { - ins.get(); - continue; - } - - ins >> block_name; - ins >> block_type; - - if (!strcmp(block_type, "softrectangular")) { - cout << "ERROR: soft block packing is not supported now." << endl; - exit(1); - } else if (!strcmp(block_type, "hardrectilinear")) { - Point tempPoint; - vector vertices; - int numVertices; - bool success; - float width, height; - - ins >> numVertices; - success = true; - if (numVertices != 4) { - cout << "ERROR in parsing .blocks file. " - << "rectilinear blocks can be only rectangles for now" << endl; - exit(1); - } - - for (int i = 0; i < numVertices; ++i) { - success &= needCaseChar(ins, '('); - ins.get(); - ins >> tempPoint.x; - success &= needCaseChar(ins, ','); - ins.get(); - ins >> tempPoint.y; - success &= needCaseChar(ins, ')'); - ins.get(); - vertices.push_back(tempPoint); - } - if (!success) { - cout << "ERROR in parsing .blocks file while processing " - << "hardrectilinear blocks." << endl; - exit(1); - } - - width = vertices[2].x - vertices[0].x; - height = vertices[2].y - vertices[0].y; - - // consider a block - // cout << "[" << indexBlock << "] " - // << setw(10) << block_name - // << " width: " << width - // << " height: " << height << endl; - set_dimensions(indexBlock, width, height); - if (indexBlock >= int(block_names.size())) { - cout << "ERROR: too many hard block specified." << endl; - exit(1); - } - in_block_names[indexBlock] = block_name; - ++indexBlock; - } else if (!strcmp(block_type, "terminal")) { /* a pad */ - } else if (ins.good()) { - cout << "ERROR: invalid block type: " << block_type << endl; - exit(1); - } - } - } // end of while-loop - ins.close(); - - if (numSoftBl + numHardBl != indexBlock) { - cout << "ERROR in parsing .blocks file. # blocks do not tally " - << (indexBlock) << " vs. " << (numSoftBl + numHardBl) << endl; - exit(1); - } - set_dimensions(numHardBl, 0, Dimension::Infty); - in_block_names[numHardBl] = "LEFT"; - - set_dimensions(numHardBl + 1, Dimension::Infty, 0); - in_block_names[numHardBl + 1] = "BOTTOM"; -} -// ======================================================== diff --git a/src/mpl/src/ParquetFP/src/basepacking.h b/src/mpl/src/ParquetFP/src/basepacking.h deleted file mode 100644 index 547f6714600..00000000000 --- a/src/mpl/src/ParquetFP/src/basepacking.h +++ /dev/null @@ -1,361 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2007 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef BASEPACKING_H -#define BASEPACKING_H - -#include -#include -#include -#include -#include -#include -#include - -// struct-like classes for representation conversion -// -------------------------------------------------------- -class BasePacking -{ - public: - std::vector xloc; - std::vector yloc; - std::vector width; - std::vector height; -}; -// -------------------------------------------------------- -class OrientedPacking : public BasePacking -{ - public: - enum ORIENT - { - N, - E, - S, - W, - FN, - FE, - FS, - FW, - OrientUndefined = -1 - }; - std::vector orient; - - inline static ORIENT toOrient(char* orient); - inline static const char* toChar(ORIENT orient); - inline static ORIENT flip(ORIENT orient); -}; -inline std::ostream& operator<<(std::ostream& outs, OrientedPacking::ORIENT); -inline void Save_bbb(std::ostream& outs, const OrientedPacking& pk); -inline void Read_bbb(std::istream& ins, const OrientedPacking& pk); -// -------------------------------------------------------- -namespace basepacking_h { -class Dimension -{ - public: - std::vector width; - std::vector height; - - // Grid Snapping - std::vector snapX, snapY; - // Macro Halo Information - std::vector haloX, haloY; - std::vector channelX, channelY; - - static constexpr float Infty = std::numeric_limits::max(); - static constexpr float Epsilon_Accuracy = 1e10f; - static constexpr int Undefined = -1; - static constexpr int Orient_Num = 8; -}; -} // namespace basepacking_h -// -------------------------------------------------------- -class HardBlockInfoType -{ - public: - HardBlockInfoType(std::ifstream& ins, // formats: - const std::string& format); // "txt" or "blocks" - const std::vector& blocks; - const std::vector& block_names; - inline const basepacking_h::Dimension& operator[](int index) const; - inline int blocknum() const; - inline float blockArea() const; - - static constexpr int Orient_Num = basepacking_h::Dimension::Orient_Num; - - friend class MixedBlockInfoType; - friend class MixedBlockInfoTypeFromDB; - - protected: - std::vector - in_blocks; // store the left & bottom edges at the back - std::vector in_block_names; // parallel array with in_blocks - - // support - void set_dimensions(int i, - float w, - float h, - float snapX = 0, - float snapY = 0, - float haloX = 0, - float haloY = 0, - float channelX = 0, - float channelY = 0); - void ParseTxt(std::ifstream& ins); - void ParseBlocks(std::ifstream& ins); - - HardBlockInfoType(int blocknum) - : blocks(in_blocks), - block_names(in_block_names), - in_blocks(blocknum + 2), - in_block_names(blocknum + 2) - { - } - - HardBlockInfoType(const HardBlockInfoType&); -}; -// -------------------------------------------------------- -inline void PrintDimensions(float width, float height); -inline void PrintAreas(float deadspace, float blockArea); -inline void PrintUtilization(float deadspace, float blockArea); -// -------------------------------------------------------- - -// ========================= -// IMPLEMENTATIONS -// ========================= -inline std::ostream& operator<<(std::ostream& outs, - OrientedPacking::ORIENT orient) -{ - switch (orient) { - case OrientedPacking::N: - outs << "N"; - break; - case OrientedPacking::E: - outs << "E"; - break; - case OrientedPacking::S: - outs << "S"; - break; - case OrientedPacking::W: - outs << "W"; - break; - case OrientedPacking::FN: - outs << "FN"; - break; - case OrientedPacking::FE: - outs << "FE"; - break; - case OrientedPacking::FS: - outs << "FS"; - break; - case OrientedPacking::FW: - outs << "FW"; - break; - case OrientedPacking::OrientUndefined: - outs << "--"; - break; - default: - std::cout << "ERROR in outputting orientations." << std::endl; - exit(1); - break; - } - return outs; -} -// -------------------------------------------------------- -inline void Save_bbb(std::ostream& outs, const OrientedPacking& pk) -{ - float totalWidth = 0.0f; - float totalHeight = 0.0f; - int blocknum = pk.xloc.size(); - for (int i = 0; i < blocknum; i++) { - totalWidth = std::max(totalWidth, pk.xloc[i] + pk.width[i]); - totalHeight = std::max(totalHeight, pk.yloc[i] + pk.height[i]); - } - - outs << totalWidth << std::endl; - outs << totalHeight << std::endl; - outs << blocknum << std::endl; - for (int i = 0; i < blocknum; i++) - outs << pk.width[i] << " " << pk.height[i] << std::endl; - outs << std::endl; - - for (int i = 0; i < blocknum; i++) - outs << pk.xloc[i] << " " << pk.yloc[i] << std::endl; -} -// -------------------------------------------------------- -inline void Read_bbb(std::istream& ins, OrientedPacking& pk) -{ - float width, height; - ins >> width >> height; - - int blocknum = -1; - ins >> blocknum; - - pk.xloc.resize(blocknum); - pk.yloc.resize(blocknum); - pk.width.resize(blocknum); - pk.height.resize(blocknum); - pk.orient.resize(blocknum); - for (int i = 0; i < blocknum; i++) { - ins >> pk.width[i] >> pk.height[i]; - pk.orient[i] = OrientedPacking::N; - } - - for (int i = 0; i < blocknum; i++) - ins >> pk.xloc[i] >> pk.yloc[i]; -} -// -------------------------------------------------------- -inline OrientedPacking::ORIENT OrientedPacking::flip( - OrientedPacking::ORIENT orient) -{ - switch (orient) { - case N: - return FE; - case E: - return FN; - case S: - return FW; - case W: - return FS; - case FN: - return E; - case FE: - return N; - case FS: - return W; - case FW: - return S; - case OrientUndefined: - return OrientUndefined; - default: - std::cout << "ERROR: invalid orientation: " << orient << std::endl; - exit(1); - break; - } -} -// -------------------------------------------------------- -inline OrientedPacking::ORIENT OrientedPacking::toOrient(char* orient) -{ - if (!strcmp(orient, "N")) - return N; - if (!strcmp(orient, "E")) - return E; - if (!strcmp(orient, "S")) - return S; - if (!strcmp(orient, "W")) - return W; - if (!strcmp(orient, "FN")) - return FN; - if (!strcmp(orient, "FE")) - return FE; - if (!strcmp(orient, "FS")) - return FS; - if (!strcmp(orient, "FW")) - return FW; - if (!strcmp(orient, "--")) - return OrientUndefined; - - std::cout << "ERROR: in converting char* to ORIENT" << std::endl; - exit(1); - return OrientUndefined; -} -// -------------------------------------------------------- -inline const char* OrientedPacking::toChar(ORIENT orient) -{ - if (orient == N) - return ("N"); - if (orient == E) - return ("E"); - if (orient == S) - return ("S"); - if (orient == W) - return ("W"); - if (orient == FN) - return ("FN"); - if (orient == FE) - return ("FE"); - if (orient == FS) - return ("FS"); - if (orient == FW) - return ("FW"); - if (orient == OrientUndefined) - return ("--"); - - std::cout << "ERROR in converting ORIENT to char* " << std::endl; - exit(1); - return "--"; -} -// ======================================================== -inline const basepacking_h::Dimension& HardBlockInfoType::operator[]( - int index) const -{ - return in_blocks[index]; -} -// -------------------------------------------------------- -inline int HardBlockInfoType::blocknum() const -{ - return (in_blocks.size() - 2); -} -// -------------------------------------------------------- -inline float HardBlockInfoType::blockArea() const -{ - float sum = 0; - for (int i = 0; i < blocknum(); i++) - sum += in_blocks[i].width[0] * in_blocks[i].height[0]; - return sum; -} -// ======================================================== -void PrintDimensions(float width, float height) -{ - std::cout << "width: " << width << std::endl; - std::cout << "height: " << height << std::endl; -} -// -------------------------------------------------------- -void PrintAreas(float deadspace, float blockArea) -{ - std::cout << "total area: " << std::setw(11) << deadspace + blockArea - << std::endl; - std::cout << "block area: " << std::setw(11) << blockArea << std::endl; - std::cout << "dead space: " << std::setw(11) << deadspace << " (" - << (deadspace / blockArea) * 100 << "%)" << std::endl; -} -// -------------------------------------------------------- -void PrintUtilization(float deadspace, float blockArea) -{ - float totalArea = deadspace + blockArea; - std::cout << "area usage (wrt. total area): " - << ((1 - (deadspace / totalArea)) * 100) << "%" << std::endl; - std::cout << "dead space % (wrt. total area): " - << ((deadspace / totalArea) * 100) << "%" << std::endl; - std::cout << "---------------------------" << std::endl; -} -// ======================================================== - -#endif diff --git a/src/mpl/src/ParquetFP/src/btree.cxx b/src/mpl/src/ParquetFP/src/btree.cxx deleted file mode 100644 index c9e3b570977..00000000000 --- a/src/mpl/src/ParquetFP/src/btree.cxx +++ /dev/null @@ -1,998 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "btree.h" - -#include -#include -#include -#include -#include -#include - -namespace parquetfp { - -using namespace basepacking_h; -using std::cout; -using std::endl; -using std::max; -using std::min; -using std::ofstream; -using std::string; -using std::vector; - -// ======================================================== -BTree::BTree(const HardBlockInfoType& blockinfo) - : tree(in_tree), - contour(in_contour), - NUM_BLOCKS(blockinfo.blocknum()), - in_blockinfo(blockinfo), - in_tree(blockinfo.blocknum() + 2), - in_contour(blockinfo.blocknum() + 2), - in_obstacleframe{0, 0}, - seen_obstacles(false), - new_block_x_shift(0), - new_block_y_shift(0), - - in_xloc(blockinfo.blocknum() + 2, Undefined), - in_yloc(blockinfo.blocknum() + 2, Undefined), - in_width(blockinfo.blocknum() + 2, Undefined), - in_height(blockinfo.blocknum() + 2, Undefined), - - in_blockArea(blockinfo.blockArea()), - in_totalArea(0), - in_totalWidth(0), - in_totalHeight(0), - in_totalContourArea(0), - - TOLERANCE(0), - - pack_origin(PACK_BOTTOM) -{ - int vec_size = NUM_BLOCKS + 2; - for (int i = 0; i < vec_size; i++) { - in_tree[i].parent = Undefined; - in_tree[i].left = Undefined; - in_tree[i].right = Undefined; - in_tree[i].block_index = i; - in_tree[i].orient = Undefined; - - in_contour[i].next = Undefined; - in_contour[i].prev = Undefined; - in_contour[i].begin = Undefined; - in_contour[i].end = Undefined; - in_contour[i].CTL = Undefined; - } - - in_contour[NUM_BLOCKS].next = NUM_BLOCKS + 1; - in_contour[NUM_BLOCKS].prev = Undefined; - in_contour[NUM_BLOCKS].begin = 0; - in_contour[NUM_BLOCKS].end = 0; - in_contour[NUM_BLOCKS].CTL = Dimension::Infty; - - in_xloc[NUM_BLOCKS] = 0; - in_yloc[NUM_BLOCKS] = 0; - in_width[NUM_BLOCKS] = 0; - in_height[NUM_BLOCKS] = Dimension::Infty; - - in_contour[NUM_BLOCKS + 1].next = Undefined; - in_contour[NUM_BLOCKS + 1].prev = NUM_BLOCKS; - in_contour[NUM_BLOCKS + 1].begin = 0; - in_contour[NUM_BLOCKS + 1].end = Dimension::Infty; - in_contour[NUM_BLOCKS + 1].CTL = 0; - - in_xloc[NUM_BLOCKS + 1] = 0; - in_yloc[NUM_BLOCKS + 1] = 0; - in_width[NUM_BLOCKS + 1] = Dimension::Infty; - in_height[NUM_BLOCKS + 1] = 0; -} -// -------------------------------------------------------- -BTree::BTree(const HardBlockInfoType& blockinfo, float nTolerance) - : tree(in_tree), - contour(in_contour), - NUM_BLOCKS(blockinfo.blocknum()), - in_blockinfo(blockinfo), - in_tree(blockinfo.blocknum() + 2), - in_contour(blockinfo.blocknum() + 2), - in_obstacleframe{0, 0}, - seen_obstacles(false), - new_block_x_shift(0), - new_block_y_shift(0), - - in_xloc(blockinfo.blocknum() + 2, Undefined), - in_yloc(blockinfo.blocknum() + 2, Undefined), - in_width(blockinfo.blocknum() + 2, Undefined), - in_height(blockinfo.blocknum() + 2, Undefined), - - in_blockArea(blockinfo.blockArea()), - in_totalArea(0), - in_totalWidth(0), - in_totalHeight(0), - in_totalContourArea(0), - - TOLERANCE(nTolerance), - - pack_origin(PACK_BOTTOM) -{ - int vec_size = NUM_BLOCKS + 2; - for (int i = 0; i < vec_size; i++) { - in_tree[i].parent = Undefined; - in_tree[i].left = Undefined; - in_tree[i].right = Undefined; - in_tree[i].block_index = i; - in_tree[i].orient = Undefined; - - in_contour[i].next = Undefined; - in_contour[i].prev = Undefined; - in_contour[i].begin = Undefined; - in_contour[i].end = Undefined; - in_contour[i].CTL = Undefined; - } - - in_contour[NUM_BLOCKS].next = NUM_BLOCKS + 1; - in_contour[NUM_BLOCKS].prev = Undefined; - in_contour[NUM_BLOCKS].begin = 0; - in_contour[NUM_BLOCKS].end = 0; - in_contour[NUM_BLOCKS].CTL = Dimension::Infty; - - in_xloc[NUM_BLOCKS] = 0; - in_yloc[NUM_BLOCKS] = 0; - in_width[NUM_BLOCKS] = 0; - in_height[NUM_BLOCKS] = Dimension::Infty; - - in_contour[NUM_BLOCKS + 1].next = Undefined; - in_contour[NUM_BLOCKS + 1].prev = NUM_BLOCKS; - in_contour[NUM_BLOCKS + 1].begin = 0; - in_contour[NUM_BLOCKS + 1].end = Dimension::Infty; - in_contour[NUM_BLOCKS + 1].CTL = 0; - - in_xloc[NUM_BLOCKS + 1] = 0; - in_yloc[NUM_BLOCKS + 1] = 0; - in_width[NUM_BLOCKS + 1] = Dimension::Infty; - in_height[NUM_BLOCKS + 1] = 0; -} -// -------------------------------------------------------- -void BTree::evaluate(const vector& ntree) -{ - if (ntree.size() != in_tree.size()) { - cout << "ERROR: size of btree's doesn't match." << endl; - exit(1); - } - - in_tree = ntree; - contour_evaluate(); -} -// -------------------------------------------------------- -void BTree::evaluate(const vector& tree_bits, - const vector& perm, - const vector& orient) -{ - if (int(perm.size()) != NUM_BLOCKS) { - cout << "ERROR: the permutation length doesn't match with " - << "size of the tree." << endl; - exit(1); - } - bits2tree(tree_bits, perm, orient, in_tree); - // OutputBTree(cout, in_tree); - contour_evaluate(); -} -// -------------------------------------------------------- -void BTree::bits2tree(const vector& tree_bits, - const vector& perm, - const vector& orient, - vector& ntree) -{ - int perm_size = perm.size(); - ntree.resize(perm_size + 2); - clean_tree(ntree); - - int treePtr = perm_size; - int bitsPtr = 0; - - int lastAct = -1; - for (int i = 0; i < perm_size; i++) { - int currAct = tree_bits[bitsPtr]; - while (currAct == 1) { - // move up a level/sibling - if (lastAct == 1) - treePtr = ntree[treePtr].parent; - - // move among siblings - while (ntree[treePtr].right != Undefined) - treePtr = ntree[treePtr].parent; - bitsPtr++; - lastAct = 1; - currAct = tree_bits[bitsPtr]; - } - - if (lastAct != 1) - ntree[treePtr].left = perm[i]; - else // lastAct == 1 - ntree[treePtr].right = perm[i]; - - ntree[perm[i]].parent = treePtr; - ntree[perm[i]].block_index = perm[i]; - ntree[perm[i]].orient = orient[i]; - - treePtr = perm[i]; - lastAct = 0; - bitsPtr++; - } -} -// -------------------------------------------------------- -void BTree::swap(int indexOne, int indexTwo) -{ - int indexOne_left = in_tree[indexOne].left; - int indexOne_right = in_tree[indexOne].right; - int indexOne_parent = in_tree[indexOne].parent; - - int indexTwo_left = in_tree[indexTwo].left; - int indexTwo_right = in_tree[indexTwo].right; - int indexTwo_parent = in_tree[indexTwo].parent; - - if (indexOne == indexTwo_parent) - swap_parent_child(indexOne, (indexTwo == in_tree[indexOne].left)); - else if (indexTwo == indexOne_parent) - swap_parent_child(indexTwo, (indexOne == in_tree[indexTwo].left)); - else { - // update around indexOne - in_tree[indexOne].parent = indexTwo_parent; - in_tree[indexOne].left = indexTwo_left; - in_tree[indexOne].right = indexTwo_right; - - if (indexOne == in_tree[indexOne_parent].left) - in_tree[indexOne_parent].left = indexTwo; - else - in_tree[indexOne_parent].right = indexTwo; - - if (indexOne_left != Undefined) - in_tree[indexOne_left].parent = indexTwo; - - if (indexOne_right != Undefined) - in_tree[indexOne_right].parent = indexTwo; - - // update around indexTwo - in_tree[indexTwo].parent = indexOne_parent; - in_tree[indexTwo].left = indexOne_left; - in_tree[indexTwo].right = indexOne_right; - - if (indexTwo == in_tree[indexTwo_parent].left) - in_tree[indexTwo_parent].left = indexOne; - else - in_tree[indexTwo_parent].right = indexOne; - - if (indexTwo_left != Undefined) - in_tree[indexTwo_left].parent = indexOne; - - if (indexTwo_right != Undefined) - in_tree[indexTwo_right].parent = indexOne; - } - contour_evaluate(); -} -// -------------------------------------------------------- -void BTree::swap_parent_child(int parent, bool isLeft) -{ - int parent_parent = in_tree[parent].parent; - int parent_left = in_tree[parent].left; - int parent_right = in_tree[parent].right; - - int child = (isLeft) ? in_tree[parent].left : in_tree[parent].right; - int child_left = in_tree[child].left; - int child_right = in_tree[child].right; - - if (isLeft) { - in_tree[parent].parent = child; - in_tree[parent].left = child_left; - in_tree[parent].right = child_right; - - if (parent == in_tree[parent_parent].left) - in_tree[parent_parent].left = child; - else - in_tree[parent_parent].right = child; - - if (parent_right != Undefined) - in_tree[parent_right].parent = child; - - in_tree[child].parent = parent_parent; - in_tree[child].left = parent; - in_tree[child].right = parent_right; - - if (child_left != Undefined) - in_tree[child_left].parent = parent; - - if (child_right != Undefined) - in_tree[child_right].parent = parent; - } else { - in_tree[parent].parent = child; - in_tree[parent].left = child_left; - in_tree[parent].right = child_right; - - if (parent == in_tree[parent_parent].left) - in_tree[parent_parent].left = child; - else - in_tree[parent_parent].right = child; - - if (parent_left != Undefined) - in_tree[parent_left].parent = child; - - in_tree[child].parent = parent_parent; - in_tree[child].left = parent_left; - in_tree[child].right = parent; - - if (child_left != Undefined) - in_tree[child_left].parent = parent; - - if (child_right != Undefined) - in_tree[child_right].parent = parent; - } -} -// -------------------------------------------------------- -void BTree::move(int index, int target, bool leftChild) -{ - int index_parent = in_tree[index].parent; - int index_left = in_tree[index].left; - int index_right = in_tree[index].right; - - // remove "index" from the tree - if ((index_left != Undefined) && (index_right != Undefined)) - remove_left_up_right_down(index); - else if (index_left != Undefined) { - in_tree[index_left].parent = index_parent; - if (index == in_tree[index_parent].left) - in_tree[index_parent].left = index_left; - else - in_tree[index_parent].right = index_left; - } else if (index_right != Undefined) { - in_tree[index_right].parent = index_parent; - if (index == in_tree[index_parent].left) - in_tree[index_parent].left = index_right; - else - in_tree[index_parent].right = index_right; - } else { - if (index == in_tree[index_parent].left) - in_tree[index_parent].left = Undefined; - else - in_tree[index_parent].right = Undefined; - } - - int target_left = in_tree[target].left; - int target_right = in_tree[target].right; - - // add "index" to the required location - if (leftChild) { - in_tree[target].left = index; - if (target_left != Undefined) - in_tree[target_left].parent = index; - - in_tree[index].parent = target; - in_tree[index].left = target_left; - in_tree[index].right = Undefined; - } else { - in_tree[target].right = index; - if (target_right != Undefined) - in_tree[target_right].parent = index; - - in_tree[index].parent = target; - in_tree[index].left = Undefined; - in_tree[index].right = target_right; - } - - // cout << "Start Move Evaluate!!" << endl; - contour_evaluate(); - // cout << "After FINISH xLoc yLoc Check" << endl; - // for(int i=0; i parquet may choose to build trees from various origins -// - this function is to make sure that objects that have coordinates based on -// the bin's bottom left will be updated appropriately -{ - float originalXMin = xMin; - float originalXMax = xMax; - float originalYMin = yMin; - float originalYMax = yMax; - float originalWidth = xMax - xMin; - float originalHeight = yMax - yMin; - - // cout << "bbox change function" << endl; - // cout << "packOrigin: " << packOrigin << endl; - // cout << "fw: " << frameWidth << ", fh: " << frameHeight << endl; - if (packOrigin == BTree::PACK_LEFT) { - // orthogonal to default - bottom left origin and grow upward and right - xMin = originalYMin; - yMin = originalXMin; - float width = originalHeight; - float height = originalWidth; - xMax = xMin + width; - yMax = yMin + height; - } else if (packOrigin == BTree::PACK_TOP) { - // 'reverse' of default - mirror in y direction - yMin = frameHeight - originalYMax; - yMax = yMin + originalHeight; - } else if (packOrigin == BTree::PACK_RIGHT) { - // 'reverse' of orth. to def. - rotate frame 90degrees counter clockwise - xMin = originalYMin; - yMin = frameWidth - originalXMax; - float width = originalHeight; - float height = originalWidth; - xMax = xMin + width; - yMax = yMin + height; - } else { - // do nothing - } -} -// -------------------------------------------------------- -void BTree::contour_evaluate() // assume the tree is set -{ - clean_contour(in_contour); - - // x- and y- shifts for new block to avoid obstacles - new_block_x_shift = 0; - new_block_y_shift = 0; - - int tree_prev = NUM_BLOCKS; - int tree_curr = in_tree[NUM_BLOCKS].left; // start with first block - // cout << "ContourEvaluate Executed!" << endl; - // cout << "InObstacleFrame: " << in_obstacleframe[0] << ", " << - // in_obstacleframe[1] << endl; - while (tree_curr != NUM_BLOCKS) // until reach the root again - { - // cout << "curr: " << tree_curr << " / " << - // in_tree[tree_curr].left - // << " / " << in_tree[tree_curr].right << " // P: " << - // in_tree[tree_curr].parent << endl ; - if (tree_prev == in_tree[tree_curr].parent) { - unsigned obstacleID = UINT_MAX; - float obstacle_xMin, obstacle_xMax, obstacle_yMin, obstacle_yMax; - float new_xMin, new_xMax, new_yMin, new_yMax; - - if (contour_new_block_intersects_obstacle(tree_curr, - obstacleID, - new_xMin, - new_xMax, - new_yMin, - new_yMax, - obstacle_xMin, - obstacle_xMax, - obstacle_yMin, - obstacle_yMax)) { - // 'add obstacle' and then resume building the tree from here - - // printf( "New (%f %f) - (%f %f)\n", new_xMin, new_yMin, - // new_xMax, new_yMax); printf( "Obs (%f %f) - (%f %f)\n", - // obstacle_xMin, obstacle_yMin, obstacle_xMax, obstacle_yMax); - int tree_parent = in_tree[tree_curr].parent; - // int parent_index = in_tree[tree_parent].block_index; - // int parent_theta = in_tree[tree_parent].orient; - // float parent_height = - // in_blockinfo[parent_index].height[parent_theta]; - float block_height = new_yMax - new_yMin; - float block_width = new_xMax - new_xMin; - - if ((tree_curr == in_tree[tree_parent].left - && obstacle_yMax + block_height - > in_contour[tree_parent].CTL + (block_height * 0.5) - && (obstacle_xMax + block_width) < in_obstacleframe[0]) - || (tree_curr == in_tree[tree_parent].right - && (obstacle_yMax + block_height) > in_obstacleframe[1])) { - // left child & shifting up makes it too high - // or right child & shifting up makes it too high; - // shift the starting location of the block right in x - new_block_x_shift += obstacle_xMax - new_xMin; - new_block_y_shift = 0; - } else { - // shift the block in y - new_block_y_shift += obstacle_yMax - new_yMin; - } - // cout << (tree_curr == in_tree[tree_parent].left? "LeftChild" : - // "RightChild") << endl; cout << "newBlockShift: (" << - // new_block_x_shift << ", " << new_block_y_shift << ")" << endl - // << endl;; - } else { - // printf( "%d %s (%f %f) - (%f %f)\n", - // tree_curr, - // in_blockinfo.block_names[in_tree[tree_curr].block_index].c_str(), - // new_xMin, new_yMin, new_xMax, new_yMax); - contour_add_block(tree_curr); - - // reset x- y- obstacle shift - new_block_x_shift = 0; - new_block_y_shift = 0; - - tree_prev = tree_curr; - if (in_tree[tree_curr].left != Undefined) - tree_curr = in_tree[tree_curr].left; - else if (in_tree[tree_curr].right != Undefined) - tree_curr = in_tree[tree_curr].right; - else - tree_curr = in_tree[tree_curr].parent; - } - } else if (tree_prev == in_tree[tree_curr].left) { - tree_prev = tree_curr; - if (in_tree[tree_curr].right != Undefined) - tree_curr = in_tree[tree_curr].right; - else - tree_curr = in_tree[tree_curr].parent; - } else { - tree_prev = tree_curr; - tree_curr = in_tree[tree_curr].parent; - } - } - in_totalWidth = in_contour[NUM_BLOCKS + 1].begin; - - int contour_ptr = in_contour[NUM_BLOCKS].next; - in_totalHeight = 0; - - // cout << "contourTraverse" << endl; - - in_totalContourArea = 0; - while (contour_ptr != NUM_BLOCKS + 1) { - in_totalHeight = max(in_totalHeight, in_contour[contour_ptr].CTL); - // cout << "Node: " << contour_ptr << endl; - // cout << "Prev: " << in_contour[contour_ptr].prev << endl; - // cout << "Next: " << in_contour[contour_ptr].next << endl; - // cout << "Begin: " << in_contour[contour_ptr].begin << endl; - // cout << "End: " << in_contour[contour_ptr].end << endl; - // cout << "CTL: " << in_contour[contour_ptr].CTL << endl << endl; - - // Calculate contour area - // cout << "real " << in_contour[contour_ptr].begin << " " << - // in_contour[contour_ptr].end << " : " << in_contour[contour_ptr].CTL << - // " " << - // (in_contour[contour_ptr].end - - // in_contour[contour_ptr].begin)*in_contour[contour_ptr].CTL << endl; - in_totalContourArea - += (in_contour[contour_ptr].end - in_contour[contour_ptr].begin) - * in_contour[contour_ptr].CTL; - - // go to next pointer - contour_ptr = in_contour[contour_ptr].next; - } - // cout << "realFinal: " << in_totalContourArea << endl; - - // cout << "xLoc yLoc Check" << endl; - // for(int i=0; i::epsilon() -inline float get_snap_coordinates(float input, float snapVal) -{ - // snap Value is zero, then simply return input values. - if (std::abs(snapVal) <= FLT_EPSILON) { - return input; - } - - // otherwise, calculate the coordinates - float calVal = input / snapVal; - int roundVal = calVal; - if (std::abs((float) roundVal - calVal) <= FLT_EPSILON) { - return input; - } else { - return (roundVal + 1) * snapVal; - } -} - -//#define FLT_EPSILON numeric_limits< float >::epsilon() -inline float get_snap_coordinates_gap(float input, float snapVal) -{ - // snap Value is zero, then simply return input values. - if (std::abs(snapVal) <= FLT_EPSILON) { - return 0; - } - - // otherwise, calculate the coordinates - float calVal = input / snapVal; - int roundVal = calVal; - if (std::abs((float) roundVal - calVal) <= FLT_EPSILON) { - return 0; - } else { - return (roundVal + 1) * snapVal - input; - } -} -// -------------------------------------------------------- -void BTree::find_new_block_location(const int tree_ptr, - float& out_x, - float& out_y, - int& contour_prev, - int& contour_ptr) -{ - // three values - // 1) new_block_x_shift : obstacle shift - // 2) halo_block_x_shift : halo consideration - // 3) snap_x_gap : macro snapping to specified grid. - // - // Hence, we have to generate/update below variables: - // 1) new_block_contour_begin - // 2) new_block_contour_end - // 3) contour_prev_ptr - int tree_parent = in_tree[tree_ptr].parent; - contour_prev = Undefined; - contour_ptr = Undefined; - - int block = in_tree[tree_ptr].block_index; - int theta = in_tree[tree_ptr].orient; - - float new_block_contour_begin; - float halo_block_x_shift = 0.0f, halo_block_y_shift = 0.0f; - if (tree_ptr == in_tree[tree_parent].left) { - // to the right of parent, start x where parent ends - new_block_contour_begin = in_contour[tree_parent].end; - // use block that's right of parent's contour for y - contour_ptr = in_contour[tree_parent].next; - - if (tree_parent != NUM_BLOCKS) { - halo_block_x_shift += in_blockinfo[block].haloX[theta]; - } - } else { - // above parent, use parent's x - new_block_contour_begin = in_contour[tree_parent].begin; - - // additional HALO consideration - if (new_block_contour_begin != 0) { - halo_block_x_shift += in_blockinfo[block].haloX[theta]; - } - // use parent's contour for y - contour_ptr = tree_parent; - - if (tree_ptr == in_tree[tree_parent].right) { - halo_block_y_shift += in_blockinfo[block].haloY[theta]; - } - } - - // Get obstacle-aware snap gap - float snap_gap_x - = get_snap_coordinates_gap(new_block_contour_begin + new_block_x_shift, - in_blockinfo[block].snapX[theta]); - - new_block_contour_begin += new_block_x_shift; // considering obstacles - new_block_contour_begin += snap_gap_x; // considering snapping - - contour_prev = in_contour[contour_ptr].prev; // begins of cPtr/tPtr match - - float new_block_contour_end = new_block_contour_begin - + in_blockinfo[block].width[theta] - + 2 * in_blockinfo[block].haloX[theta]; - float maxCTL = in_contour[contour_ptr].CTL; - float contour_ptr_end = (contour_ptr == tree_ptr) - ? new_block_contour_end - : in_contour[contour_ptr].end; - - while (contour_ptr_end <= new_block_contour_end + TOLERANCE) { - maxCTL = max(maxCTL, in_contour[contour_ptr].CTL); - contour_ptr = in_contour[contour_ptr].next; - contour_ptr_end = (contour_ptr == tree_ptr) ? new_block_contour_end - : in_contour[contour_ptr].end; - } - - // contour_prev location Update!!!! - if (snap_gap_x + new_block_x_shift > FLT_EPSILON) { - int contour_ptr_tmp = contour_prev; - float contour_ptr_end_sec = (contour_ptr_tmp == tree_ptr) - ? new_block_contour_end - : in_contour[contour_ptr_tmp].begin; - - while (contour_ptr_end_sec <= new_block_contour_begin) { - contour_ptr_tmp = in_contour[contour_ptr_tmp].next; - contour_ptr_end_sec = (contour_ptr_tmp == tree_ptr) - ? new_block_contour_end - : in_contour[contour_ptr_tmp].end; - contour_prev = in_contour[contour_ptr_tmp].prev; - } - - int prev_next = in_contour[contour_prev].next; - - if (prev_next != NUM_BLOCKS + 1 - && in_contour[prev_next].end > new_block_contour_begin - && in_contour[prev_next].begin < new_block_contour_begin) { - contour_prev = in_contour[contour_prev].next; - } - } - - float contour_ptr_begin = (contour_ptr == tree_ptr) - ? new_block_contour_begin - : in_contour[contour_ptr].begin; - - if (contour_ptr_begin + TOLERANCE < new_block_contour_end) - maxCTL = max(maxCTL, in_contour[contour_ptr].CTL); - - // left-child upper halo consideration - if (maxCTL != 0 && tree_ptr == in_tree[tree_parent].left) { - halo_block_y_shift += in_blockinfo[block].haloY[theta]; - } - - // get location where new block sho1uld be added - out_x = new_block_contour_begin + halo_block_x_shift; - out_y = get_snap_coordinates(maxCTL + new_block_y_shift + halo_block_y_shift, - in_blockinfo[block].snapY[theta]); // XXX -} -// -------------------------------------------------------- -void BTree::contour_add_block(const int tree_ptr) -{ - int contour_ptr = Undefined; - int contour_prev = Undefined; - float new_xloc, new_yloc; - - find_new_block_location( - tree_ptr, new_xloc, new_yloc, contour_prev, contour_ptr); - // cout << tree_ptr << ": newLoc (" << new_xloc << ", " << new_yloc << ") - - // ctr_prev: " << contour_prev << " contour_ptr: " << contour_ptr << endl; - - int block = in_tree[tree_ptr].block_index; - int theta = in_tree[tree_ptr].orient; - - in_xloc[tree_ptr] = new_xloc; - in_yloc[tree_ptr] = new_yloc; - in_width[tree_ptr] = in_blockinfo[block].width[theta]; - in_height[tree_ptr] = in_blockinfo[block].height[theta]; - - // x_halo control - int tree_parent = in_tree[tree_ptr].parent; - if (tree_parent == NUM_BLOCKS + 1) { - in_contour[tree_ptr].begin = in_xloc[tree_ptr]; - } else { - in_contour[tree_ptr].begin - = in_xloc[tree_ptr] - in_blockinfo[block].haloX[theta]; - } - - in_contour[tree_ptr].end = in_xloc[tree_ptr] + in_width[tree_ptr] - + in_blockinfo[block].haloX[theta]; - in_contour[tree_ptr].CTL = in_yloc[tree_ptr] + in_height[tree_ptr] - + in_blockinfo[block].haloY[theta]; - in_contour[tree_ptr].next = contour_ptr; - in_contour[tree_ptr].prev = contour_prev; - - in_contour[contour_ptr].prev = tree_ptr; - in_contour[contour_prev].next = tree_ptr; - in_contour[contour_ptr].begin = in_xloc[tree_ptr] + in_width[tree_ptr] - + in_blockinfo[block].haloX[theta]; - in_contour[tree_ptr].begin - = max(in_contour[contour_prev].end, in_contour[tree_ptr].begin); -} -// -------------------------------------------------------- -bool BTree::contour_new_block_intersects_obstacle(const int tree_ptr, - unsigned& obstacleID, - float& new_xMin, - float& new_xMax, - float& new_yMin, - float& new_yMax, - float& obstacle_xMin, - float& obstacle_xMax, - float& obstacle_yMin, - float& obstacle_yMax) -// check if adding this new block intersects an obstacle, -// return obstacleID if it does -// TODO: smarter way of storing/searching obstacles. -// Currently complexity is O(foreach add_block * foreach unseen_obstacle) -{ - if (getNumObstacles() == 0) - return false; // don't even bother - - obstacleID = Undefined; - int contour_ptr = Undefined; - int contour_prev = Undefined; - - find_new_block_location( - tree_ptr, new_xMin, new_yMin, contour_prev, contour_ptr); - // cout << tree_ptr << ": contNewLoc (" << new_xMin << ", " << new_yMin << - // ")" << endl; - - int block = in_tree[tree_ptr].block_index; - int theta = in_tree[tree_ptr].orient; - - // get the rest of the bbox of new block, if the new block were added - new_xMax = new_xMin + in_blockinfo[block].width[theta]; - new_yMax = new_yMin + in_blockinfo[block].height[theta]; - - // check if adding this new block will create a contour that - // intersects with an obstacle - for (unsigned i = 0; i < getNumObstacles(); i++) { - // if (seen_obstacles[i]) - // continue; - - obstacle_xMin = in_obstacles.xloc[i]; - obstacle_yMin = in_obstacles.yloc[i]; - obstacle_xMax = obstacle_xMin + in_obstacles.width[i]; - obstacle_yMax = obstacle_yMin + in_obstacles.height[i]; - - transform_bbox_wrt_pack_origin(pack_origin, - in_obstacleframe[0], - in_obstacleframe[1], - obstacle_xMin, - obstacle_yMin, - obstacle_xMax, - obstacle_yMax); - - // cout << "Obs " << i << " (" << obstacle_xMin << ", " << obstacle_yMin - // << ") - (" << - // obstacle_xMax << ", " << obstacle_yMax << ")" << endl; - - if ((new_xMax <= obstacle_xMin) || (new_xMin >= obstacle_xMax) - || (new_yMax <= obstacle_yMin) || (new_yMin >= obstacle_yMax)) - continue; - - // cout << "Obs " << i << " is overlapped" << endl; - - obstacleID = i; - // cout << "ANDBG block " << tree_ptr << " intersects " << obstacleID << - // endl; cout << "ANDBG block (" << new_xMin << ", " << new_yMin << ") - (" - // << new_xMax << ", " << new_yMax << ")" << endl; cout <<" intersects - // (" << obstacle_xMin << ", " << obstacle_yMin << ") - (" << obstacle_xMax - // << ", " << obstacle_yMax << ")" << endl; - return true; - } - - return false; -} -// -------------------------------------------------------- -void BTree::save_bbb(const string& filename) const -{ - ofstream outfile; - outfile.open(filename.c_str()); - if (!outfile.good()) { - cout << "ERROR: cannot open file" << filename << endl; - exit(1); - } - - outfile.setf(std::ios::fixed); - outfile.precision(3); - - outfile << in_totalWidth << endl; - outfile << in_totalHeight << endl; - outfile << NUM_BLOCKS << endl; - for (int i = 0; i < NUM_BLOCKS; i++) - outfile << in_width[i] << " " << in_height[i] << endl; - outfile << endl; - - for (int i = 0; i < NUM_BLOCKS; i++) - outfile << in_xloc[i] << " " << in_yloc[i] << endl; - outfile << endl; -} - -void BTree::save_dot(const std::string& fileName) const -{ - std::filebuf fb; - fb.open(fileName.c_str(), std::ios::out); - std::ostream outs(&fb); - - outs << "digraph BST {" << std::endl; - outs << " graph [ordering=\"out\"];" << std::endl; - - int nullPtrCnt = 0; - for (int i = 0; i < NUM_BLOCKS; i++) { - outs << " \"" << i << "\" -> "; - if (in_tree[i].left != Undefined) { - outs << "\"" << in_tree[i].left << "\";" << std::endl; - } else { - outs << "null" << std::to_string(nullPtrCnt) << std::endl; - outs << " null" << std::to_string(nullPtrCnt++) << " [shape=point];" - << std::endl; - } - - outs << " \"" << i << "\" -> "; - if (in_tree[i].right != Undefined) { - outs << "\"" << in_tree[i].right << "\";" << std::endl; - } else { - outs << "null" << std::to_string(nullPtrCnt) << std::endl; - outs << " null" << std::to_string(nullPtrCnt++) << " [shape=point];" - << std::endl; - } - } - outs << "}" << std::endl; - fb.close(); -} - -void BTree::save_plot(const std::string& fileName) const -{ - using std::endl; - std::filebuf fb; - fb.open(fileName.c_str(), std::ios::out); - std::ostream outs(&fb); - - outs << "#Use this file as a script for gnuplot" << endl; - outs << "#(See http://www.gnuplot.info/ for details)" << endl; - outs << "set nokey" << endl; - - outs << "set size ratio -1" << endl; - outs << "set title ' " << fileName << endl << endl; - - outs << "set terminal png size 1024,768" << endl; - - outs << "set xrange[" << 0 << ":" << in_totalWidth << "]" << endl; - outs << "set yrange[" << 0 << ":" << in_totalHeight << "]" << endl; - - int objCnt = 0; - float x = 0, y = 0, w = 0, h = 0; - for (int i = 0; i < NUM_BLOCKS; i++) { - x = in_xloc[i]; - y = in_yloc[i]; - w = in_width[i]; - h = in_height[i]; - outs << "set object " << ++objCnt << " rect from " << x << "," << y - << " to " << x + w << "," << y + h << " fc rgb \"gold\"" << endl; - } - outs << "plot '-' w l" << endl; - outs << "EOF" << endl << endl; - outs << "pause -1 'Press any key' " << endl; - fb.close(); -} - -// -------------------------------------------------------- -void BTree::addObstacles(BasePacking& obstacles, float obstacleFrame[2]) -// make this btree aware of obstacles -{ - in_obstacles.xloc = obstacles.xloc; - in_obstacles.yloc = obstacles.yloc; - in_obstacles.width = obstacles.width; - in_obstacles.height = obstacles.height; - - in_obstacleframe[0] = obstacleFrame[0]; - in_obstacleframe[1] = obstacleFrame[1]; -} - -// -------------------------------------------------------- - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/btree.h b/src/mpl/src/ParquetFP/src/btree.h deleted file mode 100644 index a656b010866..00000000000 --- a/src/mpl/src/ParquetFP/src/btree.h +++ /dev/null @@ -1,445 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef BTREE_H -#define BTREE_H - -#include -#include -#include - -#include "basepacking.h" - -namespace parquetfp { - -// -------------------------------------------------------- -class BTree -{ - public: - BTree(const HardBlockInfoType& blockinfo); - BTree(const HardBlockInfoType& blockinfo, float nTolerance); - inline BTree(const BTree& newBTree); - inline bool operator=(const BTree& newBTree); // true if succeeds - - void addObstacles(BasePacking& obstacles, - float obstacleFrame[2]); // give btree obstacles - inline unsigned getNumObstacles(); - // change the frame of reference for packing (used when comparing - // with fixed objects like obstacles) - enum PackOrigin - { - PACK_BOTTOM, - PACK_LEFT, - PACK_RIGHT, - PACK_TOP - }; - void set_pack_origin(PackOrigin new_pack_origin) - { - pack_origin = new_pack_origin; - } - - class BTreeNode; - class ContourNode; - const std::vector& tree; - const std::vector& contour; - - inline const std::vector& xloc() const; - inline const std::vector& yloc() const; - inline float xloc(int index) const; - inline float yloc(int index) const; - inline float width(int index) const; - inline float height(int index) const; - - inline float blockArea() const; - inline float totalArea() const; - inline float totalWidth() const; - inline float totalHeight() const; - inline float totalContourArea() const; - inline float getDistance(float x, float y) const; - - inline void setTree(const std::vector& ntree); - void evaluate(const std::vector& ntree); - void evaluate(const std::vector& tree_bits, // assume the lengths of - const std::vector& perm, // these 3 are compatible - const std::vector& orient); // with size of old tree - static void bits2tree(const std::vector& tree_bits, // assume lengths of - const std::vector& perm, // these 3 compatible - const std::vector& orient, - std::vector& ntree); - inline static void clean_tree(std::vector& otree); - inline void clean_contour(std::vector& oContour); - - // perturb the tree, evaluate contour from scratch - enum MoveType - { - SWAP, - ROTATE, - MOVE - }; - - void swap(int indexOne, int indexTwo); - inline void rotate(int index, int newOrient); - void move(int index, int target, bool leftChild); // target = 0..n - - const int NUM_BLOCKS; - static constexpr int Undefined = basepacking_h::Dimension::Undefined; - - class BTreeNode - { - public: - int parent; - int left; - int right; - - int block_index; - int orient; - }; - - class ContourNode - { - public: - int next; - int prev; - - float begin; - float end; - float CTL; - }; - - // -----output functions----- - void save_bbb(const std::string& filename) const; - void save_dot(const std::string& filename) const; - void save_plot(const std::string& filename) const; - - protected: - const HardBlockInfoType& in_blockinfo; - std::vector in_tree; - std::vector in_contour; - - // obstacle handling - BasePacking in_obstacles; - float in_obstacleframe[2]; // 0=width, 1=height - std::vector seen_obstacles; // track obstacles that have been consumed - // during contour_evaluate - float new_block_x_shift; // x shift for avoiding obstacles when adding new - // block - float new_block_y_shift; // y shift for avoiding obstacles when adding new - // block - void transform_bbox_wrt_pack_origin(BTree::PackOrigin packOrigin, - float frameWidth, - float frameHeight, - float& xMin, - float& yMin, - float& xMax, - float& yMax); - - // blah[i] refers the attribute of in_tree[i]. - std::vector in_xloc; - std::vector in_yloc; - std::vector in_width; - std::vector in_height; - - float in_blockArea; - float in_totalArea; - float in_totalWidth; - float in_totalHeight; - float in_totalContourArea; - - const float TOLERANCE; - - PackOrigin pack_origin; // frame of reference for btree's direction of growth - - void contour_evaluate(); - void contour_add_block(int treePtr); - void find_new_block_location(const int tree_ptr, - float& out_x, - float& out_y, - int&, - int&); - // handle obstacles during contour_evaluate - bool contour_new_block_intersects_obstacle(const int tree_ptr, - unsigned& obstacleID, - float& new_xMin, - float& new_xMax, - float& new_yMin, - float& new_yMax, - float& obstacle_xMin, - float& obstacle_xMax, - float& obstacle_yMin, - float& obstacle_yMax); - void contour_add_obstacle(int tree_ptr, const int obstacleID); - - void swap_parent_child(int parent, bool isLeft); - void remove_left_up_right_down(int index); -}; -// -------------------------------------------------------- -class BTreeOrientedPacking : public OrientedPacking -{ - public: - inline BTreeOrientedPacking() {} - inline BTreeOrientedPacking(const BTree& bt); - - inline void operator=(const BTree& bt); -}; -// -------------------------------------------------------- - -// ========================= -// Implementations -// ========================= -inline BTree::BTree(const BTree& newBtree) - : tree(in_tree), - contour(in_contour), - NUM_BLOCKS(newBtree.NUM_BLOCKS), - in_blockinfo(newBtree.in_blockinfo), - in_tree(newBtree.in_tree), - in_contour(newBtree.in_contour), - seen_obstacles(newBtree.seen_obstacles), - new_block_x_shift(newBtree.new_block_x_shift), - new_block_y_shift(newBtree.new_block_y_shift), - - in_xloc(newBtree.in_xloc), - in_yloc(newBtree.in_yloc), - in_width(newBtree.in_width), - in_height(newBtree.in_height), - - in_blockArea(newBtree.in_blockArea), - in_totalArea(newBtree.in_totalArea), - in_totalWidth(newBtree.in_totalWidth), - in_totalHeight(newBtree.in_totalHeight), - in_totalContourArea(newBtree.in_totalContourArea), - - TOLERANCE(newBtree.TOLERANCE), - - pack_origin(newBtree.pack_origin) -{ - in_obstacles.xloc = newBtree.in_obstacles.xloc; - in_obstacles.yloc = newBtree.in_obstacles.yloc; - in_obstacles.width = newBtree.in_obstacles.width; - in_obstacles.height = newBtree.in_obstacles.height; - in_obstacleframe[0] = newBtree.in_obstacleframe[0]; - in_obstacleframe[1] = newBtree.in_obstacleframe[1]; -} -// -------------------------------------------------------- -inline bool BTree::operator=(const BTree& newBtree) -{ - if (NUM_BLOCKS == newBtree.NUM_BLOCKS) { - in_tree = newBtree.in_tree; - in_contour = newBtree.in_contour; - - in_xloc = newBtree.in_xloc; - in_yloc = newBtree.in_yloc; - in_width = newBtree.in_width; - in_height = newBtree.in_height; - - in_blockArea = newBtree.in_blockArea; - in_totalArea = newBtree.in_totalArea; - in_totalWidth = newBtree.in_totalWidth; - in_totalHeight = newBtree.in_totalHeight; - in_totalContourArea = newBtree.in_totalContourArea; - - in_obstacles.xloc = newBtree.in_obstacles.xloc; - in_obstacles.yloc = newBtree.in_obstacles.yloc; - in_obstacles.width = newBtree.in_obstacles.width; - in_obstacles.height = newBtree.in_obstacles.height; - in_obstacleframe[0] = newBtree.in_obstacleframe[0]; - in_obstacleframe[1] = newBtree.in_obstacleframe[1]; - - pack_origin = newBtree.pack_origin; - - return true; - } else - return false; -} -// -------------------------------------------------------- -inline const std::vector& BTree::xloc() const -{ - return in_xloc; -} -// -------------------------------------------------------- -inline const std::vector& BTree::yloc() const -{ - return in_yloc; -} -// -------------------------------------------------------- -inline float BTree::xloc(int index) const -{ - return in_xloc[index]; -} -// -------------------------------------------------------- -inline float BTree::yloc(int index) const -{ - return in_yloc[index]; -} -// -------------------------------------------------------- -inline float BTree::width(int index) const -{ - return in_width[index]; -} -// -------------------------------------------------------- -inline float BTree::height(int index) const -{ - return in_height[index]; -} -// -------------------------------------------------------- -inline float BTree::blockArea() const -{ - return in_blockArea; -} -// -------------------------------------------------------- -inline float BTree::totalArea() const -{ - return in_totalArea; -} -// -------------------------------------------------------- -inline float BTree::totalWidth() const -{ - return in_totalWidth; -} -// -------------------------------------------------------- -inline float BTree::totalHeight() const -{ - return in_totalHeight; -} -// -------------------------------------------------------- -inline float BTree::totalContourArea() const -{ - return in_totalContourArea; -} -// -------------------------------------------------------- -inline float BTree::getDistance(float x, float y) const -{ - float retVal = 0.0f; - for (int i = 0; i < NUM_BLOCKS; i++) { - // float urx = in_xloc[i] + in_width[i]; - // float ury = in_yloc[i] + in_height[i]; - float urx = in_xloc[i] + in_width[i] / 2.0; - float ury = in_yloc[i] + in_height[i] / 2.0; - retVal += sqrt((x - urx) * (x - urx) * (y - ury) * (y - ury)); - } - return retVal; -} -// -------------------------------------------------------- -inline void BTree::setTree(const std::vector& ntree) -{ - in_tree = ntree; -} -// -------------------------------------------------------- -inline void BTree::clean_tree(std::vector& otree) -{ - int vec_size = otree.size(); - for (int i = 0; i < vec_size; i++) { - otree[i].parent = Undefined; - otree[i].left = Undefined; - otree[i].right = Undefined; - } - otree[vec_size - 2].block_index = vec_size - 2; - otree[vec_size - 1].block_index = vec_size - 1; - - otree[vec_size - 2].orient = Undefined; - otree[vec_size - 1].orient = Undefined; -} -// -------------------------------------------------------- -inline void BTree::clean_contour(std::vector& oContour) -{ - int vec_size = oContour.size(); - int Ledge = vec_size - 2; - int Bedge = vec_size - 1; - - oContour[Ledge].next = Bedge; - oContour[Ledge].prev = Undefined; - oContour[Ledge].begin = 0; - oContour[Ledge].end = 0; - oContour[Ledge].CTL = basepacking_h::Dimension::Infty; - - oContour[Bedge].next = Undefined; - oContour[Bedge].prev = Ledge; - oContour[Bedge].begin = 0; - oContour[Bedge].end = basepacking_h::Dimension::Infty; - oContour[Bedge].CTL = 0; - - // reset obstacles (so we consider all of them again) - if (seen_obstacles.size() != getNumObstacles()) - seen_obstacles.resize(getNumObstacles()); - fill(seen_obstacles.begin(), seen_obstacles.end(), false); -} -// -------------------------------------------------------- -inline void BTree::rotate(int index, int newOrient) -{ - in_tree[index].orient = newOrient; - contour_evaluate(); -} -// ======================================================== -inline unsigned BTree::getNumObstacles() -{ - return in_obstacles.xloc.size(); -} -// ======================================================== -inline BTreeOrientedPacking::BTreeOrientedPacking(const BTree& bt) -{ - int blocknum = bt.NUM_BLOCKS; - - xloc.resize(blocknum); - yloc.resize(blocknum); - width.resize(blocknum); - height.resize(blocknum); - orient.resize(blocknum); - for (int i = 0; i < blocknum; i++) { - xloc[i] = bt.xloc(i); - yloc[i] = bt.yloc(i); - width[i] = bt.width(i); - height[i] = bt.height(i); - orient[i] = OrientedPacking::ORIENT(bt.tree[i].orient); - } -} -// -------------------------------------------------------- -inline void BTreeOrientedPacking::operator=(const BTree& bt) -{ - int blocknum = bt.NUM_BLOCKS; - - xloc.resize(blocknum); - yloc.resize(blocknum); - width.resize(blocknum); - height.resize(blocknum); - orient.resize(blocknum); - for (int i = 0; i < blocknum; i++) { - xloc[i] = bt.xloc(i); - yloc[i] = bt.yloc(i); - width[i] = bt.width(i); - height[i] = bt.height(i); - orient[i] = OrientedPacking::ORIENT(bt.tree[i].orient); - } -} -// ======================================================== - -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/btreeanneal.cxx b/src/mpl/src/ParquetFP/src/btreeanneal.cxx deleted file mode 100644 index 6eb9ace3af2..00000000000 --- a/src/mpl/src/ParquetFP/src/btreeanneal.cxx +++ /dev/null @@ -1,1616 +0,0 @@ -/************************************************************************** - *** - *** Copyright (c) 2000-2007 Regents of the University of Michigan, - *** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy - *** and Igor L. Markov - *** - *** Contact author(s): sadya@umich.edu, imarkov@umich.edu - *** Original Affiliation: University of Michigan, EECS Dept. - *** Ann Arbor, MI 48109-2122 USA - *** - *** Permission is hereby granted, free of charge, to any person obtaining - *** a copy of this software and associated documentation files (the - *** "Software"), to deal in the Software without restriction, including - *** without limitation - *** the rights to use, copy, modify, merge, publish, distribute, sublicense, - *** and/or sell copies of the Software, and to permit persons to whom the - *** Software is furnished to do so, subject to the following conditions: - *** - *** The above copyright notice and this permission notice shall be included - *** in all copies or substantial portions of the Software. - *** - *** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - *** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - *** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - *** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - *** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - *** THE USE OR OTHER DEALINGS IN THE SOFTWARE. - *** - *** - ***************************************************************************/ - -#include "btreeanneal.h" - -#include -#include - -#include "FPcommon.h" -#include "basepacking.h" -#include "btreecompact.h" -#include "debugflags.h" -#include "mixedpacking.h" -#include "mixedpackingfromdb.h" -#include "pltobtree.h" - -// parquet data-structures, commented out in order to compile -// #include "FPcommon.h" -// #include "DB.h" -// #include "AnalytSolve.h" -// #include "CommandLine.h" -#include -#include -#include -#include -#include - -#include "allparquet.h" -#include "skyline.h" - -namespace parquetfp { - -using std::cin; -using std::cout; -using std::endl; -using std::max; -using std::min; -using std::vector; - -static void getObstaclesFromDB(DB* const db, BasePacking& out); - -// ======================================================== -BTreeAreaWireAnnealer::BTreeAreaWireAnnealer(MixedBlockInfoType& nBlockinfo) - : BaseAnnealer(), - _blockinfo_cleaner(NULL), - _blockinfo(nBlockinfo), - blockinfo(nBlockinfo), - in_curr_solution(_blockinfo.currDimensions), - in_next_solution(_blockinfo.currDimensions), - in_best_solution(_blockinfo.currDimensions), - _slackEval(NULL) -{ -} -// -------------------------------------------------------- -BTreeAreaWireAnnealer::BTreeAreaWireAnnealer(MixedBlockInfoType& nBlockinfo, - const Command_Line* const params, - DB* const db) - : BaseAnnealer(params, db), - _blockinfo_cleaner(NULL), - _blockinfo(nBlockinfo), - blockinfo(nBlockinfo), - in_curr_solution(_blockinfo.currDimensions), - in_next_solution(_blockinfo.currDimensions), - in_best_solution(_blockinfo.currDimensions) -{ - getObstaclesFromDB(db, _obstacleinfo); - _obstacleFrame[0] = db->getObstacleFrame()[0]; - _obstacleFrame[1] = db->getObstacleFrame()[1]; - in_curr_solution.addObstacles(_obstacleinfo, _obstacleFrame); - in_next_solution.addObstacles(_obstacleinfo, _obstacleFrame); - in_best_solution.addObstacles(_obstacleinfo, _obstacleFrame); - // NOTE: must construct slackEval after trees have been filled with - // obstacles, or btreeslackeval won't get obstacles - _slackEval = new BTreeSlackEval(in_curr_solution); - constructor_core(); -} -// -------------------------------------------------------- -BTreeAreaWireAnnealer::BTreeAreaWireAnnealer(const Command_Line* const params, - DB* const db) - : BaseAnnealer(params, db), - _blockinfo_cleaner( - static_cast(new MixedBlockInfoTypeFromDB(*db))), - _blockinfo(*_blockinfo_cleaner), - blockinfo(_blockinfo), - in_curr_solution(_blockinfo.currDimensions), - in_next_solution(_blockinfo.currDimensions), - in_best_solution(_blockinfo.currDimensions) -{ - getObstaclesFromDB(db, _obstacleinfo); - _obstacleFrame[0] = db->getObstacleFrame()[0]; - _obstacleFrame[1] = db->getObstacleFrame()[1]; - in_curr_solution.addObstacles(_obstacleinfo, _obstacleFrame); - in_next_solution.addObstacles(_obstacleinfo, _obstacleFrame); - in_best_solution.addObstacles(_obstacleinfo, _obstacleFrame); - // NOTE: must construct slackEval after trees have been filled with - // obstacles or btreeslackeval won't get obstacles - _slackEval = new BTreeSlackEval(in_curr_solution); - constructor_core(); -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::constructor_core() -{ - // mgwoo: -noRotation bug fixed here - Nodes* theNodes = _db->getNodes(); - unsigned numNodes = _db->getNumNodes(); - for (unsigned i = 0; i < numNodes; ++i) { - Node& node = theNodes->getNode(i); - if (_params->noRotation - || (!node.isOrientFixed() && node.isHard() - && equalFloat(node.getminAR(), 1.f) && node.allPinsAtCenter)) { - node.putIsOrientFixed(true); - } - } - // initialize the orientation map - _physicalOrient.resize(in_curr_solution.NUM_BLOCKS); - for (int i = 0; i < in_curr_solution.NUM_BLOCKS; i++) { - _physicalOrient[i].resize(blockinfo.Orient_Num); - for (int theta = 0; theta < blockinfo.Orient_Num; theta++) { - parquetfp::Node& currBlock = _db->getNodes()->getNode(i); - if (currBlock.isOrientFixed()) { - _physicalOrient[i][theta] = parquetfp::N; - } else { - _physicalOrient[i][theta] = parquetfp::ORIENT(theta); - // _physicalOrient[i][theta] = parquetfp::N; - // cout << "currentOrient: " << _physicalOrient[i][theta] << - // endl; - } - } - } - - // initialize the dimensions of soft blocks - for (int i = 0; i < in_curr_solution.NUM_BLOCKS; i++) - if (blockinfo.blockARinfo[i].isSoft) { - float blockAR = max(blockinfo.blockARinfo[i].minAR[0], - min(blockinfo.blockARinfo[i].maxAR[0], - float(1.0))); // minAR <= AR <= maxAR - float blockWidth = sqrt(blockinfo.blockARinfo[i].area * blockAR); - float blockHeight = sqrt(blockinfo.blockARinfo[i].area / blockAR); - - _blockinfo.setBlockDimensions(i, blockWidth, blockHeight, 0); - } - - // generate an initial solution - GenerateRandomSoln(in_curr_solution, blockinfo.currDimensions.blocknum()); - in_best_solution = in_curr_solution; - in_next_solution = in_curr_solution; - - // initialize the orientations of nodes in *_db if necessary - for (int i = 0; i < in_curr_solution.NUM_BLOCKS; i++) { - int initOrient = int(in_curr_solution.tree[i].orient); - initOrient = _physicalOrient[i][initOrient]; - - float initWidth = in_curr_solution.width(i); - float initHeight = in_curr_solution.height(i); - - _db->getNodes()->changeOrient( - i, parquetfp::ORIENT(initOrient), *(_db->getNets())); - _db->getNodes()->putNodeWidth(i, initWidth); - _db->getNodes()->putNodeHeight(i, initHeight); - } - - // -----debug messages----- - for (int i = 0; i < in_curr_solution.NUM_BLOCKS; i++) { - for (int thetaIt = 0; thetaIt < blockinfo.Orient_Num; thetaIt++) - if ((_db->getNodes()->getNode(i)).isOrientFixed() - && int(in_curr_solution.tree[i].orient) != 0) { - cout << "ctor: orient of block[" << i << "] should be \"n\"" << endl; - printf("in_curr_solution:orient %d\n", - int(in_curr_solution.tree[i].orient)); - cin.get(); - } - - if (_params->minWL - && (int(in_curr_solution.tree[i].orient) - != int(_db->getNodes()->getNode(i).getOrient()))) { - cout << "ctor: orient of block[" << i << "] is not consistent" << endl; - printf("in_curr_solution:orient %d vs. _db->orient: %d\n", - int(in_curr_solution.tree[i].orient), - int(_db->getNodes()->getNode(i).getOrient())); - cin.get(); - } - - int theta = in_curr_solution.tree[i].orient; - if (std::abs(in_curr_solution.width(i) - - blockinfo.currDimensions[i].width[theta]) - > 1e-6) { - printf( - "ctor: width of block[%d] is not consistent. in_curr_soln: %.2f vs. " - "blockinfo: %.2f\n", - i, - in_curr_solution.width(i), - blockinfo.currDimensions[i].width[theta]); - cin.get(); - } - - if (std::abs(in_curr_solution.height(i) - - blockinfo.currDimensions[i].height[theta]) - > 1e-6) { - printf( - "ctor: height of block[%d] is not consistent. in_curr_soln: %.2f " - "vs. blockinfo: %.2f\n", - i, - in_curr_solution.height(i), - blockinfo.currDimensions[i].height[theta]); - cin.get(); - } - - if (_params->minWL - && std::abs(in_curr_solution.width(i) - - _db->getNodes()->getNodeWidth(i)) - > 1e-6) { - printf( - "ctor: width of block[%d] is not consistent. in_curr_solution: %.2f " - "vs._db: %.2f\n", - i, - in_curr_solution.width(i), - _db->getNodes()->getNodeWidth(i)); - cin.get(); - } - } -} -// -------------------------------------------------------- -bool BTreeAreaWireAnnealer::go() -{ - DBfromSoln(in_curr_solution); - - // turn off rotation for hard square macros - // with pins in the center - Nodes* theNodes = _db->getNodes(); - unsigned numNodes = _db->getNumNodes(); - for (unsigned i = 0; i < numNodes; ++i) { - Node& node = theNodes->getNode(i); - if (_params->noRotation - || (!node.isOrientFixed() && node.isHard() - && equalFloat(node.getminAR(), 1.f) && node.allPinsAtCenter)) { - node.putIsOrientFixed(true); - } - } - // DEBUG:: - // for(int i=0; igetNode(i); - // cout << "i: " << node.isOrientFixed() << endl; - // cout << node.getName() << " " << node.getWidth() << " " << - // node.getHeight () << endl; - // } - - bool success = false; - if (in_curr_solution.NUM_BLOCKS > 1) - success = anneal(); - else - success = packOneBlock(); - - // cout << "before DB from soln" << endl; - // update *_db for locs, dimensions and slacks - DBfromSoln(in_curr_solution); - // cout << "after DB from soln" << endl; - - // for(int i=0; ievalHPWL(useWts, _params->scaleTerms, _params->useSteiner); -#else - currSoln.HPWL = _db->evalHPWL(useWts, _params->scaleTerms); -#endif - printResults(currSoln); - - return success; -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::DBfromSoln(const BTree& soln) -{ - _db->updatePlacement(const_cast&>(soln.xloc()), - const_cast&>(soln.yloc())); - for (int i = 0; i < soln.NUM_BLOCKS; i++) { - parquetfp::ORIENT newOrient = parquetfp::ORIENT(soln.tree[i].orient); - _db->getNodes()->changeOrient(i, newOrient, *(_db->getNets())); - _db->getNodes()->putNodeWidth(i, soln.width(i)); - _db->getNodes()->putNodeHeight(i, soln.height(i)); - } - - // cout << "Before evaluate Slacks: " << endl; - // for(int i=0; ievaluateSlacks(soln); - - // cout << "After evaluate Slacks: " << endl; - // for(int i=0; i xSlacks(blocknum); // % x-slacks - vector ySlacks(blocknum); // % y-slacks - float totalWidth = soln.totalWidth(); - float totalHeight = soln.totalHeight(); - for (int i = 0; i < blocknum; i++) { - xSlacks[i] = (_slackEval->xSlack()[i] / totalWidth) * 100; - ySlacks[i] = (_slackEval->ySlack()[i] / totalHeight) * 100; - } - _db->updateSlacks(xSlacks, ySlacks); - -#ifdef PARQUET_DEBUG_HAYWARD_ASSERT_BTREEANNEAL - for (int i = 0; i < blocknum; i++) { - int theta = soln.tree[i].orient; - if (theta != _physicalOrient[i][theta]) { - printf("block: %d theta: %d physicalOrient: %d\n", - i, - theta, - _physicalOrient[i][theta]); - cin.get(); - } - } -#endif -} -// -------------------------------------------------------- -bool BTreeAreaWireAnnealer::packOneBlock() -{ - const float blocksArea = in_curr_solution.blockArea(); - const float reqdAR = _params->reqdAR; - const float reqdArea = blocksArea * (1 + (_params->maxWS / 100.0)); - const float reqdWidth = sqrt(reqdArea * reqdAR); - const float reqdHeight = reqdWidth / reqdAR; - - const vector defaultXloc(1, 0); // 1 copy of "0" - const vector defaultYloc(1, 0); - const int defaultOrient = 0; - - if (_params->verb > 0) - cout << "Only one block is detected, deterministic algo used." << endl; - - if (_params->reqdAR != FREE_OUTLINE && _params->verb > 0) - cout << "outline width: " << reqdWidth << " outline height: " << reqdHeight - << endl; - - int bestOrient = defaultOrient; - - float bestHPWL = basepacking_h::Dimension::Infty; - bool success = false; - for (int theta = 0; theta < basepacking_h::Dimension::Orient_Num; theta++) { - if (_db->getNodes()->getNode(0).isOrientFixed() && theta > 0) - break; - - in_curr_solution.rotate(0, theta); - - float blockWidth = in_curr_solution.width(0); - float blockHeight = in_curr_solution.height(0); - bool fitsInside - = ((_params->reqdAR == FREE_OUTLINE) - || ((blockWidth <= reqdWidth) && (blockHeight <= reqdHeight))); - - if (_params->verb > 0) - cout << "orient: " << theta << " width: " << blockWidth - << " height: " << blockHeight - << " inside: " << ((fitsInside) ? "T" : "F"); - - success = success || fitsInside; - if (fitsInside && _params->minWL) { - DBfromSoln(in_curr_solution); - bool useWts = true; -#ifdef USEFLUTE - float currHPWL - = _db->evalHPWL(useWts, _params->scaleTerms, _params->useSteiner); -#else - float currHPWL = _db->evalHPWL(useWts, _params->scaleTerms); -#endif - - if (_params->verb > 0) - cout << " HPWL: " << currHPWL; - if (currHPWL < bestHPWL) { - bestOrient = theta; - bestHPWL = currHPWL; - } - } else if (fitsInside) - bestOrient = theta; - - if (_params->verb > 0) - cout << endl; - } - - in_curr_solution.rotate(0, bestOrient); - DBfromSoln(in_curr_solution); - - return success; -} -// --------------------------------------------------------- - -bool BTreeAreaWireAnnealer::anneal() -{ - // options - const bool budgetTime = _params->budgetTime; - float seconds = _params->seconds; - const bool minWL = _params->minWL; - - // input params - const float wireWeight = _params->wireWeight; - const float areaWeight = _params->areaWeight; - const float ARWeight = max(1 - areaWeight - wireWeight, float(0.0)); - - // input params - const float blocksArea = _db->getNodesArea(); - const float size = in_curr_solution.NUM_BLOCKS; - - float currTime = _params->startTime; - - // if any constraint is imposed - const float reqdAR = _params->reqdAR; - // const float reqdArea = blocksArea * (1+((_params->maxWS-1)/100.0)); - // const float reqdWidth = sqrt(reqdArea*reqdAR); - // const float reqdHeight = reqdWidth/reqdAR; - - // const float real_reqdAR = _params->reqdAR; - const float real_reqdArea = blocksArea * (1 + (_params->maxWS / 100.0)); - const float real_reqdWidth = sqrt(real_reqdArea * reqdAR); - const float real_reqdHeight = real_reqdWidth / reqdAR; - // const float maxDist = sqrt(real_reqdWidth * real_reqdWidth * - // real_reqdHeight * real_reqdHeight); - - // save attributes of the best solution - // float bestArea = FLT_MAX; - // float bestHPWL = FLT_MAX; - - // global counters and book-keepers - int move = UNINITIALIZED; - int count = 0; -#ifdef PARQUET_DEBUG_HAYWARD_ASSERT_BTREEANNEAL - int prev_move = UNINITIALIZED; -#endif - - unsigned int timeChangeCtr = 0; - unsigned int moveSelect = UNSIGNED_UNINITIALIZED; - unsigned int iter = UNSIGNED_UNINITIALIZED; - unsigned int masterMoveSel = 0; - - bool moveAccepted = false; - bool brokeFromLoop = false; - - float total = seconds, percent = 1; - unsigned int moves = 1000; - - // Added by DAP to support terminate on - // acceptence ratio less than 0.5% - // unsigned accept_ct = 0; - bool saved_best = false; - - _db->updatePlacement(const_cast&>(in_curr_solution.xloc()), - const_cast&>(in_curr_solution.yloc())); - bool useWts = true; -#ifdef USEFLUTE - float currHPWL - = _db->evalHPWL(useWts, _params->scaleTerms, _params->useSteiner); -#else - float currHPWL = _db->evalHPWL(useWts, _params->scaleTerms); -#endif - - // float currDist = in_curr_solution.getDistance(real_reqdWidth, - // real_reqdHeight); - - SkylineContour mapY(in_curr_solution, true); - float currWastedArea = in_curr_solution.totalContourArea() - + mapY.GetContourArea() - - 2.0 * in_curr_solution.blockArea(); - - // calculate wastedArea - // SkylineContour mapX(in_curr_solution), mapY(in_curr_solution, true); - // float currWastedContArea - // = mapX.GetContourArea() - // + mapY.GetContourArea() - // - 2.0 * in_curr_solution.blockArea(); - - float bestHPWL = currHPWL; - float bestArea = std::numeric_limits::max(); - // float bestDist = std::numeric_limits::min(); - float bestWastedArea = std::numeric_limits::max(); - - while (currTime > _params->timeCool || budgetTime) { - brokeFromLoop = false; - iter = 0; - - // ---------------------------------------- - // an iteration under the same termperature - // ---------------------------------------- - do { - // ----------------------- - // select and apply a move - // ----------------------- - - // current solution, "currHPWL" updated only when necessary - // "currWastedArea" also updated only when necessary - float currArea = in_curr_solution.totalArea(); - float currHeight = in_curr_solution.totalHeight(); - float currWidth = in_curr_solution.totalWidth(); - float currAR = currWidth / currHeight; - - ++count; - ++iter; -#ifdef PARQUET_DEBUG_HAYWARD_ASSERT_BTREEANNEAL - prev_move = move; -#endif - - // -----select the types of moves here----- - if (_params->softBlocks && currTime < 50) - masterMoveSel = rand() % 1000; - moveSelect = rand() % 1000; - - // -----take action----- - int indexOrient = UNSIGNED_UNINITIALIZED; - parquetfp::ORIENT newOrient = parquetfp::N; - parquetfp::ORIENT oldOrient = parquetfp::N; - - int index = UNINITIALIZED; - float newWidth = UNINITIALIZED; - float newHeight = UNINITIALIZED; - - // float deadspacePercent = (currArea / blocksArea - 1) * 100; - if (_params->softBlocks && - // deadspacePercent < _params->startSoftMovePercent && - masterMoveSel == 1) - move = packSoftBlocks(2); // needs its return-value (-1)!!! - - else if (_params->softBlocks && - // deadspacePercent < - // _params->startSoftMovePercent && - masterMoveSel > 950) - move = makeSoftBlMove(index, newWidth, newHeight); - - else if (((reqdAR - currAR) / reqdAR > 0.00005 - || (currAR - reqdAR) / reqdAR > 0.00005) - && (timeChangeCtr % 4) == 0 && reqdAR != FREE_OUTLINE) { - // move = makeMove(indexOrient, newOrient, oldOrient); - move = makeARMove(); - } - - else if (/*false && !minWL &&*/ - currTime < 30 && (timeChangeCtr % 5) == 0) { - // move = compactBlocks(); - } - - else if (moveSelect < 150) { - if (reqdAR != FREE_OUTLINE) - move = makeARMove(); - else - move = makeMove(indexOrient, newOrient, oldOrient); - } - - else if (moveSelect < 300 && minWL) { - if (reqdAR != FREE_OUTLINE) - move = makeARWLMove(); - else - move = makeHPWLMove(); - } - - else - move = makeMove(indexOrient, newOrient, oldOrient); - - // -----additional book-keeping for special moves----- - // for orientation moves - if (move == REP_SPEC_ORIENT || move == ORIENT) { - // temp values - if (minWL) { - _db->getNodes()->changeOrient( - indexOrient, newOrient, *(_db->getNets())); - } - } - - // for soft-block moves - if (move == SOFT_BL) { - int indexTheta = in_curr_solution.tree[index].orient; - _blockinfo.setBlockDimensions(index, newWidth, newHeight, indexTheta); - // cout << "Next Solution Evaluate" << endl; - in_next_solution.evaluate(in_curr_solution.tree); - - if (minWL) { - _db->getNodes()->putNodeWidth(index, newWidth); - _db->getNodes()->putNodeHeight(index, newHeight); - } - } - - // attributes of "in_next_solution" - float tempHeight = in_next_solution.totalHeight(); - float tempWidth = in_next_solution.totalWidth(); - float tempArea = in_next_solution.totalArea(); - float tempAR = tempWidth / tempHeight; - float tempHPWL = UNINITIALIZED; - // float tempDist = in_next_solution.getDistance( real_reqdWidth, - // real_reqdHeight); - - SkylineContour mapY(in_next_solution, true); - - float tempWastedArea = in_next_solution.totalContourArea() - + mapY.GetContourArea() - - 2.0 * in_next_solution.blockArea(); - - // ----------------------------------------------------- - // evaulate the temporary solution and calculate "delta" - // ----------------------------------------------------- - - float deltaArea = 0; - float deltaHPWL = 0; - float deltaAR = UNINITIALIZED; - float delta = UNINITIALIZED; - // float deltaDist = UNINITIALIZED; - float deltaWastedArea = UNINITIALIZED; - - /* area objective */ - if (currTime > 30) - deltaArea - = ((tempArea - currArea) * 1.2 * _params->timeInit) / blocksArea; - else - deltaArea - = ((tempArea - currArea) * 1.5 * _params->timeInit) / blocksArea; - - /* area objective */ - if (currTime > 30) - deltaWastedArea - = ((tempWastedArea - currWastedArea) * 1.2 * _params->timeInit) - / blocksArea; - else - deltaWastedArea - = ((tempWastedArea - currWastedArea) * 1.5 * _params->timeInit) - / blocksArea; - - // deltaDist = -1 * ((tempDist-currDist) * _params->timeInit) / - // maxDist; - - /* HPWL objective if applicable */ - if (minWL) { - _db->updatePlacement( - const_cast&>(in_next_solution.xloc()), - const_cast&>(in_next_solution.yloc())); - // cout << "placement Info Updated! curr" << endl; - // for(int i=0; ievalHPWL(useWts, _params->scaleTerms, _params->useSteiner); -#else - tempHPWL = _db->evalHPWL(useWts, _params->scaleTerms); -#endif - if (currHPWL == 0) - deltaHPWL = 0; - else { - if (currTime > 30) - deltaHPWL = ((tempHPWL - currHPWL) * 1.2 * _params->timeInit) - / currHPWL; // 1.2 - else - deltaHPWL = ((tempHPWL - currHPWL) * 1.5 * _params->timeInit) - / currHPWL; // 1.5 - } - } - - // if (_isFixedOutline) - // { - // /* max(x-viol, y-viol) objective */ - // if((tempHeight-currHeight) > (tempWidth-currWidth)) - // deltaArea=((tempHeight-currHeight)*1.3*_params->timeInit)/(real_reqdHeight); - // else - // deltaArea=((tempWidth-currWidth)*1.3*_params->timeInit)/(real_reqdWidth); - - // // /* x-viol + y-viol objective */ - // // deltaArea=0.5*1.3*_params->timeInit* - // // (abs(tempHeight-currHeight) / (reqdHeight) + - // // abs(tempWidth-currWidth) / (reqdWidth)); - // } - - // if (_isFixedOutline && getNumObstacles()) - //{ // XXX compute cost using outline violations, rather than AR - // // when obstacles are present (because AR is meaningless when there - // are obstacles) - // // max(x-viol, y-viol) objective - - // float deltaHeight = - // ((tempHeight-currHeight)*1.3*_params->timeInit)/(real_reqdHeight); - // float deltaWidth = - // ((tempWidth-currWidth)*1.3*_params->timeInit)/(real_reqdWidth); - - // if (deltaHeight > 0 && deltaWidth > 0) - // deltaArea = deltaHeight + deltaWidth; - // else if (deltaHeight > 0) - // deltaArea = deltaHeight; - // else if (deltaWidth > 0) - // deltaArea = deltaWidth; - // else - // deltaArea = deltaHeight + deltaWidth; - //} - - /* AR and overall objective */ - delta = deltaArea; - if (reqdAR != FREE_OUTLINE) { - deltaAR = ((tempAR - reqdAR) * (tempAR - reqdAR) - - (currAR - reqdAR) * (currAR - reqdAR)) - * 20 * _params->timeInit; // 10 // 1.2 - - // This Function !!! - if (minWL) { - // delta = (areaWeight * deltaArea + - // wireWeight * deltaHPWL + - // ARWeight * deltaAR); - // delta = 0.2 * deltaHPWL + - // 0.6 * deltaWastedContArea; - // delta = 0.2 * deltaHPWL + 0.4 * deltaAR + 0.4 * deltaDist; - delta = 0.2 * deltaHPWL + 0.4 * deltaAR + 0.4 * deltaWastedArea; - // delta = 0.4 * deltaAR + 0.8 * deltaWastedArea; - // cout << "c: " << count << " dHpwl: " << deltaHPWL - // << " dAR:" << deltaAR << " dWArea:" << deltaWastedArea<< - // endl; - - } else - delta = ((areaWeight + wireWeight / 2.0) * deltaArea - + (ARWeight + wireWeight / 2.0) * deltaAR); - - } else if (minWL) { - delta = ((areaWeight + ARWeight / 2.0) * deltaArea - + (wireWeight + ARWeight / 2.0) * deltaHPWL); - } else - delta = deltaArea; - // finish calculating "delta" - - // -------------------------------------------------- - // decide whether a move is accepted based on "delta" - // -------------------------------------------------- - - // cout << "Iter: " << iter << " Delta: " << delta << endl; - - if (delta < 0 || move == MISC) - moveAccepted = true; - else if (currTime > _params->timeCool) - // become greedy below time > timeCool - { - float ran = rand() % 10000; - float r = float(ran) / 9999; - if (r < exp(-1 * delta / currTime)) - moveAccepted = true; - else - moveAccepted = false; - } else - moveAccepted = false; - - // -----update current solution if accept----- - if (moveAccepted && move != MISC) { - // cout << "Move Accepted!!" << endl; - in_curr_solution = in_next_solution; - currHPWL = tempHPWL; - // currDist = tempDist; - currWastedArea = tempWastedArea; - } - - // -----additional book-keeping for special moves----- - if (move == REP_SPEC_ORIENT || move == ORIENT) { - // if move not accepted, then put back "oldOrient" - parquetfp::ORIENT actualOrient - = parquetfp::ORIENT(in_curr_solution.tree[indexOrient].orient); - - if (minWL) { - _db->getNodes()->changeOrient( - indexOrient, actualOrient, *(_db->getNets())); - // cout << "After Changing Orient" << endl; - // cout << "" - } - } - - if (move == SOFT_BL) { - // if move not accepted, then put back "oldWidth/Height" - float actualWidth = in_curr_solution.width(index); - float actualHeight = in_curr_solution.height(index); - int actualTheta = in_curr_solution.tree[index].orient; - _blockinfo.setBlockDimensions( - index, actualWidth, actualHeight, actualTheta); - - if (minWL) { - _db->getNodes()->putNodeWidth(index, actualWidth); - _db->getNodes()->putNodeHeight(index, actualHeight); - } - } - - // check the best updates - bool updateBest = false; - if (_params->reqdAR != FREE_OUTLINE) { - if (minWL) { - updateBest - = (currWidth <= real_reqdWidth && currHeight <= real_reqdHeight - && currHPWL < bestHPWL && currWastedArea < bestWastedArea); - // currDist > bestDist); - // cout << "HPWL: " << currHPWL << " " << bestHPWL << endl; - } else { - updateBest - = (currWidth <= real_reqdWidth && currHeight <= real_reqdHeight - && currArea < bestArea); - } - } else if (minWL) { - float currCost = areaWeight * currArea + wireWeight * currHPWL; - float bestCost = areaWeight * bestArea + wireWeight * bestHPWL; - - updateBest = (currCost < bestCost); - } else - updateBest = (currArea < bestArea); - - if (updateBest) { - saved_best = true; - bestHPWL = currHPWL; - bestArea = currArea; - // bestDist = currDist; - bestWastedArea = currWastedArea; - in_best_solution = in_curr_solution; - } - //} - - // ------------------------------ - // special terminating conditions - // ------------------------------ - - // Final Termination!! - if (minWL /* && _params->startTime > 100*/) // for lowT anneal don't have - // this condition - { - // hhchan TODO: clean-up this code mess - if (currArea <= real_reqdArea && currHeight <= real_reqdHeight - && currWidth <= real_reqdWidth && reqdAR != FREE_OUTLINE - && currTime < 5) { - // cout << "case1 !!!" << endl; - return true; - } - - if (reqdAR != FREE_OUTLINE && currTime < 5 && _params->dontClusterMacros - && _params->solveTop) { - float widthWMacroOnly = _db->getXSizeWMacroOnly(); - float heightWMacroOnly = _db->getYSizeWMacroOnly(); - - if (widthWMacroOnly <= real_reqdWidth - && heightWMacroOnly <= real_reqdHeight) { - // cout << "case2 !!!" << endl; - return true; - } - } - } else { - if (currArea <= real_reqdArea && currHeight <= real_reqdHeight - && currWidth <= real_reqdWidth && reqdAR != FREE_OUTLINE) { - // cout << "case3 !!!" << endl; - return true; - } - } - - // Hard limit for moves - if (iter >= moves) - break; - -#ifdef PARQUET_DEBUG_HAYWARD_ASSERT_BTREEANNEAL - // -----debugging messages----- - for (int i = 0; i < in_curr_solution.NUM_BLOCKS; i++) { - if (minWL - && (int(in_curr_solution.tree[i].orient) - != int(_db->getNodes()->getNode(i).getOrient()))) { - cout << "round [" << count << "]: orient of block[" << i - << "] is not consistent" << endl; - printf("in_curr_solution:orient %d vs. _db->orient: %d, move: %d", - int(in_curr_solution.tree[i].orient), - int(_db->getNodes()->getNode(i).getOrient()), - move); - cin.get(); - } - - int theta = in_curr_solution.tree[i].orient; - if (theta != int(_physicalOrient[i][theta])) { - printf( - "round[%d]: orient of block[%d] is not consistent, in_curr_soln: " - "%d vs phyOrient: %d move: %d\n", - count, - i, - theta, - _physicalOrient[i][theta], - move); - cin.get(); - } - - if (std::abs(in_curr_solution.width(i) - - blockinfo.currDimensions[i].width[theta]) - > 1e-6) { - printf( - "round[%d]: width of block[%d] is not consistent. in_curr_soln: " - "%.2f vs. blockinfo: %.2f move: %d prevMove: %d\n", - count, - i, - in_curr_solution.width(i), - blockinfo.currDimensions[i].width[theta], - move, - prev_move); - printf( - "round[%d]: oldWidth: %.2f oldHeight: %.2f newWidth: %.2f " - "newHeight: %.2f moveAccepted: %s\n", - count, - -1.0, - -1.0, - newWidth, - newHeight, - (moveAccepted) ? "T" : "F"); - cin.get(); - } - - if (std::abs(in_curr_solution.height(i) - - blockinfo.currDimensions[i].height[theta]) - > 1e-6) { - printf( - "round[%d]: height of block[%d] is not consistent. " - "in_curr_soln: %.2f vs. blockinfo: %.2f move: %d prevMove: %d\n", - count, - i, - in_curr_solution.height(i), - blockinfo.currDimensions[i].height[theta], - move, - prev_move); - printf( - "round[%d]: oldWidth: %.2f oldHeight: %.2f newWidth: %.2f " - "newHeight: %.2f moveAccepted: %s\n", - count, - -1.0, - -1.0, - newWidth, - newHeight, - (moveAccepted) ? "T" : "F"); - cin.get(); - } - - if (minWL - && std::abs(in_curr_solution.width(i) - - _db->getNodes()->getNodeWidth(i)) - > 1e-6) { - printf( - "round[%d]: width of block[%d] is not consistent. " - "in_curr_solution: %.2f vs._db: %.2f move: %d\n", - count, - i, - in_curr_solution.width(i), - _db->getNodes()->getNodeWidth(i), - move); - cin.get(); - } - - if (in_curr_solution.width(i) < 1e-10 - || in_curr_solution.height(i) < 1e-10) { - printf("round[%d]: width of block[%d]: %f height: %f move: %d\n", - count, - i, - in_curr_solution.width(i), - in_curr_solution.height(i), - move); - cin.get(); - } - } - // -----end of debugging messages----- -#endif - // cout << "iter: " << iter << " size: " << 4*size << " bTime: " << - // budgetTime << endl; - } - // while (iter < 4*size || budgetTime); - while (iter < 10 * size || budgetTime); - - // cout << "whileBreak Iter: " << iter << endl; - // finish the loop under constant temperature - - // ----------------------------- - // update temperature "currTime" - // ----------------------------- - - float alpha = UNINITIALIZED; - ++timeChangeCtr; - if (budgetTime) { - percent = seconds / total; - - if (percent < 0.66666 && percent > 0.33333) - alpha = 0.9f; - else if (percent < 0.33333 && percent > 0.16666) - alpha = 0.95f; - else if (percent < 0.16666 && percent > 0.06666) - alpha = 0.96f; - else if (percent < .06666 && percent > .00333) - alpha = 0.8f; - else if (percent < .00333 && percent > .00003) - alpha = 0.98f; - else - alpha = 0.85f; - } else { - if (currTime < 2000 && currTime > 1000) - alpha = 0.9f; - else if (currTime < 1000 && currTime > 500) - alpha = 0.95f; - else if (currTime < 500 && currTime > 200) - alpha = 0.96f; - else if (currTime < 200 && currTime > 10) - alpha = 0.96f; - else if (currTime < 15 && currTime > 0.1) - alpha = 0.98f; - else - alpha = 0.85f; - } - // cout << "currTime: " << currTime << " -> "; - currTime *= alpha; - // cout << currTime << endl; - if (brokeFromLoop) - break; - } - if (saved_best) - in_curr_solution = in_best_solution; - // if(_params->verb.getForActions() > 0) - // cout << "NumMoves attempted: " << count << endl; - if (reqdAR != FREE_OUTLINE) - return false; - else - return true; -} - -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::takePlfromDB() -{ - Pl2BTree converter(_db->getXLocs(), - _db->getYLocs(), - _db->getNodeWidths(), - _db->getNodeHeights(), - Pl2BTree::TCG); - in_curr_solution.evaluate(converter.btree()); - in_next_solution = in_curr_solution; -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::compactSoln(bool minWL, - bool fixedOutline, - float reqdH, - float reqdW) -{ - // TO DO: have this function check for WL and fixedOutline - BTreeCompactor compactor(in_curr_solution); - - int round = 0; - int numBlkChange = compactor.compact(); - float lastArea = in_curr_solution.totalArea(); - float currArea = compactor.totalArea(); - while (numBlkChange > 0) { - if (_params->verb) - printf("round[%d] %d blks moved, area: %.2f -> %.2f\n", - round, - numBlkChange, - lastArea, - currArea); - - numBlkChange = compactor.compact(); - round++; - lastArea = currArea; - currArea = compactor.totalArea(); - } - if (_params->verb > 0) - printf("round[%d] %d blks moved, area: %.2f -> %.2f\n", - round, - numBlkChange, - lastArea, - currArea); - - in_curr_solution = compactor; - DBfromSoln(in_curr_solution); -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::makeMove(int& indexOrient, - parquetfp::ORIENT& newOrient, - parquetfp::ORIENT& oldOrient) -{ - BTree::MoveType move = get_move(); - indexOrient = UNSIGNED_UNINITIALIZED; - newOrient = parquetfp::N; - oldOrient = parquetfp::N; - switch (move) { - case BTree::SWAP: - // cout << "makeMoveSwap" << endl; - perform_swap(); - return 1; - - case BTree::ROTATE: - // cout << "makeMoveRotate" << endl; - perform_rotate(indexOrient, newOrient, oldOrient); - return int(REP_SPEC_ORIENT); - - case BTree::MOVE: - // cout << "makeMoveSimple" << endl; - perform_move(); - return 3; - - default: - cout << "ERROR: invalid move specified in makeMove()" << endl; - exit(1); - } - return MISC; -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::makeMoveSlacks() -{ - // cout << "makeMoveSlacks" << endl; - int movedir = rand() % 100; - int threshold = 50; - bool horizontal = (movedir < threshold); - - makeMoveSlacksCore(horizontal); - - static int total = 0; - static int numHoriz = 0; - - total++; - numHoriz += ((horizontal) ? 1 : 0); - - if (total % 1000 == 0 && _params->verb > 0) - cout << "total: " << total << "horiz: " << numHoriz << endl; - return SLACKS_MOVE; -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::makeARMove() -{ - // cout << "makeARMove" << endl; - float currWidth = in_curr_solution.totalWidth(); - float currHeight = in_curr_solution.totalHeight(); - float currAR = currWidth / currHeight; - - const float reqdAR = _params->reqdAR; - bool horizontal = currAR > reqdAR; - - makeMoveSlacksCore(horizontal); - return AR_MOVE; -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::makeMoveSlacksCore(bool horizontal) -{ - // cout << "makeMoveSlacksCore" << endl; - _slackEval->evaluateSlacks(in_curr_solution); - // cout << "End SlackEval!!" << endl; - - vector indices_sorted; - const vector& slacks - = (horizontal) ? _slackEval->xSlack() : _slackEval->ySlack(); - - sort_slacks(slacks, indices_sorted); - - int blocknum = in_curr_solution.NUM_BLOCKS; - int range = int(ceil(blocknum / 5.0)); - - int operand_ptr = rand() % range; - int operand = indices_sorted[operand_ptr]; - while (operand_ptr > 0 && slacks[operand] > 0) { - operand_ptr--; - operand = indices_sorted[operand_ptr]; - } - - int target_ptr = blocknum - 1 - (rand() % range); - int target = indices_sorted[target_ptr]; - while (target_ptr < (blocknum - 1) && slacks[target] <= 0) { - target_ptr++; - target = indices_sorted[target_ptr]; - } - - if (target == operand || slacks[operand] < 0 || slacks[target] < 0) - return; - - in_next_solution = in_curr_solution; - in_next_solution.move(operand, target, horizontal); -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::makeHPWLMove() -{ - // cout << "makeHPWLMove" << endl; - int size = in_curr_solution.NUM_BLOCKS; - int operand = rand() % size; - int target = UNSIGNED_UNINITIALIZED; - - vector searchBlocks; - locateSearchBlocks(operand, searchBlocks); - - if (searchBlocks.size() > 0) { - int temp = rand() % searchBlocks.size(); - target = searchBlocks[temp]; - } else { - do - target = rand() % size; - while (target == operand); - } - - bool leftChild = bool(rand() % 2); - in_next_solution = in_curr_solution; - in_next_solution.move(operand, target, leftChild); - return HPWL; -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::makeARWLMove() -{ - // cout << "makeARWLMove" << endl; - // cout << "before EvalSlack xloc yloc" << endl; - // for(int i=0; ievaluateSlacks(in_curr_solution); - - // cout << "End SlackEval!!" << endl; - // for(int i=0; ireqdAR; - const float currAR - = in_curr_solution.totalWidth() / in_curr_solution.totalHeight(); - const bool horizontal = currAR > reqdAR; - const vector& slacks - = (horizontal) ? _slackEval->xSlack() : _slackEval->ySlack(); - - vector indices_sorted; - sort_slacks(slacks, indices_sorted); - - int blocknum = in_curr_solution.NUM_BLOCKS; - int range = int(ceil(blocknum / 5.0)); - - int operand_ptr = rand() % range; - int operand = indices_sorted[operand_ptr]; - while (operand_ptr > 0 && slacks[operand] > 0) { - operand_ptr--; - operand = indices_sorted[operand_ptr]; - } - - vector searchBlocks; - locateSearchBlocks(operand, searchBlocks); - - int target = UNSIGNED_UNINITIALIZED; - float maxSlack = -1; - if (searchBlocks.size() == 0) { - do - target = rand() % blocknum; - while (target == operand); - } else { - for (unsigned int i = 0; i < searchBlocks.size(); i++) { - int thisBlk = searchBlocks[i]; - if (slacks[thisBlk] > maxSlack) { - maxSlack = slacks[thisBlk]; - target = thisBlk; - } - } - } - - if (target == operand || slacks[operand] < 0 || maxSlack < 0) { - // couldn't lock on a target; let's not make any risky moves - // TODO: don't waste this move - pick something reasonable to move - return ARWL; - } - - // cout << "REVERT!!! xloc yloc" << endl; - // for(int i=0; ievaluateSlacks(in_curr_solution); - - int moveDir = rand() % 2; - bool horizontal = (moveDir % 2 == 0); - index = getSoftBlIndex(horizontal); - - if (index == NOT_FOUND) - index = getSoftBlIndex(!horizontal); - - if (index != NOT_FOUND) { - return getSoftBlNewDimensions(index, newWidth, newHeight); - } else { - newWidth = NOT_FOUND; - newHeight = NOT_FOUND; - return MISC; - } -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::getSoftBlIndex(bool horizontal) const -{ - const int blocknum = in_curr_solution.NUM_BLOCKS; - const vector& slacks - = (horizontal) ? _slackEval->xSlack() : _slackEval->ySlack(); - - const vector& orth_slacks - = (horizontal) ? _slackEval->ySlack() : _slackEval->xSlack(); - - vector indices_sorted; - sort_slacks(slacks, indices_sorted); - - int operand = NOT_FOUND; // "-1" stands for not found - for (int i = 0; (i < blocknum) && (operand == NOT_FOUND); i++) { - int index = indices_sorted[i]; - if (slacks[index] < 0 || orth_slacks[index] < 0) { - // skip these blocks affected by obstacles - continue; - } - - if (blockinfo.blockARinfo[index].isSoft) { - int theta = in_curr_solution.tree[index].orient; - float minAR = blockinfo.blockARinfo[index].minAR[theta]; - float maxAR = blockinfo.blockARinfo[index].maxAR[theta]; - - float currWidth = in_curr_solution.width(index); - float currHeight = in_curr_solution.height(index); - float currAR = currWidth / currHeight; - - bool adjustable = (horizontal) ? (currAR > minAR) : (currAR < maxAR); - - float reqdLength = (horizontal) ? _outlineHeight : _outlineWidth; - float currLength = (horizontal) ? currHeight : currWidth; - float slackAdjustment - = ((_isFixedOutline) ? currLength - reqdLength : 0.0); - float normalizedSlack = orth_slacks[index] - slackAdjustment; - if (normalizedSlack > 0 && adjustable) - operand = index; - } - } - return operand; -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::getSoftBlNewDimensions(int index, - float& newWidth, - float& newHeight) const -{ - if (_slackEval->xSlack()[index] < 0 || _slackEval->ySlack()[index] < 0) { - // don't touch nodes around obstacles - return NOOP; - } - - if (blockinfo.blockARinfo[index].isSoft) { - float origWidth = in_curr_solution.width(index); - float origHeight = in_curr_solution.height(index); - float indexArea = blockinfo.blockARinfo[index].area; - - int theta = in_curr_solution.tree[index].orient; - float minAR = blockinfo.blockARinfo[index].minAR[theta]; - float maxAR = blockinfo.blockARinfo[index].maxAR[theta]; - if (_isFixedOutline) { - const bool agressiveAR = false; - // ((in_curr_solution.totalArea() / _outlineArea - 1) - // < _params->startSoftMovePercent / 100.0); - minAR = (agressiveAR) ? minAR : max(minAR, float(1.0 / 3.0)); - maxAR = (agressiveAR) ? maxAR : min(maxAR, float(3.0)); - } - - float maxWidth = sqrt(indexArea * maxAR); - float minWidth = sqrt(indexArea * minAR); - - float maxHeight = sqrt(indexArea / minAR); - float minHeight = sqrt(indexArea / maxAR); - - float indexSlackX = _slackEval->xSlack()[index]; - float indexSlackY = _slackEval->ySlack()[index]; - - // adjustment <= 0.75 * actual slack - float slackAdjustmentX - = (_isFixedOutline) ? (in_curr_solution.totalWidth() - _outlineWidth) - : 0.0; - // slackAdjustmentX = max(slackAdjustmentX, 0.0); - // slackAdjustmentX = min(slackAdjustmentX, 0.75 * indexSlackX); - - float slackAdjustmentY - = (_isFixedOutline) ? (in_curr_solution.totalHeight() - _outlineHeight) - : 0.0; - // slackAdjustmentY = max(slackAdjustmentY, 0.0); - // slackAdjustmentY = min(slackAdjustmentY, 0.75 * indexSlackY); - - float normalizedSlackX = indexSlackX - slackAdjustmentX; - float normalizedSlackY = indexSlackY - slackAdjustmentY; - if (normalizedSlackX > normalizedSlackY) { - newWidth = min(origWidth + normalizedSlackX, maxWidth); - newWidth = max(newWidth, minWidth); - - newHeight = indexArea / newWidth; - } else { - newHeight = min(origHeight + normalizedSlackY, maxHeight); - newHeight = max(newHeight, minHeight); - - newWidth = indexArea / newHeight; - } - return SOFT_BL; - } else - return NOOP; -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::packSoftBlocks(int numIter) -{ - const int NUM_BLOCKS = in_curr_solution.NUM_BLOCKS; - for (int iter = 0; iter < numIter; iter++) { - bool horizontal = (iter % 2 == 0); - _slackEval->evaluateSlacks(in_curr_solution); - - const vector& slacks - = (horizontal) ? _slackEval->xSlack() : _slackEval->ySlack(); - - vector indices_sorted; - sort_slacks(slacks, indices_sorted); - for (int i = 0; i < NUM_BLOCKS; i++) { - int index = indices_sorted[i]; - if (slacks[index] < 0) { - // skip these blocks affected by obstacles - continue; - } - - float origWidth = in_curr_solution.width(index); - float origHeight = in_curr_solution.height(index); - - float newWidth, newHeight; - int softDecision = makeIndexSoftBlMove(index, newWidth, newHeight); - - if (softDecision == SOFT_BL) { - // change dimensions only when needed - int theta = in_curr_solution.tree[index].orient; - _blockinfo.setBlockDimensions(index, newWidth, newHeight, theta); - - in_next_solution.evaluate(in_curr_solution.tree); - - float origTotalArea = in_curr_solution.totalArea(); - float newTotalArea = in_next_solution.totalArea(); - if (newTotalArea < origTotalArea) { - in_curr_solution = in_next_solution; - if (_params->minWL) { - _db->getNodes()->putNodeWidth(index, newWidth); - _db->getNodes()->putNodeHeight(index, newHeight); - } - } else { - _blockinfo.setBlockDimensions(index, origWidth, origHeight, theta); - } - } - } - } - return MISC; -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::locateSearchBlocks(int operand, - vector& searchBlocks) -{ - int size = in_curr_solution.NUM_BLOCKS; - vector seenBlocks(size, false); - seenBlocks[operand] = true; - float unitRadiusSize - = max(in_curr_solution.totalWidth(), in_curr_solution.totalHeight()); - unitRadiusSize /= sqrt(float(size)); - - vector& xloc = const_cast&>(in_curr_solution.xloc()); - vector& yloc = const_cast&>(in_curr_solution.yloc()); - parquetfp::Point idealLoc(_analSolve->getOptLoc(operand, xloc, yloc)); - // get optimum location of "operand" - - int searchRadiusNum = int(ceil(size / 5.0)); - float searchRadius = 0; - for (int i = 0; ((i < searchRadiusNum) - && (searchBlocks.size() < unsigned(searchRadiusNum))); - ++i) { - searchRadius += unitRadiusSize; - for (int j = 0; - ((j < size) && (searchBlocks.size() < unsigned(searchRadiusNum))); - ++j) { - if (!seenBlocks[j]) { - float xDist = xloc[j] - idealLoc.x; - float yDist = yloc[j] - idealLoc.y; - float distance = sqrt(xDist * xDist + yDist * yDist); - if (distance < searchRadius) { - seenBlocks[j] = true; - searchBlocks.push_back(j); - } - } - } - } -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::GenerateRandomSoln(BTree& soln, int blocknum) -{ - vector tree_bits; - int balance = 0; - int num_zeros = 0; - for (int i = 0; i < 2 * blocknum; i++) { - float rand_num = float(rand()) / (RAND_MAX + 1.0); - float threshold; - - if (balance == 0) - threshold = 1; // push_back "0" for sure - else if (num_zeros == blocknum) - threshold = 0; // push_back "1" for sure - else - threshold = 1; // (rand_num * (balance - rand_num)); - - if (rand_num >= threshold) { - tree_bits.push_back(1); - balance--; - } else { - tree_bits.push_back(0); - balance++; - num_zeros++; - } - } - - vector tree_perm; - tree_perm.resize(blocknum); - for (int i = 0; i < blocknum; i++) - tree_perm[i] = i; - std::shuffle(tree_perm.begin(), tree_perm.end(), _random_gen); - - vector tree_perm_inverse(blocknum); - for (int i = 0; i < blocknum; i++) - tree_perm_inverse[tree_perm[i]] = i; - - vector tree_orient(blocknum); - for (int i = 0; i < blocknum; i++) { - int rand_num = int(8 * (float(rand()) / (RAND_MAX + 1.0))); - rand_num = _physicalOrient[i][rand_num]; - - tree_orient[tree_perm_inverse[i]] = rand_num; - } - - soln.evaluate(tree_bits, tree_perm, tree_orient); -} -// -------------------------------------------------------- -void getObstaclesFromDB(DB* const db, BasePacking& out) -// massage db obstacles from Node into BlockPacking -{ - out.xloc.clear(); - out.yloc.clear(); - out.width.clear(); - out.height.clear(); - - Nodes* nodes = db->getObstacles(); - // Node tmp1("obs1", 400*300, 400/300, 400/300, 0, false); - // tmp1.putX( 200 ); - // tmp1.putY( 200 ); - // tmp1.putWidth( 100 ); - // tmp1.putHeight( 100 ); - // - // nodes->putNewNode(tmp1 ); - // - // Node tmp2("obs2", 50*50, 50/50, 50/50, 0, false); - // tmp2.putX( 100 ); - // tmp2.putY( 100 ); - // tmp2.putWidth( 50 ); - // tmp2.putHeight( 50 ); - // - // nodes->putNewNode(tmp2 ); - - for (unsigned i = 0; i < nodes->getNumNodes(); ++i) { - Node& node = nodes->getNode(i); - - out.xloc.push_back(node.getX()); - out.yloc.push_back(node.getY()); - out.width.push_back(node.getWidth()); - out.height.push_back(node.getHeight()); - } - // out.xloc.push_back(0); - // out.yloc.push_back(0); - // out.width.push_back(200); - // out.height.push_back(50); - - // out.xloc.push_back(100); - // out.yloc.push_back(50); - // out.width.push_back(50); - // out.height.push_back(50); -} -// -------------------------------------------------------- - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/btreeanneal.h b/src/mpl/src/ParquetFP/src/btreeanneal.h deleted file mode 100644 index e2091e973c9..00000000000 --- a/src/mpl/src/ParquetFP/src/btreeanneal.h +++ /dev/null @@ -1,306 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef BTREEANNEAL_H -#define BTREEANNEAL_H - -#include - -#include "allparquet.h" -#include "baseannealer.h" -#include "basepacking.h" -#include "btree.h" -#include "btreecompact.h" -#include "btreeslackeval.h" -#include "mixedpacking.h" - -namespace parquetfp { - -// -------------------------------------------------------- -class BTreeAreaWireAnnealer : public BaseAnnealer -{ - public: - BTreeAreaWireAnnealer(const parquetfp::Command_Line* const params, - parquetfp::DB* const db); - - BTreeAreaWireAnnealer(MixedBlockInfoType& nBlockinfo, - const parquetfp::Command_Line* const params, - parquetfp::DB* const db); - - inline virtual ~BTreeAreaWireAnnealer(); - - virtual bool go(); - bool anneal(); // WARNING: anneal() takes at least TWO blocks - // use packOneBlock() to floorplan ONE block - virtual bool packOneBlock(); - - inline const BTree& currSolution() const; - inline const BTree& bestSolution() const; - - virtual void takePlfromDB(); - virtual void compactSoln(bool minWL, - bool fixedOutline, - float reqdH, - float reqdW); - - int makeMove(int& indexOrient, - parquetfp::ORIENT& newOrient, - parquetfp::ORIENT& oldOrient); // returns 1,2,3,4,5 or -1 - int makeMoveSlacks(); // returns 6 - int makeMoveSlacksOrient() { return 10; } // returns 10 - int makeMoveOrient() { return 10; } // returns 10 - int makeARMove(); // returns 7 - int makeSoftBlMove(int& index, float& newWidth, float& newHeight); - // returns 11 - inline int makeIndexSoftBlMove(int index, float& newWidth, float& newHeight); - // returns 11 - - int makeHPWLMove(); // returns 12 - int makeARWLMove(); // returns 13 - - int packSoftBlocks(int numIter); // returns -1 - inline int compactBlocks(); // returns -1 - - inline static void sort_slacks(const std::vector& slacks, - std::vector& indices_sorted); - void GenerateRandomSoln(BTree& soln, int blocknum); - - inline unsigned getNumObstacles(); - - protected: - MixedBlockInfoType* const _blockinfo_cleaner; - MixedBlockInfoType& _blockinfo; - BasePacking _obstacleinfo; - float _obstacleFrame[2]; - - public: - const MixedBlockInfoType& blockinfo; - - protected: - BTree in_curr_solution; - BTree in_next_solution; // sketch-board - BTree in_best_solution; - - // (blockIndex, [0-7]) --> [0-7], constantly 0 if fixedOrient - std::vector> _physicalOrient; - - BTreeSlackEval* _slackEval; - - void constructor_core(); - inline BTree::MoveType get_move() const; - inline void perform_swap(); - inline void perform_move(); - inline void perform_rotate(); - inline void perform_rotate(int& blk, - parquetfp::ORIENT& newOrient, - parquetfp::ORIENT& oldOrient); - class SlackInfo - { - public: - float slack; - int index; - - inline bool operator<(const SlackInfo& si) const - { - return slack < si.slack; - } - }; - - void DBfromSoln(const BTree& soln); // update *_db from "soln" - - void makeMoveSlacksCore(bool); // used by "makeMoveSlacks" and "makeARMove" - void locateSearchBlocks(int, - std::vector&); // used by HPWL and ARWL moves - - // the following -SoftBl- fcns assumes slacks are ALREADY EVAULATED - int getSoftBlIndex( - bool horizontal) const; // returns the index of the operand - int getSoftBlNewDimensions(int index, - float& newWidth, - float& newHeight) const; - // used by soft-block moves, returns 11 - - BTreeAreaWireAnnealer(MixedBlockInfoType& nBlockinfo); -}; -// -------------------------------------------------------- - -// ========================= -// IMPLEMENTATIONS -// ========================= -BTreeAreaWireAnnealer::~BTreeAreaWireAnnealer() -{ - if (_slackEval != NULL) - delete _slackEval; - - if (_blockinfo_cleaner != NULL) - delete _blockinfo_cleaner; -} -// -------------------------------------------------------- -const BTree& BTreeAreaWireAnnealer::currSolution() const -{ - return in_curr_solution; -} -// -------------------------------------------------------- -const BTree& BTreeAreaWireAnnealer::bestSolution() const -{ - return in_best_solution; -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::makeIndexSoftBlMove(int index, - float& newWidth, - float& newHeight) -{ - _slackEval->evaluateSlacks(in_curr_solution); - return getSoftBlNewDimensions(index, newWidth, newHeight); -} -// -------------------------------------------------------- -int BTreeAreaWireAnnealer::compactBlocks() -{ - std::cout << "compactBlocks" << std::endl; - BTreeCompactor compactor(in_curr_solution); - compactor.compact(); - in_curr_solution = compactor; - return MISC; -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::sort_slacks(const std::vector& slacks, - std::vector& indices_sorted) -{ - int blocknum = slacks.size(); - std::vector slackinfo(blocknum); - for (int i = 0; i < blocknum; i++) { - slackinfo[i].slack = slacks[i]; - slackinfo[i].index = i; - } - sort(slackinfo.begin(), slackinfo.end()); - - indices_sorted.resize(blocknum); - for (int i = 0; i < blocknum; i++) - indices_sorted[i] = slackinfo[i].index; -} -// -------------------------------------------------------- -BTree::MoveType BTreeAreaWireAnnealer::get_move() const -{ - // 0 <= "rand_num" < 1 - float rand_num = rand() / (RAND_MAX + 1.0); - if (rand_num < 0.3333) - return BTree::SWAP; - else if (rand_num < 0.6666) - return BTree::ROTATE; - else - return BTree::MOVE; -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::perform_swap() -{ - int blocknum = blockinfo.currDimensions.blocknum(); - int blkA = int(blocknum * (rand() / (RAND_MAX + 1.0))); - int blkB = int((blocknum - 1) * (rand() / (RAND_MAX + 1.0))); - blkB = (blkB >= blkA) ? blkB + 1 : blkB; - - in_next_solution = in_curr_solution; - in_next_solution.swap(blkA, blkB); -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::perform_rotate() -{ - int blocknum = blockinfo.currDimensions.blocknum(); - int blk = int(blocknum * (rand() / (RAND_MAX + 1.0))); - - // may want to do something different here, - // like search for something that can be rotated - if (_db->getNodes()->getNode(blk).isOrientFixed()) - return; - - int blk_orient = in_curr_solution.tree[blk].orient; - int new_orient = (blk_orient + 1) % 8; - new_orient = _physicalOrient[blk][new_orient]; - - // in_next_solution = in_curr_solution; - in_next_solution.setTree(in_curr_solution.tree); - in_next_solution.rotate(blk, new_orient); -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::perform_move() -{ - int blocknum = blockinfo.currDimensions.blocknum(); - int blk = int(blocknum * (rand() / (RAND_MAX + 1.0))); - - int target_rand_num = int((2 * blocknum - 1) * (rand() / (RAND_MAX + 1.0))); - int target = target_rand_num / 2; - target = (target >= blk) ? target + 1 : target; - - int leftChild = target_rand_num % 2; - - // in_next_solution = in_curr_solution; - in_next_solution.setTree(in_curr_solution.tree); - in_next_solution.move(blk, target, (leftChild == 0)); -} -// -------------------------------------------------------- -void BTreeAreaWireAnnealer::perform_rotate(int& blk, - parquetfp::ORIENT& newOrient, - parquetfp::ORIENT& oldOrient) -{ - int blocknum = blockinfo.currDimensions.blocknum(); - blk = int(blocknum * (rand() / (RAND_MAX + 1.0))); - int blk_orient = in_curr_solution.tree[blk].orient; - int new_orient = blk_orient; - - if (_db->getNodes()->getNode(blk).isOrientFixed()) { - // may want to do something different here, - // like search for something that can be rotated - } else { - if (_params->minWL) { - while (new_orient == blk_orient) - new_orient = (blk_orient + rand() % 8) % 8; - } else - new_orient = (blk_orient + 1) % 8; - new_orient = _physicalOrient[blk][new_orient]; - - // in_next_solution = in_curr_solution; - in_next_solution.setTree(in_curr_solution.tree); - in_next_solution.rotate(blk, new_orient); - } - - newOrient = parquetfp::ORIENT(new_orient); - oldOrient = parquetfp::ORIENT(blk_orient); -} -// ======================================================== -inline unsigned BTreeAreaWireAnnealer::getNumObstacles() -{ - return _obstacleinfo.xloc.size(); -} -// ======================================================== - -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/btreecompact.cxx b/src/mpl/src/ParquetFP/src/btreecompact.cxx deleted file mode 100644 index c5efa277a1f..00000000000 --- a/src/mpl/src/ParquetFP/src/btreecompact.cxx +++ /dev/null @@ -1,229 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "btreecompact.h" - -#include - -namespace parquetfp { - -// -------------------------------------------------------- -void BTreeCompactor::build_orth_tree() -{ - clean_contour(in_contour); - clean_tree(in_orth_tree); - - int tree_prev = NUM_BLOCKS; - int tree_curr = in_tree[NUM_BLOCKS].left; // start with first block - while (tree_curr != NUM_BLOCKS) // until reach the root again - { - if (tree_prev == in_tree[tree_curr].parent) { - build_orth_tree_add_block(tree_curr); - tree_prev = tree_curr; - if (in_tree[tree_curr].left != Undefined) - tree_curr = in_tree[tree_curr].left; - else if (in_tree[tree_curr].right != Undefined) - tree_curr = in_tree[tree_curr].right; - else - tree_curr = in_tree[tree_curr].parent; - } else if (tree_prev == in_tree[tree_curr].left) { - tree_prev = tree_curr; - if (in_tree[tree_curr].right != Undefined) - tree_curr = in_tree[tree_curr].right; - else - tree_curr = in_tree[tree_curr].parent; - } else { - tree_prev = tree_curr; - tree_curr = in_tree[tree_curr].parent; - } - } - in_totalWidth = in_contour[NUM_BLOCKS + 1].begin; - - int contour_ptr = in_contour[NUM_BLOCKS].next; - in_totalHeight = 0; - in_totalContourArea = 0; - while (contour_ptr != NUM_BLOCKS + 1) { - in_totalHeight = std::max(in_totalHeight, in_contour[contour_ptr].CTL); - in_totalContourArea - += (in_contour[contour_ptr].end - in_contour[contour_ptr].begin) - * in_contour[contour_ptr].CTL; - contour_ptr = in_contour[contour_ptr].next; - } - in_totalArea = in_totalWidth * in_totalHeight; - - fix_orth_tree(in_orth_tree); -} -// -------------------------------------------------------- -void BTreeCompactor::build_orth_tree_add_block(int tree_ptr) -{ - int tree_parent = in_tree[tree_ptr].parent; - int orth_tree_parent = NUM_BLOCKS; - - float maxCTL = -1; - int contour_ptr = Undefined; - int contour_prev = Undefined; - - if (tree_ptr == in_tree[in_tree[tree_ptr].parent].left) { - in_contour[tree_ptr].begin = in_contour[tree_parent].end; - contour_ptr = in_contour[tree_parent].next; - } else { - in_contour[tree_ptr].begin = in_contour[tree_parent].begin; - contour_ptr = tree_parent; - } - contour_prev = in_contour[contour_ptr].prev; // begins of cPtr/tPtr match - orth_tree_parent = contour_ptr; // initialize necessary - maxCTL = in_contour[contour_ptr].CTL; // since width/height may be 0 - - int block = in_tree[tree_ptr].block_index; - int theta = in_tree[tree_ptr].orient; - in_contour[tree_ptr].end - = in_contour[tree_ptr].begin + in_blockinfo[block].width[theta]; - - while (in_contour[contour_ptr].end <= in_contour[tree_ptr].end + TOLERANCE) { - if (in_contour[contour_ptr].CTL > maxCTL) { - maxCTL = in_contour[contour_ptr].CTL; - orth_tree_parent = contour_ptr; - } - contour_ptr = in_contour[contour_ptr].next; - } - - if (in_contour[contour_ptr].begin + TOLERANCE < in_contour[tree_ptr].end) { - if (in_contour[contour_ptr].CTL > maxCTL) { - maxCTL = in_contour[contour_ptr].CTL; - orth_tree_parent = contour_ptr; - } - } - - in_xloc[tree_ptr] = in_contour[tree_ptr].begin; - in_yloc[tree_ptr] = maxCTL; - in_width[tree_ptr] = in_blockinfo[block].width[theta]; - in_height[tree_ptr] = in_blockinfo[block].height[theta]; - - // printf("UpdateOrtho: %d: (%f %f)-(%f %f)\n", tree_ptr, in_xloc[tree_ptr], - // in_yloc[tree_ptr], - // in_xloc[tree_ptr]+ in_width[tree_ptr], - // in_yloc[tree_ptr]+ in_height[tree_ptr]); - - in_contour[tree_ptr].CTL = maxCTL + in_blockinfo[block].height[theta]; - in_contour[tree_ptr].next = contour_ptr; - in_contour[contour_ptr].prev = tree_ptr; - in_contour[contour_ptr].begin = in_contour[tree_ptr].end; - - in_contour[tree_ptr].prev = contour_prev; - in_contour[contour_prev].next = tree_ptr; - in_contour[tree_ptr].begin = in_contour[contour_prev].end; - - // edit "in_orth_tree", the orthogonal tree - if (in_orth_tree[orth_tree_parent].left == Undefined) { - // left-child of the parent - in_orth_tree[orth_tree_parent].left = tree_ptr; - in_orth_tree[tree_ptr].parent = orth_tree_parent; - } else { - // sibling fo the left-child of the parent - int orth_tree_ptr = in_orth_tree[orth_tree_parent].left; - while (in_orth_tree[orth_tree_ptr].right != Undefined) - orth_tree_ptr = in_orth_tree[orth_tree_ptr].right; - - in_orth_tree[orth_tree_ptr].right = tree_ptr; - in_orth_tree[tree_ptr].parent = orth_tree_ptr; - } -} -// -------------------------------------------------------- - -void BTreeCompactor::out_orth_dot(const std::string& file) const -{ - std::filebuf fb; - fb.open(file.c_str(), std::ios::out); - std::ostream outs(&fb); - - outs << "digraph BST {" << std::endl; - outs << " graph [ordering=\"out\"];" << std::endl; - - int nullPtrCnt = 0; - for (int i = 0; i < NUM_BLOCKS; i++) { - outs << " \"" << i << "\" -> "; - if (in_orth_tree[i].left != Undefined) { - outs << "\"" << in_orth_tree[i].left << "\";" << std::endl; - } else { - outs << "null" << std::to_string(nullPtrCnt) << std::endl; - outs << " null" << std::to_string(nullPtrCnt++) << " [shape=point];" - << std::endl; - } - - outs << " \"" << i << "\" -> "; - if (in_orth_tree[i].right != Undefined) { - outs << "\"" << in_orth_tree[i].right << "\";" << std::endl; - } else { - outs << "null" << std::to_string(nullPtrCnt) << std::endl; - outs << " null" << std::to_string(nullPtrCnt++) << " [shape=point];" - << std::endl; - } - } - outs << "}" << std::endl; - fb.close(); -} -void BTreeCompactor::out_orth_plot(const std::string& file) const -{ - using std::endl; - std::filebuf fb; - fb.open(file.c_str(), std::ios::out); - std::ostream outs(&fb); - - outs << "#Use this file as a script for gnuplot" << endl; - outs << "#(See http://www.gnuplot.info/ for details)" << endl; - outs << "set nokey" << endl; - - outs << "set size ratio -1" << endl; - outs << "set title ' " << file << endl << endl; - - outs << "set terminal png size 1024,768" << endl; - - outs << "set xrange[" << 0 << ":" << in_totalWidth << "]" << endl; - outs << "set yrange[" << 0 << ":" << in_totalHeight << "]" << endl; - - int objCnt = 0; - float x = 0, y = 0, w = 0, h = 0; - for (int i = 0; i < NUM_BLOCKS; i++) { - x = in_xloc[i]; - y = in_yloc[i]; - w = in_width[i]; - h = in_height[i]; - outs << "set object " << ++objCnt << " rect from " << x << "," << y - << " to " << x + w << "," << y + h << " fc rgb \"gold\"" << endl; - } - outs << "plot '-' w l" << endl; - outs << "EOF" << endl << endl; - outs << "pause -1 'Press any key' " << endl; - fb.close(); -} - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/btreecompact.h b/src/mpl/src/ParquetFP/src/btreecompact.h deleted file mode 100644 index 148e9da991f..00000000000 --- a/src/mpl/src/ParquetFP/src/btreecompact.h +++ /dev/null @@ -1,198 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef BTREECOMPACT_H -#define BTREECOMPACT_H - -#include - -#include "btree.h" - -namespace parquetfp { - -// -------------------------------------------------------- -class BTreeCompactor : public BTree -{ - public: - inline BTreeCompactor(const BTree& orig_tree); - inline void operator=(const BTree& new_tree); - inline void slimAssign(const BTree& new_tree); // suffices if evaluation - // follows - - inline int compact(); - void build_orth_tree(); - - const std::vector& orth_tree; - - void out_orth_dot(const std::string& file) const; - void out_orth_plot(const std::string& file) const; - - private: - std::vector in_orth_tree; // [NUM_BLOCKS] ~ in_tree[NUM_BLOCKS+1] - // [NUM_BLOCKS+1] ~ in_tree[NUM_BLOCKS] - - void build_orth_tree_add_block(int treePtr); - - // (a) swap NUM_BLK vs. NUM_BLK+1 - // (b) fix parent of BL-block - // used by build_orth_tree() only!!! - inline static void fix_orth_tree(std::vector& orth_tree); -}; -// -------------------------------------------------------- - -// ========================= -// IMPLEMENTATIONS -// ========================= -BTreeCompactor::BTreeCompactor(const BTree& orig_tree) - : BTree(orig_tree), - orth_tree(in_orth_tree), - in_orth_tree(orig_tree.tree.size()) -{ - int vec_size = in_orth_tree.size(); - for (int i = 0; i < vec_size; i++) { - in_orth_tree[i].parent = Undefined; - in_orth_tree[i].left = Undefined; - in_orth_tree[i].right = Undefined; - in_orth_tree[i].block_index = orig_tree.tree[i].block_index; - in_orth_tree[i].orient = OrientedPacking::flip( - OrientedPacking::ORIENT(orig_tree.tree[i].orient)); - } -} -// -------------------------------------------------------- -inline void BTreeCompactor::operator=(const BTree& new_tree) -{ - this->BTree::operator=(new_tree); - for (unsigned int i = 0; i < in_orth_tree.size(); i++) { - in_orth_tree[i].parent = Undefined; - in_orth_tree[i].left = Undefined; - in_orth_tree[i].right = Undefined; - in_orth_tree[i].block_index = new_tree.tree[i].block_index; - in_orth_tree[i].orient = OrientedPacking::flip( - OrientedPacking::ORIENT(new_tree.tree[i].orient)); - } -} -// -------------------------------------------------------- -inline void BTreeCompactor::slimAssign(const BTree& new_tree) -{ - in_tree = new_tree.tree; - in_blockArea = new_tree.blockArea(); - for (unsigned int i = 0; i < in_orth_tree.size(); i++) { - in_orth_tree[i].parent = Undefined; - in_orth_tree[i].left = Undefined; - in_orth_tree[i].right = Undefined; - in_orth_tree[i].block_index = new_tree.tree[i].block_index; - in_orth_tree[i].orient = OrientedPacking::flip( - OrientedPacking::ORIENT(new_tree.tree[i].orient)); - } -} -// -------------------------------------------------------- -inline int BTreeCompactor::compact() -{ - if (getNumObstacles()) { - // if obstacles are present, don't allow compaction - return 0; - } - - std::vector orig_xloc(in_xloc); - std::vector orig_yloc(in_yloc); - - build_orth_tree(); - swap_ranges(in_tree.begin(), in_tree.end(), in_orth_tree.begin()); - - // save_dot("compact-1_orig.dot"); - // save_plot("compact-1_orig.plot"); - // out_orth_dot("compact-1_orth.dot"); - // out_orth_plot("compact-1_orth.plot"); - - // cout << "-----here1: after build_orth_tree()-----" << endl; - // cout << "in_tree: " << endl; - // OutputBTree(cout, in_tree); - // cout << endl << endl; - // cout << "in_orth_tree:" << endl; - // OutputBTree(cout, in_orth_tree); - // cout << endl << endl; - - build_orth_tree(); - swap_ranges(in_tree.begin(), in_tree.end(), in_orth_tree.begin()); - - // save_dot("compact-2_orig.dot"); - // save_plot("compact-2_orig.plot"); - // out_orth_dot("compact-2_orth.dot"); - // out_orth_plot("compact-2_orth.plot"); - // cout << "-----here2: after build_orth_tree()-----" << endl; - // cout << "in_tree: " << endl; - // OutputBTree(cout, in_tree); - // cout << endl << endl; - // cout << "in_orth_tree: " << endl; - // OutputBTree(cout, in_orth_tree); - // cout << endl << endl; - // cout << "-----flipped packing-----" << endl; - // OutputPacking(cout, BTreeOrientedPacking(*this)); - - // ofstream outfile; - // outfile.open("dummy_flipped"); - // Save_bbb(outfile, BTreeOrientedPacking(*this)); - // outfile.close(); - - build_orth_tree(); - - // save_dot("compact-3_orig.dot"); - // save_plot("compact-3_orig.plot"); - // out_orth_dot("compact-3_orth.dot"); - // out_orth_plot("compact-3_orth.plot"); - - // exit(1); - - int count = 0; - for (int i = 0; i < NUM_BLOCKS; i++) { - if ((orig_xloc[i] != in_xloc[i]) || (orig_yloc[i] != in_yloc[i])) - count++; - } - return count; -} -// -------------------------------------------------------- -inline void BTreeCompactor::fix_orth_tree( - std::vector& orth_tree) -{ - // fix the tree s.t. in_tree[NUM_BLOCKS] corresponds to the root - const int NUM_BLOCKS = orth_tree.size() - 2; - int bottomLeftBlock = orth_tree[NUM_BLOCKS + 1].left; - - orth_tree[bottomLeftBlock].parent = NUM_BLOCKS; - std::iter_swap(&(orth_tree[NUM_BLOCKS]), &(orth_tree[NUM_BLOCKS + 1])); -} - -// -------------------------------------------------------- - -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/btreeslackeval.cxx b/src/mpl/src/ParquetFP/src/btreeslackeval.cxx deleted file mode 100644 index b708b9b4d6f..00000000000 --- a/src/mpl/src/ParquetFP/src/btreeslackeval.cxx +++ /dev/null @@ -1,133 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "btreeslackeval.h" - -#include - -namespace parquetfp { - -using std::vector; - -// --------------------------------------------------------- -const vector& BTreeSlackEval::evaluateXSlacks(const BTree& orig_btree) -{ - const int NUM_BLOCKS = orig_btree.NUM_BLOCKS; - _btree.build_orth_tree(); - - reverse_tree(_btree.orth_tree, _rev_orth_tree); - _btree.set_pack_origin( - BTree::PACK_RIGHT); // change frame of reference to right - _btree.evaluate(_rev_orth_tree); - _btree.set_pack_origin(BTree::PACK_BOTTOM); // restore frame of reference - - float width = orig_btree.totalWidth(); - for (int i = 0; i < NUM_BLOCKS; i++) { - _xlocRight[i] = _btree.yloc(i); - _xSlack[i] - = width - orig_btree.width(i) - _xlocRight[i] - orig_btree.xloc(i); - // std::cout << "xSlack[" << i << "]:" << _xSlack[i] << std::endl; - } - return _xSlack; -} -// -------------------------------------------------------- -const vector& BTreeSlackEval::evaluateYSlacks(const BTree& orig_btree) -{ - reverse_tree(orig_btree.tree, _rev_tree); - _btree.set_pack_origin(BTree::PACK_TOP); // change frame of reference to top - _btree.evaluate(_rev_tree); - _btree.set_pack_origin(BTree::PACK_BOTTOM); // restore frame of reference - - const int NUM_BLOCKS = _btree.NUM_BLOCKS; - float height = orig_btree.totalHeight(); - for (int i = 0; i < NUM_BLOCKS; i++) { - _ylocTop[i] = _btree.yloc(i); - _ySlack[i] - = height - orig_btree.height(i) - _ylocTop[i] - orig_btree.yloc(i); - // std::cout << "ySlack[" << i << "]:" << _ySlack[i] << std::endl; - } - return _ySlack; -} -// --------------------------------------------------------- -void BTreeSlackEval::reverse_tree(const vector& tree, - vector& rev_tree) -{ - // assume "rev_tree" has the same size as "tree" - BTree::clean_tree(rev_tree); - - static const int Undefined = BTree::Undefined; - const int NUM_BLOCKS = tree.size() - 2; - int tree_prev = NUM_BLOCKS; - int tree_curr = tree[NUM_BLOCKS].left; // start with the first child of root - vector true_parent(tree.size(), Undefined); // book-keeping variable - while (tree_curr != NUM_BLOCKS) { - if (tree_prev == tree[tree_curr].parent) { - if (tree_curr == tree[tree_prev].left) { - // left-child - rev_tree[tree_prev].left = tree_curr; - rev_tree[tree_curr].parent = tree_prev; - rev_tree[tree_curr].block_index = tree[tree_curr].block_index; - rev_tree[tree_curr].orient = tree[tree_curr].orient; - - true_parent[tree_curr] = tree_prev; - } else { - // right-child - int tree_parent = true_parent[tree_prev]; - rev_tree[tree_parent].left = tree_curr; // prob. overwrite - rev_tree[tree_curr].parent = tree_parent; - rev_tree[tree_curr].block_index = tree[tree_curr].block_index; - rev_tree[tree_curr].orient = tree[tree_curr].orient; - - rev_tree[tree_prev].parent = tree_curr; - rev_tree[tree_curr].right = tree_prev; - - true_parent[tree_curr] = tree_parent; - } - tree_prev = tree_curr; - if (tree[tree_curr].right != Undefined) - tree_curr = tree[tree_curr].right; - else if (tree[tree_curr].left != Undefined) - tree_curr = tree[tree_curr].left; - else - tree_curr = tree[tree_curr].parent; - } else if (tree_prev == tree[tree_curr].right) { - tree_prev = tree_curr; - tree_curr = (tree[tree_curr].left != Undefined) ? tree[tree_curr].left - : tree[tree_curr].parent; - } else { - tree_prev = tree_curr; - tree_curr = tree[tree_curr].parent; - } - } -} - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/btreeslackeval.h b/src/mpl/src/ParquetFP/src/btreeslackeval.h deleted file mode 100644 index 2d807a41b34..00000000000 --- a/src/mpl/src/ParquetFP/src/btreeslackeval.h +++ /dev/null @@ -1,131 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef BTREESLACKEVAL_H -#define BTREESLACKEVAL_H - -#include "basepacking.h" -#include "btree.h" -#include "btreecompact.h" - -namespace parquetfp { - -// -------------------------------------------------------- -class BTreeSlackEval -{ - public: - inline BTreeSlackEval(const BTree& newBTree); - - inline void evaluateSlacks(const BTree& newBTree); - const std::vector& evaluateXSlacks(const BTree& orig_btree); - const std::vector& evaluateYSlacks(const BTree& orig_btree); - - inline const std::vector& xSlack() const; - inline const std::vector& ySlack() const; - - inline const std::vector& xlocRight() const; // xloc from Right - inline const std::vector& ylocTop() const; // yloc from Top - - inline const BTreeCompactor& btree() const; - inline const std::vector& rev_tree() const; - inline const std::vector& rev_orth_tree() const; - - static void reverse_tree(const std::vector& tree, - std::vector& rev_tree); - - private: - BTreeCompactor _btree; - std::vector _xSlack; - std::vector _ySlack; - - std::vector _xlocRight; - std::vector _ylocTop; - - std::vector _rev_tree; - std::vector _rev_orth_tree; - - BTreeSlackEval(const BTreeSlackEval&); // copy forbidden -}; -// -------------------------------------------------------- - -// =============== -// IMPLEMENTATIONS -// =============== -BTreeSlackEval::BTreeSlackEval(const BTree& newBTree) - : _btree(newBTree), - _xSlack(newBTree.NUM_BLOCKS), - _ySlack(newBTree.NUM_BLOCKS), - _xlocRight(newBTree.NUM_BLOCKS), - _ylocTop(newBTree.NUM_BLOCKS), - _rev_tree(newBTree.tree.size()), - _rev_orth_tree(newBTree.tree.size()) -{ - BTree::clean_tree(_rev_tree); - BTree::clean_tree(_rev_orth_tree); -} -// -------------------------------------------------------- -void BTreeSlackEval::evaluateSlacks(const BTree& newBTree) -{ - _btree.slimAssign(newBTree); - evaluateXSlacks(newBTree); // mess with "_btree" only - evaluateYSlacks(newBTree); -} -// -------------------------------------------------------- -const std::vector& BTreeSlackEval::xSlack() const -{ - return _xSlack; -} -// -------------------------------------------------------- -const std::vector& BTreeSlackEval::ySlack() const -{ - return _ySlack; -} -// -------------------------------------------------------- -const BTreeCompactor& BTreeSlackEval::btree() const -{ - return _btree; -} -// -------------------------------------------------------- -const std::vector& BTreeSlackEval::rev_tree() const -{ - return _rev_tree; -} -// -------------------------------------------------------- -const std::vector& BTreeSlackEval::rev_orth_tree() const -{ - return _rev_orth_tree; -} -// -------------------------------------------------------- - -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/debugflags.h b/src/mpl/src/ParquetFP/src/debugflags.h deleted file mode 100644 index bdbc5d6a8bd..00000000000 --- a/src/mpl/src/ParquetFP/src/debugflags.h +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef DEBUGFLAGS_H -#define DEBUGFLAGS_H - -// #define PARQUET_DEBUG_HAYWARD_ASSERT_BTREEANNEAL -// #define PARQUET_DEBUG_HAYWARD_DISPLAY_MIXEDPACKINGFROMDB - -#endif diff --git a/src/mpl/src/ParquetFP/src/mixedpacking.cxx b/src/mpl/src/ParquetFP/src/mixedpacking.cxx deleted file mode 100644 index 731cc368e0c..00000000000 --- a/src/mpl/src/ParquetFP/src/mixedpacking.cxx +++ /dev/null @@ -1,320 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "mixedpacking.h" - -#include -#include -#include - -#include "basepacking.h" -#include "parsers.h" -using namespace parse_utils; -using namespace basepacking_h; -using std::cout; -using std::endl; -using std::max; -using std::min; -using std::string; -using std::vector; - -const int MixedBlockInfoType::Orient_Num = HardBlockInfoType::Orient_Num; -// -------------------------------------------------------- -MixedBlockInfoType::MixedBlockInfoType(const string& blocksfilename, - const string& format) - : currDimensions(_currDimensions), - blockARinfo(_blockARinfo), - _currDimensions(0) -{ - std::ifstream infile; - infile.open(blocksfilename.c_str()); - if (!infile.good()) { - cout << "ERROR: cannot open file " << blocksfilename << endl; - exit(1); - } - - if (format == "txt") { - // cout << "Sorry, .txt format isn't supported now." << endl; - // exit(0); - ParseTxt(infile); - } else if (format == "blocks") - ParseBlocks(infile); -} -// -------------------------------------------------------- -void MixedBlockInfoType::ParseBlocks(std::ifstream& input) -{ - char block_name[1024]; - char block_type[1024]; - char tempWord1[1024]; - - vector vertices; - int numVertices; - bool success; - float width, height; - - float area, minAr, maxAr; - int numSoftBl = 0; - int numHardBl = 0; - int numBl = numSoftBl + numHardBl; - int numTerm = 0; - - int indexBlock = 0; - int indexTerm = 0; - - if (!input) { - cout << "ERROR: .blocks file could not be opened successfully" << endl; - exit(0); - } - - while (!input.eof()) { - input >> tempWord1; - if (!(strcmp(tempWord1, "NumSoftRectangularBlocks"))) - break; - } - input >> tempWord1; - input >> numSoftBl; - - while (!input.eof()) { - input >> tempWord1; - if (!(strcmp(tempWord1, "NumHardRectilinearBlocks"))) - break; - } - input >> tempWord1; - input >> numHardBl; - - while (!input.eof()) { - input >> tempWord1; - if (!(strcmp(tempWord1, "NumTerminals"))) - break; - } - input >> tempWord1; - input >> numTerm; - - numBl = numHardBl + numSoftBl; - _currDimensions.in_blocks.resize(numBl + 2); - _currDimensions.in_block_names.resize(numBl + 2); - _blockARinfo.resize(numHardBl + numSoftBl + 2); - while (!input.eof()) { - block_type[0] = '\0'; - eatblank(input); - if (input.eof()) - break; - if (input.peek() == '#') - eathash(input); - else { - eatblank(input); - if (input.peek() == '\n' || input.peek() == '\r') { - input.get(); - continue; - } - - input >> block_name; - input >> block_type; - - if (!strcmp(block_type, "softrectangular")) { - input >> area; - input >> minAr; - input >> maxAr; - - width = sqrt(area); - height = sqrt(area); - - // printf("[%d]: area: %.2lf minAR: %.2lf maxAR: %.2lf - // width: %.2lf height: %.2lf\n", - // indexBlock, area, minAr, maxAr, width, height); - _currDimensions.set_dimensions(indexBlock, width, height); - if (indexBlock >= int(_currDimensions.block_names.size())) { - cout << "ERROR: too many hard block specified." << endl; - exit(1); - } - _currDimensions.in_block_names[indexBlock] = block_name; - - _blockARinfo[indexBlock].area = area; - set_blockARinfo_AR(indexBlock, min(minAr, maxAr), max(minAr, maxAr)); - _blockARinfo[indexBlock].isSoft = true; - - ++indexBlock; - // cout<> numVertices; - Point tempPoint; - success = 1; - if (numVertices > 4) - cout << "ERROR in parsing .blocks file. rectilinear blocks can be " - "only rectangles for now\n"; - for (int i = 0; i < numVertices; ++i) { - success &= needCaseChar(input, '('); - input.get(); - input >> tempPoint.x; - success &= needCaseChar(input, ','); - input.get(); - input >> tempPoint.y; - success &= needCaseChar(input, ')'); - input.get(); - vertices.push_back(tempPoint); - } - if (!success) - cout << "ERROR in parsing .blocks file while processing " - "hardrectilinear blocks" - << endl; - - width = vertices[2].x - vertices[0].x; - height = vertices[2].y - vertices[0].y; - area = width * height; - minAr = width / height; - maxAr = minAr; - - _currDimensions.set_dimensions(indexBlock, width, height); - if (indexBlock >= int(_currDimensions.block_names.size())) { - cout << "ERROR: too many hard block specified." << endl; - exit(1); - } - _currDimensions.in_block_names[indexBlock] = block_name; - - _blockARinfo[indexBlock].area = area; - set_blockARinfo_AR(indexBlock, min(minAr, maxAr), max(minAr, maxAr)); - _blockARinfo[indexBlock].isSoft = false; - - ++indexBlock; - vertices.clear(); - // cout<> numHardBl; - size_t numBl = numHardBl; - _currDimensions.in_blocks.resize(numBl + 2); - _currDimensions.in_block_names.resize(numBl + 2); - _blockARinfo.resize(numHardBl + 2); - - for (int i = 0; i < numBl; i++) { - input >> block_name; - input >> width >> height; - input >> snapX >> snapY; - input >> haloX >> haloY; - input >> channelX >> channelY; - - area = width * height; - minAr = width / height; - maxAr = minAr; - - _currDimensions.set_dimensions(indexBlock, - width, - height, - snapX, - snapY, - haloX, - haloY, - channelX, - channelY); - if (indexBlock >= int(_currDimensions.block_names.size())) { - cout << "ERROR: too many hard block specified." << endl; - exit(1); - } - _currDimensions.in_block_names[indexBlock] = block_name; - - _blockARinfo[indexBlock].area = area; - set_blockARinfo_AR(indexBlock, min(minAr, maxAr), max(minAr, maxAr)); - _blockARinfo[indexBlock].isSoft = false; - - ++indexBlock; - } - - input >> numTerm; - for (int i = 0; i < numTerm; i++) { - input >> block_name; - } - - _currDimensions.set_dimensions(numBl, 0, Dimension::Infty); - _currDimensions.in_block_names[numBl] = "LEFT"; - _blockARinfo[numBl].area = 0; - _blockARinfo[numBl].minAR.resize(Orient_Num, 0); - _blockARinfo[numBl].maxAR.resize(Orient_Num, 0); - _blockARinfo[numBl].isSoft = false; - - _currDimensions.set_dimensions(numBl + 1, Dimension::Infty, 0); - _currDimensions.in_block_names[numBl + 1] = "BOTTOM"; - _blockARinfo[numBl + 1].area = 0; - _blockARinfo[numBl + 1].minAR.resize(Orient_Num, Dimension::Infty); - _blockARinfo[numBl + 1].maxAR.resize(Orient_Num, Dimension::Infty); - _blockARinfo[numBl + 1].isSoft = false; -} diff --git a/src/mpl/src/ParquetFP/src/mixedpacking.h b/src/mpl/src/ParquetFP/src/mixedpacking.h deleted file mode 100644 index 97da09ceeb6..00000000000 --- a/src/mpl/src/ParquetFP/src/mixedpacking.h +++ /dev/null @@ -1,107 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef MIXEDPACKING_H -#define MIXEDPACKING_H - -#include - -#include "basepacking.h" - -// -------------------------------------------------------- -class MixedBlockInfoType -{ - public: - MixedBlockInfoType(const std::string& blocksfilename, - const std::string& format); // "blocks" or "txt" - virtual ~MixedBlockInfoType() {} - - class BlockARInfo - { - public: - float area; - std::vector maxAR; // maxAR/minAR for the "North" orientation - std::vector minAR; - bool isSoft; - }; - const HardBlockInfoType& currDimensions; - const std::vector& blockARinfo; - static const int Orient_Num; // = HardBlockInfoType::Orient_Num; - - inline void setBlockDimensions(int index, - float newWidth, - float newHeight, - int theta); - - protected: - HardBlockInfoType _currDimensions; - std::vector _blockARinfo; - - void ParseBlocks(std::ifstream& input); - void ParseTxt(std::ifstream& input); - inline void set_blockARinfo_AR(int index, float minAR, float maxAR); - - // used by descendent class "MixedBlockInfoTypeFromDB" - MixedBlockInfoType(int blocknum) - : currDimensions(_currDimensions), - blockARinfo(_blockARinfo), - _currDimensions(blocknum), - _blockARinfo(blocknum + 2) - { - } -}; -// -------------------------------------------------------- - -// =============== -// IMPLEMENTATIONS -// =============== -void MixedBlockInfoType::setBlockDimensions(int index, - float newWidth, - float newHeight, - int theta) -{ - float realWidth = (theta % 2 == 0) ? newWidth : newHeight; - float realHeight = (theta % 2 == 0) ? newHeight : newWidth; - _currDimensions.set_dimensions(index, realWidth, realHeight); -} -// -------------------------------------------------------- -void MixedBlockInfoType::set_blockARinfo_AR(int index, float minAR, float maxAR) -{ - _blockARinfo[index].minAR.resize(Orient_Num); - _blockARinfo[index].maxAR.resize(Orient_Num); - for (int i = 0; i < Orient_Num; i++) { - _blockARinfo[index].minAR[i] = ((i % 2 == 0) ? minAR : (1.f / maxAR)); - _blockARinfo[index].maxAR[i] = ((i % 2 == 0) ? maxAR : (1.f / minAR)); - } -} -// -------------------------------------------------------- -#endif diff --git a/src/mpl/src/ParquetFP/src/mixedpackingfromdb.cxx b/src/mpl/src/ParquetFP/src/mixedpackingfromdb.cxx deleted file mode 100644 index 330d5982b19..00000000000 --- a/src/mpl/src/ParquetFP/src/mixedpackingfromdb.cxx +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "mixedpackingfromdb.h" - -#include "DB.h" -#include "basepacking.h" -#include "debugflags.h" -#include "mixedpacking.h" - -using parquetfp::DB; -using parquetfp::Node; -using parquetfp::Nodes; -using std::vector; - -// -------------------------------------------------------- -MixedBlockInfoTypeFromDB::MixedBlockInfoTypeFromDB(const DB& db) - : MixedBlockInfoType(db.getNumNodes()) -{ - // extract information from DB - vector widths(db.getNodeWidths()); - vector heights(db.getNodeHeights()); - - Nodes& nodes = *(const_cast(db).getNodes()); - int blocknum = db.getNumNodes(); - for (int i = 0; i < blocknum; i++) { - Node& currBlk = nodes.getNode(i); - int theta = (currBlk.getOrient()); - setBlockDimensions(i, widths[i], heights[i], theta); - _currDimensions.in_block_names[i] = currBlk.getName(); - -#ifdef PARQUET_DEBUG_HAYWARD_DISPLAY_MIXEDPACKINGFROMDB - printf("[%d]: theta: %d, width: %lf, height %lf\n", - i, - theta, - widths[i], - heights[i]); -#endif - - float currMaxAR = currBlk.getmaxAR(); - float currMinAR = currBlk.getminAR(); - float currArea = currBlk.getArea(); - - _blockARinfo[i].area = currArea; - set_blockARinfo_AR(i, currMinAR, currMaxAR); - _blockARinfo[i].isSoft = (currMaxAR > currMinAR); - -#ifdef PARQUET_DEBUG_HAYWARD_DISPLAY_MIXEDPACKINGFROMDB - printf("[%d]: theta: %d, maxAR: %lf, minAR: %lf, area: %lf\n", - i, - theta, - currMaxAR, - currMinAR, - currArea); -#endif - } - - static const float Infty = basepacking_h::Dimension::Infty; - _currDimensions.set_dimensions(blocknum, 0, Infty); - _currDimensions.in_block_names[blocknum] = "LEFT"; - _blockARinfo[blocknum].area = 0; - _blockARinfo[blocknum].minAR.resize(Orient_Num, 0); - _blockARinfo[blocknum].maxAR.resize(Orient_Num, 0); - _blockARinfo[blocknum].isSoft = false; - - _currDimensions.set_dimensions(blocknum + 1, Infty, 0); - _currDimensions.in_block_names[blocknum + 1] = "BOTTOM"; - _blockARinfo[blocknum + 1].area = 0; - _blockARinfo[blocknum + 1].minAR.resize(Orient_Num, Infty); - _blockARinfo[blocknum + 1].maxAR.resize(Orient_Num, Infty); - _blockARinfo[blocknum + 1].isSoft = false; -} -// -------------------------------------------------------- diff --git a/src/mpl/src/ParquetFP/src/mixedpackingfromdb.h b/src/mpl/src/ParquetFP/src/mixedpackingfromdb.h deleted file mode 100644 index b84c32ae3a5..00000000000 --- a/src/mpl/src/ParquetFP/src/mixedpackingfromdb.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef MIXEDPACKINGFROMDB_H -#define MIXEDPACKINGFROMDB_H - -#include - -#include "DB.h" -#include "basepacking.h" -#include "mixedpacking.h" -using parquetfp::DB; - -// -------------------------------------------------------- -class MixedBlockInfoTypeFromDB : public MixedBlockInfoType -{ - public: - MixedBlockInfoTypeFromDB(const DB& db); - virtual ~MixedBlockInfoTypeFromDB() {} -}; -// -------------------------------------------------------- - -#endif diff --git a/src/mpl/src/ParquetFP/src/netlist.cxx b/src/mpl/src/ParquetFP/src/netlist.cxx deleted file mode 100644 index 944190c1133..00000000000 --- a/src/mpl/src/ParquetFP/src/netlist.cxx +++ /dev/null @@ -1,308 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ -#include "netlist.h" - -#include -#include -#include - -#include "basepacking.h" -#include "parsers.h" - -using namespace parse_utils; -using namespace basepacking_h; -using std::cout; -using std::endl; -using std::ifstream; -using std::max; -using std::min; -using std::ofstream; -using std::string; -using std::vector; - -// -------------------------------------------------------- -float NetType::getHPWL(const OrientedPacking& pk) const -{ - float minX = Dimension::Infty; - float maxX = -1 * Dimension::Infty; - float minY = Dimension::Infty; - float maxY = -1 * Dimension::Infty; - - for (unsigned int i = 0; i < in_pads.size(); i++) { - float xloc = in_pads[i].xloc; - float yloc = in_pads[i].yloc; - - minX = min(minX, xloc); - maxX = max(maxX, xloc); - minY = min(minY, yloc); - maxY = max(maxY, yloc); - // printf("PAD [%d]: %lf, %lf\n", i, xloc, yloc); - } - - for (unsigned int i = 0; i < in_pins.size(); i++) { - float orig_x_offset = in_pins[i].x_offset; - float orig_y_offset = in_pins[i].y_offset; - - int blk_index = in_pins[i].block; - OrientedPacking::ORIENT blk_orient = pk.orient[blk_index]; - - float x_length - = (blk_orient % 2 == 0) ? pk.width[blk_index] : pk.height[blk_index]; - float y_length - = (blk_orient % 2 == 0) ? pk.height[blk_index] : pk.width[blk_index]; - - float x_offset = -1; - float y_offset = -1; - getOffsets(orig_x_offset, orig_y_offset, blk_orient, x_offset, y_offset); - - float xloc = pk.xloc[blk_index] + (x_length / 2) + x_offset; - float yloc = pk.yloc[blk_index] + (y_length / 2) + y_offset; - - minX = min(minX, xloc); - maxX = max(maxX, xloc); - minY = min(minY, yloc); - maxY = max(maxY, yloc); - // printf("PIN [%d]: %lf (%lf-%lf), %lf(%lf-%lf)\n", - // i, xloc, pk.xloc[blk_index], pk.xloc[blk_index]+x_length, - // yloc, pk.yloc[blk_index], pk.yloc[blk_index]+y_length); - } - // printf("x-span: %lf - %lf\n", minX, maxX); - // printf("y-span: %lf - %lf\n", minY, maxY); - // printf("HPWL: %lf ", (maxX-minX) + (maxY-minY)); - return ((maxX - minX) + (maxY - minY)); -} -// -------------------------------------------------------- -void NetListType::ParsePl(ifstream& infile, const HardBlockInfoType& blockinfo) -{ - in_all_pads.clear(); - - ofstream outfile; - outfile.open("dummy_pl"); - - string line; - int objCount = 0; - for (int lineCount = 0; getline(infile, line); lineCount++) { - char name[100]; - float xloc, yloc; - - outfile << line << endl; - if (sscanf(line.c_str(), "%s %f %f", name, &xloc, &yloc) == 3) { - if (objCount >= blockinfo.blocknum()) { - PadInfoType temp_pad; - temp_pad.pad_name = name; - temp_pad.xloc = xloc; - temp_pad.yloc = yloc; - - in_all_pads.push_back(temp_pad); - } - objCount++; - } - } -} -// -------------------------------------------------------- -void NetListType::ParseNets(ifstream& infile, - const HardBlockInfoType& blockinfo) -{ - string line; - int numNets = -1; - int numPins = -1; - if (!infile.good()) { - cout << "ERROR: .nets file could not be opened successfully" << endl; - exit(1); - } - - // get NumNets - getline(infile, line); - while (getline(infile, line)) { - char first_word[100]; - char ch; - - if ((sscanf(line.c_str(), "%s %c %d", first_word, &ch, &numNets) == 3) - && !strcmp(first_word, "NumNets")) - break; - } - - if (!infile.good()) { - cout << "ERROR in reading .net file (# nets)." << endl; - exit(1); - } - - // get NumPins - while (getline(infile, line)) { - char first_word[100]; - char ch; - - if ((sscanf(line.c_str(), "%s %c %d", first_word, &ch, &numPins) == 3) - && !strcmp(first_word, "NumPins")) - break; - } - - if (!infile.good()) { - cout << "ERROR in reading .net file (# pins)." << endl; - exit(1); - } - - // parse the contents of the nets - int netDegree = -1; // degree of the current net - int degreeCount = 0; - int pinCount = 0; - vector netPads; // vector of pads for the current net; - vector netPins; // vector of pins for the current net; - for (int lineCount = 0; infile.good(); lineCount++) { - char dummy_word[1000]; - char block_name[1000]; - char dummy_chars[100]; - int number; - float x_percent, y_percent; - - getline(infile, line); - if (sscanf(line.c_str(), "%s", dummy_word) < 1) { - // blank line - if (infile.eof()) { - // wrap up the last net. - int degreeCount = netPins.size() + netPads.size(); - if (degreeCount == netDegree) { - NetType temp(netPins, netPads); - in_nets.push_back(temp); - - degreeCount = 0; - netPins.clear(); - netPads.clear(); - } else { - printf("ERROR: netDegree in net %lu does not tally\n", - in_nets.size()); - exit(1); - } - } - } else if ((sscanf(line.c_str(), "%c", dummy_chars + 0) == 1) - && dummy_chars[0] == '#') { /* comments (starts with '#') */ - } else if (sscanf(line.c_str(), - "%s %c %c %c%f %c%f", - block_name, - dummy_chars + 0, - dummy_chars + 1, - dummy_chars + 2, - &x_percent, - dummy_chars + 3, - &y_percent) - == 7) { - // consider a pin, on the block "block_name". - int index = get_index(string(block_name), blockinfo); - if (index == -1) { - printf("ERROR: Unrecognized block \"%s\"\n", block_name); - exit(1); - } else { - x_percent /= 100; - y_percent /= 100; - - NetType::PinType temp; - temp.block = index; - temp.x_offset = (blockinfo[index].width[0] * x_percent) / 2; - temp.y_offset = (blockinfo[index].height[0] * y_percent) / 2; - // printf("block %d: x_offset: %.2lf y_offset: %.2lf width: - // %.2lf height: %2.lf\n", - // index, temp.x_offset, temp.y_offset, - // blockinfo[index].width[0], - // blockinfo[index].height[0]); - netPins.push_back(temp); - degreeCount++; - pinCount++; - } - } else if (sscanf(line.c_str(), - "%s %c %d", - dummy_word, - dummy_chars + 0, - &number) - == 3) { - if (!strcmp(dummy_word, "NetDegree")) { - // see "NetDegree : x, wrap up previous net - if (netDegree == -1) - netDegree = number; - else if (degreeCount == netDegree) { - NetType temp(netPins, netPads); - in_nets.push_back(NetType(netPins, netPads)); - - netDegree = number; - degreeCount = 0; - netPins.clear(); - netPads.clear(); - } else { - printf("ERROR: netDegree in net %lu does not tally (%d vs. %d).\n", - in_nets.size(), - degreeCount, - netDegree); - exit(1); - } - } else { - printf("ERROR in parsing .net file (line %d after NumPins).\n", - lineCount + 1); - printf("line: %s\n", line.c_str()); - exit(1); - } - } else if (sscanf(line.c_str(), "%s %c", block_name, dummy_chars + 0) - == 2) { - // consider a pad, with name "block_name". - vector indices; - get_index(string(block_name), indices); - if (indices.empty()) { - printf("ERROR: unrecognized pad \"%s\"\n", block_name); - exit(1); - } else { - for (unsigned int i = 0; i < indices.size(); i++) { - NetType::PadType temp; - temp.xloc = in_all_pads[indices[i]].xloc; - temp.yloc = in_all_pads[indices[i]].yloc; - netPads.push_back(temp); - pinCount++; - } - degreeCount++; - } - - } else { - printf("ERROR in parsing .net file (line %d after NumPins).\n", - lineCount + 1); - printf("line: %s\n", line.c_str()); - exit(1); - } - } - - if (pinCount != numPins) { - printf("ERROR: # pins does not tally (%d vs. %d).", pinCount, numPins); - exit(1); - } else if (int(in_nets.size()) != numNets) { - printf( - "ERROR: # nets does not tally (%lu vz. %d).", in_nets.size(), numNets); - exit(1); - } - infile.close(); -} -// -------------------------------------------------------- diff --git a/src/mpl/src/ParquetFP/src/netlist.h b/src/mpl/src/ParquetFP/src/netlist.h deleted file mode 100644 index 343a6bc01c0..00000000000 --- a/src/mpl/src/ParquetFP/src/netlist.h +++ /dev/null @@ -1,245 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef NETLIST_H -#define NETLIST_H - -#include -#include - -#include "basepacking.h" - -// -------------------------------------------------------- -class NetType -{ - public: - class PinType; - class PadType; - NetType(const std::vector& newPins, - const std::vector& newPads) - : pins(in_pins), pads(in_pads), in_pins(newPins), in_pads(newPads) - { - } - - inline NetType(const NetType& newNet); - inline void operator=(const NetType& newNet); - - const std::vector& pins; - const std::vector& pads; - - float getHPWL(const OrientedPacking& pk) const; - - class PinType - { - public: - int block; // index of blocks - float x_offset; // offset from center - float y_offset; // offset from center - }; - - class PadType - { - public: - float xloc; - float yloc; - }; - - private: - std::vector in_pins; - std::vector in_pads; - - inline void getOffsets(float orig_x_offset, - float orig_y_offset, - OrientedPacking::ORIENT orient, - float& x_offset, - float& y_offset) const; -}; -// -------------------------------------------------------- -class NetListType -{ - public: - inline NetListType(std::ifstream& infile_pl, - std::ifstream& infile_nets, - const HardBlockInfoType& blockinfo); - - class PadInfoType; - const std::vector& nets; - const std::vector& padinfo; - inline float getHPWL(const OrientedPacking& pk) const; - - class PadInfoType - { - public: - std::string pad_name; - float xloc; - float yloc; - }; - - private: - std::vector in_nets; - std::vector in_all_pads; - - void ParsePl(std::ifstream& infile, const HardBlockInfoType& blockinfo); - void ParseNets(std::ifstream& infile, const HardBlockInfoType& blockinfo); - inline void get_index(const std::string& name, - std::vector& indices) const; - inline int get_index(const std::string& name, - const HardBlockInfoType& blockinfo) const; - - NetListType(const NetListType&); -}; -// -------------------------------------------------------- - -// ============== -// IMPLEMENTATION -// ============== -inline NetListType::NetListType(std::ifstream& infile_pl, - std::ifstream& infile_nets, - const HardBlockInfoType& blockinfo) - : nets(in_nets), padinfo(in_all_pads) -{ - ParsePl(infile_pl, blockinfo); - ParseNets(infile_nets, blockinfo); -} -// -------------------------------------------------------- -inline float NetListType::getHPWL(const OrientedPacking& pk) const -{ - int num_nets = in_nets.size(); - float HPWL = 0; - for (int i = 0; i < num_nets; i++) { - // printf("---Net [%d]---\n", i); - HPWL += in_nets[i].getHPWL(pk); - // std::cout.setf(ios::fixed); - // std::cout.precision(2); - // std::cout << HPWL << std::endl << std::endl; - } - return HPWL; -} -// -------------------------------------------------------- -inline int NetListType::get_index(const std::string& name, - const HardBlockInfoType& blockinfo) const -{ - for (int i = 0; i < blockinfo.blocknum(); i++) - if (name == blockinfo.block_names[i]) - return i; - return -1; -} -// -------------------------------------------------------- -inline void NetListType::get_index(const std::string& name, - std::vector& indices) const -{ - indices.clear(); - for (unsigned int i = 0; i < in_all_pads.size(); i++) { - const std::string& this_pad_name = in_all_pads[i].pad_name; - int pos = this_pad_name.find(name, 0); - if (pos == 0) { - if (this_pad_name.length() == name.length()) - indices.push_back(i); - else if (this_pad_name[name.length()] == '@') - indices.push_back(i); - } - } -} -// -------------------------------------------------------- -inline NetType::NetType(const NetType& newNet) : pins(in_pins), pads(in_pads) -{ - in_pins = newNet.in_pins; - in_pads = newNet.in_pads; -} -// -------------------------------------------------------- -inline void NetType::operator=(const NetType& newNet) -{ - in_pins = newNet.in_pins; - in_pads = newNet.in_pads; -} -// -------------------------------------------------------- -inline void NetType::getOffsets(float orig_x_offset, - float orig_y_offset, - OrientedPacking::ORIENT blk_orient, - float& x_offset, - float& y_offset) const -{ - switch (blk_orient) { - case OrientedPacking::N: - x_offset = orig_x_offset; - y_offset = orig_y_offset; - break; - - case OrientedPacking::E: - x_offset = orig_y_offset; - y_offset = -1 * orig_x_offset; - break; - - case OrientedPacking::S: - x_offset = -1 * orig_x_offset; - y_offset = -1 * orig_y_offset; - break; - - case OrientedPacking::W: - x_offset = -1 * orig_y_offset; - y_offset = orig_x_offset; - break; - - case OrientedPacking::FN: - x_offset = -1 * orig_x_offset; - y_offset = orig_y_offset; - break; - - case OrientedPacking::FE: - x_offset = orig_y_offset; - y_offset = orig_x_offset; - break; - - case OrientedPacking::FS: - x_offset = orig_x_offset; - y_offset = -1 * orig_y_offset; - break; - - case OrientedPacking::FW: - x_offset = -1 * orig_y_offset; - y_offset = -1 * orig_x_offset; - break; - - case OrientedPacking::OrientUndefined: - std::cout << "ERROR: the orientation for this block is undefined." - << std::endl; - exit(1); - break; - - default: - std::cout << "ERROR in specified orientation." << std::endl; - exit(1); - break; - } -} -// -------------------------------------------------------- -#endif diff --git a/src/mpl/src/ParquetFP/src/parsers.h b/src/mpl/src/ParquetFP/src/parsers.h deleted file mode 100644 index bac9dd200cb..00000000000 --- a/src/mpl/src/ParquetFP/src/parsers.h +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef PARSERS_H -#define PARSERS_H - -#include -#include -#include -#include - -namespace parse_utils { -struct ltstr -{ - inline bool operator()(const char* s1, const char* s2) const - { - return strcmp(s1, s2) < 0; - } -}; - -struct Point -{ - float x; - float y; -}; - -struct IntPoint -{ - int x; - int y; -}; - -// global parsing functions -inline void eatblank(std::ifstream& i); -inline void skiptoeol(std::ifstream& i); -inline void eathash(std::ifstream& i); -inline bool needCaseChar(std::ifstream& i, char character); -} // namespace parse_utils -// namespace parse_utils - -// ========================= -// IMPLEMENTATIONS -// ========================= -inline void parse_utils::eatblank(std::ifstream& i) -{ - while (i.peek() == ' ' || i.peek() == '\t') - i.get(); -} -// -------------------------------------------------------- -inline void parse_utils::skiptoeol(std::ifstream& i) -{ - while (!i.eof() && i.peek() != '\n' && i.peek() != '\r') - i.get(); - i.get(); -} -// -------------------------------------------------------- -inline bool parse_utils::needCaseChar(std::ifstream& i, char character) -{ - while (!i.eof() && i.peek() != character) - i.get(); - if (i.eof()) - return false; - else - return true; -} -// -------------------------------------------------------- -inline void parse_utils::eathash(std::ifstream& i) -{ - skiptoeol(i); -} -// -------------------------------------------------------- -#endif diff --git a/src/mpl/src/ParquetFP/src/plcompact.cxx b/src/mpl/src/ParquetFP/src/plcompact.cxx deleted file mode 100644 index da2d3f19dcc..00000000000 --- a/src/mpl/src/ParquetFP/src/plcompact.cxx +++ /dev/null @@ -1,433 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "plcompact.h" - -#include -#include -#include -#include - -#include "basepacking.h" - -using std::cout; -using std::endl; -using std::vector; - -const float ShiftLegalizer::Infty = basepacking_h::Dimension::Infty; -const int ShiftLegalizer::Undefined = basepacking_h::Dimension::Undefined; - -const float ShiftBlock::Infty = basepacking_h::Dimension::Infty; -const float ShiftBlock::Neg_Infty = -1 * ShiftBlock::Infty; -const int ShiftBlock::Undefined = basepacking_h::Dimension::Undefined; -// -------------------------------------------------------- -ShiftLegalizer::ShiftLegalizer(const vector& n_xloc, - const vector& n_yloc, - const vector& n_widths, - const vector& n_heights, - float left_bound, - float right_bound, - float top_bound, - float bottom_bound) - : _blocknum(n_xloc.size()), - _xloc(n_xloc), - _yloc(n_yloc), - _widths(n_widths), - _heights(n_heights), - _epsilon(ShiftBlock::Infty), - _leftBound(left_bound), - _rightBound(right_bound), - _topBound(top_bound), - _bottomBound(bottom_bound) -{ - for (int i = 0; i < _blocknum; i++) - _epsilon = std::min(_epsilon, std::min(_widths[i], _heights[i])); - - _epsilon /= basepacking_h::Dimension::Epsilon_Accuracy; -} -// -------------------------------------------------------- -bool ShiftLegalizer::legalizeAll(ShiftLegalizer::AlgoType algo, - const vector& checkBlks, - vector& badBlks) -{ - switch (algo) { - case NAIVE: - return naiveLegalize(checkBlks, badBlks); - - default: - cout << "ERROR: invalid algo specified in ShiftLegalizer::legalizeAll()" - << endl; - exit(1); - break; - } -} -// -------------------------------------------------------- -bool ShiftLegalizer::naiveLegalize(const vector& checkBlks, - vector& badBlks) -{ - int checkBlkNum = checkBlks.size(); - bool success = true; - - for (int i = 0; i < checkBlkNum; i++) - putBlockIntoCore(i); - - for (int i = 0; i < checkBlkNum; i++) { - bool thisSuccess = legalizeBlock(checkBlks[i]); - if (!thisSuccess) - badBlks.push_back(checkBlks[i]); - success = success && thisSuccess; - } - return success; -} -// -------------------------------------------------------- -bool ShiftLegalizer::legalizeBlock(int currBlk) -{ - printf("-----Block %d-----\n", currBlk); - - // move only if it resolves ALL overlaps - ShiftBlock shift_block(_xloc, - _yloc, - _widths, - _heights, - _leftBound, - _rightBound, - _topBound, - _bottomBound); - vector shiftinfo; - shift_block(currBlk, shiftinfo); - - bool existsOverlaps = false; - bool success = false; // only makes sense when "existsOverlaps" - ShiftRotateDecision decision; // initialized - for (int i = 0; i < ShiftBlock::DIR_NUM; i++) { - // if overlap occurs - if (std::abs(shiftinfo[i].shiftRangeMin) > _epsilon) { - bool tempSuccess - = shiftDecider(ShiftBlock::Directions(i), shiftinfo, decision); - - decision.rotate = false; - success = success || tempSuccess; - existsOverlaps = true; - } - } - - // -----try rotating the block if no move works so far----- - if (existsOverlaps && !success) { - // temporarily change the info - std::swap(_widths[currBlk], _heights[currBlk]); - float orig_xloc = _xloc[currBlk]; - float orig_yloc = _yloc[currBlk]; - - // apply the same procedures to find moves - ShiftBlock shift_block_rotated(_xloc, - _yloc, - _widths, - _heights, - _leftBound, - _rightBound, - _topBound, - _bottomBound); - vector shiftinfo_rotated; - shift_block_rotated(currBlk, shiftinfo_rotated); - - existsOverlaps = false; - for (int i = 0; i < ShiftBlock::DIR_NUM; i++) { - // if overlap occurs - if (std::abs(shiftinfo_rotated[i].shiftRangeMin) > _epsilon) { - bool tempSuccess = shiftDecider( - ShiftBlock::Directions(i), shiftinfo_rotated, decision); - - decision.rotate = true; - success = success || tempSuccess; - existsOverlaps = true; - } - } - - // special case when "rotating" helps already - if (!existsOverlaps) { - decision.rotate = true; - decision.shiftDir = ShiftBlock::EAST; - decision.shiftExtent = 0; - - success = true; - } - - // restore the global details even when succeed - std::swap(_widths[currBlk], _heights[currBlk]); - _xloc[currBlk] = orig_xloc; - _yloc[currBlk] = orig_yloc; - } - - // move towards the direction that needs least fix - if (decision.shiftDir != Undefined) { - adjustBlock(currBlk, decision); - return true; - } else if (!existsOverlaps) - return true; - else - return false; -} -// -------------------------------------------------------- -bool ShiftLegalizer::shiftDecider( - ShiftBlock::Directions currDir, - const vector& shiftinfo, - ShiftRotateDecision& decision) const -{ - if (shiftinfo[currDir].shiftRangeMin - < shiftinfo[currDir].shiftRangeMax + _epsilon) { - if (shiftinfo[currDir].shiftRangeMin < decision.shiftExtent) { - decision.shiftDir = currDir; - decision.shiftExtent = shiftinfo[currDir].shiftRangeMin; - } - return true; - } else - return false; // "f" ==> exists unresolvable overlap (not converse) -} -// -------------------------------------------------------- -void ShiftLegalizer::adjustBlock(int currBlk, - const ShiftRotateDecision& decision) -{ - if (decision.rotate) - std::swap(_widths[currBlk], _heights[currBlk]); - - switch (decision.shiftDir) { - case ShiftBlock::NORTH: - _yloc[currBlk] += decision.shiftExtent; - break; - - case ShiftBlock::EAST: - _xloc[currBlk] -= decision.shiftExtent; - break; - - case ShiftBlock::SOUTH: - _yloc[currBlk] -= decision.shiftExtent; - break; - - case ShiftBlock::WEST: - _xloc[currBlk] += decision.shiftExtent; - break; - - default: - cout << "ERROR: invalid direction specified in moveblock()" << endl; - exit(1); - } -} -// -------------------------------------------------------- -void ShiftLegalizer::putBlockIntoCore(int currBlk) -{ - _xloc[currBlk] = std::max(_xloc[currBlk], _leftBound); - _xloc[currBlk] = std::min(_xloc[currBlk], _rightBound - _widths[currBlk]); - - _yloc[currBlk] = std::max(_yloc[currBlk], _bottomBound); - _yloc[currBlk] = std::min(_yloc[currBlk], _topBound - _heights[currBlk]); -} -// -------------------------------------------------------- -ShiftBlock::ShiftBlock(const vector& xloc, - const vector& yloc, - const vector& widths, - const vector& heights, - float left_bound, - float right_bound, - float top_bound, - float bottom_bound) - : _blocknum(xloc.size()), - _xStart(_blocknum + 4), - _xEnd(_blocknum + 4), - _yStart(_blocknum + 4), - _yEnd(_blocknum + 4), - _epsilon(Infty) -{ - for (int i = 0; i < _blocknum; i++) { - _xStart[i] = xloc[i]; - _xEnd[i] = xloc[i] + widths[i]; - _yStart[i] = yloc[i]; - _yEnd[i] = yloc[i] + heights[i]; - - _epsilon = std::min(_epsilon, std::min(widths[i], heights[i])); - } - _epsilon /= basepacking_h::Dimension::Epsilon_Accuracy; - - // LEFT-edge - _xStart[_blocknum] = Neg_Infty; - _xEnd[_blocknum] = left_bound; - _yStart[_blocknum] = Neg_Infty; - _yEnd[_blocknum] = Infty; - - // BOTTOM-edge - _xStart[_blocknum + 1] = Neg_Infty; - _xEnd[_blocknum + 1] = Infty; - _yStart[_blocknum + 1] = Neg_Infty; - _yEnd[_blocknum + 1] = bottom_bound; - - // RIGHT-edge - _xStart[_blocknum + 2] = right_bound; - _xEnd[_blocknum + 2] = Infty; - _yStart[_blocknum + 2] = Neg_Infty; - _yEnd[_blocknum + 2] = Infty; - - // TOP-edge - _xStart[_blocknum + 3] = Neg_Infty; - _xEnd[_blocknum + 3] = Infty; - _yStart[_blocknum + 3] = top_bound; - _yEnd[_blocknum + 3] = Infty; -} -// -------------------------------------------------------- -void ShiftBlock::operator()(int currBlk, vector& shiftinfo) const -{ - // -----initialize the output----- - shiftinfo.resize(DIR_NUM); - for (int i = 0; i < int(DIR_NUM); i++) { - Directions currDir = Directions(i); - shiftinfo[currDir].shiftRangeMin = 0; - shiftinfo[currDir].shiftRangeMax = Infty; - shiftinfo[currDir].overlapMin = Infty; - shiftinfo[currDir].overlapMax = 0; - } - - // -----determine the overlap's and/or shiftRange----- - for (int tempBlk = 0; tempBlk < _blocknum + 4; tempBlk++) { - // printf("-----tempBlk %d-----\n", tempBlk); - if (tempBlk != currBlk) { - if (_xStart[tempBlk] < _xEnd[currBlk] - _epsilon - && _xStart[currBlk] < _xEnd[tempBlk] - _epsilon) { - // horizontal overlap, relevant for dir's N and S - if (_yStart[tempBlk] < _yEnd[currBlk] - _epsilon - && _yStart[currBlk] < _yEnd[tempBlk] - _epsilon) { - // real overlaps, "shiftRange(Min/Max)" must be +ve - shiftinfo[NORTH].shiftRangeMin - = std::max(shiftinfo[NORTH].shiftRangeMin, - _yEnd[tempBlk] - _yStart[currBlk]); - - shiftinfo[SOUTH].shiftRangeMin - = std::max(shiftinfo[SOUTH].shiftRangeMin, - _yEnd[currBlk] - _yStart[tempBlk]); - - shiftinfo[EAST].shiftRangeMin = std::max( - shiftinfo[EAST].shiftRangeMin, _xEnd[currBlk] - _xStart[tempBlk]); - - shiftinfo[WEST].shiftRangeMin = std::max( - shiftinfo[WEST].shiftRangeMin, _xEnd[tempBlk] - _xStart[currBlk]); - - // handle "overlap(Min/Max)" - shiftinfo[NORTH].overlapMin - = std::min(shiftinfo[NORTH].overlapMin, _xStart[tempBlk]); - - shiftinfo[NORTH].overlapMax - = std::max(shiftinfo[NORTH].overlapMax, _xEnd[tempBlk]); - - shiftinfo[SOUTH].overlapMin = shiftinfo[NORTH].overlapMin; - shiftinfo[SOUTH].overlapMax = shiftinfo[NORTH].overlapMax; - - shiftinfo[EAST].overlapMin - = std::min(shiftinfo[EAST].overlapMin, _yStart[tempBlk]); - - shiftinfo[EAST].overlapMax - = std::max(shiftinfo[EAST].overlapMax, _yEnd[tempBlk]); - - shiftinfo[WEST].overlapMin = shiftinfo[EAST].overlapMin; - shiftinfo[WEST].overlapMax = shiftinfo[EAST].overlapMax; - // cout << "here -1- real overlap" << endl; - } else if (_yStart[tempBlk] < _yEnd[currBlk] - _epsilon) { - // "tempBlk" below "currBlk" - shiftinfo[SOUTH].shiftRangeMax = std::min( - shiftinfo[SOUTH].shiftRangeMax, - std::max(_yStart[currBlk] - _yEnd[tempBlk], float(0.0))); - // cout << "here -2- tempBlk below currBlk" << endl; - } else { - // "tempBlk" above "currBlk" - shiftinfo[NORTH].shiftRangeMax = std::min( - shiftinfo[NORTH].shiftRangeMax, - std::max(_yStart[tempBlk] - _yEnd[currBlk], float(0.0))); - // cout << "here -3- tempBlk above currBlk" << endl; - } - } else if (_yStart[tempBlk] < _yEnd[currBlk] - _epsilon - && _yStart[currBlk] < _yEnd[tempBlk] - _epsilon) { - // vertical overlap, but not horizontal - if (_xStart[tempBlk] < _xEnd[currBlk] - _epsilon) { - // "tempBlk" left of "currBlk" - shiftinfo[EAST].shiftRangeMax = std::min( - shiftinfo[EAST].shiftRangeMax, - std::max(_xStart[currBlk] - _xEnd[tempBlk], float(0.0))); - // cout << "here -4- tempBlk left of currBlk" << endl; - } else { - // "tempBlk" right of "currBlk" - shiftinfo[WEST].shiftRangeMax = std::min( - shiftinfo[WEST].shiftRangeMax, - std::max(_xStart[tempBlk] - _xEnd[currBlk], float(0.0))); - // cout << "here -5- tempBlk right of currBlk" << endl; - } - } - } - } -} -// -------------------------------------------------------- -void OutputShiftInfo(std::ostream& outs, - const vector& shiftinfo) -{ - outs << "NORTH: " << endl; - outs << "shiftRangeMin: " << shiftinfo[ShiftBlock::NORTH].shiftRangeMin - << endl; - outs << "shiftRangeMax: " << shiftinfo[ShiftBlock::NORTH].shiftRangeMax - << endl; - outs << "overlapMin: " << shiftinfo[ShiftBlock::NORTH].overlapMin << endl; - outs << "overlapMax: " << shiftinfo[ShiftBlock::NORTH].overlapMax << endl; - outs << endl; - - outs << "EAST: " << endl; - outs << "shiftRangeMin: " << shiftinfo[ShiftBlock::EAST].shiftRangeMin - << endl; - outs << "shiftRangeMax: " << shiftinfo[ShiftBlock::EAST].shiftRangeMax - << endl; - outs << "overlapMin: " << shiftinfo[ShiftBlock::EAST].overlapMin << endl; - outs << "overlapMax: " << shiftinfo[ShiftBlock::EAST].overlapMax << endl; - outs << endl; - - outs << "SOUTH: " << endl; - outs << "shiftRangeMin: " << shiftinfo[ShiftBlock::SOUTH].shiftRangeMin - << endl; - outs << "shiftRangeMax: " << shiftinfo[ShiftBlock::SOUTH].shiftRangeMax - << endl; - outs << "overlapMin: " << shiftinfo[ShiftBlock::SOUTH].overlapMin << endl; - outs << "overlapMax: " << shiftinfo[ShiftBlock::SOUTH].overlapMax << endl; - outs << endl; - - outs << "WEST: " << endl; - outs << "shiftRangeMin: " << shiftinfo[ShiftBlock::WEST].shiftRangeMin - << endl; - outs << "shiftRangeMax: " << shiftinfo[ShiftBlock::WEST].shiftRangeMax - << endl; - outs << "overlapMin: " << shiftinfo[ShiftBlock::WEST].overlapMin << endl; - outs << "overlapMax: " << shiftinfo[ShiftBlock::WEST].overlapMax << endl; - outs << endl; - outs << "--------" << endl; -} -// -------------------------------------------------------- diff --git a/src/mpl/src/ParquetFP/src/plcompact.h b/src/mpl/src/ParquetFP/src/plcompact.h deleted file mode 100644 index 4d59363e0f5..00000000000 --- a/src/mpl/src/ParquetFP/src/plcompact.h +++ /dev/null @@ -1,214 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef PLCOMPACT_H -#define PLCOMPACT_H - -#include - -#include "basepacking.h" - -// -------------------------------------------------------- -// back-end database to determine how much a block can/has to move -// *** NOT INTENDED TO BE USED DIRECTLY, USE ShiftLegalizer INSTEAD *** -class ShiftBlock -{ - public: - ShiftBlock(const std::vector& xloc, - const std::vector& yloc, - const std::vector& widths, - const std::vector& heights, - float left_bound, - float right_bound, - float top_bound, - float bottom_bound); - - class ShiftInfo - { - public: - float shiftRangeMin; - float shiftRangeMax; - float overlapMin; - float overlapMax; - }; - void operator()( - int currBlk, - std::vector& shiftinfo) const; // 4-elt std::vector - - enum Directions - { - NORTH, - EAST, - SOUTH, - WEST, - DIR_NUM - }; - static const float Infty; - static const float Neg_Infty; - static const int Undefined; - - private: - int _blocknum; - std::vector _xStart; - std::vector _xEnd; - std::vector _yStart; - std::vector _yEnd; - - float _epsilon; -}; -// -------------------------------------------------------- -// front-end legalizer to be used -class ShiftLegalizer -{ - public: - ShiftLegalizer(const std::vector& n_xloc, - const std::vector& n_yloc, - const std::vector& n_widths, - const std::vector& n_heights, - float left_bound, - float right_bound, - float top_bound, - float bottom_bound); - - enum AlgoType - { - NAIVE - }; - - bool legalizeAll(AlgoType algo, - const std::vector& checkBlks, - std::vector& badBlks); - - bool naiveLegalize(const std::vector& checkBlks, - std::vector& badBlks); // "t" ~ badBlks.empty() - bool legalizeBlock(int currBlk); // "t" ~ "currBlk" not overlap - - void putBlockIntoCore(int currBlk); - - inline const std::vector& xloc() const; - inline const std::vector& yloc() const; - inline const std::vector& widths() const; - inline const std::vector& heights() const; - - inline float leftBound() const; - inline float rightBound() const; - inline float topBound() const; - inline float bottomBound() const; - - static const float Infty; - static const int Undefined; - - class ShiftRotateDecision - { - public: - inline ShiftRotateDecision(); - - bool rotate; - int shiftDir; - float shiftExtent; - }; - bool shiftDecider(ShiftBlock::Directions currDir, - const std::vector& shiftinfo, - ShiftRotateDecision& decision) const; - bool rotateDecider(int currBlk, - const std::vector& shiftinfo, - ShiftRotateDecision& decision) const; - - private: - int _blocknum; - std::vector _xloc; - std::vector _yloc; - std::vector _widths; - std::vector _heights; - float _epsilon; - - const float _leftBound; - const float _rightBound; - const float _topBound; - const float _bottomBound; - - void adjustBlock(int currBlk, const ShiftRotateDecision& decision); -}; -void OutputShiftInfo(std::ostream& outs, - const std::vector& shiftinfo); -// -------------------------------------------------------- - -// =============== -// IMPLEMENTATIONS -// =============== -const std::vector& ShiftLegalizer::xloc() const -{ - return _xloc; -} -// -------------------------------------------------------- -const std::vector& ShiftLegalizer::yloc() const -{ - return _yloc; -} -// -------------------------------------------------------- -const std::vector& ShiftLegalizer::widths() const -{ - return _widths; -} -// -------------------------------------------------------- -const std::vector& ShiftLegalizer::heights() const -{ - return _heights; -} -// -------------------------------------------------------- -float ShiftLegalizer::leftBound() const -{ - return _leftBound; -} -// -------------------------------------------------------- -float ShiftLegalizer::rightBound() const -{ - return _rightBound; -} -// -------------------------------------------------------- -float ShiftLegalizer::topBound() const -{ - return _topBound; -} -// -------------------------------------------------------- -float ShiftLegalizer::bottomBound() const -{ - return _bottomBound; -} -// -------------------------------------------------------- -ShiftLegalizer::ShiftRotateDecision::ShiftRotateDecision() - : rotate(false), shiftDir(Undefined), shiftExtent(Infty) -{ -} -// -------------------------------------------------------- - -#endif diff --git a/src/mpl/src/ParquetFP/src/plsptobtree.cxx b/src/mpl/src/ParquetFP/src/plsptobtree.cxx deleted file mode 100644 index 6a995046759..00000000000 --- a/src/mpl/src/ParquetFP/src/plsptobtree.cxx +++ /dev/null @@ -1,185 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "plsptobtree.h" - -#include -#include -#include - -#include "btree.h" - -namespace parquetfp { - -using std::vector; - -// -------------------------------------------------------- -PlSP2BTree::PlSP2BTree(const vector& n_xloc, - const vector& n_yloc, - const vector& n_widths, - const vector& n_heights, - const vector& XX, - const vector& YY) - : xloc(n_xloc), - yloc(n_yloc), - widths(n_widths), - heights(n_heights), - _blocknum(n_xloc.size()), - _XX(XX), - _YY(YY), - _XXinverse(_blocknum), - _YYinverse(_blocknum), - _btree(_blocknum + 2) -{ - constructor_core(); -} -// -------------------------------------------------------- -PlSP2BTree::PlSP2BTree(const vector& n_xloc, - const vector& n_yloc, - const vector& n_widths, - const vector& n_heights, - const vector& XX, - const vector& YY) - : xloc(n_xloc), - yloc(n_yloc), - widths(n_widths), - heights(n_heights), - _blocknum(n_xloc.size()), - _XX(_blocknum), - _YY(_blocknum), - _XXinverse(_blocknum), - _YYinverse(_blocknum), - _btree(_blocknum + 2) -{ - for (int i = 0; i < _blocknum; i++) { - _XX[i] = int(XX[i]); - _YY[i] = int(YY[i]); - } - constructor_core(); -} -// -------------------------------------------------------- -void PlSP2BTree::build_tree() -{ - for (int i = 0; i < _blocknum; i++) { - int currBlock = _YY[i]; - int otree_parent = _blocknum; // left-edge initially - - float currXStart = xloc[currBlock]; - float minDistance = currXStart; - int parentMaxIndex = _blocknum; - for (int j = i - 1; j >= 0; j--) { - int tempBlock = _YY[j]; - if (SPleftof(tempBlock, currBlock)) { - if (_XXinverse[tempBlock] < parentMaxIndex) { - float tempDistance = currXStart - xloc[tempBlock] - widths[tempBlock]; - if (tempDistance < minDistance) { - minDistance = tempDistance; - otree_parent = tempBlock; - } - } - } else // SPbelow(tempBlock, currBlock) - parentMaxIndex = std::min(parentMaxIndex, _XXinverse[tempBlock]); - } - build_tree_add_block(currBlock, otree_parent); - } -} -// -------------------------------------------------------- -void PlSP2BTree::build_tree_add_block(int currBlock, int otree_parent) -{ - // printf("block %d added with block %d as its otree-parent\n", - // currBlock, otree_parent); - - if (_btree[otree_parent].left == Undefined) { - _btree[otree_parent].left = currBlock; - _btree[currBlock].parent = otree_parent; - } else { - int tree_prev = otree_parent; - int tree_curr = _btree[otree_parent].left; - while ((tree_curr != Undefined) && (yloc[tree_curr] < yloc[currBlock])) { - tree_prev = tree_curr; - tree_curr = _btree[tree_curr].right; - } - - // printf("tree_curr: %d tree_prev: %d\n", tree_curr, tree_prev); - // printf("YLOC: tree_curr: %.2lf currBlock: %.2lf tree_prev: - // %.2lf\n", - // (tree_curr != Undefined)? yloc[tree_curr] : -1, - // yloc[currBlock], yloc[tree_prev]); - - if ((tree_curr != Undefined) && (tree_curr == _btree[tree_prev].left)) - _btree[tree_prev].left = currBlock; - else - _btree[tree_prev].right = currBlock; - _btree[currBlock].parent = tree_prev; - - _btree[currBlock].right = tree_curr; // possibly Undefined - if (tree_curr != Undefined) - _btree[tree_curr].parent = currBlock; - } -} -// -------------------------------------------------------- -void PlSP2BTree::constructor_core() -{ - initializeTree(); - for (int i = 0; i < _blocknum; i++) { - _XXinverse[_XX[i]] = i; - _YYinverse[_YY[i]] = i; - } - build_tree(); -} -// -------------------------------------------------------- -void PlSP2BTree::initializeTree() -{ - int vec_size = int(_btree.size()); - for (int i = 0; i < vec_size; i++) { - _btree[i].parent = _blocknum; - _btree[i].left = Undefined; - _btree[i].right = Undefined; - _btree[i].block_index = i; - _btree[i].orient = 0; - } - - _btree[_blocknum].parent = Undefined; - _btree[_blocknum].left = Undefined; - _btree[_blocknum].right = Undefined; - _btree[_blocknum].block_index = _blocknum; - _btree[_blocknum].orient = Undefined; - - _btree[_blocknum + 1].parent = _blocknum; - _btree[_blocknum + 1].left = Undefined; - _btree[_blocknum + 1].right = Undefined; - _btree[_blocknum + 1].block_index = _blocknum + 1; - _btree[_blocknum + 1].orient = Undefined; -} -// -------------------------------------------------------- - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/plsptobtree.h b/src/mpl/src/ParquetFP/src/plsptobtree.h deleted file mode 100644 index 57e5ea4ee85..00000000000 --- a/src/mpl/src/ParquetFP/src/plsptobtree.h +++ /dev/null @@ -1,144 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef PLSPTOBTREE_H -#define PLSPTOBTREE_H - -#include "btree.h" - -namespace parquetfp { - -// -------------------------------------------------------- -class PlSP2BTree -{ - public: - PlSP2BTree(const std::vector& n_xloc, - const std::vector& n_yloc, - const std::vector& n_widths, - const std::vector& n_heights, - const std::vector& XX, - const std::vector& YY); - - PlSP2BTree(const std::vector& n_xloc, - const std::vector& n_yloc, - const std::vector& n_widths, - const std::vector& n_heights, - const std::vector& XX, - const std::vector& YY); - - inline const std::vector& btree() const; - inline const std::vector& SP_XX() const; - inline const std::vector& SP_YY() const; - inline const std::vector& SP_XXinverse() const; - inline const std::vector& SP_YYinverse() const; - - const std::vector& xloc; - const std::vector& yloc; - const std::vector& widths; - const std::vector& heights; - - inline bool SPleftof(int i, int j) const; - inline bool SPrightof(int i, int j) const; - inline bool SPabove(int i, int j) const; - inline bool SPbelow(int i, int j) const; - - static constexpr float Infty = basepacking_h::Dimension::Infty; - static constexpr int Undefined = BTree::Undefined; - - private: - int _blocknum; - std::vector _XX; - std::vector _YY; - std::vector _XXinverse; - std::vector _YYinverse; - std::vector _btree; - - void constructor_core(); - void initializeTree(); - - void build_tree(); - void build_tree_add_block(int currBlock, int otree_parent); -}; -// -------------------------------------------------------- - -// =============== -// IMPLEMENTATIONS -// =============== -inline const std::vector& PlSP2BTree::btree() const -{ - return _btree; -} -// -------------------------------------------------------- -inline const std::vector& PlSP2BTree::SP_XX() const -{ - return _XX; -} -// -------------------------------------------------------- -inline const std::vector& PlSP2BTree::SP_YY() const -{ - return _YY; -} -// -------------------------------------------------------- -inline const std::vector& PlSP2BTree::SP_XXinverse() const -{ - return _XXinverse; -} -// -------------------------------------------------------- -inline const std::vector& PlSP2BTree::SP_YYinverse() const -{ - return _YYinverse; -} -// -------------------------------------------------------- -inline bool PlSP2BTree::SPleftof(int i, int j) const -{ - return (_XXinverse[i] < _XXinverse[j] && _YYinverse[i] < _YYinverse[j]); -} -// -------------------------------------------------------- -inline bool PlSP2BTree::SPrightof(int i, int j) const -{ - return SPleftof(j, i); -} -// -------------------------------------------------------- -inline bool PlSP2BTree::SPabove(int i, int j) const -{ - return (_XXinverse[i] < _XXinverse[j] && _YYinverse[i] > _YYinverse[j]); -} -// -------------------------------------------------------- -inline bool PlSP2BTree::SPbelow(int i, int j) const -{ - return SPabove(j, i); -} -// -------------------------------------------------------- - -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/ParquetFP/src/pltobtree.cxx b/src/mpl/src/ParquetFP/src/pltobtree.cxx deleted file mode 100644 index 68711880d11..00000000000 --- a/src/mpl/src/ParquetFP/src/pltobtree.cxx +++ /dev/null @@ -1,447 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#include "pltobtree.h" - -#include -#include -#include -#include -#include - -#include "plsptobtree.h" - -namespace parquetfp { - -using std::cout; -using std::endl; -using std::vector; - -const float Pl2BTree::Infty = basepacking_h::Dimension::Infty; -const int Pl2BTree::Undefined = basepacking_h::Dimension::Undefined; -const float Pl2BTree::Epsilon_Accuracy - = basepacking_h::Dimension::Epsilon_Accuracy; -float Pl2BTree::BuildTreeRecord::_epsilon = 0; -// -------------------------------------------------------- -void Pl2BTree::heuristic_build_tree() -{ - BuildTreeRecord::_epsilon = _epsilon; - - // -----initialize the list----- - vector treeRecord(_blocknum + 1); - for (int i = 0; i < _blocknum; i++) { - treeRecord[i].parent = _blocknum; // set as the LEFT-edge initially - treeRecord[i].treeLocIndex = i; - treeRecord[i].distance = _xloc[i]; // set as its xloc initially - - treeRecord[i].xStart = _xloc[i]; - treeRecord[i].xEnd = _xloc[i] + _widths[i]; - treeRecord[i].yStart = _yloc[i]; - treeRecord[i].yEnd = _yloc[i] + _heights[i]; - treeRecord[i].used = false; - } - treeRecord[_blocknum].parent = Undefined; - treeRecord[_blocknum].treeLocIndex = _blocknum; - treeRecord[_blocknum].distance = 0; - - treeRecord[_blocknum].xStart = 0; - treeRecord[_blocknum].xEnd = 0; - treeRecord[_blocknum].yStart = 0; - treeRecord[_blocknum].yEnd = Infty; - treeRecord[_blocknum].used = true; - - // determine the real (otree) parent of each node, maybe unchanged - for (int i = 0; i < _blocknum; i++) { - float minDistance = treeRecord[i].distance; - for (int j = 0; j < _blocknum; j++) { - if (i != j) { - // if overlap in y-span occurs (compact to the left) - if (treeRecord[i].yEnd > treeRecord[j].yStart + _epsilon - && treeRecord[j].yEnd > treeRecord[i].yStart + _epsilon) { - float tempDistance - = BuildTreeRecord::getDistance(treeRecord[i], treeRecord[j]); - - // break ties - if (tempDistance < minDistance) { - treeRecord[i].parent = j; - minDistance = tempDistance; - } - } - } - } - } - - for (int treeNodeCount = 0; treeNodeCount < _blocknum; treeNodeCount++) { - // -----add a block to the B*-Tree----- - vector::iterator min_ptr = min_element( - treeRecord.begin(), treeRecord.end(), ValidCriterion(treeRecord)); - - build_tree_add_block(*min_ptr); - min_ptr->used = true; - - // -----update the rest of the list----- - int currBlock = min_ptr->treeLocIndex; - for (int tempBlock = 0; tempBlock < _blocknum; tempBlock++) - if (!treeRecord[tempBlock].used) { - // determine the distance of removed block from this block - float tempDistance = BuildTreeRecord::getDistance( - treeRecord[tempBlock], treeRecord[currBlock]); - - // determine whether to update and update if necessary - treeRecord[tempBlock].distance - = std::min(treeRecord[tempBlock].distance, tempDistance); - } - - // OutputBTree(cout, _btree); - // cin.get(); - } // end while (!treeRecord.empty) -} -// -------------------------------------------------------- -void Pl2BTree::build_tree_add_block(const Pl2BTree::BuildTreeRecord& btr) -{ - // printf("block %d added with block %d as its otree-parent\n", - // btr.treeLocIndex, btr.parent); - - int currBlock = btr.treeLocIndex; - int otree_parent = btr.parent; - if (_btree[otree_parent].left == Undefined) { - _btree[otree_parent].left = currBlock; - _btree[currBlock].parent = otree_parent; - } else { - int tree_prev = otree_parent; - int tree_curr = _btree[otree_parent].left; - while ((tree_curr != Undefined) && (_yloc[tree_curr] < _yloc[currBlock])) { - tree_prev = tree_curr; - tree_curr = _btree[tree_curr].right; - } - - // printf("tree_curr: %d tree_prev: %d\n", tree_curr, tree_prev); - // printf("YLOC: tree_curr: %.2lf currBlock: %.2lf tree_prev: - // %.2lf\n", - // (tree_curr != Undefined)? _yloc[tree_curr] : -1, - // _yloc[currBlock], _yloc[tree_prev]); - - if ((tree_curr != Undefined) && (tree_curr == _btree[tree_prev].left)) - _btree[tree_prev].left = currBlock; - else - _btree[tree_prev].right = currBlock; - _btree[currBlock].parent = tree_prev; - - _btree[currBlock].right = tree_curr; // possibly Undefined - if (tree_curr != Undefined) - _btree[tree_curr].parent = currBlock; - } -} -// -------------------------------------------------------- -float Pl2BTree::BuildTreeRecord::getDistance(const BuildTreeRecord& btr1, - const BuildTreeRecord& btr2) -{ - float tempDistance = btr1.xStart - btr2.xEnd; // tempXlocStart - currXlocEnd; - - if (btr1.yEnd < btr2.yStart + _epsilon || // only count if y-spans overlap - btr2.yEnd < btr1.yStart + _epsilon) - tempDistance = Infty; - - else if (tempDistance < -1 * _epsilon) // horizontal overlap? not necessary - { - if (btr2.xStart < btr1.xEnd - _epsilon) // horizontal overlap - { - if ((btr1.yEnd > btr2.yStart + _epsilon) - && (btr1.yStart < btr2.yEnd - _epsilon)) - tempDistance = 0; // real overlap, push it horizontally - else - tempDistance = Infty; // no overlap, treat it as no-edge - } else - tempDistance = Infty; - } - - return std::max(tempDistance, float(0.0)); -} -// -------------------------------------------------------- -bool Pl2BTree::BuildTreeRecord::operator<(const BuildTreeRecord& btr) const -{ - float difference = distance - btr.distance; - if (std::abs(difference) < _epsilon) { - if (xEnd < btr.xStart + _epsilon) // break ties by x-span (L > R) - return true; - else if (btr.xEnd < xStart + _epsilon) - return false; - - if (yEnd < btr.yStart + _epsilon) // break ties by y-span (T > B) - return true; - else if (btr.yEnd < yStart + _epsilon) - return false; - else - return false; // two blocks overlap, whatever - } else - return difference < 0; -} -// -------------------------------------------------------- -bool Pl2BTree::ValidCriterion::operator()(const BuildTreeRecord& btr1, - const BuildTreeRecord& btr2) const -{ - if (btr1.used) - return false; - - else if (btr2.used) // btr1 is not used - return true; - - else if (!btr_vec[btr1.parent].used) - return false; - - else if (!btr_vec[btr2.parent].used) // parent of btr1 is used - return true; - - else - return btr1 < btr2; -} -// -------------------------------------------------------- -void Pl2BTree::TCG_build_tree() -{ - vector> TCGMatrixVert(_blocknum, vector(_blocknum, false)); - vector> TCGMatrixHoriz(TCGMatrixVert); - - // set up the immediate constraints - for (int i = 0; i < _blocknum; ++i) { - for (int j = 0; j <= i; ++j) { - float horizOverlap = 0; - float vertOverlap = 0; - unsigned vertOverlapDir = 0; - unsigned horizOverlapDir = 0; - - if (i == j) { - TCGMatrixHoriz[i][j] = true; - TCGMatrixVert[i][j] = true; - continue; - } - - // i != j - TCGMatrixHoriz[i][j] = false; - TCGMatrixVert[i][j] = false; - TCGMatrixHoriz[j][i] = false; - TCGMatrixVert[j][i] = false; - - float iXStart = _xloc[i]; - float iXEnd = _xloc[i] + _widths[i]; - float jXStart = _xloc[j]; - float jXEnd = _xloc[j] + _widths[j]; - - float iYStart = _yloc[i]; - float iYEnd = _yloc[i] + _heights[i]; - float jYStart = _yloc[j]; - float jYEnd = _yloc[j] + _heights[j]; - - // horizontal constraint - if (jYStart < iYEnd - _epsilon && iYStart < jYEnd - _epsilon) { - if (jYStart < iYStart && jYEnd < iYEnd) { - vertOverlap = jYEnd - iYStart; // lower overlap (j lower i) - vertOverlapDir = 0; - } else if (jYStart > iYStart) // (jYEnd <= iYEnd) - { - vertOverlap = jYEnd - jYStart; // inner overlap (j inner i) - if (iYEnd - jYEnd > jYStart - iYStart) - vertOverlapDir = 0; - else - vertOverlapDir = 1; - } else if (jYEnd > iYEnd) // (jYStart <= iYstart) - { - vertOverlap = iYEnd - jYStart; // upper overlap (j upper i) - vertOverlapDir = 1; - } else // (jYStart <= iYStart && jYEnd > iYEnd) - { - vertOverlap = iYEnd - iYStart; // outer overlap (j outer i) - if (jYEnd - iYEnd > iYStart - jYStart) - vertOverlapDir = 1; - else - vertOverlapDir = 0; - } - } else - TCGMatrixHoriz[i][j] = false; // no overlap - - // vertical constraint - if (jXStart < iXEnd - _epsilon && iXStart < jXEnd - _epsilon) { - if (jXStart < iXStart && jXEnd < iXEnd) { - horizOverlap = jXEnd - iXStart; // left overlap (j left i) - horizOverlapDir = 0; - } else if (jXEnd < iXEnd) // (jXStart >= iXStart) - { - horizOverlap = jXEnd - jXStart; // inner overlap (j inner i) - if (iXEnd - jXEnd > jXStart - iXStart) - horizOverlapDir = 0; - else - horizOverlapDir = 1; - } else if (jXStart > iXStart) // (jXEnd >= iXEnd) - { - horizOverlap = iXEnd - jXStart; // right overlap (j right i) - horizOverlapDir = 1; - } else // (jXStart < iXStart) && (jXEnd >= iXEnd) - { - horizOverlap = iXEnd - iXStart; // outer overlap (j out i) - if (jXEnd - iXEnd > iXStart - jXStart) - horizOverlapDir = 1; - else - horizOverlapDir = 0; - } - } else - TCGMatrixVert[i][j] = false; // no overlap - - // determine edge in TCG's - if (vertOverlap != 0 && horizOverlap == 0) { - if (iXStart <= jXStart) - TCGMatrixHoriz[i][j] = true; - else - TCGMatrixHoriz[j][i] = true; - } else if (horizOverlap != 0 && vertOverlap == 0) { - if (iYStart <= jYStart) - TCGMatrixVert[i][j] = true; - else - TCGMatrixVert[j][i] = true; - } - // overlapping - else if (horizOverlap != 0 && vertOverlap != 0) { - if (vertOverlap >= horizOverlap) { - if (horizOverlapDir == 1) - TCGMatrixHoriz[i][j] = true; - else - TCGMatrixHoriz[j][i] = true; - } else { - if (vertOverlapDir == 1) - TCGMatrixVert[i][j] = true; - else - TCGMatrixVert[j][i] = true; - } - } - } - } - - // floyd marshal to find transitive closure - // TCG_FM(TCGMatrixHoriz, TCGMatrixVert); - - // dynamic programming DFS algo to find transitive closure - TCG_DP(TCGMatrixHoriz); - TCG_DP(TCGMatrixVert); - - // find ties and break them - for (int i = 0; i < _blocknum; ++i) { - for (int j = 0; j < _blocknum; ++j) { - if (i == j) - continue; - - if (TCGMatrixHoriz[i][j] && TCGMatrixHoriz[j][i]) { - cout << "ERROR in TCG 1 " << i << "\t" << j << endl; - } - - if (TCGMatrixVert[i][j] && TCGMatrixVert[j][i]) { - cout << "ERROR in TCG 2 " << i << "\t" << j << endl; - } - - unsigned ctr = 0; - if (TCGMatrixHoriz[i][j]) - ++ctr; - if (TCGMatrixHoriz[j][i]) - ++ctr; - if (TCGMatrixVert[i][j]) - ++ctr; - if (TCGMatrixVert[j][i]) - ++ctr; - - if (ctr > 1) { - unsigned dir = rand() % 2; - if (dir == 0) // H constraint - { - TCGMatrixVert[i][j] = false; - TCGMatrixVert[j][i] = false; - } else // V constraint - { - TCGMatrixHoriz[i][j] = false; - TCGMatrixHoriz[j][i] = false; - } - } - - // no constraint between the blocks - if (!TCGMatrixHoriz[i][j] && !TCGMatrixHoriz[j][i] && !TCGMatrixVert[i][j] - && !TCGMatrixVert[j][i]) { - TCGMatrixHoriz[i][j] = (_xloc[i] < _xloc[j]); - } - } - } - - // get the sequence pair now - for (int i = 0; i < _blocknum; ++i) { - _XX[i] = i; - _YY[i] = i; - } - sort(_XX.begin(), _XX.end(), SPXRelation(TCGMatrixHoriz, TCGMatrixVert)); - sort(_YY.begin(), _YY.end(), SPYRelation(TCGMatrixHoriz, TCGMatrixVert)); - - PlSP2BTree plsp2btree(_xloc, _yloc, _widths, _heights, _XX, _YY); - _btree = plsp2btree.btree(); -} -// -------------------------------------------------------- -void Pl2BTree::TCG_DP(vector>& TCGMatrix) -{ - vector> adjMatrix(TCGMatrix); - vector pre(_blocknum, Undefined); - - for (int i = 0; i < _blocknum; ++i) - fill(TCGMatrix[i].begin(), TCGMatrix[i].end(), false); - - _count = 0; - for (int i = 0; i < _blocknum; ++i) - if (pre[i] == -1) - TCGDfs(TCGMatrix, adjMatrix, i, pre); -} -// -------------------------------------------------------- -void Pl2BTree::TCGDfs(vector>& TCGMatrix, - const vector>& adjMatrix, - int v, - vector& pre) -{ - pre[v] = _count; - _count++; - for (int u = 0; u < _blocknum; ++u) { - if (adjMatrix[v][u]) { - TCGMatrix[v][u] = true; - if (pre[u] > pre[v]) // taken care of already - continue; - - if (pre[u] == Undefined) - TCGDfs(TCGMatrix, adjMatrix, u, pre); - - for (int i = 0; i < _blocknum; ++i) - if (TCGMatrix[u][i]) - TCGMatrix[v][i] = true; - } - } -} - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/pltobtree.h b/src/mpl/src/ParquetFP/src/pltobtree.h deleted file mode 100644 index 28e86b754fc..00000000000 --- a/src/mpl/src/ParquetFP/src/pltobtree.h +++ /dev/null @@ -1,281 +0,0 @@ -/************************************************************************** -*** -*** Copyright (c) 2000-2006 Regents of the University of Michigan, -*** Saurabh N. Adya, Hayward Chan, Jarrod A. Roy -*** and Igor L. Markov -*** -*** Contact author(s): sadya@umich.edu, imarkov@umich.edu -*** Original Affiliation: University of Michigan, EECS Dept. -*** Ann Arbor, MI 48109-2122 USA -*** -*** Permission is hereby granted, free of charge, to any person obtaining -*** a copy of this software and associated documentation files (the -*** "Software"), to deal in the Software without restriction, including -*** without limitation -*** the rights to use, copy, modify, merge, publish, distribute, sublicense, -*** and/or sell copies of the Software, and to permit persons to whom the -*** Software is furnished to do so, subject to the following conditions: -*** -*** The above copyright notice and this permission notice shall be included -*** in all copies or substantial portions of the Software. -*** -*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -*** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -*** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -*** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -*** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -*** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -*** THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*** -*** -***************************************************************************/ - -#ifndef PLTOBTREE_H -#define PLTOBTREE_H - -#include "basepacking.h" -#include "btree.h" - -namespace parquetfp { - -// -------------------------------------------------------- -class Pl2BTree -{ - public: - enum AlgoType - { - HEURISTIC, - TCG - }; - - inline Pl2BTree(const std::vector& n_xloc, - const std::vector& n_yloc, - const std::vector& n_widths, - const std::vector& n_heights, - AlgoType algo); - - inline const std::vector& btree() const; - inline const std::vector& getXX() const; - inline const std::vector& getYY() const; - - static const float Infty; - static const int Undefined; // = basepacking_h::Dimension::Undefined; - static const float - Epsilon_Accuracy; // = basepacking_h::Dimension::Epsilon_Accuracy; - - private: - const std::vector& _xloc; - const std::vector& _yloc; - const std::vector& _widths; - const std::vector& _heights; - const int _blocknum; - const float _epsilon; - - std::vector _btree; - - inline void initializeTree(); - inline float get_epsilon() const; - - // heuristic O(n^2) algo, usu. works for compacted packings - class BuildTreeRecord - { - public: - int parent; - int treeLocIndex; - float distance; - float yDistance; - - float xStart; - float xEnd; - float yStart; - float yEnd; - bool used; - - bool operator<(const BuildTreeRecord& btr) const; - - static float _epsilon; - static float getDistance(const BuildTreeRecord& btr1, - const BuildTreeRecord& btr2); - }; - - class ValidCriterion // only compare relevant elements - { - public: - inline ValidCriterion(const std::vector& new_btr_vec); - bool operator()(const BuildTreeRecord& btr1, - const BuildTreeRecord& btr2) const; - - const std::vector& btr_vec; - }; - - void heuristic_build_tree(); - void build_tree_add_block(const BuildTreeRecord& btr); - - // tcg-based algo, always work - int _count; - std::vector _XX; - std::vector _YY; - void TCG_build_tree(); - - // DP to find TCG - void TCG_DP(std::vector>& TCGMatrix); - void TCGDfs(std::vector>& TCGMatrix, - const std::vector>& adjMatrix, - int v, - std::vector& pre); - - class SPXRelation - { - public: - SPXRelation(const std::vector>& TCGMatrixHorizIP, - const std::vector>& TCGMatrixVertIP) - : TCGMatrixHoriz(TCGMatrixHorizIP), TCGMatrixVert(TCGMatrixVertIP) - { - } - - inline bool operator()(int i, int j) const; - - private: - const std::vector>& TCGMatrixHoriz; - const std::vector>& TCGMatrixVert; - }; - - class SPYRelation - { - public: - SPYRelation(const std::vector>& TCGMatrixHorizIP, - const std::vector>& TCGMatrixVertIP) - : TCGMatrixHoriz(TCGMatrixHorizIP), TCGMatrixVert(TCGMatrixVertIP) - { - } - - inline bool operator()(int i, int j) const; - - private: - const std::vector>& TCGMatrixHoriz; - const std::vector>& TCGMatrixVert; - }; -}; -// -------------------------------------------------------- - -// =============== -// IMPLEMENTATIONS -// =============== -Pl2BTree::Pl2BTree(const std::vector& n_xloc, - const std::vector& n_yloc, - const std::vector& n_widths, - const std::vector& n_heights, - Pl2BTree::AlgoType algo) - : _xloc(n_xloc), - _yloc(n_yloc), - _widths(n_widths), - _heights(n_heights), - _blocknum(n_xloc.size()), - _epsilon(get_epsilon()), - _btree(n_xloc.size() + 2), - _count(Undefined), - _XX(_blocknum, Undefined), - _YY(_blocknum, Undefined) -{ - initializeTree(); - switch (algo) { - case HEURISTIC: - heuristic_build_tree(); - break; - - case TCG: - TCG_build_tree(); - break; - - default: - std::cout << "ERROR: invalid algorithm specified for Pl2BTree()." - << std::endl; - exit(1); - } -} -// -------------------------------------------------------- -void Pl2BTree::initializeTree() -{ - int vec_size = int(_btree.size()); - for (int i = 0; i < vec_size; i++) { - _btree[i].parent = _blocknum; - _btree[i].left = Undefined; - _btree[i].right = Undefined; - _btree[i].block_index = i; - _btree[i].orient = 0; - } - - _btree[_blocknum].parent = Undefined; - _btree[_blocknum].left = Undefined; - _btree[_blocknum].right = Undefined; - _btree[_blocknum].block_index = _blocknum; - _btree[_blocknum].orient = Undefined; - - _btree[_blocknum + 1].parent = _blocknum; - _btree[_blocknum + 1].left = Undefined; - _btree[_blocknum + 1].right = Undefined; - _btree[_blocknum + 1].block_index = _blocknum + 1; - _btree[_blocknum + 1].orient = Undefined; -} -// -------------------------------------------------------- -float Pl2BTree::get_epsilon() const -{ - float ep = Infty; - for (int i = 0; i < _blocknum; i++) - ep = std::min(ep, std::min(_widths[i], _heights[i])); - ep /= Epsilon_Accuracy; - return ep; -} -// -------------------------------------------------------- -const std::vector& Pl2BTree::btree() const -{ - return _btree; -} -// -------------------------------------------------------- -const std::vector& Pl2BTree::getXX() const -{ - return _XX; -} -// -------------------------------------------------------- -const std::vector& Pl2BTree::getYY() const -{ - return _YY; -} -// -------------------------------------------------------- -Pl2BTree::ValidCriterion::ValidCriterion( - const std::vector& new_btr_vec) - : btr_vec(new_btr_vec) -{ -} -// -------------------------------------------------------- -bool Pl2BTree::SPXRelation::operator()(int i, int j) const -{ - if (TCGMatrixHoriz[i][j]) - return true; - else if (TCGMatrixHoriz[j][i]) - return false; - else if (TCGMatrixVert[j][i]) - return true; - else if (TCGMatrixVert[i][j]) - return false; - else - return i < j; -} -// -------------------------------------------------------- -bool Pl2BTree::SPYRelation::operator()(int i, int j) const -{ - if (TCGMatrixHoriz[i][j]) - return true; - else if (TCGMatrixHoriz[j][i]) - return false; - else if (TCGMatrixVert[j][i]) - return false; - else if (TCGMatrixVert[i][j]) - return true; - else - return i < j; -} -// -------------------------------------------------------- - -} // namespace parquetfp -#endif diff --git a/src/mpl/src/ParquetFP/src/skyline.cxx b/src/mpl/src/ParquetFP/src/skyline.cxx deleted file mode 100644 index 4afa1997696..00000000000 --- a/src/mpl/src/ParquetFP/src/skyline.cxx +++ /dev/null @@ -1,439 +0,0 @@ -#include "skyline.h" - -#include -#include - -using std::cout; -using std::endl; - -namespace parquetfp { - -// A divide and conquer based C++ program to find skyline of given -// buildings - -// -// Strip Structure Definition -// -Strip::Strip(float _left, float _height, int _index) -{ - left = _left; - ht = _height; - index = _index; -} -void Strip::print() -{ - cout << "Left: " << left << " Height: " << ht << " index: " << index << endl; -} - -// -// Skyline Structure Definition -// - -Skyline::Skyline(const Skyline& prev) -{ - this->capacity = prev.n; - this->n = prev.n; - - this->arr = new Strip[this->capacity]; - for (int i = 0; i < this->n; i++) { - this->arr[i] = prev.arr[i]; - } -} - -Skyline::Skyline() : arr(0), capacity(0), n(0) -{ -} - -Skyline::Skyline(int cap) -{ - capacity = cap; - // cout << "CAP: " << cap << endl; - arr = new Strip[cap]; - n = 0; -} - -Skyline::~Skyline() -{ - if (arr) { - delete[] arr; - } - arr = 0; - capacity = 0; -} - -void Skyline::append(Strip* st) -{ - // Check for redundant strip, a strip is - // redundant if it has same height or left as previous - if (n > 0 && arr[n - 1].ht == st->ht) { - return; - } - if (n > 0 && arr[n - 1].left == st->left) { - // arr[n-1].ht = max(arr[n-1].ht, st->ht); - if (arr[n - 1].ht < st->ht) { - arr[n - 1].ht = st->ht; - arr[n - 1].index = st->index; - } - return; - } - arr[n] = *st; - n++; -} - -void Skyline::print() -{ - for (int i = 0; i < n; i++) { - cout << i << " Left:" << arr[i].left << " Height:" << arr[i].ht - << " Index:" << arr[i].index << endl; - } - cout << endl; -} - -// This function returns skyline for a given array of buildings -// arr[l..h]. This function is similar to mergeSort(). -Skyline* findSkyline(std::vector& arr, int l, int h) -{ - if (l == h) { - Skyline* res = new Skyline(2); - Strip left(arr[l].left, arr[l].height, arr[l].idx); - Strip right(arr[l].right, 0, arr[l].idx); - - res->append(&left); - res->append(&right); - // cout << "recursive End: " << endl; - // res->print(); - return res; - } - - int mid = (l + h) / 2; - - // Recur for left and right halves and merge the two results - Skyline* sl = findSkyline(arr, l, mid); - Skyline* sr = findSkyline(arr, mid + 1, h); - Skyline* res = sl->Merge(sr); - - // To avoid memory leak - delete sl; - delete sr; - - // Return merged skyline - return res; -} - -// Similar to merge() in MergeSort -// This function merges another skyline 'other' to the skyline -// for which it is called. The function returns pointer to -// the resultant skyline -Skyline* Skyline::Merge(Skyline* other) -{ - // cout << "Merge: below Two Lists" << endl; - // cout << "this" << endl; - // this->print(); - // cout << "other" << endl; - // other->print(); - // cout << endl; - - // Create a resultant skyline with capacity as sum of two - // skylines - Skyline* res = new Skyline(this->n + other->n); - - // To store current heights of two skylines - float h1 = 0, h2 = 0; - - // Indexes of strips in two skylines - int i = 0, j = 0; - int idx1 = 0, idx2 = 0; - - while (i < this->n && j < other->n) { - // Compare x coordinates of left sides of two - // skylines and put the smaller one in result - if (this->arr[i].left < other->arr[j].left) { - float x1 = this->arr[i].left; - h1 = this->arr[i].ht; - idx1 = this->arr[i].index; - - // Choose height as max of two heights - float maxh = fmax(h1, h2); - - // cout << "icase" << endl; - // cout << "i-j: " << i << " " << j << endl; - // cout << "h1-h2: " << h1 << " " << h2 << " " << endl; - // cout << "idx1-idx2: " << idx1 << " " << idx2 << endl << endl; - - Strip curStrip(x1, maxh, (h1 > h2) ? idx1 : idx2); - res->append(&curStrip); - i++; - } else if (this->arr[i].left > other->arr[j].left) { - float x2 = other->arr[j].left; - h2 = other->arr[j].ht; - idx2 = other->arr[j].index; - - float maxh = fmax(h1, h2); - - // cout << "jcase" << endl; - // cout << "i-j: " << i << " " << j << endl; - // cout << "h1-h2: " << h1 << " " << h2 << endl; - // cout << "idx1-idx2: " << idx1 << " " << idx2 << endl << endl; - - Strip curStrip(x2, maxh, (h1 > h2) ? idx1 : idx2); - res->append(&curStrip); - j++; - } - // below x1 and x2 is same cases - else { - float x1 = this->arr[i].left; - h1 = this->arr[i].ht; - idx1 = this->arr[i].index; - - // float x2 = other->arr[j].left; - h2 = other->arr[j].ht; - idx2 = other->arr[j].index; - - float maxh = fmax(h1, h2); - - // here x1 and x2 is same - Strip curStrip(x1, maxh, (h1 > h2) ? idx1 : idx2); - res->append(&curStrip); - i++; - j++; - } - } - - // If there are strips left in this skyline or other - // skyline - while (i < this->n) { - res->append(&arr[i]); - i++; - } - while (j < other->n) { - res->append(&other->arr[j]); - j++; - } - - // cout << "after merged: " << endl; - // res->print(); - return res; -} - -Skyline* Skyline::copy() -{ - Skyline* newObj = new Skyline(n); - for (int i = 0; i < n; i++) { - newObj->arr[i] = this->arr[i]; - } - return newObj; -} - -SkylineContour::SkylineContour() - : skyline_(0), width_(FLT_MIN), height_(FLT_MIN) -{ -} - -SkylineContour::SkylineContour(int capacity) - : skyline_(0), width_(FLT_MIN), height_(FLT_MIN) -{ -} - -SkylineContour::SkylineContour(const SkylineContour& prev) - : width_(prev.width_), height_(prev.height_), bTreeInfo_(prev.bTreeInfo_) -{ - if (prev.skyline_) { - skyline_ = prev.skyline_->copy(); - } else { - skyline_ = 0; - } -} - -// build from ParquetFP's BTree -// consider rotation of macro cells. -SkylineContour::SkylineContour(const BTree& bTree, bool isRotate) - : skyline_(0), width_(FLT_MIN), height_(FLT_MIN) -{ - bTreeInfo_.reserve(bTree.NUM_BLOCKS); - for (int i = 0; i < bTree.NUM_BLOCKS; i++) { - // left, right, height, index - - if (!isRotate) { - InsertBtreeNode(bTree.xloc(i), - bTree.xloc(i) + bTree.width(i), - bTree.yloc(i) + bTree.height(i), - i); - } else { - InsertBtreeNode(bTree.yloc(i), - bTree.yloc(i) + bTree.height(i), - bTree.xloc(i) + bTree.width(i), - i); - } - } - EvaluateContour(); -} - -bool SkylineContour::operator=(const SkylineContour& prev) -{ - width_ = prev.width_; - height_ = prev.height_; - bTreeInfo_ = prev.bTreeInfo_; - if (prev.skyline_) { - skyline_ = prev.skyline_->copy(); - } else { - skyline_ = 0; - } - return true; -} -SkylineContour::~SkylineContour() -{ - Clear(); -} - -void SkylineContour::Clear() -{ - if (skyline_) { - delete skyline_; - skyline_ = 0; - } - width_ = height_ = 0; - std::vector().swap(bTreeInfo_); -} - -void SkylineContour::InsertBtreeNode(float _left, - float _right, - float _height, - int _idx) -{ - // cout << _left << " " << _right << " " << _height << " " << _idx << endl; - // cout << "bTreeInfoSize: " << bTreeInfo_.size() << endl; - bTreeInfo_.push_back(SkylineContour::BTreeNode(_left, _right, _height, _idx)); -} - -// Evaluate Contour -void SkylineContour::EvaluateContour() -{ - if (skyline_) { - delete skyline_; - } - skyline_ = findSkyline(bTreeInfo_, 0, bTreeInfo_.size() - 1); - height_ = 0; - for (int i = 0; i < skyline_->count(); i++) { - height_ = (height_ < skyline_->arr[i].ht) ? skyline_->arr[i].ht : height_; - } - - width_ = skyline_->arr[skyline_->count() - 1].left; -} - -// traverse the Skyline Contour and get maximum heights -// between [left, right] -float SkylineContour::GetHeight(float left, float right) -{ - if (!skyline_) { - return 0; - } - - float height = 0; - - for (int i = 0; i < skyline_->count() - 1; i++) { - float lx = fmax(left, skyline_->arr[i].left); - float ux = fmin(right, skyline_->arr[i + 1].left); - if (lx >= ux) { - continue; - } - cout << "seg: " << lx << " " << ux << " " << skyline_->arr[i].ht << endl; - height = (height < skyline_->arr[i].ht) ? skyline_->arr[i].ht : height; - } - - cout << "return height: " << height << endl; - return height; -} - -std::pair SkylineContour::GetHeightWithIdx(float left, float right) -{ - if (!skyline_) { - return std::make_pair(0, -1); - } - - float height = 0; - int idx = -1; - - for (int i = 0; i < skyline_->count() - 1; i++) { - float lx = fmax(left, skyline_->arr[i].left); - float ux = fmin(right, skyline_->arr[i + 1].left); - if (lx >= ux) { - continue; - } - cout << "seg: " << lx << " " << ux << " " << skyline_->arr[i].ht << endl; - if (height < skyline_->arr[i].ht) { - height = skyline_->arr[i].ht; - idx = skyline_->arr[i].index; - } - } - - cout << "return height: " << height << endl; - return std::make_pair(height, idx); -} - -// extract ContourArea -float SkylineContour::GetContourArea() -{ - float area = 0.0f; - for (int i = 0; i < skyline_->count() - 1; i++) { - float prevPoint = skyline_->arr[i].left; - float nextPoint = skyline_->arr[i + 1].left; - // cout << prevPoint << " - " << nextPoint << " : " << - // skyline_->arr[i].ht << " " - // << (nextPoint - prevPoint) * skyline_->arr[i].ht << endl; - area += (nextPoint - prevPoint) * skyline_->arr[i].ht; - } - - // cout << "final: " << area << endl; - - return area; -} - -/* -int GetVal (int min, int max) { - return rand() % (max-min) + min; -} - -float GetRandFloat () { - return 1000.0f * static_cast (rand()) / static_cast -(RAND_MAX); -} - -// drive program -int main() -{ - int num = 200000; - Block* arr = NULL; - arr = new Block[num]; - - for(int i=0; iprint(); - delete ptr; - - return 0; -} -*/ - -} // namespace parquetfp diff --git a/src/mpl/src/ParquetFP/src/skyline.h b/src/mpl/src/ParquetFP/src/skyline.h deleted file mode 100644 index 6db0a006a16..00000000000 --- a/src/mpl/src/ParquetFP/src/skyline.h +++ /dev/null @@ -1,122 +0,0 @@ -#ifndef __SKYLINE_CONTOUR__ -#define __SKYLINE_CONTOUR__ 0 - -#include - -#include "btree.h" - -namespace parquetfp { - -// A structure for building -struct Block -{ - float left; // x coordinate of left side - float ht; // height - float right; // x coordinate of right side -}; - -// A strip in skyline -class Strip -{ - private: - float left; // x coordinate of left side - float ht; // height - int index; // original index - - public: - Strip(float _left = 0.0f, float _height = 0.0f, int _index = -1); - - void print(); - friend class Skyline; - friend class SkylineContour; -}; - -// Skyline: To represent Output (An array of strips) -class Skyline -{ - private: - Strip* arr; // Array of strips - int capacity; // Capacity of strip array - int n; // Actual number of strips in array - - public: - // Constructor - Skyline(); - Skyline(const Skyline& prev); - Skyline(int cap); - ~Skyline(); - - int count() { return n; } - - // A function to merge another skyline - // to this skyline - Skyline* Merge(Skyline* other); - - // Function to add a strip 'st' to array - void append(Strip* st); - - // A utility function to print all strips of - // skyline - void print(); - - Skyline* copy(); - - friend class BTree; - friend class SkylineContour; -}; - -class SkylineContour -{ - public: - // Incremental BTree Node Information - class BTreeNode - { - public: - float left; - float right; - float height; - int idx; - BTreeNode(float _left, float _right, float _height, int _idx) - : left(_left), right(_right), height(_height), idx(_idx){}; - }; - - // Contour Node Information - class ContourNode - { - public: - float begin; - float end; - float height; - }; - - private: - // Strip strips_[5000]; - Skyline* skyline_; - float width_; - float height_; - - // contourInfo_ is updated from skyline_ - std::vector bTreeInfo_; - - public: - SkylineContour(); - SkylineContour(int capacity); - SkylineContour(const SkylineContour& prev); - bool operator=(const SkylineContour& prev); - SkylineContour(const BTree& bTree, bool isRotate = false); - ~SkylineContour(); - - void Clear(); - - void InsertBtreeNode(float _left, float _right, float _height, int _idx); - void EvaluateContour(); - float Width() { return width_; }; - float Height() { return height_; }; - float GetHeight(float left, float right); - float GetContourArea(); - std::pair GetHeightWithIdx(float left, float right); -}; - -} // namespace parquetfp - -#endif diff --git a/src/mpl/src/Partition.cpp b/src/mpl/src/Partition.cpp deleted file mode 100644 index 10f6a7dbeef..00000000000 --- a/src/mpl/src/Partition.cpp +++ /dev/null @@ -1,409 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2019-2020, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#include "mpl/Partition.h" - -#include "btreeanneal.h" -#include "mixedpackingfromdb.h" -#include "mpl/MacroPlacer.h" -#include "utl/Logger.h" - -namespace mpl { - -using std::make_pair; -using std::max; -using std::min; -using std::to_string; - -using utl::MPL; - -Partition::Partition(PartClass _partClass, - double _lx, - double _ly, - double _width, - double _height, - MacroPlacer* macro_placer, - utl::Logger* log) - : partClass(_partClass), - lx(_lx), - ly(_ly), - width(_width), - height(_height), - solution_width(0.0), - solution_height(0.0), - logger_(log), - macro_placer_(macro_placer) -{ -} - -#define EAST_IDX (macros_.size() + coreEdgeIndex(CoreEdge::East)) -#define WEST_IDX (macros_.size() + coreEdgeIndex(CoreEdge::West)) -#define NORTH_IDX (macros_.size() + coreEdgeIndex(CoreEdge::North)) -#define SOUTH_IDX (macros_.size() + coreEdgeIndex(CoreEdge::South)) - -#define GLOBAL_EAST_IDX \ - (macro_placer_->macroCount() + coreEdgeIndex(CoreEdge::East)) -#define GLOBAL_WEST_IDX \ - (macro_placer_->macroCount() + coreEdgeIndex(CoreEdge::West)) -#define GLOBAL_NORTH_IDX \ - (macro_placer_->macroCount() + coreEdgeIndex(CoreEdge::North)) -#define GLOBAL_SOUTH_IDX \ - (macro_placer_->macroCount() + coreEdgeIndex(CoreEdge::South)) - -string Partition::getName(int macroIdx) -{ - if (macroIdx < macros_.size()) { - return macros_[macroIdx].name(); - } else { - return coreEdgeString(coreEdgeFromIndex(macroIdx - macros_.size())); - } -} - -void Partition::fillNetlistTable(MacroPartMap& macroPartMap) -{ - int macro_edge_count = macros_.size() + core_edge_count; - net_tbl_.resize(macro_edge_count * macro_edge_count); - - if (partClass == ALL) { - for (size_t i = 0; i < macro_edge_count; i++) { - for (size_t j = 0; j < macro_edge_count; j++) { - // Note that net_tbl only entries for i < j. - net_tbl_[i * macro_edge_count + j] = macro_placer_->weight(i, j); - } - } - } else { - for (size_t i = 0; i < net_tbl_.size(); i++) { - net_tbl_[i] = 0.0; - } - - // row - for (size_t i = 0; i < macro_edge_count; i++) { - // column - for (size_t j = 0; j < macro_edge_count; j++) { - if (i == j) - continue; - // from: macro case - if (i < macros_.size()) { - int global_idx1 = globalIndex(i); - // to macro case - if (j < macros_.size()) { - int global_idx2 = globalIndex(j); - net_tbl_[i * macro_edge_count + j] - = macro_placer_->weight(global_idx1, global_idx2); - } - // to IO-west case - else if (j == WEST_IDX) { - int weight = macro_placer_->weight(global_idx1, GLOBAL_WEST_IDX); - if (partClass == PartClass::NE) { - for (auto& macro_idx : macroPartMap[PartClass::NW]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - if (partClass == PartClass::SE) { - for (auto& macro_idx : macroPartMap[PartClass::SW]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - net_tbl_[i * macro_edge_count + j] = weight; - } else if (j == EAST_IDX) { - int weight = macro_placer_->weight(global_idx1, GLOBAL_EAST_IDX); - if (partClass == PartClass::NW) { - for (auto& macro_idx : macroPartMap[PartClass::NE]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - if (partClass == PartClass::SW) { - for (auto& macro_idx : macroPartMap[PartClass::SE]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - net_tbl_[i * macro_edge_count + j] = weight; - } else if (j == NORTH_IDX) { - int weight = macro_placer_->weight(global_idx1, GLOBAL_NORTH_IDX); - if (partClass == PartClass::SE) { - for (auto& macro_idx : macroPartMap[PartClass::SE]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - if (partClass == PartClass::SW) { - for (auto& macro_idx : macroPartMap[PartClass::NW]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - net_tbl_[i * macro_edge_count + j] = weight; - } else if (j == SOUTH_IDX) { - int weight = macro_placer_->weight(global_idx1, GLOBAL_SOUTH_IDX); - - if (partClass == PartClass::NE) { - for (auto& macro_idx : macroPartMap[PartClass::SE]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - if (partClass == PartClass::NW) { - for (auto& macro_idx : macroPartMap[PartClass::SW]) { - weight += macro_placer_->weight(global_idx1, macro_idx); - } - } - net_tbl_[i * macro_edge_count + j] = weight; - } - } - // from IO - else if (i == WEST_IDX) { - // to Macro - if (j < macros_.size()) { - int global_idx2 = globalIndex(j); - net_tbl_[i * macro_edge_count + j] - = macro_placer_->weight(GLOBAL_WEST_IDX, global_idx2); - } - } else if (i == EAST_IDX) { - // to Macro - if (j < macros_.size()) { - int global_idx2 = globalIndex(j); - net_tbl_[i * macro_edge_count + j] - = macro_placer_->weight(GLOBAL_EAST_IDX, global_idx2); - } - } else if (i == NORTH_IDX) { - // to Macro - if (j < macros_.size()) { - int global_idx2 = globalIndex(j); - net_tbl_[i * macro_edge_count + j] - = macro_placer_->weight(GLOBAL_NORTH_IDX, global_idx2); - } - } else if (i == SOUTH_IDX) { - // to Macro - if (j < macros_.size()) { - int global_idx2 = globalIndex(j); - net_tbl_[i * macro_edge_count + j] - = macro_placer_->weight(GLOBAL_SOUTH_IDX, global_idx2); - } - } - } - } - } -} - -int Partition::globalIndex(int macro_idx) -{ - return macro_placer_->macroIndex(macros_[macro_idx].dbInstPtr); -} - -// Call ParquetFP -bool Partition::anneal() -{ - debugPrint(logger_, utl::MPL, "anneal", 1, "start anneal"); - // No macro, no need to execute - if (!macros_.empty()) { - // Populating DB structure - // Instantiate Parquet DB structure - DB db; - pfp::Nodes* pfp_nodes = db.getNodes(); - pfp::Nets* pfp_nets = db.getNets(); - - ////////////////////////////////////////////////////// - // Make node structures for macros. - for (auto& macro : macros_) { - // ParqueFP Node putHaloX/Y, putChannelX/Y are non-functional. - // Simulate them by expanding the macro size. - // Halo and 1/2 channel on both left/right top/bottom. - double padded_width = macro_placer_->paddedWidth(macro); - double padded_height = macro_placer_->paddedHeight(macro); - double aspect_ratio = padded_width / padded_height; - pfp::Node node(macro.name(), - padded_width * padded_height, - aspect_ratio, - aspect_ratio, - ¯o - ¯os_[0], - false); - - node.addSubBlockIndex(¯o - ¯os_[0]); - pfp_nodes->putNewNode(node); - } - - // Make node structures for pin edges. - int indexTerm = 0; - for (int i = 0; i < core_edge_count; i++) { - CoreEdge core_edge = coreEdgeFromIndex(i); - pfp::Node pin(coreEdgeString(core_edge), 0, 1, 1, indexTerm++, true); - double x = 0.0; - double y = 0.0; - switch (core_edge) { - case CoreEdge::West: - x = 0.0; - y = height / 2.0; - break; - case CoreEdge::East: - x = width; - y = height / 2.0; - break; - case CoreEdge::North: - x = width / 2.0; - y = height; - break; - case CoreEdge::South: - x = width / 2.0; - y = 0.0; - break; - } - pin.putX(x); - pin.putY(y); - pfp_nodes->putNewTerm(pin); - } - - ////////////////////////////////////////////////////// - // Feed net / weight structure - - // Preprocessing in macro placer side - // For nets and wts - int macro_edge_count = macros_.size() + core_edge_count; - int pnet_idx = 0; - for (size_t i = 0; i < macro_edge_count; i++) { - for (size_t j = i + 1; j < macro_edge_count; j++) { - int cost = 0; - if (!net_tbl_.empty()) { - // Note that net_tbl only has entries for i < j. - // This looks stupid because it is looking at ij and ji entries - // -cherry - cost = net_tbl_[i * macro_edge_count + j] - + net_tbl_[j * macro_edge_count + i]; - } - if (cost != 0) { - makePins(min(i, j), max(i, j), cost, pnet_idx, pfp_nets); - pnet_idx++; - } - } - } - - if (pnet_idx == 0) { - for (size_t i = 0; i < core_edge_count; i++) { - for (size_t j = i + 1; j < core_edge_count; j++) { - makePins(i, j, 1, pnet_idx, pfp_nets); - pnet_idx++; - } - } - } - - pfp_nets->updateNodeInfo(*pfp_nodes); - pfp_nodes->updatePinsInfo(*pfp_nets); - - // Populate MixedBlockInfoType object - // It is from DB object - MixedBlockInfoTypeFromDB dbBlockInfo(db); - MixedBlockInfoType* blockInfo = &dbBlockInfo; - - // Populate Command_Line options. - pfp::Command_Line param; - param.minWL = true; - param.noRotation = true; - param.FPrep = "BTree"; - param.seed = 100; - param.scaleTerms = false; - - // Fixed-outline mode in Parquet - param.nonTrivialOutline = pfp::BBox(0, 0, width, height); - param.reqdAR = width / height; - param.maxWS = 0; - param.verb = 0; - - // Instantiate BTreeAnnealer Object - pfp::BTreeAreaWireAnnealer* annealer - = new pfp::BTreeAreaWireAnnealer(*blockInfo, ¶m, &db); - annealer->go(); - - const pfp::BTree& sol = annealer->currSolution(); - solution_width = sol.totalWidth(); - solution_height = sol.totalHeight(); - delete annealer; - if (solution_width > width || solution_height > height) { - return false; - } - // flip info initialization for each partition - bool isFlipX = false, isFlipY = false; - switch (partClass) { - // y flip - case NW: - isFlipY = true; - break; - // x, y flip - case NE: - isFlipX = isFlipY = true; - break; - // NonFlip - case SW: - break; - // x flip - case SE: - isFlipX = true; - break; - // very weird - default: - break; - } - - // update partition macro locations - for (size_t i = 0; i < pfp_nodes->getNumNodes(); i++) { - pfp::Node& node = pfp_nodes->getNode(i); - Macro& macro = macros_[i]; - macro.lx = (isFlipX) ? width - node.getX() - node.getWidth() + lx - : node.getX() + lx; - macro.ly = (isFlipY) ? height - node.getY() - node.getHeight() + ly - : node.getY() + ly; - MacroSpacings& spacings = macro_placer_->getSpacings(macro); - // Remove halo/channel origin offset. - macro.lx += spacings.getSpacingX(); - macro.ly += spacings.getSpacingY(); - } - } - return true; -} - -void Partition::makePins(int macro_idx1, - int macro_idx2, - int cost, - int pnet_idx, - pfp::Nets* pfp_nets) -{ - pfp::Net pnet; - - parquetfp::pin pin1(getName(macro_idx1).c_str(), true, 0, 0, pnet_idx); - parquetfp::pin pin2(getName(macro_idx2).c_str(), true, 0, 0, pnet_idx); - - pnet.addNode(pin1); - pnet.addNode(pin2); - pnet.putIndex(pnet_idx); - pnet.putName(string("n" + to_string(pnet_idx)).c_str()); - pnet.putWeight(cost); - - pfp_nets->putNewNet(pnet); -} - -} // namespace mpl diff --git a/src/mpl/src/graphics.cpp b/src/mpl/src/graphics.cpp deleted file mode 100644 index 978e23bcf0e..00000000000 --- a/src/mpl/src/graphics.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2021, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#include "graphics.h" - -#include "utl/Logger.h" - -namespace mpl { - -Graphics::Graphics(odb::dbDatabase* db) - : partition_relative_coords_(false), db_(db) -{ - gui::Gui::get()->registerRenderer(this); -} - -void Graphics::drawObjects(gui::Painter& painter) -{ - odb::dbTech* tech = db_->getTech(); - const int dbu = tech->getDbUnitsPerMicron(); - - painter.setPen(gui::Painter::white, /* cosmetic */ true); - - for (auto& partition : partitions_) { - painter.setBrush(gui::Painter::transparent); - int lx = partition.lx * dbu; - int ly = partition.ly * dbu; - int ux = (partition.lx + partition.width) * dbu; - int uy = (partition.ly + partition.height) * dbu; - painter.drawRect({lx, ly, ux, uy}); - - // Macro coordinates are partition relative pre-anneal - // but not post-anneal - double x_offset = 0; - double y_offset = 0; - if (partition_relative_coords_) { - x_offset = partition.lx; - y_offset = partition.ly; - } - for (auto& macro : partition.macros_) { - painter.setBrush(gui::Painter::gray); - lx = (x_offset + macro.lx) * dbu; - ly = (y_offset + macro.ly) * dbu; - ux = (x_offset + macro.lx + macro.w) * dbu; - uy = (y_offset + macro.ly + macro.h) * dbu; - painter.drawRect({lx, ly, ux, uy}); - } - } -} - -void Graphics::set_partitions(const std::vector& partitions, - bool partition_relative_coords) -{ - partitions_ = partitions; - partition_relative_coords_ = partition_relative_coords; - gui::Gui::get()->redraw(); - gui::Gui::get()->pause(); -} - -void Graphics::status(const std::string& message) -{ - gui::Gui::get()->status(message); -} - -/* static */ -bool Graphics::guiActive() -{ - return gui::Gui::enabled(); -} - -} // namespace mpl diff --git a/src/mpl/src/graphics.h b/src/mpl/src/graphics.h deleted file mode 100644 index 417440c3ad8..00000000000 --- a/src/mpl/src/graphics.h +++ /dev/null @@ -1,77 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// BSD 3-Clause License -// -// Copyright (c) 2021, The Regents of the University of California -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include - -#include "gui/gui.h" -#include "mpl/MacroPlacer.h" - -namespace utl { -class Logger; -} - -namespace odb { -class dbDatabase; -} - -namespace mpl { - -// This class draws debugging graphics on the layout -class Graphics : public gui::Renderer -{ - public: - Graphics(odb::dbDatabase* db); - - // Draw the partition - void set_partitions(const std::vector& partitions, - bool relative_coords); - - // Show a message in the status bar - void status(const std::string& message); - - // From Renderer API - virtual void drawObjects(gui::Painter& painter) override; - - // Is the GUI being displayed (true) or are we in batch mode (false) - static bool guiActive(); - - private: - std::vector partitions_; - bool partition_relative_coords_; - odb::dbDatabase* db_; -}; - -} // namespace mpl diff --git a/src/mpl/test/CMakeLists.txt b/src/mpl/test/CMakeLists.txt deleted file mode 100644 index 0b52c691446..00000000000 --- a/src/mpl/test/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -include("openroad") - -set(TEST_NAMES - level3_01 - level3_02 - east_west1 - east_west2 - snap_layer1 -) - -foreach(TEST_NAME IN LISTS TEST_NAMES) - or_integration_test("mpl" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) -endforeach() diff --git a/src/mpl/test/Nangate45 b/src/mpl/test/Nangate45 deleted file mode 120000 index 7f1df955c57..00000000000 --- a/src/mpl/test/Nangate45 +++ /dev/null @@ -1 +0,0 @@ -../../../test/Nangate45 \ No newline at end of file diff --git a/src/mpl/test/east_west.tcl b/src/mpl/test/east_west.tcl deleted file mode 100644 index 61ca2fbad18..00000000000 --- a/src/mpl/test/east_west.tcl +++ /dev/null @@ -1,48 +0,0 @@ -source "helpers.tcl" -read_liberty Nangate45/Nangate45_typ.lib -read_liberty Nangate45/fakeram45_64x7.lib - -read_lef Nangate45/Nangate45.lef -read_lef Nangate45/fakeram45_64x7.lef - -# place_pins result is not stable across ports. sigh. -if {0} { - read_verilog east_west1.v - link_design mem2 - source Nangate45/Nangate45.vars - - set core_width 200 - set core_height 100 - set margin 10 - set die_area "0 0 [expr $core_width + $margin * 2] [expr $core_height + $margin * 2]" - set core_area "$margin $margin $core_width $core_height" - - initialize_floorplan -site $site \ - -die_area $die_area \ - -core_area $core_area - source $tracks_file - - # place mem_out0 pins on west/east edge - # place mem_out1 pins on east/west edge - if { $mem0_pins_west } { - set mem0_pin_x $margin - set mem1_pin_x [expr $margin + $core_width] - } else { - set mem0_pin_x [expr $margin + $core_width] - set mem1_pin_x $margin - } - set bus_width 7 - for {set i 0} {$i < $bus_width} {incr i} { - place_pin -pin_name mem_out0[$i] -layer $io_placer_ver_layer \ - -location "$mem0_pin_x [expr $margin + $i * $core_height / $bus_width]" -pin_size {1 1} - place_pin -pin_name mem_out1[$i] -layer $io_placer_ver_layer \ - -location "$mem1_pin_x [expr $margin + $i * $core_height / $bus_width]" -pin_size {1 1} - } - place_pin -pin_name clk -layer $io_placer_hor_layer \ - -location "[expr $margin + $core_width / 2] $margin" -pin_size {1 1} - global_placement - - write_def east_west1.def -} else { - read_def east_west1.def -} diff --git a/src/mpl/test/east_west1.def b/src/mpl/test/east_west1.def deleted file mode 100644 index ced3173e1ea..00000000000 --- a/src/mpl/test/east_west1.def +++ /dev/null @@ -1,173 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN mem2 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 440000 240000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 20140 22400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 20140 25200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 20140 28000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 20140 30800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 20140 33600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 20140 36400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 20140 39200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 20140 42000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 20140 44800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 20140 47600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 20140 50400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 20140 53200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 20140 56000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 20140 58800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 20140 61600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 20140 64400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 20140 67200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 20140 70000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 20140 72800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 20140 75600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 20140 78400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 20140 81200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 20140 84000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 20140 86800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 20140 89600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 20140 92400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 20140 95200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 20140 98000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 20140 100800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 20140 103600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 20140 106400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 20140 109200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 20140 112000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 20140 114800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 20140 117600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 20140 120400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 20140 123200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 20140 126000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 20140 128800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 20140 131600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 20140 134400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 20140 137200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 20140 140000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 20140 142800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 20140 145600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 20140 148400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 20140 151200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 20140 154000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 20140 156800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 20140 159600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 20140 162400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 20140 165200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 20140 168000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 20140 170800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 20140 173600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 20140 176400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_56 FreePDK45_38x28_10R_NP_162NW_34O 20140 179200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_57 FreePDK45_38x28_10R_NP_162NW_34O 20140 182000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_58 FreePDK45_38x28_10R_NP_162NW_34O 20140 184800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_59 FreePDK45_38x28_10R_NP_162NW_34O 20140 187600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_60 FreePDK45_38x28_10R_NP_162NW_34O 20140 190400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_61 FreePDK45_38x28_10R_NP_162NW_34O 20140 193200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_62 FreePDK45_38x28_10R_NP_162NW_34O 20140 196000 N DO 999 BY 1 STEP 380 0 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal10 ; -COMPONENTS 2 ; - - mem0 fakeram45_64x7 + PLACED ( 100585 63476 ) N ; - - mem1 fakeram45_64x7 + PLACED ( 211775 63476 ) N ; -END COMPONENTS -PINS 15 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 220000 20000 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 20000 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 48000 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 76000 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 104000 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 134000 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 162000 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 190000 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 20000 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 48000 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 76000 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 104000 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 134000 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 162000 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 190000 ) N ; -END PINS -NETS 15 ; - - clk ( PIN clk ) ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/east_west1.defok b/src/mpl/test/east_west1.defok deleted file mode 100644 index 96ad355fe77..00000000000 --- a/src/mpl/test/east_west1.defok +++ /dev/null @@ -1,173 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN mem2 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 440000 240000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 20140 22400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 20140 25200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 20140 28000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 20140 30800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 20140 33600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 20140 36400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 20140 39200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 20140 42000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 20140 44800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 20140 47600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 20140 50400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 20140 53200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 20140 56000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 20140 58800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 20140 61600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 20140 64400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 20140 67200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 20140 70000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 20140 72800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 20140 75600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 20140 78400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 20140 81200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 20140 84000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 20140 86800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 20140 89600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 20140 92400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 20140 95200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 20140 98000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 20140 100800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 20140 103600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 20140 106400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 20140 109200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 20140 112000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 20140 114800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 20140 117600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 20140 120400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 20140 123200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 20140 126000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 20140 128800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 20140 131600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 20140 134400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 20140 137200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 20140 140000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 20140 142800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 20140 145600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 20140 148400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 20140 151200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 20140 154000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 20140 156800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 20140 159600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 20140 162400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 20140 165200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 20140 168000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 20140 170800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 20140 173600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 20140 176400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_56 FreePDK45_38x28_10R_NP_162NW_34O 20140 179200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_57 FreePDK45_38x28_10R_NP_162NW_34O 20140 182000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_58 FreePDK45_38x28_10R_NP_162NW_34O 20140 184800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_59 FreePDK45_38x28_10R_NP_162NW_34O 20140 187600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_60 FreePDK45_38x28_10R_NP_162NW_34O 20140 190400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_61 FreePDK45_38x28_10R_NP_162NW_34O 20140 193200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_62 FreePDK45_38x28_10R_NP_162NW_34O 20140 196000 N DO 999 BY 1 STEP 380 0 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal10 ; -COMPONENTS 2 ; - - mem0 fakeram45_64x7 + FIXED ( 21280 23520 ) N ; - - mem1 fakeram45_64x7 + FIXED ( 130480 23520 ) N ; -END COMPONENTS -PINS 15 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 220000 20000 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 20000 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 48000 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 76000 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 104000 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 134000 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 162000 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 190000 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 20000 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 48000 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 76000 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 104000 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 134000 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 162000 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 190000 ) N ; -END PINS -NETS 15 ; - - clk ( PIN clk ) ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/east_west1.ok b/src/mpl/test/east_west1.ok deleted file mode 100644 index 468dad9022d..00000000000 --- a/src/mpl/test/east_west1.ok +++ /dev/null @@ -1,14 +0,0 @@ -[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells -[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x7.lef, created 1 library cells -[INFO ODB-0128] Design: mem2 -[INFO ODB-0130] Created 15 pins. -[INFO ODB-0131] Created 2 components and 64 component-terminals. -[INFO ODB-0133] Created 15 nets and 16 connections. -[INFO MPL-0101] Found 2 macros. -[INFO MPL-0102] West pins 7. -[INFO MPL-0102] East pins 5. -[INFO MPL-0102] North pins 1. -[INFO MPL-0102] South pins 2. -[INFO MPL-0067] Initial weighted wire length 911.416. -[INFO MPL-0068] Placed weighted wire length 857.51. -No differences found. diff --git a/src/mpl/test/east_west1.py b/src/mpl/test/east_west1.py deleted file mode 100644 index 32fba61a3f9..00000000000 --- a/src/mpl/test/east_west1.py +++ /dev/null @@ -1,20 +0,0 @@ -# mem0 with west connctions, mem1 with east connections -from openroad import Design, Tech -import helpers -import mpl_aux - -tech = Tech() -tech.readLiberty("Nangate45/Nangate45_typ.lib") -tech.readLiberty("Nangate45/fakeram45_64x7.lib") -tech.readLef("Nangate45/Nangate45.lef") -tech.readLef("Nangate45/fakeram45_64x7.lef") - -design = helpers.make_design(tech) -design.readDef("east_west1.def") -design.evalTclString('read_sdc "gcd.sdc"') - -mpl_aux.macro_placement(design, style="corner_min_wl", halo=[0.5, 0.5]) - -def_file = helpers.make_result_file("east_west1.def") -design.writeDef(def_file) -helpers.diff_files(def_file, "east_west1.defok") diff --git a/src/mpl/test/east_west1.tcl b/src/mpl/test/east_west1.tcl deleted file mode 100644 index 643a7ff20df..00000000000 --- a/src/mpl/test/east_west1.tcl +++ /dev/null @@ -1,13 +0,0 @@ -# mem0 with west connctions, mem1 with east connections -source helpers.tcl -set mem0_pins_west 1 -source east_west.tcl -read_sdc gcd.sdc - -# Note that the default -style MAXIMIZES wire length and incorrectly -# places the memories away from the pins they are connected to. -macro_placement -style corner_min_wl -halo {0.5 0.5} - -set def_file [make_result_file east_west1.def] -write_def $def_file -diff_file $def_file east_west1.defok diff --git a/src/mpl/test/east_west1.v b/src/mpl/test/east_west1.v deleted file mode 100644 index 2dcbbffce1d..00000000000 --- a/src/mpl/test/east_west1.v +++ /dev/null @@ -1,14 +0,0 @@ -module mem2 ( - clk, - mem_out0, - mem_out1); - input clk; - output [6:0] mem_out0; - output [6:0] mem_out1; - - fakeram45_64x7 mem0 (.clk(clk), - .rd_out(mem_out0)); - - fakeram45_64x7 mem1 (.clk(clk), - .rd_out(mem_out1)); -endmodule diff --git a/src/mpl/test/east_west2.def b/src/mpl/test/east_west2.def deleted file mode 100644 index b61e16f5368..00000000000 --- a/src/mpl/test/east_west2.def +++ /dev/null @@ -1,150 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN mem2 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 116280 112000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 0 0 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 0 2800 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 0 5600 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 0 8400 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 0 11200 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 0 14000 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 0 16800 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 0 19600 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 0 22400 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 0 25200 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 0 28000 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 0 30800 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 0 33600 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 0 36400 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 0 39200 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 0 42000 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 0 44800 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 0 47600 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 0 50400 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 0 53200 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 0 56000 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 0 58800 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 0 61600 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 0 64400 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 0 67200 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 0 70000 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 0 72800 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 0 75600 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 0 78400 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 0 81200 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 0 84000 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 0 86800 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 0 89600 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 0 92400 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 0 95200 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 0 98000 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 0 100800 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 0 103600 N DO 306 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 0 106400 FS DO 306 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 0 109200 N DO 306 BY 1 STEP 380 0 ; -TRACKS X 190 DO 306 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 400 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 306 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 400 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 306 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 400 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 208 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 200 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 208 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 200 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 208 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 200 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 73 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 70 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 73 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 70 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 37 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 35 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 37 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 35 STEP 3200 LAYER metal10 ; -COMPONENTS 2 ; - - mem0 fakeram45_64x7 + PLACED ( 100 0 ) N ; - - mem1 fakeram45_64x7 + PLACED ( 12000 0 ) N ; -END COMPONENTS -PINS 15 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 7980 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 7420 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 15820 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 9100 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 9660 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 10220 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 10780 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 11340 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 116500 11900 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 116500 12460 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 116500 13020 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 116500 13580 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 116500 14140 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 116500 14700 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 116500 15260 ) N ; -END PINS -NETS 15 ; - - clk ( PIN clk ) ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/east_west2.defok b/src/mpl/test/east_west2.defok deleted file mode 100644 index 96ad355fe77..00000000000 --- a/src/mpl/test/east_west2.defok +++ /dev/null @@ -1,173 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN mem2 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 440000 240000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 20140 22400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 20140 25200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 20140 28000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 20140 30800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 20140 33600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 20140 36400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 20140 39200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 20140 42000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 20140 44800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 20140 47600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 20140 50400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 20140 53200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 20140 56000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 20140 58800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 20140 61600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 20140 64400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 20140 67200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 20140 70000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 20140 72800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 20140 75600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 20140 78400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 20140 81200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 20140 84000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 20140 86800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 20140 89600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 20140 92400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 20140 95200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 20140 98000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 20140 100800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 20140 103600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 20140 106400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 20140 109200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 20140 112000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 20140 114800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 20140 117600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 20140 120400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 20140 123200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 20140 126000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 20140 128800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 20140 131600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 20140 134400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 20140 137200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 20140 140000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 20140 142800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 20140 145600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 20140 148400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 20140 151200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 20140 154000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 20140 156800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 20140 159600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 20140 162400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 20140 165200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 20140 168000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 20140 170800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 20140 173600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 20140 176400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_56 FreePDK45_38x28_10R_NP_162NW_34O 20140 179200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_57 FreePDK45_38x28_10R_NP_162NW_34O 20140 182000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_58 FreePDK45_38x28_10R_NP_162NW_34O 20140 184800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_59 FreePDK45_38x28_10R_NP_162NW_34O 20140 187600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_60 FreePDK45_38x28_10R_NP_162NW_34O 20140 190400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_61 FreePDK45_38x28_10R_NP_162NW_34O 20140 193200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_62 FreePDK45_38x28_10R_NP_162NW_34O 20140 196000 N DO 999 BY 1 STEP 380 0 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal10 ; -COMPONENTS 2 ; - - mem0 fakeram45_64x7 + FIXED ( 21280 23520 ) N ; - - mem1 fakeram45_64x7 + FIXED ( 130480 23520 ) N ; -END COMPONENTS -PINS 15 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 220000 20000 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 20000 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 48000 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 76000 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 104000 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 134000 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 162000 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 190000 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 20000 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 48000 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 76000 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 104000 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 134000 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 162000 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 190000 ) N ; -END PINS -NETS 15 ; - - clk ( PIN clk ) ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/east_west2.ok b/src/mpl/test/east_west2.ok deleted file mode 100644 index 0996721ab10..00000000000 --- a/src/mpl/test/east_west2.ok +++ /dev/null @@ -1,14 +0,0 @@ -[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells -[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x7.lef, created 1 library cells -[INFO ODB-0128] Design: mem2 -[INFO ODB-0130] Created 15 pins. -[INFO ODB-0131] Created 2 components and 64 component-terminals. -[INFO ODB-0133] Created 15 nets and 16 connections. -[INFO MPL-0101] Found 2 macros. -[INFO MPL-0102] West pins 7. -[INFO MPL-0102] East pins 5. -[INFO MPL-0102] North pins 1. -[INFO MPL-0102] South pins 2. -[INFO MPL-0067] Initial weighted wire length 1023.28. -[INFO MPL-0068] Placed weighted wire length 962.075. -No differences found. diff --git a/src/mpl/test/east_west2.py b/src/mpl/test/east_west2.py deleted file mode 100644 index 7b95ef877ef..00000000000 --- a/src/mpl/test/east_west2.py +++ /dev/null @@ -1,23 +0,0 @@ -# mem0 with west connctions, mem1 with east connections -from openroad import Design, Tech -import helpers -import mpl_aux - -tech = Tech() -tech.readLiberty("Nangate45/Nangate45_typ.lib") -tech.readLiberty("Nangate45/fakeram45_64x7.lib") -tech.readLef("Nangate45/Nangate45.lef") -tech.readLef("Nangate45/fakeram45_64x7.lef") - -design = helpers.make_design(tech) -design.readDef("east_west1.def") - -# This appears to be the only difference from east_west1, ie, we do not -# read in the sdc file -# design.evalTclString('read_sdc "gcd.sdc"') - -mpl_aux.macro_placement(design, style="corner_min_wl", halo=[0.5, 0.5]) - -def_file = helpers.make_result_file("east_west2.def") -design.writeDef(def_file) -helpers.diff_files(def_file, "east_west2.defok") diff --git a/src/mpl/test/east_west2.tcl b/src/mpl/test/east_west2.tcl deleted file mode 100644 index 0173bc27ed7..00000000000 --- a/src/mpl/test/east_west2.tcl +++ /dev/null @@ -1,12 +0,0 @@ -# mem0 with east connctions, mem1 with west connections -source helpers.tcl -set mem0_pins_west 0 -source east_west.tcl - -# Note that the default -style MAXIMIZES wire length and incorrectly -# places the memories away from the pins they are connected to. -macro_placement -style corner_min_wl -halo {0.5 0.5} - -set def_file [make_result_file east_west2.def] -write_def $def_file -diff_file $def_file east_west2.defok diff --git a/src/mpl/test/extract_utils.py b/src/mpl/test/extract_utils.py deleted file mode 120000 index 3a16235d508..00000000000 --- a/src/mpl/test/extract_utils.py +++ /dev/null @@ -1 +0,0 @@ -../../../docs/src/scripts/extract_utils.py \ No newline at end of file diff --git a/src/mpl/test/gcd.sdc b/src/mpl/test/gcd.sdc deleted file mode 100644 index 257422ed82d..00000000000 --- a/src/mpl/test/gcd.sdc +++ /dev/null @@ -1 +0,0 @@ -create_clock -name core_clock -period 10.0000 -waveform {0.0000 5.0000} [get_ports {clk}] diff --git a/src/mpl/test/gpl_aux.py b/src/mpl/test/gpl_aux.py deleted file mode 120000 index 22001460202..00000000000 --- a/src/mpl/test/gpl_aux.py +++ /dev/null @@ -1 +0,0 @@ -../../gpl/test/gpl_aux.py \ No newline at end of file diff --git a/src/mpl/test/helpers.py b/src/mpl/test/helpers.py deleted file mode 120000 index e10a2da7588..00000000000 --- a/src/mpl/test/helpers.py +++ /dev/null @@ -1 +0,0 @@ -../../../test/helpers.py \ No newline at end of file diff --git a/src/mpl/test/helpers.tcl b/src/mpl/test/helpers.tcl deleted file mode 120000 index 509ca07b27e..00000000000 --- a/src/mpl/test/helpers.tcl +++ /dev/null @@ -1 +0,0 @@ -../../../test/helpers.tcl \ No newline at end of file diff --git a/src/mpl/test/level3.def b/src/mpl/test/level3.def deleted file mode 100644 index ff3f18fd3d8..00000000000 --- a/src/mpl/test/level3.def +++ /dev/null @@ -1,670 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN gcd_mem3 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 400000 500000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 10260 11200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 10260 14000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 10260 16800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 10260 19600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 10260 22400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 10260 25200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 10260 28000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 10260 30800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 10260 33600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 10260 36400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 10260 39200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 10260 42000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 10260 44800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 10260 47600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 10260 50400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 10260 53200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 10260 56000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 10260 58800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 10260 61600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 10260 64400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 10260 67200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 10260 70000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 10260 72800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 10260 75600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 10260 78400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 10260 81200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 10260 84000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 10260 86800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 10260 89600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 10260 92400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 10260 95200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 10260 98000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 10260 100800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 10260 103600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 10260 106400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 10260 109200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 10260 112000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 10260 114800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 10260 117600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 10260 120400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 10260 123200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 10260 126000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 10260 128800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 10260 131600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 10260 134400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 10260 137200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 10260 140000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 10260 142800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 10260 145600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 10260 148400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 10260 151200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 10260 154000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 10260 156800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 10260 159600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 10260 162400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 10260 165200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_56 FreePDK45_38x28_10R_NP_162NW_34O 10260 168000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_57 FreePDK45_38x28_10R_NP_162NW_34O 10260 170800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_58 FreePDK45_38x28_10R_NP_162NW_34O 10260 173600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_59 FreePDK45_38x28_10R_NP_162NW_34O 10260 176400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_60 FreePDK45_38x28_10R_NP_162NW_34O 10260 179200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_61 FreePDK45_38x28_10R_NP_162NW_34O 10260 182000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_62 FreePDK45_38x28_10R_NP_162NW_34O 10260 184800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_63 FreePDK45_38x28_10R_NP_162NW_34O 10260 187600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_64 FreePDK45_38x28_10R_NP_162NW_34O 10260 190400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_65 FreePDK45_38x28_10R_NP_162NW_34O 10260 193200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_66 FreePDK45_38x28_10R_NP_162NW_34O 10260 196000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_67 FreePDK45_38x28_10R_NP_162NW_34O 10260 198800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_68 FreePDK45_38x28_10R_NP_162NW_34O 10260 201600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_69 FreePDK45_38x28_10R_NP_162NW_34O 10260 204400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_70 FreePDK45_38x28_10R_NP_162NW_34O 10260 207200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_71 FreePDK45_38x28_10R_NP_162NW_34O 10260 210000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_72 FreePDK45_38x28_10R_NP_162NW_34O 10260 212800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_73 FreePDK45_38x28_10R_NP_162NW_34O 10260 215600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_74 FreePDK45_38x28_10R_NP_162NW_34O 10260 218400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_75 FreePDK45_38x28_10R_NP_162NW_34O 10260 221200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_76 FreePDK45_38x28_10R_NP_162NW_34O 10260 224000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_77 FreePDK45_38x28_10R_NP_162NW_34O 10260 226800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_78 FreePDK45_38x28_10R_NP_162NW_34O 10260 229600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_79 FreePDK45_38x28_10R_NP_162NW_34O 10260 232400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_80 FreePDK45_38x28_10R_NP_162NW_34O 10260 235200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_81 FreePDK45_38x28_10R_NP_162NW_34O 10260 238000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_82 FreePDK45_38x28_10R_NP_162NW_34O 10260 240800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_83 FreePDK45_38x28_10R_NP_162NW_34O 10260 243600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_84 FreePDK45_38x28_10R_NP_162NW_34O 10260 246400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_85 FreePDK45_38x28_10R_NP_162NW_34O 10260 249200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_86 FreePDK45_38x28_10R_NP_162NW_34O 10260 252000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_87 FreePDK45_38x28_10R_NP_162NW_34O 10260 254800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_88 FreePDK45_38x28_10R_NP_162NW_34O 10260 257600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_89 FreePDK45_38x28_10R_NP_162NW_34O 10260 260400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_90 FreePDK45_38x28_10R_NP_162NW_34O 10260 263200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_91 FreePDK45_38x28_10R_NP_162NW_34O 10260 266000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_92 FreePDK45_38x28_10R_NP_162NW_34O 10260 268800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_93 FreePDK45_38x28_10R_NP_162NW_34O 10260 271600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_94 FreePDK45_38x28_10R_NP_162NW_34O 10260 274400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_95 FreePDK45_38x28_10R_NP_162NW_34O 10260 277200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_96 FreePDK45_38x28_10R_NP_162NW_34O 10260 280000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_97 FreePDK45_38x28_10R_NP_162NW_34O 10260 282800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_98 FreePDK45_38x28_10R_NP_162NW_34O 10260 285600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_99 FreePDK45_38x28_10R_NP_162NW_34O 10260 288400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_100 FreePDK45_38x28_10R_NP_162NW_34O 10260 291200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_101 FreePDK45_38x28_10R_NP_162NW_34O 10260 294000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_102 FreePDK45_38x28_10R_NP_162NW_34O 10260 296800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_103 FreePDK45_38x28_10R_NP_162NW_34O 10260 299600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_104 FreePDK45_38x28_10R_NP_162NW_34O 10260 302400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_105 FreePDK45_38x28_10R_NP_162NW_34O 10260 305200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_106 FreePDK45_38x28_10R_NP_162NW_34O 10260 308000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_107 FreePDK45_38x28_10R_NP_162NW_34O 10260 310800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_108 FreePDK45_38x28_10R_NP_162NW_34O 10260 313600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_109 FreePDK45_38x28_10R_NP_162NW_34O 10260 316400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_110 FreePDK45_38x28_10R_NP_162NW_34O 10260 319200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_111 FreePDK45_38x28_10R_NP_162NW_34O 10260 322000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_112 FreePDK45_38x28_10R_NP_162NW_34O 10260 324800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_113 FreePDK45_38x28_10R_NP_162NW_34O 10260 327600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_114 FreePDK45_38x28_10R_NP_162NW_34O 10260 330400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_115 FreePDK45_38x28_10R_NP_162NW_34O 10260 333200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_116 FreePDK45_38x28_10R_NP_162NW_34O 10260 336000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_117 FreePDK45_38x28_10R_NP_162NW_34O 10260 338800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_118 FreePDK45_38x28_10R_NP_162NW_34O 10260 341600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_119 FreePDK45_38x28_10R_NP_162NW_34O 10260 344400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_120 FreePDK45_38x28_10R_NP_162NW_34O 10260 347200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_121 FreePDK45_38x28_10R_NP_162NW_34O 10260 350000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_122 FreePDK45_38x28_10R_NP_162NW_34O 10260 352800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_123 FreePDK45_38x28_10R_NP_162NW_34O 10260 355600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_124 FreePDK45_38x28_10R_NP_162NW_34O 10260 358400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_125 FreePDK45_38x28_10R_NP_162NW_34O 10260 361200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_126 FreePDK45_38x28_10R_NP_162NW_34O 10260 364000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_127 FreePDK45_38x28_10R_NP_162NW_34O 10260 366800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_128 FreePDK45_38x28_10R_NP_162NW_34O 10260 369600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_129 FreePDK45_38x28_10R_NP_162NW_34O 10260 372400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_130 FreePDK45_38x28_10R_NP_162NW_34O 10260 375200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_131 FreePDK45_38x28_10R_NP_162NW_34O 10260 378000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_132 FreePDK45_38x28_10R_NP_162NW_34O 10260 380800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_133 FreePDK45_38x28_10R_NP_162NW_34O 10260 383600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_134 FreePDK45_38x28_10R_NP_162NW_34O 10260 386400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_135 FreePDK45_38x28_10R_NP_162NW_34O 10260 389200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_136 FreePDK45_38x28_10R_NP_162NW_34O 10260 392000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_137 FreePDK45_38x28_10R_NP_162NW_34O 10260 394800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_138 FreePDK45_38x28_10R_NP_162NW_34O 10260 397600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_139 FreePDK45_38x28_10R_NP_162NW_34O 10260 400400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_140 FreePDK45_38x28_10R_NP_162NW_34O 10260 403200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_141 FreePDK45_38x28_10R_NP_162NW_34O 10260 406000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_142 FreePDK45_38x28_10R_NP_162NW_34O 10260 408800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_143 FreePDK45_38x28_10R_NP_162NW_34O 10260 411600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_144 FreePDK45_38x28_10R_NP_162NW_34O 10260 414400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_145 FreePDK45_38x28_10R_NP_162NW_34O 10260 417200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_146 FreePDK45_38x28_10R_NP_162NW_34O 10260 420000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_147 FreePDK45_38x28_10R_NP_162NW_34O 10260 422800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_148 FreePDK45_38x28_10R_NP_162NW_34O 10260 425600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_149 FreePDK45_38x28_10R_NP_162NW_34O 10260 428400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_150 FreePDK45_38x28_10R_NP_162NW_34O 10260 431200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_151 FreePDK45_38x28_10R_NP_162NW_34O 10260 434000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_152 FreePDK45_38x28_10R_NP_162NW_34O 10260 436800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_153 FreePDK45_38x28_10R_NP_162NW_34O 10260 439600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_154 FreePDK45_38x28_10R_NP_162NW_34O 10260 442400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_155 FreePDK45_38x28_10R_NP_162NW_34O 10260 445200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_156 FreePDK45_38x28_10R_NP_162NW_34O 10260 448000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_157 FreePDK45_38x28_10R_NP_162NW_34O 10260 450800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_158 FreePDK45_38x28_10R_NP_162NW_34O 10260 453600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_159 FreePDK45_38x28_10R_NP_162NW_34O 10260 456400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_160 FreePDK45_38x28_10R_NP_162NW_34O 10260 459200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_161 FreePDK45_38x28_10R_NP_162NW_34O 10260 462000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_162 FreePDK45_38x28_10R_NP_162NW_34O 10260 464800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_163 FreePDK45_38x28_10R_NP_162NW_34O 10260 467600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_164 FreePDK45_38x28_10R_NP_162NW_34O 10260 470400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_165 FreePDK45_38x28_10R_NP_162NW_34O 10260 473200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_166 FreePDK45_38x28_10R_NP_162NW_34O 10260 476000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_167 FreePDK45_38x28_10R_NP_162NW_34O 10260 478800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_168 FreePDK45_38x28_10R_NP_162NW_34O 10260 481600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_169 FreePDK45_38x28_10R_NP_162NW_34O 10260 484400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_170 FreePDK45_38x28_10R_NP_162NW_34O 10260 487200 N DO 999 BY 1 STEP 380 0 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 250 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 313 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 250 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 313 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 125 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 157 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 125 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 157 STEP 3200 LAYER metal10 ; -COMPONENTS 24 ; - - mem0 fakeram45_64x7 + PLACED ( 264767 285310 ) N ; - - mem1 fakeram45_64x7 + PLACED ( 282340 121832 ) N ; - - mem2 fakeram45_64x7 + PLACED ( 264929 239853 ) N ; - - r10 DFF_X1 + PLACED ( 277482 237870 ) N ; - - r11 DFF_X1 + PLACED ( 278102 168030 ) N ; - - r12 DFF_X1 + PLACED ( 276751 280105 ) N ; - - r13 DFF_X1 + PLACED ( 277947 186590 ) N ; - - r14 DFF_X1 + PLACED ( 249329 281162 ) N ; - - r15 DFF_X1 + PLACED ( 250670 283996 ) N ; - - r16 DFF_X1 + PLACED ( 247689 185950 ) N ; - - r20 DFF_X1 + PLACED ( 269742 213388 ) N ; - - r21 DFF_X1 + PLACED ( 270302 168057 ) N ; - - r22 DFF_X1 + PLACED ( 269117 242470 ) N ; - - r23 DFF_X1 + PLACED ( 270332 182466 ) N ; - - r24 DFF_X1 + PLACED ( 259021 246800 ) N ; - - r25 DFF_X1 + PLACED ( 267011 249609 ) N ; - - r26 DFF_X1 + PLACED ( 258298 186075 ) N ; - - r30 DFF_X1 + PLACED ( 281002 189782 ) N ; - - r31 DFF_X1 + PLACED ( 281236 169207 ) N ; - - r32 DFF_X1 + PLACED ( 280668 207354 ) N ; - - r33 DFF_X1 + PLACED ( 281098 179947 ) N ; - - r34 DFF_X1 + PLACED ( 269253 212963 ) N ; - - r35 DFF_X1 + PLACED ( 267008 215910 ) N ; - - r36 DFF_X1 + PLACED ( 268972 186295 ) N ; -END COMPONENTS -PINS 75 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 43260 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 256620 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 24780 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 361900 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 172060 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 464380 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 241110 499930 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 201590 70 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 66780 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 338380 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 383990 499930 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 144590 70 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 148540 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 193340 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 340620 ) N ; - - mem_out2[0] + NET mem_out2[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 403900 ) N ; - - mem_out2[1] + NET mem_out2[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 317100 ) N ; - - mem_out2[2] + NET mem_out2[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 425180 ) N ; - - mem_out2[3] + NET mem_out2[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 315590 70 ) N ; - - mem_out2[4] + NET mem_out2[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 214620 ) N ; - - mem_out2[5] + NET mem_out2[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 295820 ) N ; - - mem_out2[6] + NET mem_out2[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 212230 499930 ) N ; - - req_msg[0] + NET req_msg[0] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 383180 ) N ; - - req_msg[10] + NET req_msg[10] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 3500 ) N ; - - req_msg[11] + NET req_msg[11] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 108780 ) N ; - - req_msg[12] + NET req_msg[12] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 58710 70 ) N ; - - req_msg[13] + NET req_msg[13] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 344470 70 ) N ; - - req_msg[14] + NET req_msg[14] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 253820 ) N ; - - req_msg[15] + NET req_msg[15] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 422380 ) N ; - - req_msg[16] + NET req_msg[16] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 211820 ) N ; - - req_msg[17] + NET req_msg[17] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 258590 70 ) N ; - - req_msg[18] + NET req_msg[18] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 63980 ) N ; - - req_msg[19] + NET req_msg[19] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 115710 70 ) N ; - - req_msg[1] + NET req_msg[1] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 40470 499930 ) N ; - - req_msg[20] + NET req_msg[20] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 401100 ) N ; - - req_msg[21] + NET req_msg[21] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 88060 ) N ; - - req_msg[22] + NET req_msg[22] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 97470 499930 ) N ; - - req_msg[23] + NET req_msg[23] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 355110 499930 ) N ; - - req_msg[24] + NET req_msg[24] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 46060 ) N ; - - req_msg[25] + NET req_msg[25] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 126350 499930 ) N ; - - req_msg[26] + NET req_msg[26] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 151340 ) N ; - - req_msg[27] + NET req_msg[27] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 235340 ) N ; - - req_msg[28] + NET req_msg[28] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 85260 ) N ; - - req_msg[29] + NET req_msg[29] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 277340 ) N ; - - req_msg[2] + NET req_msg[2] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 69350 499930 ) N ; - - req_msg[30] + NET req_msg[30] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 183350 499930 ) N ; - - req_msg[31] + NET req_msg[31] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 380380 ) N ; - - req_msg[3] + NET req_msg[3] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 1710 70 ) N ; - - req_msg[4] + NET req_msg[4] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 232540 ) N ; - - req_msg[5] + NET req_msg[5] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 155230 499930 ) N ; - - req_msg[6] + NET req_msg[6] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 269230 499930 ) N ; - - req_msg[7] + NET req_msg[7] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 488460 ) N ; - - req_msg[8] + NET req_msg[8] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 106540 ) N ; - - req_msg[9] + NET req_msg[9] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 275100 ) N ; - - req_rdy + NET req_rdy + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 29830 70 ) N ; - - req_val + NET req_val + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 467180 ) N ; - - reset + NET reset + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 169820 ) N ; - - resp_msg[0] + NET resp_msg[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 230470 70 ) N ; - - resp_msg[10] + NET resp_msg[10] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 445900 ) N ; - - resp_msg[11] + NET resp_msg[11] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 130060 ) N ; - - resp_msg[12] + NET resp_msg[12] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 485660 ) N ; - - resp_msg[13] + NET resp_msg[13] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 21980 ) N ; - - resp_msg[14] + NET resp_msg[14] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 86830 70 ) N ; - - resp_msg[15] + NET resp_msg[15] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 172710 70 ) N ; - - resp_msg[1] + NET resp_msg[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 190540 ) N ; - - resp_msg[2] + NET resp_msg[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 319900 ) N ; - - resp_msg[3] + NET resp_msg[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 287470 70 ) N ; - - resp_msg[4] + NET resp_msg[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 326230 499930 ) N ; - - resp_msg[5] + NET resp_msg[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 298110 499930 ) N ; - - resp_msg[6] + NET resp_msg[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 443660 ) N ; - - resp_msg[7] + NET resp_msg[7] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 12350 499930 ) N ; - - resp_msg[8] + NET resp_msg[8] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 373350 70 ) N ; - - resp_msg[9] + NET resp_msg[9] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 127260 ) N ; - - resp_rdy + NET resp_rdy + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 359100 ) N ; - - resp_val + NET resp_val + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 298620 ) N ; -END PINS -NETS 139 ; - - _003_ ( mem1 w_mask_in[0] ) + USE SIGNAL ; - - _006_ ( mem0 we_in ) + USE SIGNAL ; - - _007_ ( mem0 ce_in ) + USE SIGNAL ; - - _008_ ( mem0 addr_in[5] ) + USE SIGNAL ; - - _009_ ( mem0 addr_in[4] ) + USE SIGNAL ; - - _010_ ( mem0 addr_in[3] ) + USE SIGNAL ; - - _011_ ( mem0 addr_in[2] ) + USE SIGNAL ; - - _012_ ( mem2 we_in ) ( mem0 addr_in[1] ) + USE SIGNAL ; - - _013_ ( mem2 ce_in ) ( mem0 addr_in[0] ) + USE SIGNAL ; - - _014_ ( mem2 addr_in[5] ) ( mem0 wd_in[6] ) + USE SIGNAL ; - - _015_ ( mem2 addr_in[4] ) ( mem0 wd_in[5] ) + USE SIGNAL ; - - _016_ ( mem2 addr_in[3] ) ( mem0 wd_in[4] ) + USE SIGNAL ; - - _017_ ( mem2 addr_in[2] ) ( mem0 wd_in[3] ) + USE SIGNAL ; - - _018_ ( mem2 addr_in[1] ) ( mem0 wd_in[2] ) + USE SIGNAL ; - - _019_ ( mem2 addr_in[0] ) ( mem0 wd_in[1] ) + USE SIGNAL ; - - _020_ ( mem2 wd_in[6] ) ( mem0 wd_in[0] ) + USE SIGNAL ; - - _021_ ( mem2 wd_in[5] ) ( mem0 w_mask_in[6] ) + USE SIGNAL ; - - _054_ ( mem1 w_mask_in[3] ) + USE SIGNAL ; - - _055_ ( mem1 w_mask_in[2] ) + USE SIGNAL ; - - _056_ ( mem1 w_mask_in[1] ) + USE SIGNAL ; - - _076_ ( mem2 wd_in[4] ) ( mem0 w_mask_in[5] ) + USE SIGNAL ; - - _077_ ( mem2 wd_in[3] ) ( mem0 w_mask_in[4] ) + USE SIGNAL ; - - _078_ ( mem2 wd_in[2] ) ( mem0 w_mask_in[3] ) + USE SIGNAL ; - - _079_ ( mem2 wd_in[1] ) ( mem0 w_mask_in[2] ) + USE SIGNAL ; - - _080_ ( mem2 wd_in[0] ) ( mem0 w_mask_in[1] ) + USE SIGNAL ; - - _081_ ( mem2 w_mask_in[6] ) ( mem0 w_mask_in[0] ) + USE SIGNAL ; - - _082_ ( mem2 w_mask_in[5] ) + USE SIGNAL ; - - _083_ ( mem2 w_mask_in[4] ) + USE SIGNAL ; - - _084_ ( mem2 w_mask_in[3] ) + USE SIGNAL ; - - _085_ ( mem2 w_mask_in[2] ) + USE SIGNAL ; - - _086_ ( mem2 w_mask_in[1] ) + USE SIGNAL ; - - _087_ ( mem2 w_mask_in[0] ) + USE SIGNAL ; - - _090_ ( mem1 we_in ) + USE SIGNAL ; - - _091_ ( mem1 ce_in ) + USE SIGNAL ; - - _092_ ( mem1 addr_in[5] ) + USE SIGNAL ; - - _093_ ( mem1 addr_in[4] ) + USE SIGNAL ; - - _094_ ( mem1 addr_in[3] ) + USE SIGNAL ; - - _095_ ( mem1 addr_in[2] ) + USE SIGNAL ; - - _096_ ( mem1 addr_in[1] ) + USE SIGNAL ; - - _097_ ( mem1 addr_in[0] ) + USE SIGNAL ; - - _105_ ( mem1 w_mask_in[6] ) + USE SIGNAL ; - - _106_ ( mem1 w_mask_in[5] ) + USE SIGNAL ; - - _107_ ( mem1 w_mask_in[4] ) + USE SIGNAL ; - - clk ( PIN clk ) ( r36 CK ) ( r35 CK ) ( r34 CK ) ( r33 CK ) ( r32 CK ) ( r31 CK ) - ( r30 CK ) ( r26 CK ) ( r25 CK ) ( r24 CK ) ( r23 CK ) ( r22 CK ) ( r21 CK ) ( r20 CK ) - ( r16 CK ) ( r15 CK ) ( r14 CK ) ( r13 CK ) ( r12 CK ) ( r11 CK ) ( r10 CK ) ( mem2 clk ) - ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - l1[0] ( r20 D ) ( r10 Q ) + USE SIGNAL ; - - l1[1] ( r21 D ) ( r11 Q ) + USE SIGNAL ; - - l1[2] ( r22 D ) ( r12 Q ) + USE SIGNAL ; - - l1[3] ( r23 D ) ( r13 Q ) + USE SIGNAL ; - - l1[4] ( r24 D ) ( r14 Q ) + USE SIGNAL ; - - l1[5] ( r25 D ) ( r15 Q ) + USE SIGNAL ; - - l1[6] ( r26 D ) ( r16 Q ) + USE SIGNAL ; - - l2[0] ( r30 D ) ( r20 Q ) + USE SIGNAL ; - - l2[1] ( r31 D ) ( r21 Q ) + USE SIGNAL ; - - l2[2] ( r32 D ) ( r22 Q ) + USE SIGNAL ; - - l2[3] ( r33 D ) ( r23 Q ) + USE SIGNAL ; - - l2[4] ( r34 D ) ( r24 Q ) + USE SIGNAL ; - - l2[5] ( r35 D ) ( r25 Q ) + USE SIGNAL ; - - l2[6] ( r36 D ) ( r26 Q ) + USE SIGNAL ; - - l3[0] ( r30 Q ) ( mem1 wd_in[0] ) + USE SIGNAL ; - - l3[1] ( r31 Q ) ( mem1 wd_in[1] ) + USE SIGNAL ; - - l3[2] ( r32 Q ) ( mem1 wd_in[2] ) + USE SIGNAL ; - - l3[3] ( r33 Q ) ( mem1 wd_in[3] ) + USE SIGNAL ; - - l3[4] ( r34 Q ) ( mem1 wd_in[4] ) + USE SIGNAL ; - - l3[5] ( r35 Q ) ( mem1 wd_in[5] ) + USE SIGNAL ; - - l3[6] ( r36 Q ) ( mem1 wd_in[6] ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( r10 D ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( r11 D ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( r12 D ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( r13 D ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( r14 D ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( r15 D ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( r16 D ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; - - mem_out2[0] ( PIN mem_out2[0] ) ( mem2 rd_out[0] ) + USE SIGNAL ; - - mem_out2[1] ( PIN mem_out2[1] ) ( mem2 rd_out[1] ) + USE SIGNAL ; - - mem_out2[2] ( PIN mem_out2[2] ) ( mem2 rd_out[2] ) + USE SIGNAL ; - - mem_out2[3] ( PIN mem_out2[3] ) ( mem2 rd_out[3] ) + USE SIGNAL ; - - mem_out2[4] ( PIN mem_out2[4] ) ( mem2 rd_out[4] ) + USE SIGNAL ; - - mem_out2[5] ( PIN mem_out2[5] ) ( mem2 rd_out[5] ) + USE SIGNAL ; - - mem_out2[6] ( PIN mem_out2[6] ) ( mem2 rd_out[6] ) + USE SIGNAL ; - - req_msg[0] ( PIN req_msg[0] ) + USE SIGNAL ; - - req_msg[10] ( PIN req_msg[10] ) + USE SIGNAL ; - - req_msg[11] ( PIN req_msg[11] ) + USE SIGNAL ; - - req_msg[12] ( PIN req_msg[12] ) + USE SIGNAL ; - - req_msg[13] ( PIN req_msg[13] ) + USE SIGNAL ; - - req_msg[14] ( PIN req_msg[14] ) + USE SIGNAL ; - - req_msg[15] ( PIN req_msg[15] ) + USE SIGNAL ; - - req_msg[16] ( PIN req_msg[16] ) + USE SIGNAL ; - - req_msg[17] ( PIN req_msg[17] ) + USE SIGNAL ; - - req_msg[18] ( PIN req_msg[18] ) + USE SIGNAL ; - - req_msg[19] ( PIN req_msg[19] ) + USE SIGNAL ; - - req_msg[1] ( PIN req_msg[1] ) + USE SIGNAL ; - - req_msg[20] ( PIN req_msg[20] ) + USE SIGNAL ; - - req_msg[21] ( PIN req_msg[21] ) + USE SIGNAL ; - - req_msg[22] ( PIN req_msg[22] ) + USE SIGNAL ; - - req_msg[23] ( PIN req_msg[23] ) + USE SIGNAL ; - - req_msg[24] ( PIN req_msg[24] ) + USE SIGNAL ; - - req_msg[25] ( PIN req_msg[25] ) + USE SIGNAL ; - - req_msg[26] ( PIN req_msg[26] ) + USE SIGNAL ; - - req_msg[27] ( PIN req_msg[27] ) + USE SIGNAL ; - - req_msg[28] ( PIN req_msg[28] ) + USE SIGNAL ; - - req_msg[29] ( PIN req_msg[29] ) + USE SIGNAL ; - - req_msg[2] ( PIN req_msg[2] ) + USE SIGNAL ; - - req_msg[30] ( PIN req_msg[30] ) + USE SIGNAL ; - - req_msg[31] ( PIN req_msg[31] ) + USE SIGNAL ; - - req_msg[3] ( PIN req_msg[3] ) + USE SIGNAL ; - - req_msg[4] ( PIN req_msg[4] ) + USE SIGNAL ; - - req_msg[5] ( PIN req_msg[5] ) + USE SIGNAL ; - - req_msg[6] ( PIN req_msg[6] ) + USE SIGNAL ; - - req_msg[7] ( PIN req_msg[7] ) + USE SIGNAL ; - - req_msg[8] ( PIN req_msg[8] ) + USE SIGNAL ; - - req_msg[9] ( PIN req_msg[9] ) + USE SIGNAL ; - - req_rdy ( PIN req_rdy ) + USE SIGNAL ; - - req_val ( PIN req_val ) + USE SIGNAL ; - - reset ( PIN reset ) + USE SIGNAL ; - - resp_msg[0] ( PIN resp_msg[0] ) + USE SIGNAL ; - - resp_msg[10] ( PIN resp_msg[10] ) + USE SIGNAL ; - - resp_msg[11] ( PIN resp_msg[11] ) + USE SIGNAL ; - - resp_msg[12] ( PIN resp_msg[12] ) + USE SIGNAL ; - - resp_msg[13] ( PIN resp_msg[13] ) + USE SIGNAL ; - - resp_msg[14] ( PIN resp_msg[14] ) + USE SIGNAL ; - - resp_msg[15] ( PIN resp_msg[15] ) + USE SIGNAL ; - - resp_msg[1] ( PIN resp_msg[1] ) + USE SIGNAL ; - - resp_msg[2] ( PIN resp_msg[2] ) + USE SIGNAL ; - - resp_msg[3] ( PIN resp_msg[3] ) + USE SIGNAL ; - - resp_msg[4] ( PIN resp_msg[4] ) + USE SIGNAL ; - - resp_msg[5] ( PIN resp_msg[5] ) + USE SIGNAL ; - - resp_msg[6] ( PIN resp_msg[6] ) + USE SIGNAL ; - - resp_msg[7] ( PIN resp_msg[7] ) + USE SIGNAL ; - - resp_msg[8] ( PIN resp_msg[8] ) + USE SIGNAL ; - - resp_msg[9] ( PIN resp_msg[9] ) + USE SIGNAL ; - - resp_rdy ( PIN resp_rdy ) + USE SIGNAL ; - - resp_val ( PIN resp_val ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/level3.tcl b/src/mpl/test/level3.tcl deleted file mode 100644 index c2bca533533..00000000000 --- a/src/mpl/test/level3.tcl +++ /dev/null @@ -1,30 +0,0 @@ -source "helpers.tcl" -read_liberty Nangate45/Nangate45_typ.lib -read_liberty Nangate45/fakeram45_64x7.lib - -read_lef Nangate45/Nangate45.lef -read_lef Nangate45/fakeram45_64x7.lef - -# place_pins result is not stable across ports. sigh. -if {0} { - read_verilog level3.v - link_design gcd_mem3 - - source Nangate45/Nangate45.vars - - # macro_place fails with smaller cores - set die_area {0 0 200 250} - set core_area {5 5 195 245} - - initialize_floorplan -site $site \ - -die_area $die_area \ - -core_area $core_area - source $tracks_file - place_pins -random -hor_layers $io_placer_hor_layer -ver_layers $io_placer_ver_layer - global_placement - - write_def level3.def -} else { - read_def level3.def -} -read_sdc gcd.sdc diff --git a/src/mpl/test/level3.v b/src/mpl/test/level3.v deleted file mode 100644 index e790cb2f5ef..00000000000 --- a/src/mpl/test/level3.v +++ /dev/null @@ -1,160 +0,0 @@ -module gcd_mem3 ( - clk, - req_msg, - req_rdy, - req_val, - reset, - resp_msg, - resp_rdy, - resp_val, - mem_out0, - mem_out1, - mem_out2); - input clk; - input [31:0] req_msg; - output req_rdy; - input req_val; - input reset; - output [15:0] resp_msg; - input resp_rdy; - output resp_val; - output [6:0] mem_out0; - output [6:0] mem_out1; - output [6:0] mem_out2; - wire [6:0] data; - - // mem0/rd_out -> r1* -> r2* -> r3* -> mem1/wd_in - DFF_X1 r10 (.D(mem_out0[0]), - .CK(clk), - .Q(l1[0])); - DFF_X1 r11 (.D(mem_out0[1]), - .CK(clk), - .Q(l1[1])); - DFF_X1 r12 (.D(mem_out0[2]), - .CK(clk), - .Q(l1[2])); - DFF_X1 r13 (.D(mem_out0[3]), - .CK(clk), - .Q(l1[3])); - DFF_X1 r14 (.D(mem_out0[4]), - .CK(clk), - .Q(l1[4])); - DFF_X1 r15 (.D(mem_out0[5]), - .CK(clk), - .Q(l1[5])); - DFF_X1 r16 (.D(mem_out0[6]), - .CK(clk), - .Q(l1[6])); - - DFF_X1 r20 (.D(l1[0]), - .CK(clk), - .Q(l2[0])); - DFF_X1 r21 (.D(l1[1]), - .CK(clk), - .Q(l2[1])); - DFF_X1 r22 (.D(l1[2]), - .CK(clk), - .Q(l2[2])); - DFF_X1 r23 (.D(l1[3]), - .CK(clk), - .Q(l2[3])); - DFF_X1 r24 (.D(l1[4]), - .CK(clk), - .Q(l2[4])); - DFF_X1 r25 (.D(l1[5]), - .CK(clk), - .Q(l2[5])); - DFF_X1 r26 (.D(l1[6]), - .CK(clk), - .Q(l2[6])); - - DFF_X1 r30 (.D(l2[0]), - .CK(clk), - .Q(l3[0])); - DFF_X1 r31 (.D(l2[1]), - .CK(clk), - .Q(l3[1])); - DFF_X1 r32 (.D(l2[2]), - .CK(clk), - .Q(l3[2])); - DFF_X1 r33 (.D(l2[3]), - .CK(clk), - .Q(l3[3])); - DFF_X1 r34 (.D(l2[4]), - .CK(clk), - .Q(l3[4])); - DFF_X1 r35 (.D(l2[5]), - .CK(clk), - .Q(l3[5])); - DFF_X1 r36 (.D(l2[6]), - .CK(clk), - .Q(l3[6])); - - fakeram45_64x7 mem0 (.clk(clk), - .rd_out(mem_out0), - .we_in(_006_), - .ce_in(_007_), - .addr_in({ _008_, - _009_, - _010_, - _011_, - _012_, - _013_ }), - .wd_in({ _014_, - _015_, - _016_, - _017_, - _018_, - _019_, - _020_ }), - .w_mask_in({ _021_, - _076_, - _077_, - _078_, - _079_, - _080_, - _081_ })); - fakeram45_64x7 mem1 (.clk(clk), - .rd_out(mem_out1), - .we_in(_090_), - .ce_in(_091_), - .addr_in({ _092_, - _093_, - _094_, - _095_, - _096_, - _097_ }), - .wd_in(l3[6:0]), - .w_mask_in({ _105_, - _106_, - _107_, - _054_, - _055_, - _056_, - _003_ })); - fakeram45_64x7 mem2 (.clk(clk), - .rd_out(mem_out2), - .we_in(_012_), - .ce_in(_013_), - .addr_in({ _014_, - _015_, - _016_, - _017_, - _018_, - _019_ }), - .wd_in({ _020_, - _021_, - _076_, - _077_, - _078_, - _079_, - _080_ }), - .w_mask_in({ _081_, - _082_, - _083_, - _084_, - _085_, - _086_, - _087_ })); -endmodule - diff --git a/src/mpl/test/level3_01.defok b/src/mpl/test/level3_01.defok deleted file mode 100644 index 50b07b655aa..00000000000 --- a/src/mpl/test/level3_01.defok +++ /dev/null @@ -1,670 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN gcd_mem3 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 400000 500000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 10260 11200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 10260 14000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 10260 16800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 10260 19600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 10260 22400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 10260 25200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 10260 28000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 10260 30800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 10260 33600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 10260 36400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 10260 39200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 10260 42000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 10260 44800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 10260 47600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 10260 50400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 10260 53200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 10260 56000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 10260 58800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 10260 61600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 10260 64400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 10260 67200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 10260 70000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 10260 72800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 10260 75600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 10260 78400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 10260 81200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 10260 84000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 10260 86800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 10260 89600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 10260 92400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 10260 95200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 10260 98000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 10260 100800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 10260 103600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 10260 106400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 10260 109200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 10260 112000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 10260 114800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 10260 117600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 10260 120400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 10260 123200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 10260 126000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 10260 128800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 10260 131600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 10260 134400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 10260 137200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 10260 140000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 10260 142800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 10260 145600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 10260 148400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 10260 151200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 10260 154000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 10260 156800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 10260 159600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 10260 162400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 10260 165200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_56 FreePDK45_38x28_10R_NP_162NW_34O 10260 168000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_57 FreePDK45_38x28_10R_NP_162NW_34O 10260 170800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_58 FreePDK45_38x28_10R_NP_162NW_34O 10260 173600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_59 FreePDK45_38x28_10R_NP_162NW_34O 10260 176400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_60 FreePDK45_38x28_10R_NP_162NW_34O 10260 179200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_61 FreePDK45_38x28_10R_NP_162NW_34O 10260 182000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_62 FreePDK45_38x28_10R_NP_162NW_34O 10260 184800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_63 FreePDK45_38x28_10R_NP_162NW_34O 10260 187600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_64 FreePDK45_38x28_10R_NP_162NW_34O 10260 190400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_65 FreePDK45_38x28_10R_NP_162NW_34O 10260 193200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_66 FreePDK45_38x28_10R_NP_162NW_34O 10260 196000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_67 FreePDK45_38x28_10R_NP_162NW_34O 10260 198800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_68 FreePDK45_38x28_10R_NP_162NW_34O 10260 201600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_69 FreePDK45_38x28_10R_NP_162NW_34O 10260 204400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_70 FreePDK45_38x28_10R_NP_162NW_34O 10260 207200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_71 FreePDK45_38x28_10R_NP_162NW_34O 10260 210000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_72 FreePDK45_38x28_10R_NP_162NW_34O 10260 212800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_73 FreePDK45_38x28_10R_NP_162NW_34O 10260 215600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_74 FreePDK45_38x28_10R_NP_162NW_34O 10260 218400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_75 FreePDK45_38x28_10R_NP_162NW_34O 10260 221200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_76 FreePDK45_38x28_10R_NP_162NW_34O 10260 224000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_77 FreePDK45_38x28_10R_NP_162NW_34O 10260 226800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_78 FreePDK45_38x28_10R_NP_162NW_34O 10260 229600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_79 FreePDK45_38x28_10R_NP_162NW_34O 10260 232400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_80 FreePDK45_38x28_10R_NP_162NW_34O 10260 235200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_81 FreePDK45_38x28_10R_NP_162NW_34O 10260 238000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_82 FreePDK45_38x28_10R_NP_162NW_34O 10260 240800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_83 FreePDK45_38x28_10R_NP_162NW_34O 10260 243600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_84 FreePDK45_38x28_10R_NP_162NW_34O 10260 246400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_85 FreePDK45_38x28_10R_NP_162NW_34O 10260 249200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_86 FreePDK45_38x28_10R_NP_162NW_34O 10260 252000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_87 FreePDK45_38x28_10R_NP_162NW_34O 10260 254800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_88 FreePDK45_38x28_10R_NP_162NW_34O 10260 257600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_89 FreePDK45_38x28_10R_NP_162NW_34O 10260 260400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_90 FreePDK45_38x28_10R_NP_162NW_34O 10260 263200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_91 FreePDK45_38x28_10R_NP_162NW_34O 10260 266000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_92 FreePDK45_38x28_10R_NP_162NW_34O 10260 268800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_93 FreePDK45_38x28_10R_NP_162NW_34O 10260 271600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_94 FreePDK45_38x28_10R_NP_162NW_34O 10260 274400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_95 FreePDK45_38x28_10R_NP_162NW_34O 10260 277200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_96 FreePDK45_38x28_10R_NP_162NW_34O 10260 280000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_97 FreePDK45_38x28_10R_NP_162NW_34O 10260 282800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_98 FreePDK45_38x28_10R_NP_162NW_34O 10260 285600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_99 FreePDK45_38x28_10R_NP_162NW_34O 10260 288400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_100 FreePDK45_38x28_10R_NP_162NW_34O 10260 291200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_101 FreePDK45_38x28_10R_NP_162NW_34O 10260 294000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_102 FreePDK45_38x28_10R_NP_162NW_34O 10260 296800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_103 FreePDK45_38x28_10R_NP_162NW_34O 10260 299600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_104 FreePDK45_38x28_10R_NP_162NW_34O 10260 302400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_105 FreePDK45_38x28_10R_NP_162NW_34O 10260 305200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_106 FreePDK45_38x28_10R_NP_162NW_34O 10260 308000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_107 FreePDK45_38x28_10R_NP_162NW_34O 10260 310800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_108 FreePDK45_38x28_10R_NP_162NW_34O 10260 313600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_109 FreePDK45_38x28_10R_NP_162NW_34O 10260 316400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_110 FreePDK45_38x28_10R_NP_162NW_34O 10260 319200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_111 FreePDK45_38x28_10R_NP_162NW_34O 10260 322000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_112 FreePDK45_38x28_10R_NP_162NW_34O 10260 324800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_113 FreePDK45_38x28_10R_NP_162NW_34O 10260 327600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_114 FreePDK45_38x28_10R_NP_162NW_34O 10260 330400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_115 FreePDK45_38x28_10R_NP_162NW_34O 10260 333200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_116 FreePDK45_38x28_10R_NP_162NW_34O 10260 336000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_117 FreePDK45_38x28_10R_NP_162NW_34O 10260 338800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_118 FreePDK45_38x28_10R_NP_162NW_34O 10260 341600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_119 FreePDK45_38x28_10R_NP_162NW_34O 10260 344400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_120 FreePDK45_38x28_10R_NP_162NW_34O 10260 347200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_121 FreePDK45_38x28_10R_NP_162NW_34O 10260 350000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_122 FreePDK45_38x28_10R_NP_162NW_34O 10260 352800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_123 FreePDK45_38x28_10R_NP_162NW_34O 10260 355600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_124 FreePDK45_38x28_10R_NP_162NW_34O 10260 358400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_125 FreePDK45_38x28_10R_NP_162NW_34O 10260 361200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_126 FreePDK45_38x28_10R_NP_162NW_34O 10260 364000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_127 FreePDK45_38x28_10R_NP_162NW_34O 10260 366800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_128 FreePDK45_38x28_10R_NP_162NW_34O 10260 369600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_129 FreePDK45_38x28_10R_NP_162NW_34O 10260 372400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_130 FreePDK45_38x28_10R_NP_162NW_34O 10260 375200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_131 FreePDK45_38x28_10R_NP_162NW_34O 10260 378000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_132 FreePDK45_38x28_10R_NP_162NW_34O 10260 380800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_133 FreePDK45_38x28_10R_NP_162NW_34O 10260 383600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_134 FreePDK45_38x28_10R_NP_162NW_34O 10260 386400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_135 FreePDK45_38x28_10R_NP_162NW_34O 10260 389200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_136 FreePDK45_38x28_10R_NP_162NW_34O 10260 392000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_137 FreePDK45_38x28_10R_NP_162NW_34O 10260 394800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_138 FreePDK45_38x28_10R_NP_162NW_34O 10260 397600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_139 FreePDK45_38x28_10R_NP_162NW_34O 10260 400400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_140 FreePDK45_38x28_10R_NP_162NW_34O 10260 403200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_141 FreePDK45_38x28_10R_NP_162NW_34O 10260 406000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_142 FreePDK45_38x28_10R_NP_162NW_34O 10260 408800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_143 FreePDK45_38x28_10R_NP_162NW_34O 10260 411600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_144 FreePDK45_38x28_10R_NP_162NW_34O 10260 414400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_145 FreePDK45_38x28_10R_NP_162NW_34O 10260 417200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_146 FreePDK45_38x28_10R_NP_162NW_34O 10260 420000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_147 FreePDK45_38x28_10R_NP_162NW_34O 10260 422800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_148 FreePDK45_38x28_10R_NP_162NW_34O 10260 425600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_149 FreePDK45_38x28_10R_NP_162NW_34O 10260 428400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_150 FreePDK45_38x28_10R_NP_162NW_34O 10260 431200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_151 FreePDK45_38x28_10R_NP_162NW_34O 10260 434000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_152 FreePDK45_38x28_10R_NP_162NW_34O 10260 436800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_153 FreePDK45_38x28_10R_NP_162NW_34O 10260 439600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_154 FreePDK45_38x28_10R_NP_162NW_34O 10260 442400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_155 FreePDK45_38x28_10R_NP_162NW_34O 10260 445200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_156 FreePDK45_38x28_10R_NP_162NW_34O 10260 448000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_157 FreePDK45_38x28_10R_NP_162NW_34O 10260 450800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_158 FreePDK45_38x28_10R_NP_162NW_34O 10260 453600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_159 FreePDK45_38x28_10R_NP_162NW_34O 10260 456400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_160 FreePDK45_38x28_10R_NP_162NW_34O 10260 459200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_161 FreePDK45_38x28_10R_NP_162NW_34O 10260 462000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_162 FreePDK45_38x28_10R_NP_162NW_34O 10260 464800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_163 FreePDK45_38x28_10R_NP_162NW_34O 10260 467600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_164 FreePDK45_38x28_10R_NP_162NW_34O 10260 470400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_165 FreePDK45_38x28_10R_NP_162NW_34O 10260 473200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_166 FreePDK45_38x28_10R_NP_162NW_34O 10260 476000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_167 FreePDK45_38x28_10R_NP_162NW_34O 10260 478800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_168 FreePDK45_38x28_10R_NP_162NW_34O 10260 481600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_169 FreePDK45_38x28_10R_NP_162NW_34O 10260 484400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_170 FreePDK45_38x28_10R_NP_162NW_34O 10260 487200 N DO 999 BY 1 STEP 380 0 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 250 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 313 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 250 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 313 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 125 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 157 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 125 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 157 STEP 3200 LAYER metal10 ; -COMPONENTS 24 ; - - mem0 fakeram45_64x7 + FIXED ( 281120 376880 ) N ; - - mem1 fakeram45_64x7 + FIXED ( 281120 12320 ) N ; - - mem2 fakeram45_64x7 + FIXED ( 281120 263200 ) N ; - - r10 DFF_X1 + PLACED ( 277482 237870 ) N ; - - r11 DFF_X1 + PLACED ( 278102 168030 ) N ; - - r12 DFF_X1 + PLACED ( 276751 280105 ) N ; - - r13 DFF_X1 + PLACED ( 277947 186590 ) N ; - - r14 DFF_X1 + PLACED ( 249329 281162 ) N ; - - r15 DFF_X1 + PLACED ( 250670 283996 ) N ; - - r16 DFF_X1 + PLACED ( 247689 185950 ) N ; - - r20 DFF_X1 + PLACED ( 269742 213388 ) N ; - - r21 DFF_X1 + PLACED ( 270302 168057 ) N ; - - r22 DFF_X1 + PLACED ( 269117 242470 ) N ; - - r23 DFF_X1 + PLACED ( 270332 182466 ) N ; - - r24 DFF_X1 + PLACED ( 259021 246800 ) N ; - - r25 DFF_X1 + PLACED ( 267011 249609 ) N ; - - r26 DFF_X1 + PLACED ( 258298 186075 ) N ; - - r30 DFF_X1 + PLACED ( 281002 189782 ) N ; - - r31 DFF_X1 + PLACED ( 281236 169207 ) N ; - - r32 DFF_X1 + PLACED ( 280668 207354 ) N ; - - r33 DFF_X1 + PLACED ( 281098 179947 ) N ; - - r34 DFF_X1 + PLACED ( 269253 212963 ) N ; - - r35 DFF_X1 + PLACED ( 267008 215910 ) N ; - - r36 DFF_X1 + PLACED ( 268972 186295 ) N ; -END COMPONENTS -PINS 75 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 43260 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 256620 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 24780 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 361900 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 172060 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 464380 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 241110 499930 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 201590 70 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 66780 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 338380 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 383990 499930 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 144590 70 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 148540 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 193340 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 340620 ) N ; - - mem_out2[0] + NET mem_out2[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 403900 ) N ; - - mem_out2[1] + NET mem_out2[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 317100 ) N ; - - mem_out2[2] + NET mem_out2[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 425180 ) N ; - - mem_out2[3] + NET mem_out2[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 315590 70 ) N ; - - mem_out2[4] + NET mem_out2[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 214620 ) N ; - - mem_out2[5] + NET mem_out2[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 295820 ) N ; - - mem_out2[6] + NET mem_out2[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 212230 499930 ) N ; - - req_msg[0] + NET req_msg[0] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 383180 ) N ; - - req_msg[10] + NET req_msg[10] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 3500 ) N ; - - req_msg[11] + NET req_msg[11] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 108780 ) N ; - - req_msg[12] + NET req_msg[12] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 58710 70 ) N ; - - req_msg[13] + NET req_msg[13] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 344470 70 ) N ; - - req_msg[14] + NET req_msg[14] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 253820 ) N ; - - req_msg[15] + NET req_msg[15] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 422380 ) N ; - - req_msg[16] + NET req_msg[16] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 211820 ) N ; - - req_msg[17] + NET req_msg[17] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 258590 70 ) N ; - - req_msg[18] + NET req_msg[18] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 63980 ) N ; - - req_msg[19] + NET req_msg[19] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 115710 70 ) N ; - - req_msg[1] + NET req_msg[1] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 40470 499930 ) N ; - - req_msg[20] + NET req_msg[20] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 401100 ) N ; - - req_msg[21] + NET req_msg[21] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 88060 ) N ; - - req_msg[22] + NET req_msg[22] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 97470 499930 ) N ; - - req_msg[23] + NET req_msg[23] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 355110 499930 ) N ; - - req_msg[24] + NET req_msg[24] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 46060 ) N ; - - req_msg[25] + NET req_msg[25] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 126350 499930 ) N ; - - req_msg[26] + NET req_msg[26] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 151340 ) N ; - - req_msg[27] + NET req_msg[27] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 235340 ) N ; - - req_msg[28] + NET req_msg[28] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 85260 ) N ; - - req_msg[29] + NET req_msg[29] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 277340 ) N ; - - req_msg[2] + NET req_msg[2] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 69350 499930 ) N ; - - req_msg[30] + NET req_msg[30] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 183350 499930 ) N ; - - req_msg[31] + NET req_msg[31] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 380380 ) N ; - - req_msg[3] + NET req_msg[3] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 1710 70 ) N ; - - req_msg[4] + NET req_msg[4] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 232540 ) N ; - - req_msg[5] + NET req_msg[5] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 155230 499930 ) N ; - - req_msg[6] + NET req_msg[6] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 269230 499930 ) N ; - - req_msg[7] + NET req_msg[7] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 488460 ) N ; - - req_msg[8] + NET req_msg[8] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 106540 ) N ; - - req_msg[9] + NET req_msg[9] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 275100 ) N ; - - req_rdy + NET req_rdy + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 29830 70 ) N ; - - req_val + NET req_val + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 467180 ) N ; - - reset + NET reset + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 169820 ) N ; - - resp_msg[0] + NET resp_msg[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 230470 70 ) N ; - - resp_msg[10] + NET resp_msg[10] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 445900 ) N ; - - resp_msg[11] + NET resp_msg[11] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 130060 ) N ; - - resp_msg[12] + NET resp_msg[12] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 485660 ) N ; - - resp_msg[13] + NET resp_msg[13] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 21980 ) N ; - - resp_msg[14] + NET resp_msg[14] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 86830 70 ) N ; - - resp_msg[15] + NET resp_msg[15] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 172710 70 ) N ; - - resp_msg[1] + NET resp_msg[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 190540 ) N ; - - resp_msg[2] + NET resp_msg[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 319900 ) N ; - - resp_msg[3] + NET resp_msg[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 287470 70 ) N ; - - resp_msg[4] + NET resp_msg[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 326230 499930 ) N ; - - resp_msg[5] + NET resp_msg[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 298110 499930 ) N ; - - resp_msg[6] + NET resp_msg[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 443660 ) N ; - - resp_msg[7] + NET resp_msg[7] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 12350 499930 ) N ; - - resp_msg[8] + NET resp_msg[8] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 373350 70 ) N ; - - resp_msg[9] + NET resp_msg[9] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 127260 ) N ; - - resp_rdy + NET resp_rdy + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 359100 ) N ; - - resp_val + NET resp_val + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 298620 ) N ; -END PINS -NETS 139 ; - - _003_ ( mem1 w_mask_in[0] ) + USE SIGNAL ; - - _006_ ( mem0 we_in ) + USE SIGNAL ; - - _007_ ( mem0 ce_in ) + USE SIGNAL ; - - _008_ ( mem0 addr_in[5] ) + USE SIGNAL ; - - _009_ ( mem0 addr_in[4] ) + USE SIGNAL ; - - _010_ ( mem0 addr_in[3] ) + USE SIGNAL ; - - _011_ ( mem0 addr_in[2] ) + USE SIGNAL ; - - _012_ ( mem2 we_in ) ( mem0 addr_in[1] ) + USE SIGNAL ; - - _013_ ( mem2 ce_in ) ( mem0 addr_in[0] ) + USE SIGNAL ; - - _014_ ( mem2 addr_in[5] ) ( mem0 wd_in[6] ) + USE SIGNAL ; - - _015_ ( mem2 addr_in[4] ) ( mem0 wd_in[5] ) + USE SIGNAL ; - - _016_ ( mem2 addr_in[3] ) ( mem0 wd_in[4] ) + USE SIGNAL ; - - _017_ ( mem2 addr_in[2] ) ( mem0 wd_in[3] ) + USE SIGNAL ; - - _018_ ( mem2 addr_in[1] ) ( mem0 wd_in[2] ) + USE SIGNAL ; - - _019_ ( mem2 addr_in[0] ) ( mem0 wd_in[1] ) + USE SIGNAL ; - - _020_ ( mem2 wd_in[6] ) ( mem0 wd_in[0] ) + USE SIGNAL ; - - _021_ ( mem2 wd_in[5] ) ( mem0 w_mask_in[6] ) + USE SIGNAL ; - - _054_ ( mem1 w_mask_in[3] ) + USE SIGNAL ; - - _055_ ( mem1 w_mask_in[2] ) + USE SIGNAL ; - - _056_ ( mem1 w_mask_in[1] ) + USE SIGNAL ; - - _076_ ( mem2 wd_in[4] ) ( mem0 w_mask_in[5] ) + USE SIGNAL ; - - _077_ ( mem2 wd_in[3] ) ( mem0 w_mask_in[4] ) + USE SIGNAL ; - - _078_ ( mem2 wd_in[2] ) ( mem0 w_mask_in[3] ) + USE SIGNAL ; - - _079_ ( mem2 wd_in[1] ) ( mem0 w_mask_in[2] ) + USE SIGNAL ; - - _080_ ( mem2 wd_in[0] ) ( mem0 w_mask_in[1] ) + USE SIGNAL ; - - _081_ ( mem2 w_mask_in[6] ) ( mem0 w_mask_in[0] ) + USE SIGNAL ; - - _082_ ( mem2 w_mask_in[5] ) + USE SIGNAL ; - - _083_ ( mem2 w_mask_in[4] ) + USE SIGNAL ; - - _084_ ( mem2 w_mask_in[3] ) + USE SIGNAL ; - - _085_ ( mem2 w_mask_in[2] ) + USE SIGNAL ; - - _086_ ( mem2 w_mask_in[1] ) + USE SIGNAL ; - - _087_ ( mem2 w_mask_in[0] ) + USE SIGNAL ; - - _090_ ( mem1 we_in ) + USE SIGNAL ; - - _091_ ( mem1 ce_in ) + USE SIGNAL ; - - _092_ ( mem1 addr_in[5] ) + USE SIGNAL ; - - _093_ ( mem1 addr_in[4] ) + USE SIGNAL ; - - _094_ ( mem1 addr_in[3] ) + USE SIGNAL ; - - _095_ ( mem1 addr_in[2] ) + USE SIGNAL ; - - _096_ ( mem1 addr_in[1] ) + USE SIGNAL ; - - _097_ ( mem1 addr_in[0] ) + USE SIGNAL ; - - _105_ ( mem1 w_mask_in[6] ) + USE SIGNAL ; - - _106_ ( mem1 w_mask_in[5] ) + USE SIGNAL ; - - _107_ ( mem1 w_mask_in[4] ) + USE SIGNAL ; - - clk ( PIN clk ) ( r36 CK ) ( r35 CK ) ( r34 CK ) ( r33 CK ) ( r32 CK ) ( r31 CK ) - ( r30 CK ) ( r26 CK ) ( r25 CK ) ( r24 CK ) ( r23 CK ) ( r22 CK ) ( r21 CK ) ( r20 CK ) - ( r16 CK ) ( r15 CK ) ( r14 CK ) ( r13 CK ) ( r12 CK ) ( r11 CK ) ( r10 CK ) ( mem2 clk ) - ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - l1[0] ( r20 D ) ( r10 Q ) + USE SIGNAL ; - - l1[1] ( r21 D ) ( r11 Q ) + USE SIGNAL ; - - l1[2] ( r22 D ) ( r12 Q ) + USE SIGNAL ; - - l1[3] ( r23 D ) ( r13 Q ) + USE SIGNAL ; - - l1[4] ( r24 D ) ( r14 Q ) + USE SIGNAL ; - - l1[5] ( r25 D ) ( r15 Q ) + USE SIGNAL ; - - l1[6] ( r26 D ) ( r16 Q ) + USE SIGNAL ; - - l2[0] ( r30 D ) ( r20 Q ) + USE SIGNAL ; - - l2[1] ( r31 D ) ( r21 Q ) + USE SIGNAL ; - - l2[2] ( r32 D ) ( r22 Q ) + USE SIGNAL ; - - l2[3] ( r33 D ) ( r23 Q ) + USE SIGNAL ; - - l2[4] ( r34 D ) ( r24 Q ) + USE SIGNAL ; - - l2[5] ( r35 D ) ( r25 Q ) + USE SIGNAL ; - - l2[6] ( r36 D ) ( r26 Q ) + USE SIGNAL ; - - l3[0] ( r30 Q ) ( mem1 wd_in[0] ) + USE SIGNAL ; - - l3[1] ( r31 Q ) ( mem1 wd_in[1] ) + USE SIGNAL ; - - l3[2] ( r32 Q ) ( mem1 wd_in[2] ) + USE SIGNAL ; - - l3[3] ( r33 Q ) ( mem1 wd_in[3] ) + USE SIGNAL ; - - l3[4] ( r34 Q ) ( mem1 wd_in[4] ) + USE SIGNAL ; - - l3[5] ( r35 Q ) ( mem1 wd_in[5] ) + USE SIGNAL ; - - l3[6] ( r36 Q ) ( mem1 wd_in[6] ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( r10 D ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( r11 D ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( r12 D ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( r13 D ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( r14 D ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( r15 D ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( r16 D ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; - - mem_out2[0] ( PIN mem_out2[0] ) ( mem2 rd_out[0] ) + USE SIGNAL ; - - mem_out2[1] ( PIN mem_out2[1] ) ( mem2 rd_out[1] ) + USE SIGNAL ; - - mem_out2[2] ( PIN mem_out2[2] ) ( mem2 rd_out[2] ) + USE SIGNAL ; - - mem_out2[3] ( PIN mem_out2[3] ) ( mem2 rd_out[3] ) + USE SIGNAL ; - - mem_out2[4] ( PIN mem_out2[4] ) ( mem2 rd_out[4] ) + USE SIGNAL ; - - mem_out2[5] ( PIN mem_out2[5] ) ( mem2 rd_out[5] ) + USE SIGNAL ; - - mem_out2[6] ( PIN mem_out2[6] ) ( mem2 rd_out[6] ) + USE SIGNAL ; - - req_msg[0] ( PIN req_msg[0] ) + USE SIGNAL ; - - req_msg[10] ( PIN req_msg[10] ) + USE SIGNAL ; - - req_msg[11] ( PIN req_msg[11] ) + USE SIGNAL ; - - req_msg[12] ( PIN req_msg[12] ) + USE SIGNAL ; - - req_msg[13] ( PIN req_msg[13] ) + USE SIGNAL ; - - req_msg[14] ( PIN req_msg[14] ) + USE SIGNAL ; - - req_msg[15] ( PIN req_msg[15] ) + USE SIGNAL ; - - req_msg[16] ( PIN req_msg[16] ) + USE SIGNAL ; - - req_msg[17] ( PIN req_msg[17] ) + USE SIGNAL ; - - req_msg[18] ( PIN req_msg[18] ) + USE SIGNAL ; - - req_msg[19] ( PIN req_msg[19] ) + USE SIGNAL ; - - req_msg[1] ( PIN req_msg[1] ) + USE SIGNAL ; - - req_msg[20] ( PIN req_msg[20] ) + USE SIGNAL ; - - req_msg[21] ( PIN req_msg[21] ) + USE SIGNAL ; - - req_msg[22] ( PIN req_msg[22] ) + USE SIGNAL ; - - req_msg[23] ( PIN req_msg[23] ) + USE SIGNAL ; - - req_msg[24] ( PIN req_msg[24] ) + USE SIGNAL ; - - req_msg[25] ( PIN req_msg[25] ) + USE SIGNAL ; - - req_msg[26] ( PIN req_msg[26] ) + USE SIGNAL ; - - req_msg[27] ( PIN req_msg[27] ) + USE SIGNAL ; - - req_msg[28] ( PIN req_msg[28] ) + USE SIGNAL ; - - req_msg[29] ( PIN req_msg[29] ) + USE SIGNAL ; - - req_msg[2] ( PIN req_msg[2] ) + USE SIGNAL ; - - req_msg[30] ( PIN req_msg[30] ) + USE SIGNAL ; - - req_msg[31] ( PIN req_msg[31] ) + USE SIGNAL ; - - req_msg[3] ( PIN req_msg[3] ) + USE SIGNAL ; - - req_msg[4] ( PIN req_msg[4] ) + USE SIGNAL ; - - req_msg[5] ( PIN req_msg[5] ) + USE SIGNAL ; - - req_msg[6] ( PIN req_msg[6] ) + USE SIGNAL ; - - req_msg[7] ( PIN req_msg[7] ) + USE SIGNAL ; - - req_msg[8] ( PIN req_msg[8] ) + USE SIGNAL ; - - req_msg[9] ( PIN req_msg[9] ) + USE SIGNAL ; - - req_rdy ( PIN req_rdy ) + USE SIGNAL ; - - req_val ( PIN req_val ) + USE SIGNAL ; - - reset ( PIN reset ) + USE SIGNAL ; - - resp_msg[0] ( PIN resp_msg[0] ) + USE SIGNAL ; - - resp_msg[10] ( PIN resp_msg[10] ) + USE SIGNAL ; - - resp_msg[11] ( PIN resp_msg[11] ) + USE SIGNAL ; - - resp_msg[12] ( PIN resp_msg[12] ) + USE SIGNAL ; - - resp_msg[13] ( PIN resp_msg[13] ) + USE SIGNAL ; - - resp_msg[14] ( PIN resp_msg[14] ) + USE SIGNAL ; - - resp_msg[15] ( PIN resp_msg[15] ) + USE SIGNAL ; - - resp_msg[1] ( PIN resp_msg[1] ) + USE SIGNAL ; - - resp_msg[2] ( PIN resp_msg[2] ) + USE SIGNAL ; - - resp_msg[3] ( PIN resp_msg[3] ) + USE SIGNAL ; - - resp_msg[4] ( PIN resp_msg[4] ) + USE SIGNAL ; - - resp_msg[5] ( PIN resp_msg[5] ) + USE SIGNAL ; - - resp_msg[6] ( PIN resp_msg[6] ) + USE SIGNAL ; - - resp_msg[7] ( PIN resp_msg[7] ) + USE SIGNAL ; - - resp_msg[8] ( PIN resp_msg[8] ) + USE SIGNAL ; - - resp_msg[9] ( PIN resp_msg[9] ) + USE SIGNAL ; - - resp_rdy ( PIN resp_rdy ) + USE SIGNAL ; - - resp_val ( PIN resp_val ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/level3_01.ok b/src/mpl/test/level3_01.ok deleted file mode 100644 index 96943fdd98a..00000000000 --- a/src/mpl/test/level3_01.ok +++ /dev/null @@ -1,36 +0,0 @@ -[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells -[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x7.lef, created 1 library cells -[INFO ODB-0128] Design: gcd_mem3 -[INFO ODB-0130] Created 75 pins. -[INFO ODB-0131] Created 24 components and 222 component-terminals. -[INFO ODB-0133] Created 139 nets and 153 connections. -[INFO MPL-0101] Found 3 macros. -[INFO MPL-0102] West pins 24. -[INFO MPL-0102] East pins 23. -[INFO MPL-0102] North pins 14. -[INFO MPL-0102] South pins 14. -[INFO MPL-0069] Initial weighted wire length 2565.97. -Begin one level partition. -[INFO MPL-0076] Partition 3 macros. -[INFO MPL-0077] Using 1 cut lines. -[INFO MPL-0079] Cut line 132.43. -End one level partition. -Begin horizontal partition. -Begin east partition. -[INFO MPL-0076] Partition 0 macros. -[INFO MPL-0077] Using 0 cut lines. -End east partition. -Begin west partition. -[INFO MPL-0076] Partition 3 macros. -[INFO MPL-0077] Using 3 cut lines. -[INFO MPL-0079] Cut line 61.60. -[INFO MPL-0079] Cut line 120.40. -[INFO MPL-0079] Cut line 142.80. -End west partition. -End horizontal partition. -[INFO MPL-0070] Using 3 partition sets. -[INFO MPL-0071] Solution 1 weighted wire length 2645.83. -[INFO MPL-0071] Solution 2 weighted wire length 3704.35. -[WARNING MPL-0061] Parquet area 54.77 x 114 exceeds the partition area 62.51 x 102.2. -[INFO MPL-0073] Best weighted wire length 3704.35. -No differences found. diff --git a/src/mpl/test/level3_01.py b/src/mpl/test/level3_01.py deleted file mode 100644 index 3815362a3a2..00000000000 --- a/src/mpl/test/level3_01.py +++ /dev/null @@ -1,20 +0,0 @@ -from openroad import Design, Tech -import helpers -import mpl_aux - -# 3 levels of registers between mem0 and mem1 -tech = Tech() -tech.readLiberty("Nangate45/Nangate45_typ.lib") -tech.readLiberty("Nangate45/fakeram45_64x7.lib") -tech.readLef("Nangate45/Nangate45.lef") -tech.readLef("Nangate45/fakeram45_64x7.lef") - -design = helpers.make_design(tech) -design.readDef("level3.def") -design.evalTclString('read_sdc "gcd.sdc"') - -mpl_aux.macro_placement(design, halo=[0.5, 0.5]) - -def_file = helpers.make_result_file("level3_01.def") -design.writeDef(def_file) -helpers.diff_files(def_file, "level3_01.defok") diff --git a/src/mpl/test/level3_01.tcl b/src/mpl/test/level3_01.tcl deleted file mode 100644 index f017a966014..00000000000 --- a/src/mpl/test/level3_01.tcl +++ /dev/null @@ -1,8 +0,0 @@ -# 3 levels of registers between mem0 and mem1 -source helpers.tcl -source level3.tcl -macro_placement -halo {0.5 0.5} - -set def_file [make_result_file level3_01.def] -write_def $def_file -diff_file $def_file level3_01.defok diff --git a/src/mpl/test/level3_02.defok b/src/mpl/test/level3_02.defok deleted file mode 100644 index b09e3fa39ae..00000000000 --- a/src/mpl/test/level3_02.defok +++ /dev/null @@ -1,670 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN gcd_mem3 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 400000 500000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 10260 11200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 10260 14000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 10260 16800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 10260 19600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 10260 22400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 10260 25200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 10260 28000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 10260 30800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 10260 33600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 10260 36400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 10260 39200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 10260 42000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 10260 44800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 10260 47600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 10260 50400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 10260 53200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 10260 56000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 10260 58800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 10260 61600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 10260 64400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 10260 67200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 10260 70000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 10260 72800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 10260 75600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 10260 78400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 10260 81200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 10260 84000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 10260 86800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 10260 89600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 10260 92400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 10260 95200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 10260 98000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 10260 100800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 10260 103600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 10260 106400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 10260 109200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 10260 112000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 10260 114800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 10260 117600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 10260 120400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 10260 123200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 10260 126000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 10260 128800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 10260 131600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 10260 134400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 10260 137200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 10260 140000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 10260 142800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 10260 145600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 10260 148400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 10260 151200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 10260 154000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 10260 156800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 10260 159600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 10260 162400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 10260 165200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_56 FreePDK45_38x28_10R_NP_162NW_34O 10260 168000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_57 FreePDK45_38x28_10R_NP_162NW_34O 10260 170800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_58 FreePDK45_38x28_10R_NP_162NW_34O 10260 173600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_59 FreePDK45_38x28_10R_NP_162NW_34O 10260 176400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_60 FreePDK45_38x28_10R_NP_162NW_34O 10260 179200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_61 FreePDK45_38x28_10R_NP_162NW_34O 10260 182000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_62 FreePDK45_38x28_10R_NP_162NW_34O 10260 184800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_63 FreePDK45_38x28_10R_NP_162NW_34O 10260 187600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_64 FreePDK45_38x28_10R_NP_162NW_34O 10260 190400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_65 FreePDK45_38x28_10R_NP_162NW_34O 10260 193200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_66 FreePDK45_38x28_10R_NP_162NW_34O 10260 196000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_67 FreePDK45_38x28_10R_NP_162NW_34O 10260 198800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_68 FreePDK45_38x28_10R_NP_162NW_34O 10260 201600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_69 FreePDK45_38x28_10R_NP_162NW_34O 10260 204400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_70 FreePDK45_38x28_10R_NP_162NW_34O 10260 207200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_71 FreePDK45_38x28_10R_NP_162NW_34O 10260 210000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_72 FreePDK45_38x28_10R_NP_162NW_34O 10260 212800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_73 FreePDK45_38x28_10R_NP_162NW_34O 10260 215600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_74 FreePDK45_38x28_10R_NP_162NW_34O 10260 218400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_75 FreePDK45_38x28_10R_NP_162NW_34O 10260 221200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_76 FreePDK45_38x28_10R_NP_162NW_34O 10260 224000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_77 FreePDK45_38x28_10R_NP_162NW_34O 10260 226800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_78 FreePDK45_38x28_10R_NP_162NW_34O 10260 229600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_79 FreePDK45_38x28_10R_NP_162NW_34O 10260 232400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_80 FreePDK45_38x28_10R_NP_162NW_34O 10260 235200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_81 FreePDK45_38x28_10R_NP_162NW_34O 10260 238000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_82 FreePDK45_38x28_10R_NP_162NW_34O 10260 240800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_83 FreePDK45_38x28_10R_NP_162NW_34O 10260 243600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_84 FreePDK45_38x28_10R_NP_162NW_34O 10260 246400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_85 FreePDK45_38x28_10R_NP_162NW_34O 10260 249200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_86 FreePDK45_38x28_10R_NP_162NW_34O 10260 252000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_87 FreePDK45_38x28_10R_NP_162NW_34O 10260 254800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_88 FreePDK45_38x28_10R_NP_162NW_34O 10260 257600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_89 FreePDK45_38x28_10R_NP_162NW_34O 10260 260400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_90 FreePDK45_38x28_10R_NP_162NW_34O 10260 263200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_91 FreePDK45_38x28_10R_NP_162NW_34O 10260 266000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_92 FreePDK45_38x28_10R_NP_162NW_34O 10260 268800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_93 FreePDK45_38x28_10R_NP_162NW_34O 10260 271600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_94 FreePDK45_38x28_10R_NP_162NW_34O 10260 274400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_95 FreePDK45_38x28_10R_NP_162NW_34O 10260 277200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_96 FreePDK45_38x28_10R_NP_162NW_34O 10260 280000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_97 FreePDK45_38x28_10R_NP_162NW_34O 10260 282800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_98 FreePDK45_38x28_10R_NP_162NW_34O 10260 285600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_99 FreePDK45_38x28_10R_NP_162NW_34O 10260 288400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_100 FreePDK45_38x28_10R_NP_162NW_34O 10260 291200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_101 FreePDK45_38x28_10R_NP_162NW_34O 10260 294000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_102 FreePDK45_38x28_10R_NP_162NW_34O 10260 296800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_103 FreePDK45_38x28_10R_NP_162NW_34O 10260 299600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_104 FreePDK45_38x28_10R_NP_162NW_34O 10260 302400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_105 FreePDK45_38x28_10R_NP_162NW_34O 10260 305200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_106 FreePDK45_38x28_10R_NP_162NW_34O 10260 308000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_107 FreePDK45_38x28_10R_NP_162NW_34O 10260 310800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_108 FreePDK45_38x28_10R_NP_162NW_34O 10260 313600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_109 FreePDK45_38x28_10R_NP_162NW_34O 10260 316400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_110 FreePDK45_38x28_10R_NP_162NW_34O 10260 319200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_111 FreePDK45_38x28_10R_NP_162NW_34O 10260 322000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_112 FreePDK45_38x28_10R_NP_162NW_34O 10260 324800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_113 FreePDK45_38x28_10R_NP_162NW_34O 10260 327600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_114 FreePDK45_38x28_10R_NP_162NW_34O 10260 330400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_115 FreePDK45_38x28_10R_NP_162NW_34O 10260 333200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_116 FreePDK45_38x28_10R_NP_162NW_34O 10260 336000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_117 FreePDK45_38x28_10R_NP_162NW_34O 10260 338800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_118 FreePDK45_38x28_10R_NP_162NW_34O 10260 341600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_119 FreePDK45_38x28_10R_NP_162NW_34O 10260 344400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_120 FreePDK45_38x28_10R_NP_162NW_34O 10260 347200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_121 FreePDK45_38x28_10R_NP_162NW_34O 10260 350000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_122 FreePDK45_38x28_10R_NP_162NW_34O 10260 352800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_123 FreePDK45_38x28_10R_NP_162NW_34O 10260 355600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_124 FreePDK45_38x28_10R_NP_162NW_34O 10260 358400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_125 FreePDK45_38x28_10R_NP_162NW_34O 10260 361200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_126 FreePDK45_38x28_10R_NP_162NW_34O 10260 364000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_127 FreePDK45_38x28_10R_NP_162NW_34O 10260 366800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_128 FreePDK45_38x28_10R_NP_162NW_34O 10260 369600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_129 FreePDK45_38x28_10R_NP_162NW_34O 10260 372400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_130 FreePDK45_38x28_10R_NP_162NW_34O 10260 375200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_131 FreePDK45_38x28_10R_NP_162NW_34O 10260 378000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_132 FreePDK45_38x28_10R_NP_162NW_34O 10260 380800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_133 FreePDK45_38x28_10R_NP_162NW_34O 10260 383600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_134 FreePDK45_38x28_10R_NP_162NW_34O 10260 386400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_135 FreePDK45_38x28_10R_NP_162NW_34O 10260 389200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_136 FreePDK45_38x28_10R_NP_162NW_34O 10260 392000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_137 FreePDK45_38x28_10R_NP_162NW_34O 10260 394800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_138 FreePDK45_38x28_10R_NP_162NW_34O 10260 397600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_139 FreePDK45_38x28_10R_NP_162NW_34O 10260 400400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_140 FreePDK45_38x28_10R_NP_162NW_34O 10260 403200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_141 FreePDK45_38x28_10R_NP_162NW_34O 10260 406000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_142 FreePDK45_38x28_10R_NP_162NW_34O 10260 408800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_143 FreePDK45_38x28_10R_NP_162NW_34O 10260 411600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_144 FreePDK45_38x28_10R_NP_162NW_34O 10260 414400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_145 FreePDK45_38x28_10R_NP_162NW_34O 10260 417200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_146 FreePDK45_38x28_10R_NP_162NW_34O 10260 420000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_147 FreePDK45_38x28_10R_NP_162NW_34O 10260 422800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_148 FreePDK45_38x28_10R_NP_162NW_34O 10260 425600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_149 FreePDK45_38x28_10R_NP_162NW_34O 10260 428400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_150 FreePDK45_38x28_10R_NP_162NW_34O 10260 431200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_151 FreePDK45_38x28_10R_NP_162NW_34O 10260 434000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_152 FreePDK45_38x28_10R_NP_162NW_34O 10260 436800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_153 FreePDK45_38x28_10R_NP_162NW_34O 10260 439600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_154 FreePDK45_38x28_10R_NP_162NW_34O 10260 442400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_155 FreePDK45_38x28_10R_NP_162NW_34O 10260 445200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_156 FreePDK45_38x28_10R_NP_162NW_34O 10260 448000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_157 FreePDK45_38x28_10R_NP_162NW_34O 10260 450800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_158 FreePDK45_38x28_10R_NP_162NW_34O 10260 453600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_159 FreePDK45_38x28_10R_NP_162NW_34O 10260 456400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_160 FreePDK45_38x28_10R_NP_162NW_34O 10260 459200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_161 FreePDK45_38x28_10R_NP_162NW_34O 10260 462000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_162 FreePDK45_38x28_10R_NP_162NW_34O 10260 464800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_163 FreePDK45_38x28_10R_NP_162NW_34O 10260 467600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_164 FreePDK45_38x28_10R_NP_162NW_34O 10260 470400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_165 FreePDK45_38x28_10R_NP_162NW_34O 10260 473200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_166 FreePDK45_38x28_10R_NP_162NW_34O 10260 476000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_167 FreePDK45_38x28_10R_NP_162NW_34O 10260 478800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_168 FreePDK45_38x28_10R_NP_162NW_34O 10260 481600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_169 FreePDK45_38x28_10R_NP_162NW_34O 10260 484400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_170 FreePDK45_38x28_10R_NP_162NW_34O 10260 487200 N DO 999 BY 1 STEP 380 0 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 1053 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 1786 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 714 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 893 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 250 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 313 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 250 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 313 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 125 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 157 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 125 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 157 STEP 3200 LAYER metal10 ; -COMPONENTS 24 ; - - mem0 fakeram45_64x7 + FIXED ( 120960 12320 ) N ; - - mem1 fakeram45_64x7 + FIXED ( 11200 12320 ) N ; - - mem2 fakeram45_64x7 + FIXED ( 11200 126000 ) N ; - - r10 DFF_X1 + PLACED ( 271943 237755 ) N ; - - r11 DFF_X1 + PLACED ( 272620 167794 ) N ; - - r12 DFF_X1 + PLACED ( 271233 279956 ) N ; - - r13 DFF_X1 + PLACED ( 272574 186112 ) N ; - - r14 DFF_X1 + PLACED ( 249426 281046 ) N ; - - r15 DFF_X1 + PLACED ( 257303 283908 ) N ; - - r16 DFF_X1 + PLACED ( 247770 185936 ) N ; - - r20 DFF_X1 + PLACED ( 280236 213431 ) N ; - - r21 DFF_X1 + PLACED ( 280718 168590 ) N ; - - r22 DFF_X1 + PLACED ( 279560 242458 ) N ; - - r23 DFF_X1 + PLACED ( 280538 183269 ) N ; - - r24 DFF_X1 + PLACED ( 258939 246700 ) N ; - - r25 DFF_X1 + PLACED ( 256782 249421 ) N ; - - r26 DFF_X1 + PLACED ( 258228 186053 ) N ; - - r30 DFF_X1 + PLACED ( 272784 189680 ) N ; - - r31 DFF_X1 + PLACED ( 273077 168741 ) N ; - - r32 DFF_X1 + PLACED ( 272483 207243 ) N ; - - r33 DFF_X1 + PLACED ( 273107 179251 ) N ; - - r34 DFF_X1 + PLACED ( 269393 212886 ) N ; - - r35 DFF_X1 + PLACED ( 274628 215881 ) N ; - - r36 DFF_X1 + PLACED ( 269094 186256 ) N ; -END COMPONENTS -PINS 75 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 43260 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 256620 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 24780 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 361900 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 172060 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 464380 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 241110 499930 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 201590 70 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 66780 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 338380 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 383990 499930 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 144590 70 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 148540 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 193340 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 340620 ) N ; - - mem_out2[0] + NET mem_out2[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 403900 ) N ; - - mem_out2[1] + NET mem_out2[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 317100 ) N ; - - mem_out2[2] + NET mem_out2[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 425180 ) N ; - - mem_out2[3] + NET mem_out2[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 315590 70 ) N ; - - mem_out2[4] + NET mem_out2[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 214620 ) N ; - - mem_out2[5] + NET mem_out2[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 295820 ) N ; - - mem_out2[6] + NET mem_out2[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 212230 499930 ) N ; - - req_msg[0] + NET req_msg[0] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 383180 ) N ; - - req_msg[10] + NET req_msg[10] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 3500 ) N ; - - req_msg[11] + NET req_msg[11] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 108780 ) N ; - - req_msg[12] + NET req_msg[12] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 58710 70 ) N ; - - req_msg[13] + NET req_msg[13] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 344470 70 ) N ; - - req_msg[14] + NET req_msg[14] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 253820 ) N ; - - req_msg[15] + NET req_msg[15] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 422380 ) N ; - - req_msg[16] + NET req_msg[16] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 211820 ) N ; - - req_msg[17] + NET req_msg[17] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 258590 70 ) N ; - - req_msg[18] + NET req_msg[18] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 63980 ) N ; - - req_msg[19] + NET req_msg[19] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 115710 70 ) N ; - - req_msg[1] + NET req_msg[1] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 40470 499930 ) N ; - - req_msg[20] + NET req_msg[20] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 401100 ) N ; - - req_msg[21] + NET req_msg[21] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 88060 ) N ; - - req_msg[22] + NET req_msg[22] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 97470 499930 ) N ; - - req_msg[23] + NET req_msg[23] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 355110 499930 ) N ; - - req_msg[24] + NET req_msg[24] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 46060 ) N ; - - req_msg[25] + NET req_msg[25] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 126350 499930 ) N ; - - req_msg[26] + NET req_msg[26] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 151340 ) N ; - - req_msg[27] + NET req_msg[27] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 235340 ) N ; - - req_msg[28] + NET req_msg[28] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 85260 ) N ; - - req_msg[29] + NET req_msg[29] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 277340 ) N ; - - req_msg[2] + NET req_msg[2] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 69350 499930 ) N ; - - req_msg[30] + NET req_msg[30] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 183350 499930 ) N ; - - req_msg[31] + NET req_msg[31] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 380380 ) N ; - - req_msg[3] + NET req_msg[3] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 1710 70 ) N ; - - req_msg[4] + NET req_msg[4] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 232540 ) N ; - - req_msg[5] + NET req_msg[5] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 155230 499930 ) N ; - - req_msg[6] + NET req_msg[6] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 269230 499930 ) N ; - - req_msg[7] + NET req_msg[7] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 488460 ) N ; - - req_msg[8] + NET req_msg[8] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 106540 ) N ; - - req_msg[9] + NET req_msg[9] + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 275100 ) N ; - - req_rdy + NET req_rdy + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 29830 70 ) N ; - - req_val + NET req_val + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 467180 ) N ; - - reset + NET reset + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 169820 ) N ; - - resp_msg[0] + NET resp_msg[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 230470 70 ) N ; - - resp_msg[10] + NET resp_msg[10] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 445900 ) N ; - - resp_msg[11] + NET resp_msg[11] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 130060 ) N ; - - resp_msg[12] + NET resp_msg[12] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 485660 ) N ; - - resp_msg[13] + NET resp_msg[13] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 21980 ) N ; - - resp_msg[14] + NET resp_msg[14] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 86830 70 ) N ; - - resp_msg[15] + NET resp_msg[15] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 172710 70 ) N ; - - resp_msg[1] + NET resp_msg[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 190540 ) N ; - - resp_msg[2] + NET resp_msg[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 319900 ) N ; - - resp_msg[3] + NET resp_msg[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 287470 70 ) N ; - - resp_msg[4] + NET resp_msg[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 326230 499930 ) N ; - - resp_msg[5] + NET resp_msg[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 298110 499930 ) N ; - - resp_msg[6] + NET resp_msg[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 443660 ) N ; - - resp_msg[7] + NET resp_msg[7] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 12350 499930 ) N ; - - resp_msg[8] + NET resp_msg[8] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -70 -70 ) ( 70 70 ) - + PLACED ( 373350 70 ) N ; - - resp_msg[9] + NET resp_msg[9] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 127260 ) N ; - - resp_rdy + NET resp_rdy + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 70 359100 ) N ; - - resp_val + NET resp_val + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -70 -70 ) ( 70 70 ) - + PLACED ( 399930 298620 ) N ; -END PINS -NETS 139 ; - - _003_ ( mem1 w_mask_in[0] ) + USE SIGNAL ; - - _006_ ( mem0 we_in ) + USE SIGNAL ; - - _007_ ( mem0 ce_in ) + USE SIGNAL ; - - _008_ ( mem0 addr_in[5] ) + USE SIGNAL ; - - _009_ ( mem0 addr_in[4] ) + USE SIGNAL ; - - _010_ ( mem0 addr_in[3] ) + USE SIGNAL ; - - _011_ ( mem0 addr_in[2] ) + USE SIGNAL ; - - _012_ ( mem2 we_in ) ( mem0 addr_in[1] ) + USE SIGNAL ; - - _013_ ( mem2 ce_in ) ( mem0 addr_in[0] ) + USE SIGNAL ; - - _014_ ( mem2 addr_in[5] ) ( mem0 wd_in[6] ) + USE SIGNAL ; - - _015_ ( mem2 addr_in[4] ) ( mem0 wd_in[5] ) + USE SIGNAL ; - - _016_ ( mem2 addr_in[3] ) ( mem0 wd_in[4] ) + USE SIGNAL ; - - _017_ ( mem2 addr_in[2] ) ( mem0 wd_in[3] ) + USE SIGNAL ; - - _018_ ( mem2 addr_in[1] ) ( mem0 wd_in[2] ) + USE SIGNAL ; - - _019_ ( mem2 addr_in[0] ) ( mem0 wd_in[1] ) + USE SIGNAL ; - - _020_ ( mem2 wd_in[6] ) ( mem0 wd_in[0] ) + USE SIGNAL ; - - _021_ ( mem2 wd_in[5] ) ( mem0 w_mask_in[6] ) + USE SIGNAL ; - - _054_ ( mem1 w_mask_in[3] ) + USE SIGNAL ; - - _055_ ( mem1 w_mask_in[2] ) + USE SIGNAL ; - - _056_ ( mem1 w_mask_in[1] ) + USE SIGNAL ; - - _076_ ( mem2 wd_in[4] ) ( mem0 w_mask_in[5] ) + USE SIGNAL ; - - _077_ ( mem2 wd_in[3] ) ( mem0 w_mask_in[4] ) + USE SIGNAL ; - - _078_ ( mem2 wd_in[2] ) ( mem0 w_mask_in[3] ) + USE SIGNAL ; - - _079_ ( mem2 wd_in[1] ) ( mem0 w_mask_in[2] ) + USE SIGNAL ; - - _080_ ( mem2 wd_in[0] ) ( mem0 w_mask_in[1] ) + USE SIGNAL ; - - _081_ ( mem2 w_mask_in[6] ) ( mem0 w_mask_in[0] ) + USE SIGNAL ; - - _082_ ( mem2 w_mask_in[5] ) + USE SIGNAL ; - - _083_ ( mem2 w_mask_in[4] ) + USE SIGNAL ; - - _084_ ( mem2 w_mask_in[3] ) + USE SIGNAL ; - - _085_ ( mem2 w_mask_in[2] ) + USE SIGNAL ; - - _086_ ( mem2 w_mask_in[1] ) + USE SIGNAL ; - - _087_ ( mem2 w_mask_in[0] ) + USE SIGNAL ; - - _090_ ( mem1 we_in ) + USE SIGNAL ; - - _091_ ( mem1 ce_in ) + USE SIGNAL ; - - _092_ ( mem1 addr_in[5] ) + USE SIGNAL ; - - _093_ ( mem1 addr_in[4] ) + USE SIGNAL ; - - _094_ ( mem1 addr_in[3] ) + USE SIGNAL ; - - _095_ ( mem1 addr_in[2] ) + USE SIGNAL ; - - _096_ ( mem1 addr_in[1] ) + USE SIGNAL ; - - _097_ ( mem1 addr_in[0] ) + USE SIGNAL ; - - _105_ ( mem1 w_mask_in[6] ) + USE SIGNAL ; - - _106_ ( mem1 w_mask_in[5] ) + USE SIGNAL ; - - _107_ ( mem1 w_mask_in[4] ) + USE SIGNAL ; - - clk ( PIN clk ) ( r36 CK ) ( r35 CK ) ( r34 CK ) ( r33 CK ) ( r32 CK ) ( r31 CK ) - ( r30 CK ) ( r26 CK ) ( r25 CK ) ( r24 CK ) ( r23 CK ) ( r22 CK ) ( r21 CK ) ( r20 CK ) - ( r16 CK ) ( r15 CK ) ( r14 CK ) ( r13 CK ) ( r12 CK ) ( r11 CK ) ( r10 CK ) ( mem2 clk ) - ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - l1[0] ( r20 D ) ( r10 Q ) + USE SIGNAL ; - - l1[1] ( r21 D ) ( r11 Q ) + USE SIGNAL ; - - l1[2] ( r22 D ) ( r12 Q ) + USE SIGNAL ; - - l1[3] ( r23 D ) ( r13 Q ) + USE SIGNAL ; - - l1[4] ( r24 D ) ( r14 Q ) + USE SIGNAL ; - - l1[5] ( r25 D ) ( r15 Q ) + USE SIGNAL ; - - l1[6] ( r26 D ) ( r16 Q ) + USE SIGNAL ; - - l2[0] ( r30 D ) ( r20 Q ) + USE SIGNAL ; - - l2[1] ( r31 D ) ( r21 Q ) + USE SIGNAL ; - - l2[2] ( r32 D ) ( r22 Q ) + USE SIGNAL ; - - l2[3] ( r33 D ) ( r23 Q ) + USE SIGNAL ; - - l2[4] ( r34 D ) ( r24 Q ) + USE SIGNAL ; - - l2[5] ( r35 D ) ( r25 Q ) + USE SIGNAL ; - - l2[6] ( r36 D ) ( r26 Q ) + USE SIGNAL ; - - l3[0] ( r30 Q ) ( mem1 wd_in[0] ) + USE SIGNAL ; - - l3[1] ( r31 Q ) ( mem1 wd_in[1] ) + USE SIGNAL ; - - l3[2] ( r32 Q ) ( mem1 wd_in[2] ) + USE SIGNAL ; - - l3[3] ( r33 Q ) ( mem1 wd_in[3] ) + USE SIGNAL ; - - l3[4] ( r34 Q ) ( mem1 wd_in[4] ) + USE SIGNAL ; - - l3[5] ( r35 Q ) ( mem1 wd_in[5] ) + USE SIGNAL ; - - l3[6] ( r36 Q ) ( mem1 wd_in[6] ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( r10 D ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( r11 D ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( r12 D ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( r13 D ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( r14 D ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( r15 D ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( r16 D ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; - - mem_out2[0] ( PIN mem_out2[0] ) ( mem2 rd_out[0] ) + USE SIGNAL ; - - mem_out2[1] ( PIN mem_out2[1] ) ( mem2 rd_out[1] ) + USE SIGNAL ; - - mem_out2[2] ( PIN mem_out2[2] ) ( mem2 rd_out[2] ) + USE SIGNAL ; - - mem_out2[3] ( PIN mem_out2[3] ) ( mem2 rd_out[3] ) + USE SIGNAL ; - - mem_out2[4] ( PIN mem_out2[4] ) ( mem2 rd_out[4] ) + USE SIGNAL ; - - mem_out2[5] ( PIN mem_out2[5] ) ( mem2 rd_out[5] ) + USE SIGNAL ; - - mem_out2[6] ( PIN mem_out2[6] ) ( mem2 rd_out[6] ) + USE SIGNAL ; - - req_msg[0] ( PIN req_msg[0] ) + USE SIGNAL ; - - req_msg[10] ( PIN req_msg[10] ) + USE SIGNAL ; - - req_msg[11] ( PIN req_msg[11] ) + USE SIGNAL ; - - req_msg[12] ( PIN req_msg[12] ) + USE SIGNAL ; - - req_msg[13] ( PIN req_msg[13] ) + USE SIGNAL ; - - req_msg[14] ( PIN req_msg[14] ) + USE SIGNAL ; - - req_msg[15] ( PIN req_msg[15] ) + USE SIGNAL ; - - req_msg[16] ( PIN req_msg[16] ) + USE SIGNAL ; - - req_msg[17] ( PIN req_msg[17] ) + USE SIGNAL ; - - req_msg[18] ( PIN req_msg[18] ) + USE SIGNAL ; - - req_msg[19] ( PIN req_msg[19] ) + USE SIGNAL ; - - req_msg[1] ( PIN req_msg[1] ) + USE SIGNAL ; - - req_msg[20] ( PIN req_msg[20] ) + USE SIGNAL ; - - req_msg[21] ( PIN req_msg[21] ) + USE SIGNAL ; - - req_msg[22] ( PIN req_msg[22] ) + USE SIGNAL ; - - req_msg[23] ( PIN req_msg[23] ) + USE SIGNAL ; - - req_msg[24] ( PIN req_msg[24] ) + USE SIGNAL ; - - req_msg[25] ( PIN req_msg[25] ) + USE SIGNAL ; - - req_msg[26] ( PIN req_msg[26] ) + USE SIGNAL ; - - req_msg[27] ( PIN req_msg[27] ) + USE SIGNAL ; - - req_msg[28] ( PIN req_msg[28] ) + USE SIGNAL ; - - req_msg[29] ( PIN req_msg[29] ) + USE SIGNAL ; - - req_msg[2] ( PIN req_msg[2] ) + USE SIGNAL ; - - req_msg[30] ( PIN req_msg[30] ) + USE SIGNAL ; - - req_msg[31] ( PIN req_msg[31] ) + USE SIGNAL ; - - req_msg[3] ( PIN req_msg[3] ) + USE SIGNAL ; - - req_msg[4] ( PIN req_msg[4] ) + USE SIGNAL ; - - req_msg[5] ( PIN req_msg[5] ) + USE SIGNAL ; - - req_msg[6] ( PIN req_msg[6] ) + USE SIGNAL ; - - req_msg[7] ( PIN req_msg[7] ) + USE SIGNAL ; - - req_msg[8] ( PIN req_msg[8] ) + USE SIGNAL ; - - req_msg[9] ( PIN req_msg[9] ) + USE SIGNAL ; - - req_rdy ( PIN req_rdy ) + USE SIGNAL ; - - req_val ( PIN req_val ) + USE SIGNAL ; - - reset ( PIN reset ) + USE SIGNAL ; - - resp_msg[0] ( PIN resp_msg[0] ) + USE SIGNAL ; - - resp_msg[10] ( PIN resp_msg[10] ) + USE SIGNAL ; - - resp_msg[11] ( PIN resp_msg[11] ) + USE SIGNAL ; - - resp_msg[12] ( PIN resp_msg[12] ) + USE SIGNAL ; - - resp_msg[13] ( PIN resp_msg[13] ) + USE SIGNAL ; - - resp_msg[14] ( PIN resp_msg[14] ) + USE SIGNAL ; - - resp_msg[15] ( PIN resp_msg[15] ) + USE SIGNAL ; - - resp_msg[1] ( PIN resp_msg[1] ) + USE SIGNAL ; - - resp_msg[2] ( PIN resp_msg[2] ) + USE SIGNAL ; - - resp_msg[3] ( PIN resp_msg[3] ) + USE SIGNAL ; - - resp_msg[4] ( PIN resp_msg[4] ) + USE SIGNAL ; - - resp_msg[5] ( PIN resp_msg[5] ) + USE SIGNAL ; - - resp_msg[6] ( PIN resp_msg[6] ) + USE SIGNAL ; - - resp_msg[7] ( PIN resp_msg[7] ) + USE SIGNAL ; - - resp_msg[8] ( PIN resp_msg[8] ) + USE SIGNAL ; - - resp_msg[9] ( PIN resp_msg[9] ) + USE SIGNAL ; - - resp_rdy ( PIN resp_rdy ) + USE SIGNAL ; - - resp_val ( PIN resp_val ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/level3_02.ok b/src/mpl/test/level3_02.ok deleted file mode 100644 index 20734ba60a0..00000000000 --- a/src/mpl/test/level3_02.ok +++ /dev/null @@ -1,87 +0,0 @@ -[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells -[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x7.lef, created 1 library cells -[INFO ODB-0128] Design: gcd_mem3 -[INFO ODB-0130] Created 75 pins. -[INFO ODB-0131] Created 24 components and 222 component-terminals. -[INFO ODB-0133] Created 139 nets and 153 connections. -[INFO GPL-0002] DBU: 2000 -[INFO GPL-0003] SiteSize: ( 0.190 1.400 ) um -[INFO GPL-0004] CoreBBox: ( 5.130 5.600 ) ( 194.940 245.000 ) um -[INFO GPL-0006] NumInstances: 24 -[INFO GPL-0007] NumPlaceInstances: 24 -[INFO GPL-0008] NumFixedInstances: 0 -[INFO GPL-0009] NumDummyInstances: 0 -[INFO GPL-0010] NumNets: 139 -[INFO GPL-0011] NumPins: 228 -[INFO GPL-0012] DieBBox: ( 0.000 0.000 ) ( 200.000 250.000 ) um -[INFO GPL-0013] CoreBBox: ( 5.130 5.600 ) ( 194.940 245.000 ) um -[INFO GPL-0016] CoreArea: 45440.514 um^2 -[INFO GPL-0017] NonPlaceInstsArea: 0.000 um^2 -[INFO GPL-0018] PlaceInstsArea: 9128.322 um^2 -[INFO GPL-0019] Util: 20.089 % -[INFO GPL-0020] StdInstsArea: 94.962 um^2 -[INFO GPL-0021] MacroInstsArea: 9033.360 um^2 -[InitialPlace] Iter: 1 CG residual: 0.00000009 HPWL: 21592182 -[InitialPlace] Iter: 2 CG residual: 0.00000004 HPWL: 20919637 -[InitialPlace] Iter: 3 CG residual: 0.00000007 HPWL: 20817286 -[InitialPlace] Iter: 4 CG residual: 0.00000008 HPWL: 20768809 -[InitialPlace] Iter: 5 CG residual: 0.00000009 HPWL: 20764722 -[INFO GPL-0031] FillerInit:NumGCells: 1150 -[INFO GPL-0032] FillerInit:NumGNets: 139 -[INFO GPL-0033] FillerInit:NumGPins: 228 -[INFO GPL-0023] TargetDensity: 0.700 -[INFO GPL-0024] AvrgPlaceInstArea: 380.347 um^2 -[INFO GPL-0025] IdealBinArea: 543.353 um^2 -[INFO GPL-0026] IdealBinCnt: 83 -[INFO GPL-0027] TotalBinArea: 45440.514 um^2 -[INFO GPL-0028] BinCnt: 8 8 -[INFO GPL-0029] BinSize: ( 23.727 29.925 ) -[INFO GPL-0030] NumBins: 64 -[NesterovSolve] Iter: 1 overflow: 0.398 HPWL: 7410672 -[NesterovSolve] Iter: 10 overflow: 0.376 HPWL: 7433283 -[NesterovSolve] Iter: 20 overflow: 0.386 HPWL: 7431963 -[NesterovSolve] Iter: 30 overflow: 0.383 HPWL: 7431378 -[NesterovSolve] Iter: 40 overflow: 0.384 HPWL: 7435211 -[NesterovSolve] Iter: 50 overflow: 0.384 HPWL: 7433865 -[NesterovSolve] Iter: 60 overflow: 0.383 HPWL: 7433471 -[NesterovSolve] Iter: 70 overflow: 0.383 HPWL: 7432435 -[NesterovSolve] Iter: 80 overflow: 0.383 HPWL: 7430935 -[NesterovSolve] Iter: 90 overflow: 0.383 HPWL: 7428619 -[NesterovSolve] Iter: 100 overflow: 0.382 HPWL: 7425063 -[NesterovSolve] Iter: 110 overflow: 0.382 HPWL: 7419775 -[NesterovSolve] Iter: 120 overflow: 0.381 HPWL: 7416047 -[NesterovSolve] Iter: 130 overflow: 0.380 HPWL: 7415706 -[NesterovSolve] Iter: 140 overflow: 0.377 HPWL: 7417568 -[NesterovSolve] Iter: 150 overflow: 0.374 HPWL: 7426705 -[NesterovSolve] Iter: 160 overflow: 0.370 HPWL: 7441687 -[NesterovSolve] Iter: 170 overflow: 0.366 HPWL: 7459936 -[NesterovSolve] Iter: 180 overflow: 0.362 HPWL: 7477805 -[NesterovSolve] Iter: 190 overflow: 0.360 HPWL: 7489113 -[NesterovSolve] Iter: 200 overflow: 0.359 HPWL: 7478203 -[NesterovSolve] Iter: 210 overflow: 0.358 HPWL: 7448550 -[NesterovSolve] Iter: 220 overflow: 0.353 HPWL: 7440154 -[NesterovSolve] Iter: 230 overflow: 0.345 HPWL: 7441557 -[NesterovSolve] Iter: 240 overflow: 0.339 HPWL: 7413070 -[NesterovSolve] Iter: 250 overflow: 0.327 HPWL: 7410081 -[NesterovSolve] Iter: 260 overflow: 0.312 HPWL: 7391901 -[NesterovSolve] Iter: 270 overflow: 0.291 HPWL: 7413584 -[NesterovSolve] Iter: 280 overflow: 0.263 HPWL: 7410839 -[NesterovSolve] Iter: 290 overflow: 0.228 HPWL: 7407697 -[NesterovSolve] Iter: 300 overflow: 0.197 HPWL: 7387747 -[NesterovSolve] Iter: 310 overflow: 0.185 HPWL: 7387967 -[NesterovSolve] Iter: 320 overflow: 0.162 HPWL: 7408639 -[NesterovSolve] Iter: 330 overflow: 0.150 HPWL: 7438422 -[NesterovSolve] Iter: 340 overflow: 0.149 HPWL: 7481553 -[NesterovSolve] Iter: 350 overflow: 0.146 HPWL: 7541164 -[NesterovSolve] Iter: 360 overflow: 0.136 HPWL: 7595990 -[NesterovSolve] Iter: 370 overflow: 0.122 HPWL: 7630448 -[NesterovSolve] Iter: 380 overflow: 0.105 HPWL: 7727198 -[NesterovSolve] Finished with Overflow: 0.098313 -[INFO MPL-0101] Found 3 macros. -[INFO MPL-0102] West pins 24. -[INFO MPL-0102] East pins 23. -[INFO MPL-0102] North pins 14. -[INFO MPL-0102] South pins 14. -[INFO MPL-0067] Initial weighted wire length 2566.13. -[INFO MPL-0068] Placed weighted wire length 3185. -No differences found. diff --git a/src/mpl/test/level3_02.py b/src/mpl/test/level3_02.py deleted file mode 100644 index 3d209257d6c..00000000000 --- a/src/mpl/test/level3_02.py +++ /dev/null @@ -1,22 +0,0 @@ -from openroad import Design, Tech -import helpers -import mpl_aux -import gpl_aux - -# 3 levels of registers between mem0 and mem1 -tech = Tech() -tech.readLiberty("Nangate45/Nangate45_typ.lib") -tech.readLiberty("Nangate45/fakeram45_64x7.lib") -tech.readLef("Nangate45/Nangate45.lef") -tech.readLef("Nangate45/fakeram45_64x7.lef") - -design = helpers.make_design(tech) -design.readDef("level3.def") -design.evalTclString('read_sdc "gcd.sdc"') - -gpl_aux.global_placement(design) -mpl_aux.macro_placement(design, style="corner_min_wl", halo=[0.5, 0.5]) - -def_file = helpers.make_result_file("level3_02.def") -design.writeDef(def_file) -helpers.diff_files(def_file, "level3_02.defok") diff --git a/src/mpl/test/level3_02.tcl b/src/mpl/test/level3_02.tcl deleted file mode 100644 index 6fbc868d41b..00000000000 --- a/src/mpl/test/level3_02.tcl +++ /dev/null @@ -1,9 +0,0 @@ -# 3 levels of registers between mem0 and mem1, -style corner_min_wl -source helpers.tcl -source level3.tcl -global_placement -macro_placement -style corner_min_wl -halo {0.5 0.5} - -set def_file [make_result_file level3_02.def] -write_def $def_file -diff_file $def_file level3_02.defok diff --git a/src/mpl/test/manpage.py b/src/mpl/test/manpage.py deleted file mode 120000 index c39859549f2..00000000000 --- a/src/mpl/test/manpage.py +++ /dev/null @@ -1 +0,0 @@ -../../../docs/src/scripts/manpage.py \ No newline at end of file diff --git a/src/mpl/test/md_roff_compat.py b/src/mpl/test/md_roff_compat.py deleted file mode 120000 index 43530e421eb..00000000000 --- a/src/mpl/test/md_roff_compat.py +++ /dev/null @@ -1 +0,0 @@ -../../../docs/src/scripts/md_roff_compat.py \ No newline at end of file diff --git a/src/mpl/test/mpl_aux.py b/src/mpl/test/mpl_aux.py deleted file mode 100644 index 63d27bdca73..00000000000 --- a/src/mpl/test/mpl_aux.py +++ /dev/null @@ -1,134 +0,0 @@ -############################################################################# -## -## Copyright (c) 2022, The Regents of the University of California -## All rights reserved. -## -## BSD 3-Clause License -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are met: -## -## * Redistributions of source code must retain the above copyright notice, this -## list of conditions and the following disclaimer. -## -## * Redistributions in binary form must reproduce the above copyright notice, -## this list of conditions and the following disclaimer in the documentation -## and/or other materials provided with the distribution. -## -## * Neither the name of the copyright holder nor the names of its -## contributors may be used to endorse or promote products derived from -## this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -## POSSIBILITY OF SUCH DAMAGE. -############################################################################# -import utl - - -def macro_placement( - design, *, halo=None, channel=None, fence_region=None, snap_layer=None, style=None -): - if halo != None: - if len(halo) != 2: - utl.error( - utl.MPL, 192, f"halo receives a list with 2 values, {len(halo)} given." - ) - halo_x, halo_y = halo - if is_pos_float(halo_x) and is_pos_float(halo_y): - design.getMacroPlacer().setHalo(halo_x, halo_y) - - if channel != None: - if length(channel) != 2: - utl.error( - utl.MPL, - 193, - f"channel receives a list with 2 values, {len(channel)} given.", - ) - - channel_x, channel_y = channel - if is_pos_float(channel_x) and is_pos_float(channel_y): - design.getMacroPlacer().setChannel(channel_x, channel_y) - - if len(design.getBlock().getRows()) < 1: - utl.error(utl.MPL, 189, "No rows found. Use initialize_floorplan to add rows.") - - core = design.getBlock().getCoreArea() - units = design.getBlock().getDbUnitsPerMicron() - core_lx = core.xMin() / units - core_ly = core.yMin() / units - core_ux = core.xMax() / units - core_uy = core.yMax() / units - - if fence_region != None: - if len(fence_region) != 4: - utl.error( - utl.MPL, - 194, - f"fence_region receives a list with 4 values, {len(fence_region)} given.", - ) - - lx, ly, ux, uy = fence_region - - if lx < core_lx or ly < core_ly or ux > core_ux or uy > core_uy: - utl.warn( - utl.MPL, 185, "fence_region outside of core area. Using core area." - ) - design.getMacroPlacer().setFenceRegion(core_lx, core_ly, core_ux, core_uy) - else: - design.getMacroPlacer().setFenceRegion(lx, ly, ux, uy) - else: - design.getMacroPlacer().setFenceRegion(core_lx, core_ly, core_ux, core_uy) - - if not is_pos_int(snap_layer): - snap_layer = 4 - - rtech = design.getTech().getDB().getTech() - layer = rtech.findRoutingLayer(snap_layer) - - if layer == None: - utl.error(utl.MPL, 195, f"Snap layer {snap_layer} is not a routing layer.") - - design.getMacroPlacer().setSnapLayer(layer) - - if style == None: - style = "corner_max_wl" - - if style == "corner_max_wl": - design.getMacroPlacer().placeMacrosCornerMaxWl() - elif style == "corner_min_wl": - design.getMacroPlacer().placeMacrosCornerMinWL() - else: - utl.error( - utl.MPL, - 196, - "Unknown placement style. Use one of 'corner_max_wl' or 'corner_min_wl'.", - ) - - -def is_pos_int(x): - if x == None: - return False - elif isinstance(x, int) and x > 0: - return True - else: - utl.error(utl.GPL, 507, f"TypeError: {x} is not a positive integer") - return False - - -def is_pos_float(x): - if x == None: - return False - elif isinstance(x, float) and x >= 0: - return True - else: - utl.error(utl.MPL, 202, f"TypeError: {x} is not a positive float") - return False diff --git a/src/mpl/test/mpl_man_tcl_check.ok b/src/mpl/test/mpl_man_tcl_check.ok deleted file mode 100644 index 3628f2bff80..00000000000 --- a/src/mpl/test/mpl_man_tcl_check.ok +++ /dev/null @@ -1,5 +0,0 @@ -Tool Dir Help count Proc count Readme count -./src/mpl 1 1 1 -Command counts match. -./src/mpl2 2 2 2 -Command counts match. diff --git a/src/mpl/test/mpl_man_tcl_check.py b/src/mpl/test/mpl_man_tcl_check.py deleted file mode 100644 index 589cef67d0c..00000000000 --- a/src/mpl/test/mpl_man_tcl_check.py +++ /dev/null @@ -1,77 +0,0 @@ -import os -import glob -import re -from extract_utils import extract_tcl_code, extract_help, extract_proc - -# Test objective: Make sure similar output in all three: help, proc, and readme -path = os.getcwd() -module_dir = os.path.dirname(path) -module = os.path.basename(module_dir) - -or_home = os.path.dirname(os.path.dirname(os.path.dirname(path))) -os.chdir(or_home) - -help_dict, proc_dict, readme_dict = {}, {}, {} - -# Directories to exclude (according to md_roff_compat) -exclude = ["sta"] -include = ["./src/odb/src/db/odb.tcl"] - -for path in glob.glob("./src/*/src/*tcl") + include: - # exclude all dirs other than the current dir. - if module not in path: - continue - - # exclude these dirs which are not compiled in man (do not have readmes). - tool_dir = os.path.dirname(os.path.dirname(path)) - if module not in tool_dir: - continue - if "odb" in tool_dir: - tool_dir = "./src/odb" - if not os.path.exists(f"{tool_dir}/README.md"): - continue - if re.search(f".*{'|'.join(e for e in exclude)}.*", path): - continue - - # special handling for pad, since it has 3 Tcls. - if "ICeWall" in path or "PdnGen" in path: - continue - - with open(path) as f: - # Help patterns - content = f.read() - matches = extract_help(content) - help_dict[tool_dir] = len(matches) - - # Proc patterns - matches = extract_proc(content) - proc_dict[tool_dir] = len(matches) - -for path in glob.glob("./src/*/README.md"): - # exclude all dirs other than the current dir. - if module not in path: - continue - - if re.search(f".*{'|'.join(e for e in exclude)}.*", path): - continue - tool_dir = os.path.dirname(path) - - # for gui, filter out the gui:: for separate processing - results = [x for x in extract_tcl_code(open(path).read()) if "gui::" not in x] - readme_dict[tool_dir] = len(results) - - # for pad, remove `make_fake_io_site` because it is a hidden cmd arg - if "pad" in tool_dir: - readme_dict[tool_dir] -= 1 - -print( - "Tool Dir".ljust(20), "Help count".ljust(15), "Proc count".ljust(15), "Readme count" -) - -for path in help_dict: - h, p, r = help_dict[path], proc_dict[path], readme_dict[path] - print(path.ljust(20), str(h).ljust(15), str(p).ljust(15), str(r)) - if h == p == r: - print("Command counts match.") - else: - print("Command counts do not match.") diff --git a/src/mpl/test/mpl_readme_msgs_check.ok b/src/mpl/test/mpl_readme_msgs_check.ok deleted file mode 100644 index c5bd2b00770..00000000000 --- a/src/mpl/test/mpl_readme_msgs_check.ok +++ /dev/null @@ -1,4 +0,0 @@ -README.md -Names: 1, Desc: 1, Syn: 1, Options: 1, Args: 1 -Man2 successfully compiled. -Man3 successfully compiled. diff --git a/src/mpl/test/mpl_readme_msgs_check.py b/src/mpl/test/mpl_readme_msgs_check.py deleted file mode 100644 index 8a60bb0ff75..00000000000 --- a/src/mpl/test/mpl_readme_msgs_check.py +++ /dev/null @@ -1,18 +0,0 @@ -import os -import sys -from md_roff_compat import man2_translate, man3_translate - -# Test objective: Check man2/man3 items parsed. - -cur_dir = os.getcwd() -doc_dir = os.path.join( - os.path.dirname(os.path.dirname(os.path.dirname(cur_dir))), "docs" -) -save_dir = os.path.join(cur_dir, "results/docs") -os.makedirs(save_dir, exist_ok=True) - -readme_path = os.path.join(cur_dir, "../README.md") -messages_path = os.path.join(cur_dir, "../messages.txt") - -man2_translate(readme_path, save_dir) -man3_translate(messages_path, save_dir) diff --git a/src/mpl/test/regression b/src/mpl/test/regression deleted file mode 120000 index 9dd00c591a9..00000000000 --- a/src/mpl/test/regression +++ /dev/null @@ -1 +0,0 @@ -../../../test/shared/regression \ No newline at end of file diff --git a/src/mpl/test/regression_tests.tcl b/src/mpl/test/regression_tests.tcl deleted file mode 100644 index 7644022c18b..00000000000 --- a/src/mpl/test/regression_tests.tcl +++ /dev/null @@ -1,9 +0,0 @@ -record_tests { - level3_01 - level3_02 - east_west1 - east_west2 - snap_layer1 - #mpl_man_tcl_check - #mpl_readme_msgs_check -} diff --git a/src/mpl/test/save_defok b/src/mpl/test/save_defok deleted file mode 120000 index 899db325246..00000000000 --- a/src/mpl/test/save_defok +++ /dev/null @@ -1 +0,0 @@ -../../../test/shared/save_defok \ No newline at end of file diff --git a/src/mpl/test/save_ok b/src/mpl/test/save_ok deleted file mode 120000 index 4f5b707628d..00000000000 --- a/src/mpl/test/save_ok +++ /dev/null @@ -1 +0,0 @@ -../../../test/save_ok \ No newline at end of file diff --git a/src/mpl/test/snap_layer1.defok b/src/mpl/test/snap_layer1.defok deleted file mode 100644 index 41529cd0515..00000000000 --- a/src/mpl/test/snap_layer1.defok +++ /dev/null @@ -1,173 +0,0 @@ -VERSION 5.8 ; -DIVIDERCHAR "/" ; -BUSBITCHARS "[]" ; -DESIGN mem2 ; -UNITS DISTANCE MICRONS 2000 ; -DIEAREA ( 0 0 ) ( 440000 240000 ) ; -ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 20140 22400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 20140 25200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 20140 28000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 20140 30800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 20140 33600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 20140 36400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 20140 39200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 20140 42000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 20140 44800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 20140 47600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 20140 50400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 20140 53200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 20140 56000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 20140 58800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 20140 61600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 20140 64400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 20140 67200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 20140 70000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 20140 72800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 20140 75600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 20140 78400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 20140 81200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 20140 84000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 20140 86800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 20140 89600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 20140 92400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 20140 95200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 20140 98000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 20140 100800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 20140 103600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 20140 106400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 20140 109200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 20140 112000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 20140 114800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 20140 117600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 20140 120400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 20140 123200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 20140 126000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 20140 128800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 20140 131600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 20140 134400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 20140 137200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 20140 140000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 20140 142800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 20140 145600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 20140 148400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 20140 151200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 20140 154000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 20140 156800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 20140 159600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 20140 162400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 20140 165200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 20140 168000 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 20140 170800 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 20140 173600 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 20140 176400 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_56 FreePDK45_38x28_10R_NP_162NW_34O 20140 179200 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_57 FreePDK45_38x28_10R_NP_162NW_34O 20140 182000 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_58 FreePDK45_38x28_10R_NP_162NW_34O 20140 184800 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_59 FreePDK45_38x28_10R_NP_162NW_34O 20140 187600 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_60 FreePDK45_38x28_10R_NP_162NW_34O 20140 190400 N DO 999 BY 1 STEP 380 0 ; -ROW ROW_61 FreePDK45_38x28_10R_NP_162NW_34O 20140 193200 FS DO 999 BY 1 STEP 380 0 ; -ROW ROW_62 FreePDK45_38x28_10R_NP_162NW_34O 20140 196000 N DO 999 BY 1 STEP 380 0 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal1 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal1 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal2 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal2 ; -TRACKS X 190 DO 1158 STEP 380 LAYER metal3 ; -TRACKS Y 140 DO 857 STEP 280 LAYER metal3 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal4 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal4 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal5 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal5 ; -TRACKS X 190 DO 786 STEP 560 LAYER metal6 ; -TRACKS Y 140 DO 429 STEP 560 LAYER metal6 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal7 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal7 ; -TRACKS X 190 DO 275 STEP 1600 LAYER metal8 ; -TRACKS Y 140 DO 150 STEP 1600 LAYER metal8 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal9 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal9 ; -TRACKS X 190 DO 138 STEP 3200 LAYER metal10 ; -TRACKS Y 140 DO 75 STEP 3200 LAYER metal10 ; -COMPONENTS 2 ; - - mem0 fakeram45_64x7 + FIXED ( 290360 84840 ) N ; - - mem1 fakeram45_64x7 + FIXED ( 178640 84840 ) N ; -END COMPONENTS -PINS 15 ; - - clk + NET clk + DIRECTION INPUT + USE SIGNAL - + PORT - + LAYER metal3 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 220000 20000 ) N ; - - mem_out0[0] + NET mem_out0[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 20000 ) N ; - - mem_out0[1] + NET mem_out0[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 48000 ) N ; - - mem_out0[2] + NET mem_out0[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 76000 ) N ; - - mem_out0[3] + NET mem_out0[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 104000 ) N ; - - mem_out0[4] + NET mem_out0[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 134000 ) N ; - - mem_out0[5] + NET mem_out0[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 162000 ) N ; - - mem_out0[6] + NET mem_out0[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 20000 190000 ) N ; - - mem_out1[0] + NET mem_out1[0] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 20000 ) N ; - - mem_out1[1] + NET mem_out1[1] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 48000 ) N ; - - mem_out1[2] + NET mem_out1[2] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 76000 ) N ; - - mem_out1[3] + NET mem_out1[3] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 104000 ) N ; - - mem_out1[4] + NET mem_out1[4] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 134000 ) N ; - - mem_out1[5] + NET mem_out1[5] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 162000 ) N ; - - mem_out1[6] + NET mem_out1[6] + DIRECTION OUTPUT + USE SIGNAL - + PORT - + LAYER metal2 ( -1000 -1000 ) ( 1000 1000 ) - + FIXED ( 420000 190000 ) N ; -END PINS -NETS 15 ; - - clk ( PIN clk ) ( mem1 clk ) ( mem0 clk ) + USE SIGNAL ; - - mem_out0[0] ( PIN mem_out0[0] ) ( mem0 rd_out[0] ) + USE SIGNAL ; - - mem_out0[1] ( PIN mem_out0[1] ) ( mem0 rd_out[1] ) + USE SIGNAL ; - - mem_out0[2] ( PIN mem_out0[2] ) ( mem0 rd_out[2] ) + USE SIGNAL ; - - mem_out0[3] ( PIN mem_out0[3] ) ( mem0 rd_out[3] ) + USE SIGNAL ; - - mem_out0[4] ( PIN mem_out0[4] ) ( mem0 rd_out[4] ) + USE SIGNAL ; - - mem_out0[5] ( PIN mem_out0[5] ) ( mem0 rd_out[5] ) + USE SIGNAL ; - - mem_out0[6] ( PIN mem_out0[6] ) ( mem0 rd_out[6] ) + USE SIGNAL ; - - mem_out1[0] ( PIN mem_out1[0] ) ( mem1 rd_out[0] ) + USE SIGNAL ; - - mem_out1[1] ( PIN mem_out1[1] ) ( mem1 rd_out[1] ) + USE SIGNAL ; - - mem_out1[2] ( PIN mem_out1[2] ) ( mem1 rd_out[2] ) + USE SIGNAL ; - - mem_out1[3] ( PIN mem_out1[3] ) ( mem1 rd_out[3] ) + USE SIGNAL ; - - mem_out1[4] ( PIN mem_out1[4] ) ( mem1 rd_out[4] ) + USE SIGNAL ; - - mem_out1[5] ( PIN mem_out1[5] ) ( mem1 rd_out[5] ) + USE SIGNAL ; - - mem_out1[6] ( PIN mem_out1[6] ) ( mem1 rd_out[6] ) + USE SIGNAL ; -END NETS -END DESIGN diff --git a/src/mpl/test/snap_layer1.ok b/src/mpl/test/snap_layer1.ok deleted file mode 100644 index a8250b51392..00000000000 --- a/src/mpl/test/snap_layer1.ok +++ /dev/null @@ -1,46 +0,0 @@ -[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells -[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x7.lef, created 1 library cells -[INFO ODB-0128] Design: mem2 -[INFO ODB-0130] Created 15 pins. -[INFO ODB-0131] Created 2 components and 64 component-terminals. -[INFO ODB-0133] Created 15 nets and 16 connections. -[INFO MPL-0101] Found 2 macros. -[INFO MPL-0102] West pins 7. -[INFO MPL-0102] East pins 5. -[INFO MPL-0102] North pins 1. -[INFO MPL-0102] South pins 2. -[INFO MPL-0069] Initial weighted wire length 1023.28. -Begin one level partition. -[INFO MPL-0076] Partition 2 macros. -[INFO MPL-0077] Using 2 cut lines. -[INFO MPL-0079] Cut line 50.35. -[INFO MPL-0079] Cut line 105.83. -End one level partition. -Begin horizontal partition. -Begin east partition. -[INFO MPL-0076] Partition 0 macros. -[INFO MPL-0077] Using 0 cut lines. -End east partition. -Begin west partition. -[INFO MPL-0076] Partition 2 macros. -[INFO MPL-0077] Using 1 cut lines. -[INFO MPL-0079] Cut line 32.20. -End west partition. -End horizontal partition. -Begin horizontal partition. -Begin east partition. -[INFO MPL-0076] Partition 1 macros. -[INFO MPL-0077] Using 1 cut lines. -[INFO MPL-0079] Cut line 32.20. -End east partition. -Begin west partition. -[INFO MPL-0076] Partition 1 macros. -[INFO MPL-0077] Using 1 cut lines. -[INFO MPL-0079] Cut line 32.20. -End west partition. -End horizontal partition. -[INFO MPL-0070] Using 2 partition sets. -[INFO MPL-0071] Solution 1 weighted wire length 1805.16. -[INFO MPL-0071] Solution 2 weighted wire length 721.777. -[INFO MPL-0073] Best weighted wire length 1805.16. -No differences found. diff --git a/src/mpl/test/snap_layer1.py b/src/mpl/test/snap_layer1.py deleted file mode 100644 index 3ba41f237f7..00000000000 --- a/src/mpl/test/snap_layer1.py +++ /dev/null @@ -1,19 +0,0 @@ -# mem0 with west connctions, mem1 with east connections -from openroad import Design, Tech -import helpers -import mpl_aux - -tech = Tech() -tech.readLiberty("Nangate45/Nangate45_typ.lib") -tech.readLiberty("Nangate45/fakeram45_64x7.lib") -tech.readLef("Nangate45/Nangate45.lef") -tech.readLef("Nangate45/fakeram45_64x7.lef") - -design = helpers.make_design(tech) -design.readDef("east_west1.def") - -mpl_aux.macro_placement(design, snap_layer=3, halo=[1.0, 1.0]) - -def_file = helpers.make_result_file("snap_layer1.def") -design.writeDef(def_file) -helpers.diff_files(def_file, "snap_layer1.defok") diff --git a/src/mpl/test/snap_layer1.tcl b/src/mpl/test/snap_layer1.tcl deleted file mode 100644 index a4b7a49c5fe..00000000000 --- a/src/mpl/test/snap_layer1.tcl +++ /dev/null @@ -1,10 +0,0 @@ -# -snap_layer 3 -source helpers.tcl -set mem0_pins_west 1 -source east_west.tcl - -macro_placement -halo {1.0 1.0} -snap_layer 3 - -set def_file [make_result_file snap_layer1.def] -write_def $def_file -diff_file $def_file snap_layer1.defok diff --git a/test/regression b/test/regression index 3dd79466533..310151986ae 100755 --- a/test/regression +++ b/test/regression @@ -42,7 +42,6 @@ define_tool_script "tap" "src/tap/test/regression" define_tool_script "ppl" "src/ppl/test/regression" define_tool_script "pdn" "src/pdn/test/regression" define_tool_script "pad" "src/pad/test/regression" -define_tool_script "mpl" "src/mpl/test/regression" define_tool_script "mpl2" "src/mpl2/test/regression" define_tool_script "par" "src/par/test/regression" define_tool_script "gpl" "src/gpl/test/regression" From 57a177e9479f6bf6ee72380ef1633623ffd23495 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Tue, 29 Oct 2024 16:33:14 +0000 Subject: [PATCH 2/2] test: Switch flow.tcl to mpl2 Minor metrics update for tinyRocket_nangate45 for clock skew Signed-off-by: Matt Liberty --- test/flow.tcl | 6 +- test/tinyRocket_nangate45.metrics | 74 ++++++++++++------------ test/tinyRocket_nangate45.metrics_limits | 14 ++--- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/test/flow.tcl b/test/flow.tcl index 4c3d77b9a0a..e2286d4dc1e 100644 --- a/test/flow.tcl +++ b/test/flow.tcl @@ -63,8 +63,10 @@ place_pins -random -hor_layers $io_placer_hor_layer -ver_layers $io_placer_ver_l ################################################################ # Macro Placement if { [have_macros] } { - global_placement -density $global_place_density - macro_placement -halo $macro_place_halo -channel $macro_place_channel + lassign $macro_place_halo halo_x halo_y + set report_dir [make_result_file ${design}_${platform}_rtlmp] + rtl_macro_placer -halo_width $halo_x -halo_height $halo_y \ + -report_directory $report_dir } ################################################################ diff --git a/test/tinyRocket_nangate45.metrics b/test/tinyRocket_nangate45.metrics index 8b62ce5ea88..97451694d3c 100644 --- a/test/tinyRocket_nangate45.metrics +++ b/test/tinyRocket_nangate45.metrics @@ -1,54 +1,54 @@ { "IFP::ord_version": "", "IFP::instance_count": "23878", - "floorplan__design__instance__count__macros": 2, "floorplan__design__io": 269, - "design__io__hpwl": 37337478, - "design__instance__displacement__total": 25734.7, - "design__instance__displacement__mean": 1.0775, - "design__instance__displacement__max": 9.722, - "route__wirelength__estimated": 480419, - "RSZ::repair_design_buffer_count": "524", - "RSZ::max_slew_slack": "32.36975340786154", + "design__io__hpwl": 39958893, + "design__instance__displacement__total": 25364, + "design__instance__displacement__mean": 1.0625, + "design__instance__displacement__max": 8.313, + "route__wirelength__estimated": 478257, + "RSZ::repair_design_buffer_count": "525", + "RSZ::max_slew_slack": "38.51952323488392", "RSZ::max_fanout_slack": "100.0", - "RSZ::max_capacitance_slack": "34.74309796237679", - "design__instance__displacement__total": 435.337, - "design__instance__displacement__mean": 0.018, - "design__instance__displacement__max": 4.015, - "route__wirelength__estimated": 494083, + "RSZ::max_capacitance_slack": "22.75402059093391", + "design__instance__displacement__total": 519.083, + "design__instance__displacement__mean": 0.0215, + "design__instance__displacement__max": 19.304, + "route__wirelength__estimated": 492094, "design__instance__count__setup_buffer": 0, "design__instance__count__hold_buffer": 0, - "RSZ::worst_slack_min": "0.07174036567860885", - "RSZ::worst_slack_max": "0.1901969746643768", + "RSZ::worst_slack_min": "0.06528736069892538", + "RSZ::worst_slack_max": "0.2870666008378409", "RSZ::tns_max": "0.0", "RSZ::hold_buffer_count": "0", "design__instance__displacement__total": 0, "design__instance__displacement__mean": 0, "design__instance__displacement__max": 0, - "route__wirelength__estimated": 494083, + "route__wirelength__estimated": 492094, "DPL::utilization": "25.4", - "DPL::design_area": "58357", - "route__net": 27918, + "DPL::design_area": "58331", + "route__net": 27921, "route__net__special": 2, + "grt__antenna_diodes_count": 0, "grt__antenna__violating__nets": 0, "grt__antenna__violating__pins": 0, "GRT::ANT::errors": "0", - "route__net": 27918, + "route__net": 27921, "route__net__special": 2, - "route__drc_errors__iter:1": 2875, - "route__wirelength__iter:1": 600462, - "route__drc_errors__iter:2": 247, - "route__wirelength__iter:2": 598431, - "route__drc_errors__iter:3": 117, - "route__wirelength__iter:3": 598372, - "route__drc_errors__iter:4": 3, - "route__wirelength__iter:4": 598382, + "route__drc_errors__iter:1": 3122, + "route__wirelength__iter:1": 597809, + "route__drc_errors__iter:2": 294, + "route__wirelength__iter:2": 594812, + "route__drc_errors__iter:3": 121, + "route__wirelength__iter:3": 594669, + "route__drc_errors__iter:4": 2, + "route__wirelength__iter:4": 594680, "route__drc_errors__iter:5": 0, - "route__wirelength__iter:5": 598385, + "route__wirelength__iter:5": 594680, "route__drc_errors": 0, - "route__wirelength": 598385, - "route__vias": 181888, - "route__vias__singlecut": 181888, + "route__wirelength": 594680, + "route__vias": 181673, + "route__vias__singlecut": 181673, "route__vias__multicut": 0, "DRT::drv": "0", "drt__repair_antennas__pre_repair__antenna__violating__nets": 0, @@ -59,14 +59,14 @@ "design__violations": 0, "timing__drv__floating__nets": 0, "timing__drv__floating__pins": 0, - "DRT::worst_slack_min": "0.07162563800355694", - "DRT::worst_slack_max": "0.14223711500101197", + "DRT::worst_slack_min": "0.06381292896937217", + "DRT::worst_slack_max": "0.21911917345225745", "DRT::tns_max": "0.0", - "DRT::clock_skew": "0.02859512707557588", - "DRT::max_slew_slack": "17.318685209200193", + "DRT::clock_skew": "0.04558037409854051", + "DRT::max_slew_slack": "11.57755085053745", "DRT::max_fanout_slack": "100.0", - "DRT::max_capacitance_slack": "23.109233594566227", + "DRT::max_capacitance_slack": "14.60447664315136", "DRT::clock_period": "2.030000", - "flow__warnings__count": 431, + "flow__warnings__count": 11, "flow__errors__count": 0 } \ No newline at end of file diff --git a/test/tinyRocket_nangate45.metrics_limits b/test/tinyRocket_nangate45.metrics_limits index 5d2f8c4d752..4e73ac815c9 100644 --- a/test/tinyRocket_nangate45.metrics_limits +++ b/test/tinyRocket_nangate45.metrics_limits @@ -1,21 +1,21 @@ { "IFP::instance_count" : "28653.6" - ,"DPL::design_area" : "70028.4" + ,"DPL::design_area" : "69997.2" ,"DPL::utilization" : "30.479999999999997" - ,"RSZ::repair_design_buffer_count" : "628" + ,"RSZ::repair_design_buffer_count" : "630" ,"RSZ::max_slew_slack" : "0" ,"RSZ::max_capacitance_slack" : "0" ,"RSZ::max_fanout_slack" : "0" - ,"RSZ::worst_slack_min" : "-0.13125963432139115" - ,"RSZ::worst_slack_max" : "-0.012803025335623192" + ,"RSZ::worst_slack_min" : "-0.1377126393010746" + ,"RSZ::worst_slack_max" : "0.08406660083784093" ,"RSZ::tns_max" : "-484.72339999999997" ,"RSZ::hold_buffer_count" : "0" ,"GRT::ANT::errors" : "0" ,"DRT::drv" : "0" - ,"DRT::worst_slack_min" : "-0.13137436199644303" - ,"DRT::worst_slack_max" : "-0.06076288499898802" + ,"DRT::worst_slack_min" : "-0.13918707103062783" + ,"DRT::worst_slack_max" : "0.016119173452257468" ,"DRT::tns_max" : "-484.72339999999997" - ,"DRT::clock_skew" : "0.03431415249069106" + ,"DRT::clock_skew" : "0.05469644891824861" ,"DRT::max_slew_slack" : "0" ,"DRT::max_capacitance_slack" : "0" ,"DRT::max_fanout_slack" : "0"