Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/mpl/src/hier_rtlmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ void HierRTLMP::blockMacroChannels()
void HierRTLMP::init()
{
block_ = db_->getChip()->getBlock();
// Each rtl_macro_placer call starts from a fresh hierarchy: a completed
// run releases the previous one in clear(), and a call that found no
// macro to place must not skip placement in the next one.
tree_ = std::make_unique<PhysicalHierarchy>();
skip_macro_placement_ = false;
clustering_engine_ = std::make_unique<ClusteringEngine>(
block_, logger_, tritonpart_, graphics_.get());

Expand Down
12 changes: 12 additions & 0 deletions src/mpl/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,17 @@ COMPULSORY_TESTS = [
"orientation_improve3",
"place_macro_right_angle_rotation",
"placement_blockages1",
"rerun1",
"unfixed_cells_dont_fit_in_core",
]

ALL_TESTS = COMPULSORY_TESTS

# Self-checking: the script reports pass/fail, no golden log.
PASSFAIL_TESTS = [
"rerun1",
]

filegroup(
name = "regression_resources",
# Dependencies could be specified more narrowly per test case,
Expand Down Expand Up @@ -243,6 +249,10 @@ filegroup(
"testcases/macro_only.lef",
"testcases/placement_blockages1.def",
],
"rerun1": [
"testcases/fixed_macros1.def",
"testcases/orientation_improve1.lef",
],
"unfixed_cells_dont_fit_in_core": [
"testcases/macro_only.lef",
"testcases/unfixed_cells_dont_fit_in_core.def",
Expand All @@ -256,6 +266,8 @@ filegroup(
[
regression_test(
name = test_name,
check_log = test_name not in PASSFAIL_TESTS,
check_passfail = test_name in PASSFAIL_TESTS,
data = [":" + test_name + "_resources"],
tags = [] if test_name in COMPULSORY_TESTS else ["manual"],
visibility = ["//visibility:public"],
Expand Down
2 changes: 2 additions & 0 deletions src/mpl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ or_integration_tests(
halos2
halos3
halos4
PASSFAIL_TESTS
rerun1
)


Expand Down
26 changes: 26 additions & 0 deletions src/mpl/test/rerun1.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# rtl_macro_placer called more than once in one session places what is
# unfixed each time: after a call that found every macro fixed, and after
# a completed run.
source "helpers.tcl"

read_lef "./Nangate45/Nangate45.lef"
read_lef "./testcases/orientation_improve1.lef"

read_def "./testcases/fixed_macros1.def"

set_thread_count 0
set macro [[ord::get_db_block] findInst MACRO_2]

$macro setPlacementStatus FIRM
rtl_macro_placer -report_directory [make_result_dir]

$macro setPlacementStatus PLACED
rtl_macro_placer -report_directory [make_result_dir]
check "placed after a call with nothing to place" \
{ $macro getPlacementStatus } LOCKED

$macro setPlacementStatus PLACED
rtl_macro_placer -report_directory [make_result_dir]
check "placed after a completed run" { $macro getPlacementStatus } LOCKED

exit_summary
Loading